@flanksource/clicky-ui 0.3.78 → 0.3.79

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 (745) hide show
  1. package/dist/ai.cjs +2 -2
  2. package/dist/ai.js +2 -2
  3. package/dist/comments/CommentThreadList.cjs +13 -14
  4. package/dist/comments/CommentThreadList.cjs.map +1 -1
  5. package/dist/comments/CommentThreadList.d.ts.map +1 -1
  6. package/dist/comments/CommentThreadList.js +13 -14
  7. package/dist/comments/CommentThreadList.js.map +1 -1
  8. package/dist/components/EndpointSelector.cjs +7 -1
  9. package/dist/components/EndpointSelector.cjs.map +1 -1
  10. package/dist/components/EndpointSelector.d.ts.map +1 -1
  11. package/dist/components/EndpointSelector.js +7 -1
  12. package/dist/components/EndpointSelector.js.map +1 -1
  13. package/dist/components/FilterBar.cjs +36 -12
  14. package/dist/components/FilterBar.cjs.map +1 -1
  15. package/dist/components/FilterBar.d.ts +14 -2
  16. package/dist/components/FilterBar.d.ts.map +1 -1
  17. package/dist/components/FilterBar.js +36 -12
  18. package/dist/components/FilterBar.js.map +1 -1
  19. package/dist/components/FormLookupProvider.cjs +12 -4
  20. package/dist/components/FormLookupProvider.cjs.map +1 -1
  21. package/dist/components/FormLookupProvider.d.ts.map +1 -1
  22. package/dist/components/FormLookupProvider.js +13 -5
  23. package/dist/components/FormLookupProvider.js.map +1 -1
  24. package/dist/components/JSONPathPlayground.cjs +124 -233
  25. package/dist/components/JSONPathPlayground.cjs.map +1 -1
  26. package/dist/components/JSONPathPlayground.d.ts +15 -13
  27. package/dist/components/JSONPathPlayground.d.ts.map +1 -1
  28. package/dist/components/JSONPathPlayground.js +125 -234
  29. package/dist/components/JSONPathPlayground.js.map +1 -1
  30. package/dist/components/JsonSchemaForm.cjs +6 -0
  31. package/dist/components/JsonSchemaForm.cjs.map +1 -1
  32. package/dist/components/JsonSchemaForm.js +6 -0
  33. package/dist/components/JsonSchemaForm.js.map +1 -1
  34. package/dist/components/SegmentedControl.cjs +1 -1
  35. package/dist/components/SegmentedControl.cjs.map +1 -1
  36. package/dist/components/SegmentedControl.d.ts.map +1 -1
  37. package/dist/components/SegmentedControl.js +1 -1
  38. package/dist/components/SegmentedControl.js.map +1 -1
  39. package/dist/components/TimeRange.cjs +133 -60
  40. package/dist/components/TimeRange.cjs.map +1 -1
  41. package/dist/components/TimeRange.d.ts +8 -1
  42. package/dist/components/TimeRange.d.ts.map +1 -1
  43. package/dist/components/TimeRange.js +133 -60
  44. package/dist/components/TimeRange.js.map +1 -1
  45. package/dist/components/json-schema-form-accordion-array.cjs +8 -6
  46. package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
  47. package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
  48. package/dist/components/json-schema-form-accordion-array.js +9 -7
  49. package/dist/components/json-schema-form-accordion-array.js.map +1 -1
  50. package/dist/components/json-schema-form-array-rows.cjs +45 -0
  51. package/dist/components/json-schema-form-array-rows.cjs.map +1 -0
  52. package/dist/components/json-schema-form-array-rows.d.ts +10 -0
  53. package/dist/components/json-schema-form-array-rows.d.ts.map +1 -0
  54. package/dist/components/json-schema-form-array-rows.js +45 -0
  55. package/dist/components/json-schema-form-array-rows.js.map +1 -0
  56. package/dist/components/json-schema-form-item-summary.cjs +3 -5
  57. package/dist/components/json-schema-form-item-summary.cjs.map +1 -1
  58. package/dist/components/json-schema-form-item-summary.d.ts +1 -1
  59. package/dist/components/json-schema-form-item-summary.d.ts.map +1 -1
  60. package/dist/components/json-schema-form-item-summary.js +3 -5
  61. package/dist/components/json-schema-form-item-summary.js.map +1 -1
  62. package/dist/components/json-schema-form-render.cjs +11 -2
  63. package/dist/components/json-schema-form-render.cjs.map +1 -1
  64. package/dist/components/json-schema-form-render.d.ts.map +1 -1
  65. package/dist/components/json-schema-form-render.js +12 -3
  66. package/dist/components/json-schema-form-render.js.map +1 -1
  67. package/dist/components/json-schema-form-resolve.cjs +10 -0
  68. package/dist/components/json-schema-form-resolve.cjs.map +1 -1
  69. package/dist/components/json-schema-form-resolve.d.ts +1 -0
  70. package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
  71. package/dist/components/json-schema-form-resolve.js +10 -1
  72. package/dist/components/json-schema-form-resolve.js.map +1 -1
  73. package/dist/components/json-schema-form-runtime-types.d.ts +4 -0
  74. package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -1
  75. package/dist/components/json-schema-form-table-array.cjs +25 -16
  76. package/dist/components/json-schema-form-table-array.cjs.map +1 -1
  77. package/dist/components/json-schema-form-table-array.d.ts +1 -1
  78. package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
  79. package/dist/components/json-schema-form-table-array.js +26 -17
  80. package/dist/components/json-schema-form-table-array.js.map +1 -1
  81. package/dist/components/json-schema-form-types.d.ts +0 -2
  82. package/dist/components/json-schema-form-types.d.ts.map +1 -1
  83. package/dist/components/jsonPathPlaygroundEvaluator.cjs +53 -0
  84. package/dist/components/jsonPathPlaygroundEvaluator.cjs.map +1 -0
  85. package/dist/components/jsonPathPlaygroundEvaluator.d.ts +23 -0
  86. package/dist/components/jsonPathPlaygroundEvaluator.d.ts.map +1 -0
  87. package/dist/components/jsonPathPlaygroundEvaluator.js +53 -0
  88. package/dist/components/jsonPathPlaygroundEvaluator.js.map +1 -0
  89. package/dist/components/jsonPathTree.cjs +1 -0
  90. package/dist/components/jsonPathTree.cjs.map +1 -1
  91. package/dist/components/jsonPathTree.d.ts +6 -0
  92. package/dist/components/jsonPathTree.d.ts.map +1 -1
  93. package/dist/components/jsonPathTree.js +1 -0
  94. package/dist/components/jsonPathTree.js.map +1 -1
  95. package/dist/data/Clicky.cjs +37 -18
  96. package/dist/data/Clicky.cjs.map +1 -1
  97. package/dist/data/Clicky.d.ts +5 -0
  98. package/dist/data/Clicky.d.ts.map +1 -1
  99. package/dist/data/Clicky.js +37 -18
  100. package/dist/data/Clicky.js.map +1 -1
  101. package/dist/data/DataTable.cjs +49 -12
  102. package/dist/data/DataTable.cjs.map +1 -1
  103. package/dist/data/DataTable.d.ts +17 -2
  104. package/dist/data/DataTable.d.ts.map +1 -1
  105. package/dist/data/DataTable.js +49 -12
  106. package/dist/data/DataTable.js.map +1 -1
  107. package/dist/data/TaskPoolUsage.cjs +2 -1
  108. package/dist/data/TaskPoolUsage.cjs.map +1 -1
  109. package/dist/data/TaskPoolUsage.d.ts.map +1 -1
  110. package/dist/data/TaskPoolUsage.js +2 -1
  111. package/dist/data/TaskPoolUsage.js.map +1 -1
  112. package/dist/data/TimeseriesPanel.axes.cjs +18 -3
  113. package/dist/data/TimeseriesPanel.axes.cjs.map +1 -1
  114. package/dist/data/TimeseriesPanel.axes.d.ts +10 -1
  115. package/dist/data/TimeseriesPanel.axes.d.ts.map +1 -1
  116. package/dist/data/TimeseriesPanel.axes.js +17 -4
  117. package/dist/data/TimeseriesPanel.axes.js.map +1 -1
  118. package/dist/data/TimeseriesPanel.cjs +57 -23
  119. package/dist/data/TimeseriesPanel.cjs.map +1 -1
  120. package/dist/data/TimeseriesPanel.d.ts.map +1 -1
  121. package/dist/data/TimeseriesPanel.js +59 -25
  122. package/dist/data/TimeseriesPanel.js.map +1 -1
  123. package/dist/data/TimeseriesPanel.model.cjs +10 -7
  124. package/dist/data/TimeseriesPanel.model.cjs.map +1 -1
  125. package/dist/data/TimeseriesPanel.model.d.ts +7 -4
  126. package/dist/data/TimeseriesPanel.model.d.ts.map +1 -1
  127. package/dist/data/TimeseriesPanel.model.js +11 -8
  128. package/dist/data/TimeseriesPanel.model.js.map +1 -1
  129. package/dist/data/TimeseriesPanel.readout.cjs +11 -0
  130. package/dist/data/TimeseriesPanel.readout.cjs.map +1 -0
  131. package/dist/data/TimeseriesPanel.readout.d.ts +4 -0
  132. package/dist/data/TimeseriesPanel.readout.d.ts.map +1 -0
  133. package/dist/data/TimeseriesPanel.readout.js +10 -0
  134. package/dist/data/TimeseriesPanel.readout.js.map +1 -0
  135. package/dist/data/TimeseriesPanel.segments.cjs +67 -0
  136. package/dist/data/TimeseriesPanel.segments.cjs.map +1 -0
  137. package/dist/data/TimeseriesPanel.segments.d.ts +27 -0
  138. package/dist/data/TimeseriesPanel.segments.d.ts.map +1 -0
  139. package/dist/data/TimeseriesPanel.segments.js +67 -0
  140. package/dist/data/TimeseriesPanel.segments.js.map +1 -0
  141. package/dist/data/TreeDataTable.cjs +12 -3
  142. package/dist/data/TreeDataTable.cjs.map +1 -1
  143. package/dist/data/TreeDataTable.d.ts +15 -3
  144. package/dist/data/TreeDataTable.d.ts.map +1 -1
  145. package/dist/data/TreeDataTable.js +12 -3
  146. package/dist/data/TreeDataTable.js.map +1 -1
  147. package/dist/data/TreeNode.cjs +18 -3
  148. package/dist/data/TreeNode.cjs.map +1 -1
  149. package/dist/data/TreeNode.d.ts +7 -1
  150. package/dist/data/TreeNode.d.ts.map +1 -1
  151. package/dist/data/TreeNode.js +18 -3
  152. package/dist/data/TreeNode.js.map +1 -1
  153. package/dist/data/ai/SessionChatComposer.cjs +2 -0
  154. package/dist/data/ai/SessionChatComposer.cjs.map +1 -1
  155. package/dist/data/ai/SessionChatComposer.d.ts.map +1 -1
  156. package/dist/data/ai/SessionChatComposer.js +2 -0
  157. package/dist/data/ai/SessionChatComposer.js.map +1 -1
  158. package/dist/data/ai/SessionInspector.panels.cjs +47 -1
  159. package/dist/data/ai/SessionInspector.panels.cjs.map +1 -1
  160. package/dist/data/ai/SessionInspector.panels.d.ts.map +1 -1
  161. package/dist/data/ai/SessionInspector.panels.js +48 -2
  162. package/dist/data/ai/SessionInspector.panels.js.map +1 -1
  163. package/dist/data/ai/SessionViewer.unified.d.ts +48 -0
  164. package/dist/data/ai/SessionViewer.unified.d.ts.map +1 -1
  165. package/dist/data/ai/index.d.ts +2 -2
  166. package/dist/data/ai/index.d.ts.map +1 -1
  167. package/dist/data/ai/runtime-profiles/PresetWorkspace.cjs +97 -100
  168. package/dist/data/ai/runtime-profiles/PresetWorkspace.cjs.map +1 -1
  169. package/dist/data/ai/runtime-profiles/PresetWorkspace.d.ts.map +1 -1
  170. package/dist/data/ai/runtime-profiles/PresetWorkspace.js +97 -100
  171. package/dist/data/ai/runtime-profiles/PresetWorkspace.js.map +1 -1
  172. package/dist/data/ai/runtime-profiles/ProfileWorkspace.cjs +40 -38
  173. package/dist/data/ai/runtime-profiles/ProfileWorkspace.cjs.map +1 -1
  174. package/dist/data/ai/runtime-profiles/ProfileWorkspace.d.ts.map +1 -1
  175. package/dist/data/ai/runtime-profiles/ProfileWorkspace.js +41 -39
  176. package/dist/data/ai/runtime-profiles/ProfileWorkspace.js.map +1 -1
  177. package/dist/data/ai/runtime-profiles/ResolutionPreview.cjs +53 -0
  178. package/dist/data/ai/runtime-profiles/ResolutionPreview.cjs.map +1 -0
  179. package/dist/data/ai/runtime-profiles/ResolutionPreview.d.ts +7 -0
  180. package/dist/data/ai/runtime-profiles/ResolutionPreview.d.ts.map +1 -0
  181. package/dist/data/ai/runtime-profiles/ResolutionPreview.js +53 -0
  182. package/dist/data/ai/runtime-profiles/ResolutionPreview.js.map +1 -0
  183. package/dist/data/ai/runtime-profiles/index.d.ts +1 -1
  184. package/dist/data/ai/runtime-profiles/index.d.ts.map +1 -1
  185. package/dist/data/ai/sessionSubmitVariant.cjs +30 -0
  186. package/dist/data/ai/sessionSubmitVariant.cjs.map +1 -0
  187. package/dist/data/ai/sessionSubmitVariant.d.ts +7 -0
  188. package/dist/data/ai/sessionSubmitVariant.d.ts.map +1 -0
  189. package/dist/data/ai/sessionSubmitVariant.js +30 -0
  190. package/dist/data/ai/sessionSubmitVariant.js.map +1 -0
  191. package/dist/data/cells/Timestamp.cjs +15 -4
  192. package/dist/data/cells/Timestamp.cjs.map +1 -1
  193. package/dist/data/cells/Timestamp.d.ts.map +1 -1
  194. package/dist/data/cells/Timestamp.js +15 -4
  195. package/dist/data/cells/Timestamp.js.map +1 -1
  196. package/dist/data/cells/timestamp-format.cjs +28 -8
  197. package/dist/data/cells/timestamp-format.cjs.map +1 -1
  198. package/dist/data/cells/timestamp-format.d.ts +3 -1
  199. package/dist/data/cells/timestamp-format.d.ts.map +1 -1
  200. package/dist/data/cells/timestamp-format.js +28 -8
  201. package/dist/data/cells/timestamp-format.js.map +1 -1
  202. package/dist/data/charts/TrendChart.cjs +65 -31
  203. package/dist/data/charts/TrendChart.cjs.map +1 -1
  204. package/dist/data/charts/TrendChart.d.ts +12 -3
  205. package/dist/data/charts/TrendChart.d.ts.map +1 -1
  206. package/dist/data/charts/TrendChart.js +67 -33
  207. package/dist/data/charts/TrendChart.js.map +1 -1
  208. package/dist/data/charts/index.d.ts +1 -1
  209. package/dist/data/charts/index.d.ts.map +1 -1
  210. package/dist/data/chat/PromptInput.cjs +11 -2
  211. package/dist/data/chat/PromptInput.cjs.map +1 -1
  212. package/dist/data/chat/PromptInput.d.ts +15 -1
  213. package/dist/data/chat/PromptInput.d.ts.map +1 -1
  214. package/dist/data/chat/PromptInput.js +11 -2
  215. package/dist/data/chat/PromptInput.js.map +1 -1
  216. package/dist/data/chat/index.d.ts +1 -1
  217. package/dist/data/chat/index.d.ts.map +1 -1
  218. package/dist/data/data-table-filter-values.cjs.map +1 -1
  219. package/dist/data/data-table-filter-values.d.ts +1 -1
  220. package/dist/data/data-table-filter-values.d.ts.map +1 -1
  221. package/dist/data/data-table-filter-values.js.map +1 -1
  222. package/dist/data/data-table-server-filters.cjs +2 -6
  223. package/dist/data/data-table-server-filters.cjs.map +1 -1
  224. package/dist/data/data-table-server-filters.d.ts +1 -1
  225. package/dist/data/data-table-server-filters.d.ts.map +1 -1
  226. package/dist/data/data-table-server-filters.js +1 -5
  227. package/dist/data/data-table-server-filters.js.map +1 -1
  228. package/dist/data/diagnostics/ErrorDetails.cjs +2 -1
  229. package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
  230. package/dist/data/diagnostics/ErrorDetails.d.ts +2 -1
  231. package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
  232. package/dist/data/diagnostics/ErrorDetails.js +2 -1
  233. package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
  234. package/dist/data/gauge-stats.cjs +7 -3
  235. package/dist/data/gauge-stats.cjs.map +1 -1
  236. package/dist/data/gauge-stats.d.ts.map +1 -1
  237. package/dist/data/gauge-stats.js +7 -3
  238. package/dist/data/gauge-stats.js.map +1 -1
  239. package/dist/data/query-browser/QueryBrowser.cjs +41 -17
  240. package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
  241. package/dist/data/query-browser/QueryBrowser.d.ts +1 -1
  242. package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
  243. package/dist/data/query-browser/QueryBrowser.fieldNames.cjs +23 -0
  244. package/dist/data/query-browser/QueryBrowser.fieldNames.cjs.map +1 -0
  245. package/dist/data/query-browser/QueryBrowser.fieldNames.d.ts +11 -0
  246. package/dist/data/query-browser/QueryBrowser.fieldNames.d.ts.map +1 -0
  247. package/dist/data/query-browser/QueryBrowser.fieldNames.js +23 -0
  248. package/dist/data/query-browser/QueryBrowser.fieldNames.js.map +1 -0
  249. package/dist/data/query-browser/QueryBrowser.js +41 -17
  250. package/dist/data/query-browser/QueryBrowser.js.map +1 -1
  251. package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -1
  252. package/dist/data/query-browser/QueryBrowser.types.d.ts +18 -0
  253. package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -1
  254. package/dist/data/query-browser/QueryBrowser.types.js.map +1 -1
  255. package/dist/data/runtime/RuntimeBarLayout.cjs +3 -2
  256. package/dist/data/runtime/RuntimeBarLayout.cjs.map +1 -1
  257. package/dist/data/runtime/RuntimeBarLayout.d.ts.map +1 -1
  258. package/dist/data/runtime/RuntimeBarLayout.js +3 -2
  259. package/dist/data/runtime/RuntimeBarLayout.js.map +1 -1
  260. package/dist/data/test-runner/TestRunner.cjs +3 -1
  261. package/dist/data/test-runner/TestRunner.cjs.map +1 -1
  262. package/dist/data/test-runner/TestRunner.d.ts +8 -1
  263. package/dist/data/test-runner/TestRunner.d.ts.map +1 -1
  264. package/dist/data/test-runner/TestRunner.js +3 -1
  265. package/dist/data/test-runner/TestRunner.js.map +1 -1
  266. package/dist/data/test-runner/TestTree.cjs +1 -0
  267. package/dist/data/test-runner/TestTree.cjs.map +1 -1
  268. package/dist/data/test-runner/TestTree.d.ts.map +1 -1
  269. package/dist/data/test-runner/TestTree.js +1 -0
  270. package/dist/data/test-runner/TestTree.js.map +1 -1
  271. package/dist/data/test-runner/context.cjs.map +1 -1
  272. package/dist/data/test-runner/context.d.ts +2 -0
  273. package/dist/data/test-runner/context.d.ts.map +1 -1
  274. package/dist/data/test-runner/context.js.map +1 -1
  275. package/dist/data/timeseries-query.cjs +2 -2
  276. package/dist/data/timeseries-query.cjs.map +1 -1
  277. package/dist/data/timeseries-query.d.ts +1 -1
  278. package/dist/data/timeseries-query.d.ts.map +1 -1
  279. package/dist/data/timeseries-query.js +2 -2
  280. package/dist/data/timeseries-query.js.map +1 -1
  281. package/dist/data/version-info.cjs +3 -3
  282. package/dist/data/version-info.js +3 -3
  283. package/dist/data.cjs +1 -0
  284. package/dist/data.d.ts +1 -1
  285. package/dist/data.d.ts.map +1 -1
  286. package/dist/data.js +2 -2
  287. package/dist/expressions/playground/EmbeddedPlayground.cjs +40 -0
  288. package/dist/expressions/playground/EmbeddedPlayground.cjs.map +1 -0
  289. package/dist/expressions/playground/EmbeddedPlayground.d.ts +30 -0
  290. package/dist/expressions/playground/EmbeddedPlayground.d.ts.map +1 -0
  291. package/dist/expressions/playground/EmbeddedPlayground.js +40 -0
  292. package/dist/expressions/playground/EmbeddedPlayground.js.map +1 -0
  293. package/dist/expressions/playground/ExpressionPlayground.cjs +6 -6
  294. package/dist/expressions/playground/ExpressionPlayground.cjs.map +1 -1
  295. package/dist/expressions/playground/ExpressionPlayground.d.ts +10 -3
  296. package/dist/expressions/playground/ExpressionPlayground.d.ts.map +1 -1
  297. package/dist/expressions/playground/ExpressionPlayground.js +6 -6
  298. package/dist/expressions/playground/ExpressionPlayground.js.map +1 -1
  299. package/dist/expressions/playground/LazyEmbeddedPlayground.cjs +22 -0
  300. package/dist/expressions/playground/LazyEmbeddedPlayground.cjs.map +1 -0
  301. package/dist/expressions/playground/LazyEmbeddedPlayground.d.ts +4 -0
  302. package/dist/expressions/playground/LazyEmbeddedPlayground.d.ts.map +1 -0
  303. package/dist/expressions/playground/LazyEmbeddedPlayground.js +22 -0
  304. package/dist/expressions/playground/LazyEmbeddedPlayground.js.map +1 -0
  305. package/dist/expressions/playground/api.cjs.map +1 -1
  306. package/dist/expressions/playground/api.d.ts +10 -0
  307. package/dist/expressions/playground/api.d.ts.map +1 -1
  308. package/dist/expressions/playground/api.js.map +1 -1
  309. package/dist/expressions/playground/hostEvaluation.cjs +67 -0
  310. package/dist/expressions/playground/hostEvaluation.cjs.map +1 -0
  311. package/dist/expressions/playground/hostEvaluation.d.ts +39 -0
  312. package/dist/expressions/playground/hostEvaluation.d.ts.map +1 -0
  313. package/dist/expressions/playground/hostEvaluation.js +63 -0
  314. package/dist/expressions/playground/hostEvaluation.js.map +1 -0
  315. package/dist/expressions/playground/panels/GraphPanel.cjs +8 -3
  316. package/dist/expressions/playground/panels/GraphPanel.cjs.map +1 -1
  317. package/dist/expressions/playground/panels/GraphPanel.d.ts +2 -1
  318. package/dist/expressions/playground/panels/GraphPanel.d.ts.map +1 -1
  319. package/dist/expressions/playground/panels/GraphPanel.js +8 -3
  320. package/dist/expressions/playground/panels/GraphPanel.js.map +1 -1
  321. package/dist/expressions/playground/panels/graphNodes.cjs +6 -2
  322. package/dist/expressions/playground/panels/graphNodes.cjs.map +1 -1
  323. package/dist/expressions/playground/panels/graphNodes.d.ts +6 -2
  324. package/dist/expressions/playground/panels/graphNodes.d.ts.map +1 -1
  325. package/dist/expressions/playground/panels/graphNodes.js +6 -2
  326. package/dist/expressions/playground/panels/graphNodes.js.map +1 -1
  327. package/dist/expressions/playground.d.ts +1 -1
  328. package/dist/expressions/playground.d.ts.map +1 -1
  329. package/dist/hooks/use-element-height.cjs +26 -0
  330. package/dist/hooks/use-element-height.cjs.map +1 -0
  331. package/dist/hooks/use-element-height.d.ts +10 -0
  332. package/dist/hooks/use-element-height.d.ts.map +1 -0
  333. package/dist/hooks/use-element-height.js +26 -0
  334. package/dist/hooks/use-element-height.js.map +1 -0
  335. package/dist/index.cjs +6 -5
  336. package/dist/index.js +7 -7
  337. package/dist/jvm/classes/PatchedClassList.cjs +11 -2
  338. package/dist/jvm/classes/PatchedClassList.cjs.map +1 -1
  339. package/dist/jvm/classes/PatchedClassList.d.ts.map +1 -1
  340. package/dist/jvm/classes/PatchedClassList.js +11 -2
  341. package/dist/jvm/classes/PatchedClassList.js.map +1 -1
  342. package/dist/jvm/fixtures/fake-client.d.ts.map +1 -1
  343. package/dist/jvm/model/patches.cjs +4 -2
  344. package/dist/jvm/model/patches.cjs.map +1 -1
  345. package/dist/jvm/model/patches.d.ts +3 -1
  346. package/dist/jvm/model/patches.d.ts.map +1 -1
  347. package/dist/jvm/model/patches.js +4 -2
  348. package/dist/jvm/model/patches.js.map +1 -1
  349. package/dist/jvm/protocol/client.d.ts +7 -2
  350. package/dist/jvm/protocol/client.d.ts.map +1 -1
  351. package/dist/jvm/protocol/operation-client.cjs +30 -11
  352. package/dist/jvm/protocol/operation-client.cjs.map +1 -1
  353. package/dist/jvm/protocol/operation-client.d.ts.map +1 -1
  354. package/dist/jvm/protocol/operation-client.js +30 -11
  355. package/dist/jvm/protocol/operation-client.js.map +1 -1
  356. package/dist/jvm/protocol/query-keys.cjs +1 -1
  357. package/dist/jvm/protocol/query-keys.cjs.map +1 -1
  358. package/dist/jvm/protocol/query-keys.d.ts +1 -1
  359. package/dist/jvm/protocol/query-keys.d.ts.map +1 -1
  360. package/dist/jvm/protocol/query-keys.js +1 -1
  361. package/dist/jvm/protocol/query-keys.js.map +1 -1
  362. package/dist/jvm/protocol/status.cjs +38 -0
  363. package/dist/jvm/protocol/status.cjs.map +1 -0
  364. package/dist/jvm/protocol/status.d.ts +13 -0
  365. package/dist/jvm/protocol/status.d.ts.map +1 -0
  366. package/dist/jvm/protocol/status.js +38 -0
  367. package/dist/jvm/protocol/status.js.map +1 -0
  368. package/dist/jvm/protocol/types.d.ts +16 -4
  369. package/dist/jvm/protocol/types.d.ts.map +1 -1
  370. package/dist/jvm/runtime/GcSummary.cjs +7 -1
  371. package/dist/jvm/runtime/GcSummary.cjs.map +1 -1
  372. package/dist/jvm/runtime/GcSummary.d.ts.map +1 -1
  373. package/dist/jvm/runtime/GcSummary.js +7 -1
  374. package/dist/jvm/runtime/GcSummary.js.map +1 -1
  375. package/dist/jvm/surfaces/ClassesSurface.cjs +11 -10
  376. package/dist/jvm/surfaces/ClassesSurface.cjs.map +1 -1
  377. package/dist/jvm/surfaces/ClassesSurface.d.ts.map +1 -1
  378. package/dist/jvm/surfaces/ClassesSurface.js +12 -11
  379. package/dist/jvm/surfaces/ClassesSurface.js.map +1 -1
  380. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.cjs +11 -3
  381. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.cjs.map +1 -1
  382. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.d.ts +2 -0
  383. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.d.ts.map +1 -1
  384. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.js +11 -3
  385. package/dist/jvm/surfaces/JvmDiagnosticsWorkspace.js.map +1 -1
  386. package/dist/jvm/surfaces/PatchesSurface.cjs +3 -8
  387. package/dist/jvm/surfaces/PatchesSurface.cjs.map +1 -1
  388. package/dist/jvm/surfaces/PatchesSurface.d.ts +2 -1
  389. package/dist/jvm/surfaces/PatchesSurface.d.ts.map +1 -1
  390. package/dist/jvm/surfaces/PatchesSurface.js +4 -9
  391. package/dist/jvm/surfaces/PatchesSurface.js.map +1 -1
  392. package/dist/jvm/surfaces/ThreadsSurface.cjs +7 -4
  393. package/dist/jvm/surfaces/ThreadsSurface.cjs.map +1 -1
  394. package/dist/jvm/surfaces/ThreadsSurface.d.ts +4 -1
  395. package/dist/jvm/surfaces/ThreadsSurface.d.ts.map +1 -1
  396. package/dist/jvm/surfaces/ThreadsSurface.js +7 -4
  397. package/dist/jvm/surfaces/ThreadsSurface.js.map +1 -1
  398. package/dist/jvm/surfaces/jvm-context.cjs +23 -4
  399. package/dist/jvm/surfaces/jvm-context.cjs.map +1 -1
  400. package/dist/jvm/surfaces/jvm-context.d.ts +7 -0
  401. package/dist/jvm/surfaces/jvm-context.d.ts.map +1 -1
  402. package/dist/jvm/surfaces/jvm-context.js +23 -5
  403. package/dist/jvm/surfaces/jvm-context.js.map +1 -1
  404. package/dist/jvm/surfaces/use-patch-actions.cjs +2 -2
  405. package/dist/jvm/surfaces/use-patch-actions.cjs.map +1 -1
  406. package/dist/jvm/surfaces/use-patch-actions.js +2 -2
  407. package/dist/jvm/surfaces/use-patch-actions.js.map +1 -1
  408. package/dist/jvm/threads/FoldedStackTrace.cjs +3 -2
  409. package/dist/jvm/threads/FoldedStackTrace.cjs.map +1 -1
  410. package/dist/jvm/threads/FoldedStackTrace.d.ts +4 -1
  411. package/dist/jvm/threads/FoldedStackTrace.d.ts.map +1 -1
  412. package/dist/jvm/threads/FoldedStackTrace.js +3 -2
  413. package/dist/jvm/threads/FoldedStackTrace.js.map +1 -1
  414. package/dist/jvm/threads/ThreadDetail.cjs +6 -2
  415. package/dist/jvm/threads/ThreadDetail.cjs.map +1 -1
  416. package/dist/jvm/threads/ThreadDetail.d.ts +4 -1
  417. package/dist/jvm/threads/ThreadDetail.d.ts.map +1 -1
  418. package/dist/jvm/threads/ThreadDetail.js +6 -2
  419. package/dist/jvm/threads/ThreadDetail.js.map +1 -1
  420. package/dist/jvm.cjs +3 -0
  421. package/dist/jvm.d.ts +2 -1
  422. package/dist/jvm.d.ts.map +1 -1
  423. package/dist/jvm.js +3 -2
  424. package/dist/layout/AppShell.cjs.map +1 -1
  425. package/dist/layout/AppShell.d.ts +16 -0
  426. package/dist/layout/AppShell.d.ts.map +1 -1
  427. package/dist/layout/AppShell.js.map +1 -1
  428. package/dist/layout/AppShell.nav.cjs +21 -2
  429. package/dist/layout/AppShell.nav.cjs.map +1 -1
  430. package/dist/layout/AppShell.nav.js +21 -2
  431. package/dist/layout/AppShell.nav.js.map +1 -1
  432. package/dist/layout/Workspace.cjs +66 -21
  433. package/dist/layout/Workspace.cjs.map +1 -1
  434. package/dist/layout/Workspace.d.ts +6 -1
  435. package/dist/layout/Workspace.d.ts.map +1 -1
  436. package/dist/layout/Workspace.js +66 -21
  437. package/dist/layout/Workspace.js.map +1 -1
  438. package/dist/layout/Workspace.model.cjs +20 -0
  439. package/dist/layout/Workspace.model.cjs.map +1 -1
  440. package/dist/layout/Workspace.model.d.ts +17 -0
  441. package/dist/layout/Workspace.model.d.ts.map +1 -1
  442. package/dist/layout/Workspace.model.js +20 -1
  443. package/dist/layout/Workspace.model.js.map +1 -1
  444. package/dist/layout/Workspace.regions.cjs +10 -6
  445. package/dist/layout/Workspace.regions.cjs.map +1 -1
  446. package/dist/layout/Workspace.regions.d.ts +4 -1
  447. package/dist/layout/Workspace.regions.d.ts.map +1 -1
  448. package/dist/layout/Workspace.regions.js +10 -6
  449. package/dist/layout/Workspace.regions.js.map +1 -1
  450. package/dist/lib/duration.cjs +20 -0
  451. package/dist/lib/duration.cjs.map +1 -1
  452. package/dist/lib/duration.d.ts +8 -0
  453. package/dist/lib/duration.d.ts.map +1 -1
  454. package/dist/lib/duration.js +19 -1
  455. package/dist/lib/duration.js.map +1 -1
  456. package/dist/monaco/MonacoEditor.cjs +34 -30
  457. package/dist/monaco/MonacoEditor.cjs.map +1 -1
  458. package/dist/monaco/MonacoEditor.d.ts.map +1 -1
  459. package/dist/monaco/MonacoEditor.js +34 -30
  460. package/dist/monaco/MonacoEditor.js.map +1 -1
  461. package/dist/overlay/ConfirmDialog.cjs +5 -2
  462. package/dist/overlay/ConfirmDialog.cjs.map +1 -1
  463. package/dist/overlay/ConfirmDialog.d.ts +14 -2
  464. package/dist/overlay/ConfirmDialog.d.ts.map +1 -1
  465. package/dist/overlay/ConfirmDialog.js +5 -2
  466. package/dist/overlay/ConfirmDialog.js.map +1 -1
  467. package/dist/profiles/cel/celEditor.cjs +94 -285
  468. package/dist/profiles/cel/celEditor.cjs.map +1 -1
  469. package/dist/profiles/cel/celEditor.d.ts +10 -15
  470. package/dist/profiles/cel/celEditor.d.ts.map +1 -1
  471. package/dist/profiles/cel/celEditor.js +97 -287
  472. package/dist/profiles/cel/celEditor.js.map +1 -1
  473. package/dist/profiles/cel/celExpression.cjs +1 -61
  474. package/dist/profiles/cel/celExpression.cjs.map +1 -1
  475. package/dist/profiles/cel/celExpression.d.ts +2 -38
  476. package/dist/profiles/cel/celExpression.d.ts.map +1 -1
  477. package/dist/profiles/cel/celExpression.js +2 -58
  478. package/dist/profiles/cel/celExpression.js.map +1 -1
  479. package/dist/profiles/cel/celPlayground.cjs +122 -0
  480. package/dist/profiles/cel/celPlayground.cjs.map +1 -0
  481. package/dist/profiles/cel/celPlayground.d.ts +43 -0
  482. package/dist/profiles/cel/celPlayground.d.ts.map +1 -0
  483. package/dist/profiles/cel/celPlayground.js +118 -0
  484. package/dist/profiles/cel/celPlayground.js.map +1 -0
  485. package/dist/profiles/connections/connectionBrowserModel.cjs +2 -2
  486. package/dist/profiles/connections/connectionBrowserModel.cjs.map +1 -1
  487. package/dist/profiles/connections/connectionBrowserModel.d.ts +5 -1
  488. package/dist/profiles/connections/connectionBrowserModel.d.ts.map +1 -1
  489. package/dist/profiles/connections/connectionBrowserModel.js +2 -2
  490. package/dist/profiles/connections/connectionBrowserModel.js.map +1 -1
  491. package/dist/profiles/connections/connectionQueryWorkspace.cjs +2 -1
  492. package/dist/profiles/connections/connectionQueryWorkspace.cjs.map +1 -1
  493. package/dist/profiles/connections/connectionQueryWorkspace.d.ts +3 -1
  494. package/dist/profiles/connections/connectionQueryWorkspace.d.ts.map +1 -1
  495. package/dist/profiles/connections/connectionQueryWorkspace.js +2 -1
  496. package/dist/profiles/connections/connectionQueryWorkspace.js.map +1 -1
  497. package/dist/profiles/editor/UnwrapPreviewList.cjs +90 -0
  498. package/dist/profiles/editor/UnwrapPreviewList.cjs.map +1 -0
  499. package/dist/profiles/editor/UnwrapPreviewList.d.ts +7 -0
  500. package/dist/profiles/editor/UnwrapPreviewList.d.ts.map +1 -0
  501. package/dist/profiles/editor/UnwrapPreviewList.js +90 -0
  502. package/dist/profiles/editor/UnwrapPreviewList.js.map +1 -0
  503. package/dist/profiles/editor/profileCanonicalQuery.cjs +6 -58
  504. package/dist/profiles/editor/profileCanonicalQuery.cjs.map +1 -1
  505. package/dist/profiles/editor/profileCanonicalQuery.d.ts +1 -1
  506. package/dist/profiles/editor/profileCanonicalQuery.d.ts.map +1 -1
  507. package/dist/profiles/editor/profileCanonicalQuery.js +4 -56
  508. package/dist/profiles/editor/profileCanonicalQuery.js.map +1 -1
  509. package/dist/profiles/editor/profileCanonicalTranslate.cjs +48 -0
  510. package/dist/profiles/editor/profileCanonicalTranslate.cjs.map +1 -0
  511. package/dist/profiles/editor/profileCanonicalTranslate.d.ts +24 -0
  512. package/dist/profiles/editor/profileCanonicalTranslate.d.ts.map +1 -0
  513. package/dist/profiles/editor/profileCanonicalTranslate.js +47 -0
  514. package/dist/profiles/editor/profileCanonicalTranslate.js.map +1 -0
  515. package/dist/profiles/editor/profileEditor.cjs +106 -37
  516. package/dist/profiles/editor/profileEditor.cjs.map +1 -1
  517. package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
  518. package/dist/profiles/editor/profileEditor.js +107 -38
  519. package/dist/profiles/editor/profileEditor.js.map +1 -1
  520. package/dist/profiles/editor/profileEditorModel.cjs +65 -19
  521. package/dist/profiles/editor/profileEditorModel.cjs.map +1 -1
  522. package/dist/profiles/editor/profileEditorModel.d.ts +24 -8
  523. package/dist/profiles/editor/profileEditorModel.d.ts.map +1 -1
  524. package/dist/profiles/editor/profileEditorModel.js +64 -18
  525. package/dist/profiles/editor/profileEditorModel.js.map +1 -1
  526. package/dist/profiles/editor/profileEditorPreview.cjs +129 -29
  527. package/dist/profiles/editor/profileEditorPreview.cjs.map +1 -1
  528. package/dist/profiles/editor/profileEditorPreview.d.ts +18 -5
  529. package/dist/profiles/editor/profileEditorPreview.d.ts.map +1 -1
  530. package/dist/profiles/editor/profileEditorPreview.js +129 -29
  531. package/dist/profiles/editor/profileEditorPreview.js.map +1 -1
  532. package/dist/profiles/editor/profileEditorSections.cjs +137 -88
  533. package/dist/profiles/editor/profileEditorSections.cjs.map +1 -1
  534. package/dist/profiles/editor/profileEditorSections.d.ts +18 -2
  535. package/dist/profiles/editor/profileEditorSections.d.ts.map +1 -1
  536. package/dist/profiles/editor/profileEditorSections.js +138 -90
  537. package/dist/profiles/editor/profileEditorSections.js.map +1 -1
  538. package/dist/profiles/editor/profileMappingPreview.cjs +22 -6
  539. package/dist/profiles/editor/profileMappingPreview.cjs.map +1 -1
  540. package/dist/profiles/editor/profileMappingPreview.d.ts +17 -1
  541. package/dist/profiles/editor/profileMappingPreview.d.ts.map +1 -1
  542. package/dist/profiles/editor/profileMappingPreview.js +23 -7
  543. package/dist/profiles/editor/profileMappingPreview.js.map +1 -1
  544. package/dist/profiles/editor/profileSaveAsDialog.cjs +21 -13
  545. package/dist/profiles/editor/profileSaveAsDialog.cjs.map +1 -1
  546. package/dist/profiles/editor/profileSaveAsDialog.d.ts.map +1 -1
  547. package/dist/profiles/editor/profileSaveAsDialog.js +21 -13
  548. package/dist/profiles/editor/profileSaveAsDialog.js.map +1 -1
  549. package/dist/profiles/editor/profileSourceExtensions.cjs +71 -0
  550. package/dist/profiles/editor/profileSourceExtensions.cjs.map +1 -0
  551. package/dist/profiles/editor/profileSourceExtensions.d.ts +26 -0
  552. package/dist/profiles/editor/profileSourceExtensions.d.ts.map +1 -0
  553. package/dist/profiles/editor/profileSourceExtensions.js +70 -0
  554. package/dist/profiles/editor/profileSourceExtensions.js.map +1 -0
  555. package/dist/profiles/editor/samplePaths.cjs +54 -0
  556. package/dist/profiles/editor/samplePaths.cjs.map +1 -0
  557. package/dist/profiles/editor/samplePaths.d.ts +27 -0
  558. package/dist/profiles/editor/samplePaths.d.ts.map +1 -0
  559. package/dist/profiles/editor/samplePaths.js +53 -0
  560. package/dist/profiles/editor/samplePaths.js.map +1 -0
  561. package/dist/profiles/editor/testSchema.d.ts.map +1 -1
  562. package/dist/profiles/editor/useUnwrapPreviews.cjs +60 -0
  563. package/dist/profiles/editor/useUnwrapPreviews.cjs.map +1 -0
  564. package/dist/profiles/editor/useUnwrapPreviews.d.ts +38 -0
  565. package/dist/profiles/editor/useUnwrapPreviews.d.ts.map +1 -0
  566. package/dist/profiles/editor/useUnwrapPreviews.js +60 -0
  567. package/dist/profiles/editor/useUnwrapPreviews.js.map +1 -0
  568. package/dist/profiles/elasticsearch/esQueryBuilder.cjs +10 -1
  569. package/dist/profiles/elasticsearch/esQueryBuilder.cjs.map +1 -1
  570. package/dist/profiles/elasticsearch/esQueryBuilder.d.ts.map +1 -1
  571. package/dist/profiles/elasticsearch/esQueryBuilder.js +11 -2
  572. package/dist/profiles/elasticsearch/esQueryBuilder.js.map +1 -1
  573. package/dist/profiles/elasticsearch/esQueryBuilderForm.cjs +38 -0
  574. package/dist/profiles/elasticsearch/esQueryBuilderForm.cjs.map +1 -1
  575. package/dist/profiles/elasticsearch/esQueryBuilderForm.d.ts +17 -0
  576. package/dist/profiles/elasticsearch/esQueryBuilderForm.d.ts.map +1 -1
  577. package/dist/profiles/elasticsearch/esQueryBuilderForm.js +37 -1
  578. package/dist/profiles/elasticsearch/esQueryBuilderForm.js.map +1 -1
  579. package/dist/profiles/elasticsearch/esQueryConditionRow.cjs +4 -3
  580. package/dist/profiles/elasticsearch/esQueryConditionRow.cjs.map +1 -1
  581. package/dist/profiles/elasticsearch/esQueryConditionRow.d.ts.map +1 -1
  582. package/dist/profiles/elasticsearch/esQueryConditionRow.js +4 -3
  583. package/dist/profiles/elasticsearch/esQueryConditionRow.js.map +1 -1
  584. package/dist/profiles/elasticsearch/esQueryOperators.cjs.map +1 -1
  585. package/dist/profiles/elasticsearch/esQueryOperators.d.ts +8 -0
  586. package/dist/profiles/elasticsearch/esQueryOperators.d.ts.map +1 -1
  587. package/dist/profiles/elasticsearch/esQueryOperators.js.map +1 -1
  588. package/dist/profiles/fields/profileFieldControls.cjs +3 -2
  589. package/dist/profiles/fields/profileFieldControls.cjs.map +1 -1
  590. package/dist/profiles/fields/profileFieldControls.d.ts +3 -1
  591. package/dist/profiles/fields/profileFieldControls.d.ts.map +1 -1
  592. package/dist/profiles/fields/profileFieldControls.js +3 -2
  593. package/dist/profiles/fields/profileFieldControls.js.map +1 -1
  594. package/dist/profiles/fields/profileFieldEditor.cjs +98 -185
  595. package/dist/profiles/fields/profileFieldEditor.cjs.map +1 -1
  596. package/dist/profiles/fields/profileFieldEditor.d.ts +11 -3
  597. package/dist/profiles/fields/profileFieldEditor.d.ts.map +1 -1
  598. package/dist/profiles/fields/profileFieldEditor.js +99 -186
  599. package/dist/profiles/fields/profileFieldEditor.js.map +1 -1
  600. package/dist/profiles/fields/profileFieldFilterEditor.cjs +115 -81
  601. package/dist/profiles/fields/profileFieldFilterEditor.cjs.map +1 -1
  602. package/dist/profiles/fields/profileFieldFilterEditor.d.ts.map +1 -1
  603. package/dist/profiles/fields/profileFieldFilterEditor.js +116 -82
  604. package/dist/profiles/fields/profileFieldFilterEditor.js.map +1 -1
  605. package/dist/profiles/fields/profileFieldIcons.cjs +2 -0
  606. package/dist/profiles/fields/profileFieldIcons.cjs.map +1 -1
  607. package/dist/profiles/fields/profileFieldIcons.d.ts.map +1 -1
  608. package/dist/profiles/fields/profileFieldIcons.js +2 -0
  609. package/dist/profiles/fields/profileFieldIcons.js.map +1 -1
  610. package/dist/profiles/fields/profileFieldList.cjs +23 -1
  611. package/dist/profiles/fields/profileFieldList.cjs.map +1 -1
  612. package/dist/profiles/fields/profileFieldList.d.ts.map +1 -1
  613. package/dist/profiles/fields/profileFieldList.js +23 -1
  614. package/dist/profiles/fields/profileFieldList.js.map +1 -1
  615. package/dist/profiles/fields/profileFieldPreview.cjs +111 -0
  616. package/dist/profiles/fields/profileFieldPreview.cjs.map +1 -0
  617. package/dist/profiles/fields/profileFieldPreview.d.ts +25 -0
  618. package/dist/profiles/fields/profileFieldPreview.d.ts.map +1 -0
  619. package/dist/profiles/fields/profileFieldPreview.js +110 -0
  620. package/dist/profiles/fields/profileFieldPreview.js.map +1 -0
  621. package/dist/profiles/fields/profileFieldSample.cjs +182 -0
  622. package/dist/profiles/fields/profileFieldSample.cjs.map +1 -0
  623. package/dist/profiles/fields/profileFieldSample.d.ts +35 -0
  624. package/dist/profiles/fields/profileFieldSample.d.ts.map +1 -0
  625. package/dist/profiles/fields/profileFieldSample.js +180 -0
  626. package/dist/profiles/fields/profileFieldSample.js.map +1 -0
  627. package/dist/profiles/fields/profileFieldTypeField.cjs +104 -0
  628. package/dist/profiles/fields/profileFieldTypeField.cjs.map +1 -0
  629. package/dist/profiles/fields/profileFieldTypeField.d.ts +17 -0
  630. package/dist/profiles/fields/profileFieldTypeField.d.ts.map +1 -0
  631. package/dist/profiles/fields/profileFieldTypeField.js +104 -0
  632. package/dist/profiles/fields/profileFieldTypeField.js.map +1 -0
  633. package/dist/profiles/fields/profileFieldTypes.cjs +1 -0
  634. package/dist/profiles/fields/profileFieldTypes.cjs.map +1 -1
  635. package/dist/profiles/fields/profileFieldTypes.d.ts +1 -1
  636. package/dist/profiles/fields/profileFieldTypes.d.ts.map +1 -1
  637. package/dist/profiles/fields/profileFieldTypes.js +1 -0
  638. package/dist/profiles/fields/profileFieldTypes.js.map +1 -1
  639. package/dist/profiles/fields/profileFieldValueEditor.cjs +298 -0
  640. package/dist/profiles/fields/profileFieldValueEditor.cjs.map +1 -0
  641. package/dist/profiles/fields/profileFieldValueEditor.d.ts +18 -0
  642. package/dist/profiles/fields/profileFieldValueEditor.d.ts.map +1 -0
  643. package/dist/profiles/fields/profileFieldValueEditor.js +298 -0
  644. package/dist/profiles/fields/profileFieldValueEditor.js.map +1 -0
  645. package/dist/profiles/fields/profileFieldValueMode.cjs +61 -0
  646. package/dist/profiles/fields/profileFieldValueMode.cjs.map +1 -0
  647. package/dist/profiles/fields/profileFieldValueMode.d.ts +34 -0
  648. package/dist/profiles/fields/profileFieldValueMode.d.ts.map +1 -0
  649. package/dist/profiles/fields/profileFieldValueMode.js +59 -0
  650. package/dist/profiles/fields/profileFieldValueMode.js.map +1 -0
  651. package/dist/profiles/processor/processorConfig.cjs +79 -79
  652. package/dist/profiles/processor/processorConfig.cjs.map +1 -1
  653. package/dist/profiles/processor/processorConfig.d.ts +30 -3
  654. package/dist/profiles/processor/processorConfig.d.ts.map +1 -1
  655. package/dist/profiles/processor/processorConfig.js +78 -78
  656. package/dist/profiles/processor/processorConfig.js.map +1 -1
  657. package/dist/profiles/processor/processorPipeline.cjs +8 -6
  658. package/dist/profiles/processor/processorPipeline.cjs.map +1 -1
  659. package/dist/profiles/processor/processorPipeline.d.ts +3 -3
  660. package/dist/profiles/processor/processorPipeline.d.ts.map +1 -1
  661. package/dist/profiles/processor/processorPipeline.js +9 -7
  662. package/dist/profiles/processor/processorPipeline.js.map +1 -1
  663. package/dist/profiles/processor/processorPipelineEditor.cjs +38 -94
  664. package/dist/profiles/processor/processorPipelineEditor.cjs.map +1 -1
  665. package/dist/profiles/processor/processorPipelineEditor.d.ts +3 -3
  666. package/dist/profiles/processor/processorPipelineEditor.d.ts.map +1 -1
  667. package/dist/profiles/processor/processorPipelineEditor.js +39 -95
  668. package/dist/profiles/processor/processorPipelineEditor.js.map +1 -1
  669. package/dist/profiles/processor/processorPipelineExtension.cjs +3 -2
  670. package/dist/profiles/processor/processorPipelineExtension.cjs.map +1 -1
  671. package/dist/profiles/processor/processorPipelineExtension.d.ts.map +1 -1
  672. package/dist/profiles/processor/processorPipelineExtension.js +3 -2
  673. package/dist/profiles/processor/processorPipelineExtension.js.map +1 -1
  674. package/dist/profiles/query/profileSampleFilterLookup.cjs.map +1 -1
  675. package/dist/profiles/query/profileSampleFilterLookup.d.ts +6 -3
  676. package/dist/profiles/query/profileSampleFilterLookup.d.ts.map +1 -1
  677. package/dist/profiles/query/profileSampleFilterLookup.js.map +1 -1
  678. package/dist/profiles/wizard/profileWizardModel.cjs +10 -1
  679. package/dist/profiles/wizard/profileWizardModel.cjs.map +1 -1
  680. package/dist/profiles/wizard/profileWizardModel.d.ts +6 -0
  681. package/dist/profiles/wizard/profileWizardModel.d.ts.map +1 -1
  682. package/dist/profiles/wizard/profileWizardModel.js +10 -1
  683. package/dist/profiles/wizard/profileWizardModel.js.map +1 -1
  684. package/dist/profiles/wizard/profileWizardQueryStep.cjs +10 -22
  685. package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
  686. package/dist/profiles/wizard/profileWizardQueryStep.d.ts +8 -1
  687. package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
  688. package/dist/profiles/wizard/profileWizardQueryStep.js +11 -23
  689. package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
  690. package/dist/profiles/wizard/useProfileInspection.cjs +39 -0
  691. package/dist/profiles/wizard/useProfileInspection.cjs.map +1 -0
  692. package/dist/profiles/wizard/useProfileInspection.d.ts +21 -0
  693. package/dist/profiles/wizard/useProfileInspection.d.ts.map +1 -0
  694. package/dist/profiles/wizard/useProfileInspection.js +39 -0
  695. package/dist/profiles/wizard/useProfileInspection.js.map +1 -0
  696. package/dist/profiles.cjs +9 -11
  697. package/dist/profiles.js +8 -8
  698. package/dist/rpc/EntityExplorerApp.cjs +7 -3
  699. package/dist/rpc/EntityExplorerApp.cjs.map +1 -1
  700. package/dist/rpc/EntityExplorerApp.d.ts +16 -1
  701. package/dist/rpc/EntityExplorerApp.d.ts.map +1 -1
  702. package/dist/rpc/EntityExplorerApp.js +7 -3
  703. package/dist/rpc/EntityExplorerApp.js.map +1 -1
  704. package/dist/rpc/InlineError.cjs +30 -10
  705. package/dist/rpc/InlineError.cjs.map +1 -1
  706. package/dist/rpc/InlineError.d.ts +10 -1
  707. package/dist/rpc/InlineError.d.ts.map +1 -1
  708. package/dist/rpc/InlineError.js +30 -10
  709. package/dist/rpc/InlineError.js.map +1 -1
  710. package/dist/rpc/SchemaActionForm.cjs +9 -6
  711. package/dist/rpc/SchemaActionForm.cjs.map +1 -1
  712. package/dist/rpc/SchemaActionForm.d.ts.map +1 -1
  713. package/dist/rpc/SchemaActionForm.js +9 -6
  714. package/dist/rpc/SchemaActionForm.js.map +1 -1
  715. package/dist/rpc/SessionHeader.cjs +3 -3
  716. package/dist/rpc/SessionHeader.cjs.map +1 -1
  717. package/dist/rpc/SessionHeader.d.ts.map +1 -1
  718. package/dist/rpc/SessionHeader.js +3 -3
  719. package/dist/rpc/SessionHeader.js.map +1 -1
  720. package/dist/rpc/formMetadata.cjs +2 -6
  721. package/dist/rpc/formMetadata.cjs.map +1 -1
  722. package/dist/rpc/formMetadata.d.ts.map +1 -1
  723. package/dist/rpc/formMetadata.js +1 -5
  724. package/dist/rpc/formMetadata.js.map +1 -1
  725. package/dist/rpc/surfaceNav.cjs +5 -0
  726. package/dist/rpc/surfaceNav.cjs.map +1 -1
  727. package/dist/rpc/surfaceNav.d.ts.map +1 -1
  728. package/dist/rpc/surfaceNav.js +5 -0
  729. package/dist/rpc/surfaceNav.js.map +1 -1
  730. package/dist/runtime/barrels.json +4982 -4979
  731. package/dist/runtime/importmap.json +2168 -2146
  732. package/dist/styles.css +1 -1
  733. package/package.json +1 -1
  734. package/dist/data/ai/runtime-profiles/ResolutionInspector.cjs +0 -91
  735. package/dist/data/ai/runtime-profiles/ResolutionInspector.cjs.map +0 -1
  736. package/dist/data/ai/runtime-profiles/ResolutionInspector.d.ts +0 -7
  737. package/dist/data/ai/runtime-profiles/ResolutionInspector.d.ts.map +0 -1
  738. package/dist/data/ai/runtime-profiles/ResolutionInspector.js +0 -91
  739. package/dist/data/ai/runtime-profiles/ResolutionInspector.js.map +0 -1
  740. package/dist/profiles/cel/celEditorResults.cjs +0 -158
  741. package/dist/profiles/cel/celEditorResults.cjs.map +0 -1
  742. package/dist/profiles/cel/celEditorResults.d.ts +0 -37
  743. package/dist/profiles/cel/celEditorResults.d.ts.map +0 -1
  744. package/dist/profiles/cel/celEditorResults.js +0 -156
  745. package/dist/profiles/cel/celEditorResults.js.map +0 -1
@@ -0,0 +1,53 @@
1
+ // src/profiles/editor/samplePaths.ts
2
+ var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
3
+ /**
4
+ * Reads a dotted path out of a sampled row the way the query engine resolves a
5
+ * column's source (commons-db query/row_path.go lookupRowPath): a literal key
6
+ * wins over splitting, at every level. After a key_values unwrap a document holds
7
+ * keys that contain dots themselves (`process.tags` is `{"host.name": …}`), so
8
+ * `process.tags.host.name` is `process` → `tags` → the literal `host.name`.
9
+ * Keep it in step with that function.
10
+ */
11
+ function lookupSamplePath(document, path) {
12
+ if (!isObject(document)) return { found: false };
13
+ if (Object.hasOwn(document, path)) return {
14
+ found: true,
15
+ value: document[path]
16
+ };
17
+ for (let dot = path.indexOf("."); dot !== -1; dot = path.indexOf(".", dot + 1)) {
18
+ const head = path.slice(0, dot);
19
+ const nested = Object.hasOwn(document, head) ? document[head] : void 0;
20
+ if (!isObject(nested)) continue;
21
+ const found = lookupSamplePath(nested, path.slice(dot + 1));
22
+ if (found.found) return found;
23
+ }
24
+ return { found: false };
25
+ }
26
+ function jsType(value) {
27
+ if (value === null) return "null";
28
+ if (Array.isArray(value)) return "array";
29
+ return typeof value;
30
+ }
31
+ /**
32
+ * Every field path the sampled rows carry: nested objects contribute their keys
33
+ * as dotted paths, arrays and scalars are leaves. Each path lists the types it
34
+ * held, since rows disagree (a list in one, JSON text in another).
35
+ */
36
+ function sampleFieldPaths(rows) {
37
+ const types = /* @__PURE__ */ new Map();
38
+ const visit = (value, prefix) => {
39
+ for (const [key, child] of Object.entries(value)) {
40
+ const path = prefix ? `${prefix}.${key}` : key;
41
+ if (isObject(child)) visit(child, path);
42
+ else types.set(path, (types.get(path) ?? /* @__PURE__ */ new Set()).add(jsType(child)));
43
+ }
44
+ };
45
+ for (const row of rows) visit(row, "");
46
+ return [...types].sort(([a], [b]) => a.localeCompare(b)).map(([path, held]) => ({
47
+ path,
48
+ types: [...held].sort()
49
+ }));
50
+ }
51
+ export { lookupSamplePath, sampleFieldPaths };
52
+
53
+ //# sourceMappingURL=samplePaths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"samplePaths.js","names":[],"sources":["../../../src/profiles/editor/samplePaths.ts"],"sourcesContent":["// Reading field paths out of sampled rows. Nothing here changes a row: unwrap\n// rules are applied by the server alone, and the rows the editor holds are\n// already what it produced.\n\ntype Row = Record<string, unknown>;\n\nconst isObject = (value: unknown): value is Row =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nexport type SamplePathLookup = { found: true; value: unknown } | { found: false };\n\n/**\n * Reads a dotted path out of a sampled row the way the query engine resolves a\n * column's source (commons-db query/row_path.go lookupRowPath): a literal key\n * wins over splitting, at every level. After a key_values unwrap a document holds\n * keys that contain dots themselves (`process.tags` is `{\"host.name\": …}`), so\n * `process.tags.host.name` is `process` → `tags` → the literal `host.name`.\n * Keep it in step with that function.\n */\nexport function lookupSamplePath(document: unknown, path: string): SamplePathLookup {\n if (!isObject(document)) return { found: false };\n if (Object.hasOwn(document, path)) return { found: true, value: document[path] };\n for (let dot = path.indexOf(\".\"); dot !== -1; dot = path.indexOf(\".\", dot + 1)) {\n const head = path.slice(0, dot);\n const nested = Object.hasOwn(document, head) ? document[head] : undefined;\n if (!isObject(nested)) continue;\n const found = lookupSamplePath(nested, path.slice(dot + 1));\n if (found.found) return found;\n }\n return { found: false };\n}\n\nfunction jsType(value: unknown): string {\n if (value === null) return \"null\";\n if (Array.isArray(value)) return \"array\";\n return typeof value;\n}\n\n/**\n * Every field path the sampled rows carry: nested objects contribute their keys\n * as dotted paths, arrays and scalars are leaves. Each path lists the types it\n * held, since rows disagree (a list in one, JSON text in another).\n */\nexport function sampleFieldPaths(rows: Row[]): { path: string; types: string[] }[] {\n const types = new Map<string, Set<string>>();\n const visit = (value: Row, prefix: string) => {\n for (const [key, child] of Object.entries(value)) {\n const path = prefix ? `${prefix}.${key}` : key;\n if (isObject(child)) visit(child, path);\n else types.set(path, (types.get(path) ?? new Set()).add(jsType(child)));\n }\n };\n for (const row of rows) visit(row, \"\");\n return [...types]\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([path, held]) => ({ path, types: [...held].sort() }));\n}\n"],"mappings":";AAMA,IAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;;;;;;;;;AAYrE,SAAgB,iBAAiB,UAAmB,MAAgC;CAClF,IAAI,CAAC,SAAS,QAAQ,GAAG,OAAO,EAAE,OAAO,MAAM;CAC/C,IAAI,OAAO,OAAO,UAAU,IAAI,GAAG,OAAO;EAAE,OAAO;EAAM,OAAO,SAAS;CAAM;CAC/E,KAAK,IAAI,MAAM,KAAK,QAAQ,GAAG,GAAG,QAAQ,IAAI,MAAM,KAAK,QAAQ,KAAK,MAAM,CAAC,GAAG;EAC9E,MAAM,OAAO,KAAK,MAAM,GAAG,GAAG;EAC9B,MAAM,SAAS,OAAO,OAAO,UAAU,IAAI,IAAI,SAAS,QAAQ,KAAA;EAChE,IAAI,CAAC,SAAS,MAAM,GAAG;EACvB,MAAM,QAAQ,iBAAiB,QAAQ,KAAK,MAAM,MAAM,CAAC,CAAC;EAC1D,IAAI,MAAM,OAAO,OAAO;CAC1B;CACA,OAAO,EAAE,OAAO,MAAM;AACxB;AAEA,SAAS,OAAO,OAAwB;CACtC,IAAI,UAAU,MAAM,OAAO;CAC3B,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO;CACjC,OAAO,OAAO;AAChB;;;;;;AAOA,SAAgB,iBAAiB,MAAkD;CACjF,MAAM,wBAAQ,IAAI,IAAyB;CAC3C,MAAM,SAAS,OAAY,WAAmB;EAC5C,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAAG;GAChD,MAAM,OAAO,SAAS,GAAG,OAAO,GAAG,QAAQ;GAC3C,IAAI,SAAS,KAAK,GAAG,MAAM,OAAO,IAAI;QACjC,MAAM,IAAI,OAAO,MAAM,IAAI,IAAI,qBAAK,IAAI,IAAI,EAAA,CAAG,IAAI,OAAO,KAAK,CAAC,CAAC;EACxE;CACF;CACA,KAAK,MAAM,OAAO,MAAM,MAAM,KAAK,EAAE;CACrC,OAAO,CAAC,GAAG,KAAK,CAAC,CACd,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,MAAM,WAAW;EAAE;EAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK;CAAE,EAAE;AAC9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"testSchema.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/testSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,eAAO,MAAM,iBAAiB,EAAE,aA8E/B,CAAC"}
1
+ {"version":3,"file":"testSchema.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/testSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,eAAO,MAAM,iBAAiB,EAAE,aAgH/B,CAAC"}
@@ -0,0 +1,60 @@
1
+ const require_connectionBrowserModel = require("../connections/connectionBrowserModel.cjs");
2
+ const require_esQueryBuilderForm = require("../elasticsearch/esQueryBuilderForm.cjs");
3
+ const require_profileApi = require("../profileApi.cjs");
4
+ const require_jsonPathSample = require("../query/jsonPathSample.cjs");
5
+ let react = require("react");
6
+ // src/profiles/editor/useUnwrapPreviews.ts
7
+ var DEBOUNCE_MS = 400;
8
+ /**
9
+ * What each of the draft's unwrap rules does to its field, asked of the server.
10
+ *
11
+ * Unwrap runs only there (the provider's span.Unwrap), so a sample's rows come
12
+ * back already unwrapped and cannot show the field as the backend holds it. The
13
+ * server reads the same documents with the rules left out and runs the rules
14
+ * itself; the editor shows the answer and applies nothing. It re-asks when the
15
+ * draft's source changes, without a new sample.
16
+ */
17
+ function useUnwrapPreviews(draft) {
18
+ const profile = (0, react.useMemo)(() => require_jsonPathSample.sampleRequestProfile(draft), [draft]);
19
+ const params = require_esQueryBuilderForm.defaultParamValues(draft.params);
20
+ const body = profile ? JSON.stringify({
21
+ profile,
22
+ params
23
+ }) : null;
24
+ const [state, setState] = (0, react.useState)({ status: "idle" });
25
+ (0, react.useEffect)(() => {
26
+ if (body === null) {
27
+ setState({ status: "idle" });
28
+ return;
29
+ }
30
+ const controller = new AbortController();
31
+ setState({ status: "loading" });
32
+ const timer = setTimeout(() => {
33
+ require_connectionBrowserModel.fetchJSON(require_profileApi.profileApiPath("profile/sample/unwrap"), {
34
+ method: "POST",
35
+ headers: { "Content-Type": "application/json" },
36
+ body,
37
+ signal: controller.signal
38
+ }).then((result) => {
39
+ if (!controller.signal.aborted) setState({
40
+ status: "ready",
41
+ previews: result.previews,
42
+ sampled: result.sampled
43
+ });
44
+ }, (error) => {
45
+ if (!controller.signal.aborted) setState({
46
+ status: "error",
47
+ message: error instanceof Error ? error.message : String(error)
48
+ });
49
+ });
50
+ }, DEBOUNCE_MS);
51
+ return () => {
52
+ clearTimeout(timer);
53
+ controller.abort();
54
+ };
55
+ }, [body]);
56
+ return state;
57
+ }
58
+ exports.useUnwrapPreviews = useUnwrapPreviews;
59
+
60
+ //# sourceMappingURL=useUnwrapPreviews.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUnwrapPreviews.cjs","names":["useMemo","sampleRequestProfile","defaultParamValues","useState","profileApiPath"],"sources":["../../../src/profiles/editor/useUnwrapPreviews.ts"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { fetchJSON } from \"../connections/connectionBrowserModel\";\nimport { defaultParamValues } from \"../elasticsearch/esQueryBuilderForm\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile } from \"../query/jsonPathSample\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\n\n/** A rule as the draft holds it; the server decides what is valid. */\nexport type UnwrapRuleDraft = { field?: unknown; as?: unknown };\n\n/** What the server's unwrap did, or raised, for one rule (otel/span RulePreview). */\nexport type RulePreview = {\n rule: UnwrapRuleDraft;\n status: \"applied\" | \"failed\" | \"missing\" | \"invalid\";\n row: number;\n before?: unknown;\n after?: unknown;\n error?: string;\n};\n\nexport type UnwrapPreviewState =\n | { status: \"idle\" }\n | { status: \"loading\" }\n | { status: \"error\"; message: string }\n | { status: \"ready\"; previews: RulePreview[]; sampled: number };\n\nconst DEBOUNCE_MS = 400;\n\n/**\n * What each of the draft's unwrap rules does to its field, asked of the server.\n *\n * Unwrap runs only there (the provider's span.Unwrap), so a sample's rows come\n * back already unwrapped and cannot show the field as the backend holds it. The\n * server reads the same documents with the rules left out and runs the rules\n * itself; the editor shows the answer and applies nothing. It re-asks when the\n * draft's source changes, without a new sample.\n */\nexport function useUnwrapPreviews(draft: ProfileWizardDraft): UnwrapPreviewState {\n const profile = useMemo(() => sampleRequestProfile(draft), [draft]);\n const params = defaultParamValues(draft.params);\n const body = profile ? JSON.stringify({ profile, params }) : null;\n const [state, setState] = useState<UnwrapPreviewState>({ status: \"idle\" });\n\n useEffect(() => {\n if (body === null) {\n setState({ status: \"idle\" });\n return;\n }\n const controller = new AbortController();\n setState({ status: \"loading\" });\n const timer = setTimeout(() => {\n fetchJSON<{ previews: RulePreview[]; sampled: number }>(profileApiPath(\"profile/sample/unwrap\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body,\n signal: controller.signal,\n }).then(\n (result) => {\n if (!controller.signal.aborted) setState({ status: \"ready\", previews: result.previews, sampled: result.sampled });\n },\n (error: unknown) => {\n if (!controller.signal.aborted) {\n setState({ status: \"error\", message: error instanceof Error ? error.message : String(error) });\n }\n },\n );\n }, DEBOUNCE_MS);\n return () => {\n clearTimeout(timer);\n controller.abort();\n };\n }, [body]);\n\n return state;\n}\n"],"mappings":";;;;;;AA0BA,IAAM,cAAc;;;;;;;;;;AAWpB,SAAgB,kBAAkB,OAA+C;CAC/E,MAAM,WAAA,GAAUA,MAAAA,QAAAA,OAAcC,uBAAAA,qBAAqB,KAAK,GAAG,CAAC,KAAK,CAAC;CAClE,MAAM,SAASC,2BAAAA,mBAAmB,MAAM,MAAM;CAC9C,MAAM,OAAO,UAAU,KAAK,UAAU;EAAE;EAAS;CAAO,CAAC,IAAI;CAC7D,MAAM,CAAC,OAAO,aAAA,GAAYC,MAAAA,SAAAA,CAA6B,EAAE,QAAQ,OAAO,CAAC;CAEzE,CAAA,GAAA,MAAA,UAAA,OAAgB;EACd,IAAI,SAAS,MAAM;GACjB,SAAS,EAAE,QAAQ,OAAO,CAAC;GAC3B;EACF;EACA,MAAM,aAAa,IAAI,gBAAgB;EACvC,SAAS,EAAE,QAAQ,UAAU,CAAC;EAC9B,MAAM,QAAQ,iBAAiB;GAC7B,+BAAA,UAAwDC,mBAAAA,eAAe,uBAAuB,GAAG;IAC/F,QAAQ;IACR,SAAS,EAAE,gBAAgB,mBAAmB;IAC9C;IACA,QAAQ,WAAW;GACrB,CAAC,CAAC,CAAC,MACA,WAAW;IACV,IAAI,CAAC,WAAW,OAAO,SAAS,SAAS;KAAE,QAAQ;KAAS,UAAU,OAAO;KAAU,SAAS,OAAO;IAAQ,CAAC;GAClH,IACC,UAAmB;IAClB,IAAI,CAAC,WAAW,OAAO,SACrB,SAAS;KAAE,QAAQ;KAAS,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAAE,CAAC;GAEjG,CACF;EACF,GAAG,WAAW;EACd,aAAa;GACX,aAAa,KAAK;GAClB,WAAW,MAAM;EACnB;CACF,GAAG,CAAC,IAAI,CAAC;CAET,OAAO;AACT"}
@@ -0,0 +1,38 @@
1
+ import { ProfileWizardDraft } from '../wizard/profileWizardModel.js';
2
+ /** A rule as the draft holds it; the server decides what is valid. */
3
+ export type UnwrapRuleDraft = {
4
+ field?: unknown;
5
+ as?: unknown;
6
+ };
7
+ /** What the server's unwrap did, or raised, for one rule (otel/span RulePreview). */
8
+ export type RulePreview = {
9
+ rule: UnwrapRuleDraft;
10
+ status: "applied" | "failed" | "missing" | "invalid";
11
+ row: number;
12
+ before?: unknown;
13
+ after?: unknown;
14
+ error?: string;
15
+ };
16
+ export type UnwrapPreviewState = {
17
+ status: "idle";
18
+ } | {
19
+ status: "loading";
20
+ } | {
21
+ status: "error";
22
+ message: string;
23
+ } | {
24
+ status: "ready";
25
+ previews: RulePreview[];
26
+ sampled: number;
27
+ };
28
+ /**
29
+ * What each of the draft's unwrap rules does to its field, asked of the server.
30
+ *
31
+ * Unwrap runs only there (the provider's span.Unwrap), so a sample's rows come
32
+ * back already unwrapped and cannot show the field as the backend holds it. The
33
+ * server reads the same documents with the rules left out and runs the rules
34
+ * itself; the editor shows the answer and applies nothing. It re-asks when the
35
+ * draft's source changes, without a new sample.
36
+ */
37
+ export declare function useUnwrapPreviews(draft: ProfileWizardDraft): UnwrapPreviewState;
38
+ //# sourceMappingURL=useUnwrapPreviews.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUnwrapPreviews.d.ts","sourceRoot":"","sources":["../../../src/profiles/editor/useUnwrapPreviews.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,sEAAsE;AACtE,MAAM,MAAM,eAAe,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhE,qFAAqF;AACrF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAIlE;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,kBAAkB,CAqC/E"}
@@ -0,0 +1,60 @@
1
+ import { fetchJSON } from "../connections/connectionBrowserModel.js";
2
+ import { defaultParamValues } from "../elasticsearch/esQueryBuilderForm.js";
3
+ import { profileApiPath } from "../profileApi.js";
4
+ import { sampleRequestProfile } from "../query/jsonPathSample.js";
5
+ import { useEffect, useMemo, useState } from "react";
6
+ // src/profiles/editor/useUnwrapPreviews.ts
7
+ var DEBOUNCE_MS = 400;
8
+ /**
9
+ * What each of the draft's unwrap rules does to its field, asked of the server.
10
+ *
11
+ * Unwrap runs only there (the provider's span.Unwrap), so a sample's rows come
12
+ * back already unwrapped and cannot show the field as the backend holds it. The
13
+ * server reads the same documents with the rules left out and runs the rules
14
+ * itself; the editor shows the answer and applies nothing. It re-asks when the
15
+ * draft's source changes, without a new sample.
16
+ */
17
+ function useUnwrapPreviews(draft) {
18
+ const profile = useMemo(() => sampleRequestProfile(draft), [draft]);
19
+ const params = defaultParamValues(draft.params);
20
+ const body = profile ? JSON.stringify({
21
+ profile,
22
+ params
23
+ }) : null;
24
+ const [state, setState] = useState({ status: "idle" });
25
+ useEffect(() => {
26
+ if (body === null) {
27
+ setState({ status: "idle" });
28
+ return;
29
+ }
30
+ const controller = new AbortController();
31
+ setState({ status: "loading" });
32
+ const timer = setTimeout(() => {
33
+ fetchJSON(profileApiPath("profile/sample/unwrap"), {
34
+ method: "POST",
35
+ headers: { "Content-Type": "application/json" },
36
+ body,
37
+ signal: controller.signal
38
+ }).then((result) => {
39
+ if (!controller.signal.aborted) setState({
40
+ status: "ready",
41
+ previews: result.previews,
42
+ sampled: result.sampled
43
+ });
44
+ }, (error) => {
45
+ if (!controller.signal.aborted) setState({
46
+ status: "error",
47
+ message: error instanceof Error ? error.message : String(error)
48
+ });
49
+ });
50
+ }, DEBOUNCE_MS);
51
+ return () => {
52
+ clearTimeout(timer);
53
+ controller.abort();
54
+ };
55
+ }, [body]);
56
+ return state;
57
+ }
58
+ export { useUnwrapPreviews };
59
+
60
+ //# sourceMappingURL=useUnwrapPreviews.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUnwrapPreviews.js","names":[],"sources":["../../../src/profiles/editor/useUnwrapPreviews.ts"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { fetchJSON } from \"../connections/connectionBrowserModel\";\nimport { defaultParamValues } from \"../elasticsearch/esQueryBuilderForm\";\nimport { profileApiPath } from \"../profileApi\";\nimport { sampleRequestProfile } from \"../query/jsonPathSample\";\nimport type { ProfileWizardDraft } from \"../wizard/profileWizardModel\";\n\n/** A rule as the draft holds it; the server decides what is valid. */\nexport type UnwrapRuleDraft = { field?: unknown; as?: unknown };\n\n/** What the server's unwrap did, or raised, for one rule (otel/span RulePreview). */\nexport type RulePreview = {\n rule: UnwrapRuleDraft;\n status: \"applied\" | \"failed\" | \"missing\" | \"invalid\";\n row: number;\n before?: unknown;\n after?: unknown;\n error?: string;\n};\n\nexport type UnwrapPreviewState =\n | { status: \"idle\" }\n | { status: \"loading\" }\n | { status: \"error\"; message: string }\n | { status: \"ready\"; previews: RulePreview[]; sampled: number };\n\nconst DEBOUNCE_MS = 400;\n\n/**\n * What each of the draft's unwrap rules does to its field, asked of the server.\n *\n * Unwrap runs only there (the provider's span.Unwrap), so a sample's rows come\n * back already unwrapped and cannot show the field as the backend holds it. The\n * server reads the same documents with the rules left out and runs the rules\n * itself; the editor shows the answer and applies nothing. It re-asks when the\n * draft's source changes, without a new sample.\n */\nexport function useUnwrapPreviews(draft: ProfileWizardDraft): UnwrapPreviewState {\n const profile = useMemo(() => sampleRequestProfile(draft), [draft]);\n const params = defaultParamValues(draft.params);\n const body = profile ? JSON.stringify({ profile, params }) : null;\n const [state, setState] = useState<UnwrapPreviewState>({ status: \"idle\" });\n\n useEffect(() => {\n if (body === null) {\n setState({ status: \"idle\" });\n return;\n }\n const controller = new AbortController();\n setState({ status: \"loading\" });\n const timer = setTimeout(() => {\n fetchJSON<{ previews: RulePreview[]; sampled: number }>(profileApiPath(\"profile/sample/unwrap\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body,\n signal: controller.signal,\n }).then(\n (result) => {\n if (!controller.signal.aborted) setState({ status: \"ready\", previews: result.previews, sampled: result.sampled });\n },\n (error: unknown) => {\n if (!controller.signal.aborted) {\n setState({ status: \"error\", message: error instanceof Error ? error.message : String(error) });\n }\n },\n );\n }, DEBOUNCE_MS);\n return () => {\n clearTimeout(timer);\n controller.abort();\n };\n }, [body]);\n\n return state;\n}\n"],"mappings":";;;;;;AA0BA,IAAM,cAAc;;;;;;;;;;AAWpB,SAAgB,kBAAkB,OAA+C;CAC/E,MAAM,UAAU,cAAc,qBAAqB,KAAK,GAAG,CAAC,KAAK,CAAC;CAClE,MAAM,SAAS,mBAAmB,MAAM,MAAM;CAC9C,MAAM,OAAO,UAAU,KAAK,UAAU;EAAE;EAAS;CAAO,CAAC,IAAI;CAC7D,MAAM,CAAC,OAAO,YAAY,SAA6B,EAAE,QAAQ,OAAO,CAAC;CAEzE,gBAAgB;EACd,IAAI,SAAS,MAAM;GACjB,SAAS,EAAE,QAAQ,OAAO,CAAC;GAC3B;EACF;EACA,MAAM,aAAa,IAAI,gBAAgB;EACvC,SAAS,EAAE,QAAQ,UAAU,CAAC;EAC9B,MAAM,QAAQ,iBAAiB;GAC7B,UAAwD,eAAe,uBAAuB,GAAG;IAC/F,QAAQ;IACR,SAAS,EAAE,gBAAgB,mBAAmB;IAC9C;IACA,QAAQ,WAAW;GACrB,CAAC,CAAC,CAAC,MACA,WAAW;IACV,IAAI,CAAC,WAAW,OAAO,SAAS,SAAS;KAAE,QAAQ;KAAS,UAAU,OAAO;KAAU,SAAS,OAAO;IAAQ,CAAC;GAClH,IACC,UAAmB;IAClB,IAAI,CAAC,WAAW,OAAO,SACrB,SAAS;KAAE,QAAQ;KAAS,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAAE,CAAC;GAEjG,CACF;EACF,GAAG,WAAW;EACd,aAAa;GACX,aAAa,KAAK;GAClB,WAAW,MAAM;EACnB;CACF,GAAG,CAAC,IAAI,CAAC;CAET,OAAO;AACT"}
@@ -22,6 +22,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
22
22
  function EsQueryBuilder({ search, onChange, fields, vocabulary, params = [], onMappingChange, values, compilation, className }) {
23
23
  const root = search.query ?? require_esQueryBuilderModel.emptyGroup();
24
24
  const requiresTimeFieldFormat = require_esQueryBuilderForm.timeFieldFormatRequired(fields, search.timeField);
25
+ const dateField = search.timeField && !requiresTimeFieldFormat ? fields.find((field) => field.name === search.timeField) : void 0;
25
26
  const mappingFieldsChanged = (edit) => edit.params.some((param, index) => param.field !== params[index]?.field);
26
27
  const commitMappingEdit = (edit) => {
27
28
  if (onMappingChange) {
@@ -140,7 +141,7 @@ function EsQueryBuilder({ search, onChange, fields, vocabulary, params = [], onM
140
141
  })),
141
142
  placeholder: "Select epoch unit…",
142
143
  allowCustomValue: false
143
- })] }) : null,
144
+ })] }) : dateField ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TimeFieldUnitReadout, { field: dateField }) : null,
144
145
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
145
146
  className: "text-xs text-muted-foreground",
146
147
  children: "Where time-from and time-to parameters apply"
@@ -224,6 +225,14 @@ function EsQueryBuilderField({ search, onChange, schema, rootValue, onRootChange
224
225
  compilation
225
226
  });
226
227
  }
228
+ function TimeFieldUnitReadout({ field }) {
229
+ const { state, text } = require_esQueryBuilderForm.timeFieldUnitReadout(field);
230
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
231
+ "data-es-time-unit": state,
232
+ className: state === "conflicting" ? "text-xs text-destructive" : "text-xs text-foreground",
233
+ children: text
234
+ });
235
+ }
227
236
  function timeFieldFormatLabel(format) {
228
237
  switch (format) {
229
238
  case "epoch_second": return "Seconds";
@@ -1 +1 @@
1
- {"version":3,"file":"esQueryBuilder.cjs","names":["emptyGroup","timeFieldFormatRequired","reconcileSearchParamMappings","valueLookupField","removeAt","EsQueryClauseGroup","updateAt","insertAt","conditionAt","bindParamOperand","removeParamMapping","Combobox","selectTimeField","timeFieldMappings","_Fragment","EsQuerySortEditor","EsQueryOutputEditor","EsQueryPreview","savedConnectionID","browserBaseUrl","useInspection","paramRoles","defaultParamValues","useCompiledSearch","makeFieldValueLookup","esQueryFields","esBuilderVocabulary"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilder.tsx"],"sourcesContent":["/**\n * The query builder panel and the form extension that mounts it. The panel is\n * pure: it takes a specification and the vocabulary the schema described, and\n * reports edits. Everything that needs a connection — field mappings and the\n * compiled preview — is wired by the host that has one.\n */\n\nimport { Combobox } from \"../../components/Combobox\";\nimport type { JsonSchemaProperty } from \"../../components/json-schema-form-types\";\nimport {\n browserBaseUrl,\n savedConnectionID,\n} from \"../connections/connectionBrowserModel\";\nimport { useInspection } from \"../connections/useInspection\";\nimport {\n conditionAt,\n emptyGroup,\n insertAt,\n removeAt,\n updateAt,\n type EsSearch,\n type EsTimeFieldFormat,\n} from \"./esQueryBuilderModel\";\nimport {\n makeFieldValueLookup,\n valueLookupField,\n type FieldValuesSource,\n} from \"./esFieldValues\";\nimport { EsQueryClauseGroup } from \"./esQueryClauseGroup\";\nimport type { EsQueryContext, EsQueryTreeActions } from \"./esQueryConditionRow\";\nimport {\n esBuilderVocabulary,\n type EsBuilderVocabulary,\n type EsFieldMapping,\n} from \"./esQueryOperators\";\nimport { EsQueryOutputEditor } from \"./esQueryOutputEditor\";\nimport { EsQueryPreview } from \"./esQueryPreview\";\nimport { EsQuerySortEditor } from \"./esQuerySortEditor\";\nimport type { ProfileDraft } from \"../editor/profileBuilderWorkspace\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\nimport {\n bindParamOperand,\n reconcileSearchParamMappings,\n removeParamMapping,\n type ParamMappingEdit,\n} from \"./esParamMappingModel\";\nimport {\n defaultParamValues,\n esQueryFields,\n paramRoles,\n selectTimeField,\n timeFieldFormatRequired,\n timeFieldMappings,\n} from \"./esQueryBuilderForm\";\nimport { useCompiledSearch, type EsCompilation } from \"./esQueryCompile\";\n\nexport type EsQueryBuilderProps = {\n search: EsSearch;\n onChange: (search: EsSearch) => void;\n fields: EsFieldMapping[];\n vocabulary: EsBuilderVocabulary;\n /** Declared profile parameters an operand can bind to. */\n params?: ParamDraft[];\n onMappingChange?: (edit: ParamMappingEdit) => void;\n /** Where a field's own values come from; absent without a connection. */\n values?: FieldValuesSource;\n compilation?: EsCompilation;\n className?: string;\n};\n\nexport function EsQueryBuilder({\n search,\n onChange,\n fields,\n vocabulary,\n params = [],\n onMappingChange,\n values,\n compilation,\n className,\n}: EsQueryBuilderProps) {\n const root = search.query ?? emptyGroup();\n const requiresTimeFieldFormat = timeFieldFormatRequired(\n fields,\n search.timeField,\n );\n const mappingFieldsChanged = (edit: ParamMappingEdit) =>\n edit.params.some((param, index) => param.field !== params[index]?.field);\n const commitMappingEdit = (edit: ParamMappingEdit) => {\n if (onMappingChange) {\n onMappingChange(edit);\n return;\n }\n if (mappingFieldsChanged(edit)) {\n throw new Error(\n \"list parameter mappings require an atomic mapping change handler\",\n );\n }\n onChange(edit.search);\n };\n const commitSearchEdit = (nextSearch: EsSearch) => {\n const edit = reconcileSearchParamMappings({\n previousSearch: search,\n nextSearch,\n params,\n });\n if (mappingFieldsChanged(edit)) {\n commitMappingEdit(edit);\n return;\n }\n onChange(nextSearch);\n };\n const context: EsQueryContext = {\n fields,\n vocabulary,\n params,\n // The builder owns the tree, so it — not the host — decides what a lookup is\n // scoped by: the query without the row being edited. Leaving that row in\n // would filter the suggestions by the half-typed value they are meant to\n // complete.\n ...(values\n ? {\n values: ({ path, field }) => {\n const target = valueLookupField(fields, field);\n if (!target) return undefined;\n return values({\n field: target,\n search: { ...search, query: removeAt(root, path) },\n });\n },\n }\n : {}),\n };\n const actions: EsQueryTreeActions = {\n update: (path, update) =>\n commitSearchEdit({ ...search, query: updateAt(root, path, update) }),\n insert: (groupPath, condition) =>\n commitSearchEdit({\n ...search,\n query: insertAt(\n root,\n groupPath,\n conditionAt(root, groupPath)?.conditions?.length ?? 0,\n condition,\n ),\n }),\n remove: (path) =>\n commitSearchEdit({ ...search, query: removeAt(root, path) }),\n mapParam: (path, operand, name) => {\n const edit = bindParamOperand({ search, params, path, operand, name });\n commitMappingEdit(edit);\n },\n unmapParam: (path, name) => {\n const edit = removeParamMapping({ search, params, name, path });\n commitMappingEdit(edit);\n },\n };\n\n return (\n <div className={className ?? \"flex min-w-0 flex-col gap-3\"}>\n <EsQueryClauseGroup\n condition={root}\n path={[]}\n context={context}\n actions={actions}\n root\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-xs text-muted-foreground\">Time field</span>\n <Combobox\n ariaLabel=\"Time field\"\n className=\"min-w-48\"\n value={search.timeField ?? \"\"}\n onChange={(next) => onChange(selectTimeField(search, fields, next))}\n options={timeFieldMappings(fields).map((field) => ({\n value: field.name,\n label: field.name,\n }))}\n placeholder=\"Timestamp field…\"\n allowCustomValue\n />\n {requiresTimeFieldFormat ? (\n <>\n <span className=\"text-xs text-muted-foreground\">Epoch unit</span>\n <Combobox\n ariaLabel=\"Time field format\"\n ariaRequired\n required\n invalid={!search.timeFieldFormat}\n className=\"min-w-40\"\n value={search.timeFieldFormat ?? \"\"}\n onChange={(next) =>\n onChange({\n ...search,\n timeFieldFormat: (next || undefined) as\n | EsTimeFieldFormat\n | undefined,\n })\n }\n options={(vocabulary.timeFieldFormats ?? []).map((format) => ({\n value: format,\n label: timeFieldFormatLabel(format),\n }))}\n placeholder=\"Select epoch unit…\"\n allowCustomValue={false}\n />\n </>\n ) : null}\n <span className=\"text-xs text-muted-foreground\">\n Where time-from and time-to parameters apply\n </span>\n </div>\n <EsQuerySortEditor\n sort={search.sort ?? []}\n fields={fields}\n orders={vocabulary.sortOrders}\n onChange={(sort) =>\n onChange({ ...search, sort: sort.length ? sort : undefined })\n }\n />\n <EsQueryOutputEditor\n search={search}\n onChange={(patch) => onChange({ ...search, ...patch })}\n />\n {compilation ? <EsQueryPreview compilation={compilation} /> : null}\n </div>\n );\n}\n\n/**\n * The builder as the profile form mounts it. The form knows the connection and\n * the index, so the field mappings and the compiled preview come from the same\n * browser endpoints the connection browser uses.\n */\nexport function EsQueryBuilderField({\n search,\n onChange,\n schema,\n rootValue,\n onRootChange,\n}: {\n search: EsSearch;\n onChange: (next: unknown) => void;\n schema: JsonSchemaProperty;\n rootValue: ProfileDraft;\n onRootChange?: ((next: Record<string, unknown>) => void) | undefined;\n}) {\n const connectionID = savedConnectionID(rootValue.provider?.connection);\n const baseUrl = connectionID ? browserBaseUrl(connectionID) : \"\";\n const target = String(rootValue.provider?.options?.index ?? \"\");\n const inspection = useInspection({\n cacheKey: \"es-query-builder\",\n id: connectionID ?? \"\",\n baseUrl,\n enabled: baseUrl !== \"\",\n database: \"\",\n target,\n });\n const roles = paramRoles(rootValue.params);\n const params = defaultParamValues(rootValue.params);\n const compilation = useCompiledSearch({\n baseUrl,\n index: target,\n search,\n params,\n roles,\n enabled: baseUrl !== \"\",\n });\n const values = makeFieldValueLookup({\n baseUrl,\n index: target,\n params,\n roles,\n });\n\n return (\n <EsQueryBuilder\n search={search}\n onChange={(next) => onChange(next)}\n fields={esQueryFields(inspection.completion)}\n vocabulary={esBuilderVocabulary({ properties: { search: schema } })}\n params={rootValue.params ?? []}\n onMappingChange={(edit) => {\n if (!onRootChange) {\n throw new Error(\n \"query parameter mappings require an atomic root form update\",\n );\n }\n onRootChange({\n ...rootValue,\n params: edit.params,\n provider: {\n ...rootValue.provider,\n options: {\n ...rootValue.provider?.options,\n search: edit.search,\n },\n },\n });\n }}\n {...(values ? { values } : {})}\n compilation={compilation}\n />\n );\n}\n\nfunction timeFieldFormatLabel(format: EsTimeFieldFormat): string {\n switch (format) {\n case \"epoch_second\":\n return \"Seconds\";\n case \"epoch_millis\":\n return \"Milliseconds\";\n case \"epoch_micros\":\n return \"Microseconds\";\n case \"epoch_nanos\":\n return \"Nanoseconds\";\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,eAAe,EAC7B,QACA,UACA,QACA,YACA,SAAS,CAAC,GACV,iBACA,QACA,aACA,aACsB;CACtB,MAAM,OAAO,OAAO,SAASA,4BAAAA,WAAW;CACxC,MAAM,0BAA0BC,2BAAAA,wBAC9B,QACA,OAAO,SACT;CACA,MAAM,wBAAwB,SAC5B,KAAK,OAAO,MAAM,OAAO,UAAU,MAAM,UAAU,OAAO,MAAM,EAAE,KAAK;CACzE,MAAM,qBAAqB,SAA2B;EACpD,IAAI,iBAAiB;GACnB,gBAAgB,IAAI;GACpB;EACF;EACA,IAAI,qBAAqB,IAAI,GAC3B,MAAM,IAAI,MACR,kEACF;EAEF,SAAS,KAAK,MAAM;CACtB;CACA,MAAM,oBAAoB,eAAyB;EACjD,MAAM,OAAOC,4BAAAA,6BAA6B;GACxC,gBAAgB;GAChB;GACA;EACF,CAAC;EACD,IAAI,qBAAqB,IAAI,GAAG;GAC9B,kBAAkB,IAAI;GACtB;EACF;EACA,SAAS,UAAU;CACrB;CACA,MAAM,UAA0B;EAC9B;EACA;EACA;EAKA,GAAI,SACA,EACE,SAAS,EAAE,MA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C/D,QAAQ,QAAR;EACE,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,eACH,OAAO;CACX;AACF"}
1
+ {"version":3,"file":"esQueryBuilder.cjs","names":["emptyGroup","timeFieldFormatRequired","reconcileSearchParamMappings","valueLookupField","removeAt","EsQueryClauseGroup","updateAt","insertAt","conditionAt","bindParamOperand","removeParamMapping","Combobox","selectTimeField","timeFieldMappings","_Fragment","EsQuerySortEditor","EsQueryOutputEditor","EsQueryPreview","savedConnectionID","browserBaseUrl","useInspection","paramRoles","defaultParamValues","useCompiledSearch","makeFieldValueLookup","esQueryFields","esBuilderVocabulary","timeFieldUnitReadout"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilder.tsx"],"sourcesContent":["/**\n * The query builder panel and the form extension that mounts it. The panel is\n * pure: it takes a specification and the vocabulary the schema described, and\n * reports edits. Everything that needs a connection — field mappings and the\n * compiled preview — is wired by the host that has one.\n */\n\nimport { Combobox } from \"../../components/Combobox\";\nimport type { JsonSchemaProperty } from \"../../components/json-schema-form-types\";\nimport {\n browserBaseUrl,\n savedConnectionID,\n} from \"../connections/connectionBrowserModel\";\nimport { useInspection } from \"../connections/useInspection\";\nimport {\n conditionAt,\n emptyGroup,\n insertAt,\n removeAt,\n updateAt,\n type EsSearch,\n type EsTimeFieldFormat,\n} from \"./esQueryBuilderModel\";\nimport {\n makeFieldValueLookup,\n valueLookupField,\n type FieldValuesSource,\n} from \"./esFieldValues\";\nimport { EsQueryClauseGroup } from \"./esQueryClauseGroup\";\nimport type { EsQueryContext, EsQueryTreeActions } from \"./esQueryConditionRow\";\nimport {\n esBuilderVocabulary,\n type EsBuilderVocabulary,\n type EsFieldMapping,\n} from \"./esQueryOperators\";\nimport { EsQueryOutputEditor } from \"./esQueryOutputEditor\";\nimport { EsQueryPreview } from \"./esQueryPreview\";\nimport { EsQuerySortEditor } from \"./esQuerySortEditor\";\nimport type { ProfileDraft } from \"../editor/profileBuilderWorkspace\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\nimport {\n bindParamOperand,\n reconcileSearchParamMappings,\n removeParamMapping,\n type ParamMappingEdit,\n} from \"./esParamMappingModel\";\nimport {\n defaultParamValues,\n esQueryFields,\n paramRoles,\n selectTimeField,\n timeFieldFormatRequired,\n timeFieldMappings,\n timeFieldUnitReadout,\n} from \"./esQueryBuilderForm\";\nimport { useCompiledSearch, type EsCompilation } from \"./esQueryCompile\";\n\nexport type EsQueryBuilderProps = {\n search: EsSearch;\n onChange: (search: EsSearch) => void;\n fields: EsFieldMapping[];\n vocabulary: EsBuilderVocabulary;\n /** Declared profile parameters an operand can bind to. */\n params?: ParamDraft[];\n onMappingChange?: (edit: ParamMappingEdit) => void;\n /** Where a field's own values come from; absent without a connection. */\n values?: FieldValuesSource;\n compilation?: EsCompilation;\n className?: string;\n};\n\nexport function EsQueryBuilder({\n search,\n onChange,\n fields,\n vocabulary,\n params = [],\n onMappingChange,\n values,\n compilation,\n className,\n}: EsQueryBuilderProps) {\n const root = search.query ?? emptyGroup();\n const requiresTimeFieldFormat = timeFieldFormatRequired(\n fields,\n search.timeField,\n );\n const dateField =\n search.timeField && !requiresTimeFieldFormat\n ? fields.find((field) => field.name === search.timeField)\n : undefined;\n const mappingFieldsChanged = (edit: ParamMappingEdit) =>\n edit.params.some((param, index) => param.field !== params[index]?.field);\n const commitMappingEdit = (edit: ParamMappingEdit) => {\n if (onMappingChange) {\n onMappingChange(edit);\n return;\n }\n if (mappingFieldsChanged(edit)) {\n throw new Error(\n \"list parameter mappings require an atomic mapping change handler\",\n );\n }\n onChange(edit.search);\n };\n const commitSearchEdit = (nextSearch: EsSearch) => {\n const edit = reconcileSearchParamMappings({\n previousSearch: search,\n nextSearch,\n params,\n });\n if (mappingFieldsChanged(edit)) {\n commitMappingEdit(edit);\n return;\n }\n onChange(nextSearch);\n };\n const context: EsQueryContext = {\n fields,\n vocabulary,\n params,\n // The builder owns the tree, so it — not the host — decides what a lookup is\n // scoped by: the query without the row being edited. Leaving that row in\n // would filter the suggestions by the half-typed value they are meant to\n // complete.\n ...(values\n ? {\n values: ({ path, field }) => {\n const target = valueLookupField(fields, field);\n if (!target) return undefined;\n return values({\n field: target,\n search: { ...search, query: removeAt(root, path) },\n });\n },\n }\n : {}),\n };\n const actions: EsQueryTreeActions = {\n update: (path, update) =>\n commitSearchEdit({ ...search, query: updateAt(root, path, update) }),\n insert: (groupPath, condition) =>\n commitSearchEdit({\n ...search,\n query: insertAt(\n root,\n groupPath,\n conditionAt(root, groupPath)?.conditions?.length ?? 0,\n condition,\n ),\n }),\n remove: (path) =>\n commitSearchEdit({ ...search, query: removeAt(root, path) }),\n mapParam: (path, operand, name) => {\n const edit = bindParamOperand({ search, params, path, operand, name });\n commitMappingEdit(edit);\n },\n unmapParam: (path, name) => {\n const edit = removeParamMapping({ search, params, name, path });\n commitMappingEdit(edit);\n },\n };\n\n return (\n <div className={className ?? \"flex min-w-0 flex-col gap-3\"}>\n <EsQueryClauseGroup\n condition={root}\n path={[]}\n context={context}\n actions={actions}\n root\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-xs text-muted-foreground\">Time field</span>\n <Combobox\n ariaLabel=\"Time field\"\n className=\"min-w-48\"\n value={search.timeField ?? \"\"}\n onChange={(next) => onChange(selectTimeField(search, fields, next))}\n options={timeFieldMappings(fields).map((field) => ({\n value: field.name,\n label: field.name,\n }))}\n placeholder=\"Timestamp field…\"\n allowCustomValue\n />\n {requiresTimeFieldFormat ? (\n <>\n <span className=\"text-xs text-muted-foreground\">Epoch unit</span>\n <Combobox\n ariaLabel=\"Time field format\"\n ariaRequired\n required\n invalid={!search.timeFieldFormat}\n className=\"min-w-40\"\n value={search.timeFieldFormat ?? \"\"}\n onChange={(next) =>\n onChange({\n ...search,\n timeFieldFormat: (next || undefined) as\n | EsTimeFieldFormat\n | undefined,\n })\n }\n options={(vocabulary.timeFieldFormats ?? []).map((format) => ({\n value: format,\n label: timeFieldFormatLabel(format),\n }))}\n placeholder=\"Select epoch unit…\"\n allowCustomValue={false}\n />\n </>\n ) : dateField ? (\n <TimeFieldUnitReadout field={dateField} />\n ) : null}\n <span className=\"text-xs text-muted-foreground\">\n Where time-from and time-to parameters apply\n </span>\n </div>\n <EsQuerySortEditor\n sort={search.sort ?? []}\n fields={fields}\n orders={vocabulary.sortOrders}\n onChange={(sort) =>\n onChange({ ...search, sort: sort.length ? sort : undefined })\n }\n />\n <EsQueryOutputEditor\n search={search}\n onChange={(patch) => onChange({ ...search, ...patch })}\n />\n {compilation ? <EsQueryPreview compilation={compilation} /> : null}\n </div>\n );\n}\n\n/**\n * The builder as the profile form mounts it. The form knows the connection and\n * the index, so the field mappings and the compiled preview come from the same\n * browser endpoints the connection browser uses.\n */\nexport function EsQueryBuilderField({\n search,\n onChange,\n schema,\n rootValue,\n onRootChange,\n}: {\n search: EsSearch;\n onChange: (next: unknown) => void;\n schema: JsonSchemaProperty;\n rootValue: ProfileDraft;\n onRootChange?: ((next: Record<string, unknown>) => void) | undefined;\n}) {\n const connectionID = savedConnectionID(rootValue.provider?.connection);\n const baseUrl = connectionID ? browserBaseUrl(connectionID) : \"\";\n const target = String(rootValue.provider?.options?.index ?? \"\");\n const inspection = useInspection({\n cacheKey: \"es-query-builder\",\n id: connectionID ?? \"\",\n baseUrl,\n enabled: baseUrl !== \"\",\n database: \"\",\n target,\n });\n const roles = paramRoles(rootValue.params);\n const params = defaultParamValues(rootValue.params);\n const compilation = useCompiledSearch({\n baseUrl,\n index: target,\n search,\n params,\n roles,\n enabled: baseUrl !== \"\",\n });\n const values = makeFieldValueLookup({\n baseUrl,\n index: target,\n params,\n roles,\n });\n\n return (\n <EsQueryBuilder\n search={search}\n onChange={(next) => onChange(next)}\n fields={esQueryFields(inspection.completion)}\n vocabulary={esBuilderVocabulary({ properties: { search: schema } })}\n params={rootValue.params ?? []}\n onMappingChange={(edit) => {\n if (!onRootChange) {\n throw new Error(\n \"query parameter mappings require an atomic root form update\",\n );\n }\n onRootChange({\n ...rootValue,\n params: edit.params,\n provider: {\n ...rootValue.provider,\n options: {\n ...rootValue.provider?.options,\n search: edit.search,\n },\n },\n });\n }}\n {...(values ? { values } : {})}\n compilation={compilation}\n />\n );\n}\n\nfunction TimeFieldUnitReadout({ field }: { field: EsFieldMapping }) {\n const { state, text } = timeFieldUnitReadout(field);\n return (\n <span\n data-es-time-unit={state}\n className={\n state === \"conflicting\"\n ? \"text-xs text-destructive\"\n : \"text-xs text-foreground\"\n }\n >\n {text}\n </span>\n );\n}\n\nfunction timeFieldFormatLabel(format: EsTimeFieldFormat): string {\n switch (format) {\n case \"epoch_second\":\n return \"Seconds\";\n case \"epoch_millis\":\n return \"Milliseconds\";\n case \"epoch_micros\":\n return \"Microseconds\";\n case \"epoch_nanos\":\n return \"Nanoseconds\";\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuEA,SAAgB,eAAe,EAC7B,QACA,UACA,QACA,YACA,SAAS,CAAC,GACV,iBACA,QACA,aACA,aACsB;CACtB,MAAM,OAAO,OAAO,SAASA,4BAAAA,WAAW;CACxC,MAAM,0BAA0BC,2BAAAA,wBAC9B,QACA,OAAO,SACT;CACA,MAAM,YACJ,OAAO,aAAa,CAAC,0BACjB,OAAO,MAAM,UAAU,MAAM,SAAS,OAAO,SAAS,IACtD,KAAA;CACN,MAAM,wBAAwB,SAC5B,KAAK,OAAO,MAAM,OAAO,UAAU,MAAM,UAAU,OAAO,MAAM,EAAE,KAAK;CACzE,MAAM,qBAAqB,SAA2B;EACpD,IAAI,iBAAiB;GACnB,gBAAgB,IAAI;GACpB;EACF;EACA,IAAI,qBAAqB,IAAI,GAC3B,MAAM,IAAI,MACR,kEACF;EAEF,SAAS,KAAK,MAAM;CACtB;CACA,MAAM,oBAAoB,eAAyB;EACjD,MAAM,OAAOC,4BAAAA,6BAA6B;GACxC,gBAAgB;GAChB;GACA;EACF,CAAC;EACD,IAAI,qBAAqB,IAAI,GAAG;GAC9B,kBAAk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;KACR,GAAG,UAAU;KACb,SAAS;MACP,GAAG,UAAU,UAAU;MACvB,QAAQ,KAAK;KACf;IACF;GACF,CAAC;EACH;EACA,GAAK,SAAS,EAAE,OAAO,IAAI,CAAC;EACf;CACd,CAAA;AAEL;AAEA,SAAS,qBAAqB,EAAE,SAAoC;CAClE,MAAM,EAAE,OAAO,SAASC,2BAAAA,qBAAqB,KAAK;CAClD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EACE,qBAAmB;EACnB,WACE,UAAU,gBACN,6BACA;EAGL,UAAA;CACG,CAAA;AAEV;AAEA,SAAS,qBAAqB,QAAmC;CAC/D,QAAQ,QAAR;EACE,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,eACH,OAAO;CACX;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"esQueryBuilder.d.ts","sourceRoot":"","sources":["../../../src/profiles/elasticsearch/esQueryBuilder.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAMlF,OAAO,EAML,KAAK,QAAQ,EAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAS/B,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEzE,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,CAAC,MAAM,EA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AAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACtE,+BA0DA"}
@@ -9,7 +9,7 @@ import { EsQueryOutputEditor } from "./esQueryOutputEditor.js";
9
9
  import { EsQueryPreview } from "./esQueryPreview.js";
10
10
  import { EsQuerySortEditor } from "./esQuerySortEditor.js";
11
11
  import { bindParamOperand, reconcileSearchParamMappings, removeParamMapping } from "./esParamMappingModel.js";
12
- import { defaultParamValues, esQueryFields, paramRoles, selectTimeField, timeFieldFormatRequired, timeFieldMappings } from "./esQueryBuilderForm.js";
12
+ import { defaultParamValues, esQueryFields, paramRoles, selectTimeField, timeFieldFormatRequired, timeFieldMappings, timeFieldUnitReadout } from "./esQueryBuilderForm.js";
13
13
  import { useCompiledSearch } from "./esQueryCompile.js";
14
14
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
15
  // src/profiles/elasticsearch/esQueryBuilder.tsx
@@ -22,6 +22,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
22
22
  function EsQueryBuilder({ search, onChange, fields, vocabulary, params = [], onMappingChange, values, compilation, className }) {
23
23
  const root = search.query ?? emptyGroup();
24
24
  const requiresTimeFieldFormat = timeFieldFormatRequired(fields, search.timeField);
25
+ const dateField = search.timeField && !requiresTimeFieldFormat ? fields.find((field) => field.name === search.timeField) : void 0;
25
26
  const mappingFieldsChanged = (edit) => edit.params.some((param, index) => param.field !== params[index]?.field);
26
27
  const commitMappingEdit = (edit) => {
27
28
  if (onMappingChange) {
@@ -140,7 +141,7 @@ function EsQueryBuilder({ search, onChange, fields, vocabulary, params = [], onM
140
141
  })),
141
142
  placeholder: "Select epoch unit…",
142
143
  allowCustomValue: false
143
- })] }) : null,
144
+ })] }) : dateField ? /* @__PURE__ */ jsx(TimeFieldUnitReadout, { field: dateField }) : null,
144
145
  /* @__PURE__ */ jsx("span", {
145
146
  className: "text-xs text-muted-foreground",
146
147
  children: "Where time-from and time-to parameters apply"
@@ -224,6 +225,14 @@ function EsQueryBuilderField({ search, onChange, schema, rootValue, onRootChange
224
225
  compilation
225
226
  });
226
227
  }
228
+ function TimeFieldUnitReadout({ field }) {
229
+ const { state, text } = timeFieldUnitReadout(field);
230
+ return /* @__PURE__ */ jsx("span", {
231
+ "data-es-time-unit": state,
232
+ className: state === "conflicting" ? "text-xs text-destructive" : "text-xs text-foreground",
233
+ children: text
234
+ });
235
+ }
227
236
  function timeFieldFormatLabel(format) {
228
237
  switch (format) {
229
238
  case "epoch_second": return "Seconds";
@@ -1 +1 @@
1
- {"version":3,"file":"esQueryBuilder.js","names":["_Fragment"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilder.tsx"],"sourcesContent":["/**\n * The query builder panel and the form extension that mounts it. The panel is\n * pure: it takes a specification and the vocabulary the schema described, and\n * reports edits. Everything that needs a connection — field mappings and the\n * compiled preview — is wired by the host that has one.\n */\n\nimport { Combobox } from \"../../components/Combobox\";\nimport type { JsonSchemaProperty } from \"../../components/json-schema-form-types\";\nimport {\n browserBaseUrl,\n savedConnectionID,\n} from \"../connections/connectionBrowserModel\";\nimport { useInspection } from \"../connections/useInspection\";\nimport {\n conditionAt,\n emptyGroup,\n insertAt,\n removeAt,\n updateAt,\n type EsSearch,\n type EsTimeFieldFormat,\n} from \"./esQueryBuilderModel\";\nimport {\n makeFieldValueLookup,\n valueLookupField,\n type FieldValuesSource,\n} from \"./esFieldValues\";\nimport { EsQueryClauseGroup } from \"./esQueryClauseGroup\";\nimport type { EsQueryContext, EsQueryTreeActions } from \"./esQueryConditionRow\";\nimport {\n esBuilderVocabulary,\n type EsBuilderVocabulary,\n type EsFieldMapping,\n} from \"./esQueryOperators\";\nimport { EsQueryOutputEditor } from \"./esQueryOutputEditor\";\nimport { EsQueryPreview } from \"./esQueryPreview\";\nimport { EsQuerySortEditor } from \"./esQuerySortEditor\";\nimport type { ProfileDraft } from \"../editor/profileBuilderWorkspace\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\nimport {\n bindParamOperand,\n reconcileSearchParamMappings,\n removeParamMapping,\n type ParamMappingEdit,\n} from \"./esParamMappingModel\";\nimport {\n defaultParamValues,\n esQueryFields,\n paramRoles,\n selectTimeField,\n timeFieldFormatRequired,\n timeFieldMappings,\n} from \"./esQueryBuilderForm\";\nimport { useCompiledSearch, type EsCompilation } from \"./esQueryCompile\";\n\nexport type EsQueryBuilderProps = {\n search: EsSearch;\n onChange: (search: EsSearch) => void;\n fields: EsFieldMapping[];\n vocabulary: EsBuilderVocabulary;\n /** Declared profile parameters an operand can bind to. */\n params?: ParamDraft[];\n onMappingChange?: (edit: ParamMappingEdit) => void;\n /** Where a field's own values come from; absent without a connection. */\n values?: FieldValuesSource;\n compilation?: EsCompilation;\n className?: string;\n};\n\nexport function EsQueryBuilder({\n search,\n onChange,\n fields,\n vocabulary,\n params = [],\n onMappingChange,\n values,\n compilation,\n className,\n}: EsQueryBuilderProps) {\n const root = search.query ?? emptyGroup();\n const requiresTimeFieldFormat = timeFieldFormatRequired(\n fields,\n search.timeField,\n );\n const mappingFieldsChanged = (edit: ParamMappingEdit) =>\n edit.params.some((param, index) => param.field !== params[index]?.field);\n const commitMappingEdit = (edit: ParamMappingEdit) => {\n if (onMappingChange) {\n onMappingChange(edit);\n return;\n }\n if (mappingFieldsChanged(edit)) {\n throw new Error(\n \"list parameter mappings require an atomic mapping change handler\",\n );\n }\n onChange(edit.search);\n };\n const commitSearchEdit = (nextSearch: EsSearch) => {\n const edit = reconcileSearchParamMappings({\n previousSearch: search,\n nextSearch,\n params,\n });\n if (mappingFieldsChanged(edit)) {\n commitMappingEdit(edit);\n return;\n }\n onChange(nextSearch);\n };\n const context: EsQueryContext = {\n fields,\n vocabulary,\n params,\n // The builder owns the tree, so it — not the host — decides what a lookup is\n // scoped by: the query without the row being edited. Leaving that row in\n // would filter the suggestions by the half-typed value they are meant to\n // complete.\n ...(values\n ? {\n values: ({ path, field }) => {\n const target = valueLookupField(fields, field);\n if (!target) return undefined;\n return values({\n field: target,\n search: { ...search, query: removeAt(root, path) },\n });\n },\n }\n : {}),\n };\n const actions: EsQueryTreeActions = {\n update: (path, update) =>\n commitSearchEdit({ ...search, query: updateAt(root, path, update) }),\n insert: (groupPath, condition) =>\n commitSearchEdit({\n ...search,\n query: insertAt(\n root,\n groupPath,\n conditionAt(root, groupPath)?.conditions?.length ?? 0,\n condition,\n ),\n }),\n remove: (path) =>\n commitSearchEdit({ ...search, query: removeAt(root, path) }),\n mapParam: (path, operand, name) => {\n const edit = bindParamOperand({ search, params, path, operand, name });\n commitMappingEdit(edit);\n },\n unmapParam: (path, name) => {\n const edit = removeParamMapping({ search, params, name, path });\n commitMappingEdit(edit);\n },\n };\n\n return (\n <div className={className ?? \"flex min-w-0 flex-col gap-3\"}>\n <EsQueryClauseGroup\n condition={root}\n path={[]}\n context={context}\n actions={actions}\n root\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-xs text-muted-foreground\">Time field</span>\n <Combobox\n ariaLabel=\"Time field\"\n className=\"min-w-48\"\n value={search.timeField ?? \"\"}\n onChange={(next) => onChange(selectTimeField(search, fields, next))}\n options={timeFieldMappings(fields).map((field) => ({\n value: field.name,\n label: field.name,\n }))}\n placeholder=\"Timestamp field…\"\n allowCustomValue\n />\n {requiresTimeFieldFormat ? (\n <>\n <span className=\"text-xs text-muted-foreground\">Epoch unit</span>\n <Combobox\n ariaLabel=\"Time field format\"\n ariaRequired\n required\n invalid={!search.timeFieldFormat}\n className=\"min-w-40\"\n value={search.timeFieldFormat ?? \"\"}\n onChange={(next) =>\n onChange({\n ...search,\n timeFieldFormat: (next || undefined) as\n | EsTimeFieldFormat\n | undefined,\n })\n }\n options={(vocabulary.timeFieldFormats ?? []).map((format) => ({\n value: format,\n label: timeFieldFormatLabel(format),\n }))}\n placeholder=\"Select epoch unit…\"\n allowCustomValue={false}\n />\n </>\n ) : null}\n <span className=\"text-xs text-muted-foreground\">\n Where time-from and time-to parameters apply\n </span>\n </div>\n <EsQuerySortEditor\n sort={search.sort ?? []}\n fields={fields}\n orders={vocabulary.sortOrders}\n onChange={(sort) =>\n onChange({ ...search, sort: sort.length ? sort : undefined })\n }\n />\n <EsQueryOutputEditor\n search={search}\n onChange={(patch) => onChange({ ...search, ...patch })}\n />\n {compilation ? <EsQueryPreview compilation={compilation} /> : null}\n </div>\n );\n}\n\n/**\n * The builder as the profile form mounts it. The form knows the connection and\n * the index, so the field mappings and the compiled preview come from the same\n * browser endpoints the connection browser uses.\n */\nexport function EsQueryBuilderField({\n search,\n onChange,\n schema,\n rootValue,\n onRootChange,\n}: {\n search: EsSearch;\n onChange: (next: unknown) => void;\n schema: JsonSchemaProperty;\n rootValue: ProfileDraft;\n onRootChange?: ((next: Record<string, unknown>) => void) | undefined;\n}) {\n const connectionID = savedConnectionID(rootValue.provider?.connection);\n const baseUrl = connectionID ? browserBaseUrl(connectionID) : \"\";\n const target = String(rootValue.provider?.options?.index ?? \"\");\n const inspection = useInspection({\n cacheKey: \"es-query-builder\",\n id: connectionID ?? \"\",\n baseUrl,\n enabled: baseUrl !== \"\",\n database: \"\",\n target,\n });\n const roles = paramRoles(rootValue.params);\n const params = defaultParamValues(rootValue.params);\n const compilation = useCompiledSearch({\n baseUrl,\n index: target,\n search,\n params,\n roles,\n enabled: baseUrl !== \"\",\n });\n const values = makeFieldValueLookup({\n baseUrl,\n index: target,\n params,\n roles,\n });\n\n return (\n <EsQueryBuilder\n search={search}\n onChange={(next) => onChange(next)}\n fields={esQueryFields(inspection.completion)}\n vocabulary={esBuilderVocabulary({ properties: { search: schema } })}\n params={rootValue.params ?? []}\n onMappingChange={(edit) => {\n if (!onRootChange) {\n throw new Error(\n \"query parameter mappings require an atomic root form update\",\n );\n }\n onRootChange({\n ...rootValue,\n params: edit.params,\n provider: {\n ...rootValue.provider,\n options: {\n ...rootValue.provider?.options,\n search: edit.search,\n },\n },\n });\n }}\n {...(values ? { values } : {})}\n compilation={compilation}\n />\n );\n}\n\nfunction timeFieldFormatLabel(format: EsTimeFieldFormat): string {\n switch (format) {\n case \"epoch_second\":\n return \"Seconds\";\n case \"epoch_millis\":\n return \"Milliseconds\";\n case \"epoch_micros\":\n return \"Microseconds\";\n case \"epoch_nanos\":\n return \"Nanoseconds\";\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,eAAe,EAC7B,QACA,UACA,QACA,YACA,SAAS,CAAC,GACV,iBACA,QACA,aACA,aACsB;CACtB,MAAM,OAAO,OAAO,SAAS,WAAW;CACxC,MAAM,0BAA0B,wBAC9B,QACA,OAAO,SACT;CACA,MAAM,wBAAwB,SAC5B,KAAK,OAAO,MAAM,OAAO,UAAU,MAAM,UAAU,OAAO,MAAM,EAAE,KAAK;CACzE,MAAM,qBAAqB,SAA2B;EACpD,IAAI,iBAAiB;GACnB,gBAAgB,IAAI;GACpB;EACF;EACA,IAAI,qBAAqB,IAAI,GAC3B,MAAM,IAAI,MACR,kEACF;EAEF,SAAS,KAAK,MAAM;CACtB;CACA,MAAM,oBAAoB,eAAyB;EACjD,MAAM,OAAO,6BAA6B;GACxC,gBAAgB;GAChB;GACA;EACF,CAAC;EACD,IAAI,qBAAqB,IAAI,GAAG;GAC9B,kBAAkB,IAAI;GACtB;EACF;EACA,SAAS,UAAU;CACrB;CACA,MAAM,UAA0B;EAC9B;EACA;EACA;EAKA,GAAI,SACA,EACE,SAAS,EAAE,MAAM,YAAY;GAC3B,MAAM,SAAS,iBAAiB,QAAQ,KAAK;GAC7C,IAAI,CAAC,QAAQ,OAAO,KAAA;GACpB,OAAO,OAAO;IACZ,OAAO;IACP,QAAQ;KAAE,GAAG;KAAQ,OAAO,SAAS,MAAM,IAAI;IAAE;GACnD,CAAC;EACH,EACF,IACA,CAAC;CACP;CA0BA,OACE,qBAAC,OAAD;EAAK,WAAW,aAAa;EAA7B,UAAA;GACE,oBAAC,oBAAD;IACE,WAAW;IACX,MAAM,CAAC;IACE;IACA,SAAA;KA9Bb,SAAS,MAAM,WACb,iBAAiB;MAAE,GAAG;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;GACzB,IAAI,CAAC,cACH,MAAM,IAAI,MACR,6DACF;GAEF,aAAa;IACX,GAAG;IACH,QAAQ,KAAK;IACb,UAAU;KACR,GAAG,UAAU;KACb,SAAS;MACP,GAAG,UAAU,UAAU;MACvB,QAAQ,KAAK;KACf;IACF;GACF,CAAC;EACH;EACA,GAAK,SAAS,EAAE,OAAO,IAAI,CAAC;EACf;CACd,CAAA;AAEL;AAEA,SAAS,qBAAqB,QAAmC;CAC/D,QAAQ,QAAR;EACE,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,eACH,OAAO;CACX;AACF"}
1
+ {"version":3,"file":"esQueryBuilder.js","names":["_Fragment"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilder.tsx"],"sourcesContent":["/**\n * The query builder panel and the form extension that mounts it. The panel is\n * pure: it takes a specification and the vocabulary the schema described, and\n * reports edits. Everything that needs a connection — field mappings and the\n * compiled preview — is wired by the host that has one.\n */\n\nimport { Combobox } from \"../../components/Combobox\";\nimport type { JsonSchemaProperty } from \"../../components/json-schema-form-types\";\nimport {\n browserBaseUrl,\n savedConnectionID,\n} from \"../connections/connectionBrowserModel\";\nimport { useInspection } from \"../connections/useInspection\";\nimport {\n conditionAt,\n emptyGroup,\n insertAt,\n removeAt,\n updateAt,\n type EsSearch,\n type EsTimeFieldFormat,\n} from \"./esQueryBuilderModel\";\nimport {\n makeFieldValueLookup,\n valueLookupField,\n type FieldValuesSource,\n} from \"./esFieldValues\";\nimport { EsQueryClauseGroup } from \"./esQueryClauseGroup\";\nimport type { EsQueryContext, EsQueryTreeActions } from \"./esQueryConditionRow\";\nimport {\n esBuilderVocabulary,\n type EsBuilderVocabulary,\n type EsFieldMapping,\n} from \"./esQueryOperators\";\nimport { EsQueryOutputEditor } from \"./esQueryOutputEditor\";\nimport { EsQueryPreview } from \"./esQueryPreview\";\nimport { EsQuerySortEditor } from \"./esQuerySortEditor\";\nimport type { ProfileDraft } from \"../editor/profileBuilderWorkspace\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\nimport {\n bindParamOperand,\n reconcileSearchParamMappings,\n removeParamMapping,\n type ParamMappingEdit,\n} from \"./esParamMappingModel\";\nimport {\n defaultParamValues,\n esQueryFields,\n paramRoles,\n selectTimeField,\n timeFieldFormatRequired,\n timeFieldMappings,\n timeFieldUnitReadout,\n} from \"./esQueryBuilderForm\";\nimport { useCompiledSearch, type EsCompilation } from \"./esQueryCompile\";\n\nexport type EsQueryBuilderProps = {\n search: EsSearch;\n onChange: (search: EsSearch) => void;\n fields: EsFieldMapping[];\n vocabulary: EsBuilderVocabulary;\n /** Declared profile parameters an operand can bind to. */\n params?: ParamDraft[];\n onMappingChange?: (edit: ParamMappingEdit) => void;\n /** Where a field's own values come from; absent without a connection. */\n values?: FieldValuesSource;\n compilation?: EsCompilation;\n className?: string;\n};\n\nexport function EsQueryBuilder({\n search,\n onChange,\n fields,\n vocabulary,\n params = [],\n onMappingChange,\n values,\n compilation,\n className,\n}: EsQueryBuilderProps) {\n const root = search.query ?? emptyGroup();\n const requiresTimeFieldFormat = timeFieldFormatRequired(\n fields,\n search.timeField,\n );\n const dateField =\n search.timeField && !requiresTimeFieldFormat\n ? fields.find((field) => field.name === search.timeField)\n : undefined;\n const mappingFieldsChanged = (edit: ParamMappingEdit) =>\n edit.params.some((param, index) => param.field !== params[index]?.field);\n const commitMappingEdit = (edit: ParamMappingEdit) => {\n if (onMappingChange) {\n onMappingChange(edit);\n return;\n }\n if (mappingFieldsChanged(edit)) {\n throw new Error(\n \"list parameter mappings require an atomic mapping change handler\",\n );\n }\n onChange(edit.search);\n };\n const commitSearchEdit = (nextSearch: EsSearch) => {\n const edit = reconcileSearchParamMappings({\n previousSearch: search,\n nextSearch,\n params,\n });\n if (mappingFieldsChanged(edit)) {\n commitMappingEdit(edit);\n return;\n }\n onChange(nextSearch);\n };\n const context: EsQueryContext = {\n fields,\n vocabulary,\n params,\n // The builder owns the tree, so it — not the host — decides what a lookup is\n // scoped by: the query without the row being edited. Leaving that row in\n // would filter the suggestions by the half-typed value they are meant to\n // complete.\n ...(values\n ? {\n values: ({ path, field }) => {\n const target = valueLookupField(fields, field);\n if (!target) return undefined;\n return values({\n field: target,\n search: { ...search, query: removeAt(root, path) },\n });\n },\n }\n : {}),\n };\n const actions: EsQueryTreeActions = {\n update: (path, update) =>\n commitSearchEdit({ ...search, query: updateAt(root, path, update) }),\n insert: (groupPath, condition) =>\n commitSearchEdit({\n ...search,\n query: insertAt(\n root,\n groupPath,\n conditionAt(root, groupPath)?.conditions?.length ?? 0,\n condition,\n ),\n }),\n remove: (path) =>\n commitSearchEdit({ ...search, query: removeAt(root, path) }),\n mapParam: (path, operand, name) => {\n const edit = bindParamOperand({ search, params, path, operand, name });\n commitMappingEdit(edit);\n },\n unmapParam: (path, name) => {\n const edit = removeParamMapping({ search, params, name, path });\n commitMappingEdit(edit);\n },\n };\n\n return (\n <div className={className ?? \"flex min-w-0 flex-col gap-3\"}>\n <EsQueryClauseGroup\n condition={root}\n path={[]}\n context={context}\n actions={actions}\n root\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-xs text-muted-foreground\">Time field</span>\n <Combobox\n ariaLabel=\"Time field\"\n className=\"min-w-48\"\n value={search.timeField ?? \"\"}\n onChange={(next) => onChange(selectTimeField(search, fields, next))}\n options={timeFieldMappings(fields).map((field) => ({\n value: field.name,\n label: field.name,\n }))}\n placeholder=\"Timestamp field…\"\n allowCustomValue\n />\n {requiresTimeFieldFormat ? (\n <>\n <span className=\"text-xs text-muted-foreground\">Epoch unit</span>\n <Combobox\n ariaLabel=\"Time field format\"\n ariaRequired\n required\n invalid={!search.timeFieldFormat}\n className=\"min-w-40\"\n value={search.timeFieldFormat ?? \"\"}\n onChange={(next) =>\n onChange({\n ...search,\n timeFieldFormat: (next || undefined) as\n | EsTimeFieldFormat\n | undefined,\n })\n }\n options={(vocabulary.timeFieldFormats ?? []).map((format) => ({\n value: format,\n label: timeFieldFormatLabel(format),\n }))}\n placeholder=\"Select epoch unit…\"\n allowCustomValue={false}\n />\n </>\n ) : dateField ? (\n <TimeFieldUnitReadout field={dateField} />\n ) : null}\n <span className=\"text-xs text-muted-foreground\">\n Where time-from and time-to parameters apply\n </span>\n </div>\n <EsQuerySortEditor\n sort={search.sort ?? []}\n fields={fields}\n orders={vocabulary.sortOrders}\n onChange={(sort) =>\n onChange({ ...search, sort: sort.length ? sort : undefined })\n }\n />\n <EsQueryOutputEditor\n search={search}\n onChange={(patch) => onChange({ ...search, ...patch })}\n />\n {compilation ? <EsQueryPreview compilation={compilation} /> : null}\n </div>\n );\n}\n\n/**\n * The builder as the profile form mounts it. The form knows the connection and\n * the index, so the field mappings and the compiled preview come from the same\n * browser endpoints the connection browser uses.\n */\nexport function EsQueryBuilderField({\n search,\n onChange,\n schema,\n rootValue,\n onRootChange,\n}: {\n search: EsSearch;\n onChange: (next: unknown) => void;\n schema: JsonSchemaProperty;\n rootValue: ProfileDraft;\n onRootChange?: ((next: Record<string, unknown>) => void) | undefined;\n}) {\n const connectionID = savedConnectionID(rootValue.provider?.connection);\n const baseUrl = connectionID ? browserBaseUrl(connectionID) : \"\";\n const target = String(rootValue.provider?.options?.index ?? \"\");\n const inspection = useInspection({\n cacheKey: \"es-query-builder\",\n id: connectionID ?? \"\",\n baseUrl,\n enabled: baseUrl !== \"\",\n database: \"\",\n target,\n });\n const roles = paramRoles(rootValue.params);\n const params = defaultParamValues(rootValue.params);\n const compilation = useCompiledSearch({\n baseUrl,\n index: target,\n search,\n params,\n roles,\n enabled: baseUrl !== \"\",\n });\n const values = makeFieldValueLookup({\n baseUrl,\n index: target,\n params,\n roles,\n });\n\n return (\n <EsQueryBuilder\n search={search}\n onChange={(next) => onChange(next)}\n fields={esQueryFields(inspection.completion)}\n vocabulary={esBuilderVocabulary({ properties: { search: schema } })}\n params={rootValue.params ?? []}\n onMappingChange={(edit) => {\n if (!onRootChange) {\n throw new Error(\n \"query parameter mappings require an atomic root form update\",\n );\n }\n onRootChange({\n ...rootValue,\n params: edit.params,\n provider: {\n ...rootValue.provider,\n options: {\n ...rootValue.provider?.options,\n search: edit.search,\n },\n },\n });\n }}\n {...(values ? { values } : {})}\n compilation={compilation}\n />\n );\n}\n\nfunction TimeFieldUnitReadout({ field }: { field: EsFieldMapping }) {\n const { state, text } = timeFieldUnitReadout(field);\n return (\n <span\n data-es-time-unit={state}\n className={\n state === \"conflicting\"\n ? \"text-xs text-destructive\"\n : \"text-xs text-foreground\"\n }\n >\n {text}\n </span>\n );\n}\n\nfunction timeFieldFormatLabel(format: EsTimeFieldFormat): string {\n switch (format) {\n case \"epoch_second\":\n return \"Seconds\";\n case \"epoch_millis\":\n return \"Milliseconds\";\n case \"epoch_micros\":\n return \"Microseconds\";\n case \"epoch_nanos\":\n return \"Nanoseconds\";\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuEA,SAAgB,eAAe,EAC7B,QACA,UACA,QACA,YACA,SAAS,CAAC,GACV,iBACA,QACA,aACA,aACsB;CACtB,MAAM,OAAO,OAAO,SAAS,WAAW;CACxC,MAAM,0BAA0B,wBAC9B,QACA,OAAO,SACT;CACA,MAAM,YACJ,OAAO,aAAa,CAAC,0BACjB,OAAO,MAAM,UAAU,MAAM,SAAS,OAAO,SAAS,IACtD,KAAA;CACN,MAAM,wBAAwB,SAC5B,KAAK,OAAO,MAAM,OAAO,UAAU,MAAM,UAAU,OAAO,MAAM,EAAE,KAAK;CACzE,MAAM,qBAAqB,SAA2B;EACpD,IAAI,iBAAiB;GACnB,gBAAgB,IAAI;GACpB;EACF;EACA,IAAI,qBAAqB,IAAI,GAC3B,MAAM,IAAI,MACR,kEACF;EAEF,SAAS,KAAK,MAAM;CACtB;CACA,MAAM,oBAAoB,eAAyB;EACjD,MAAM,OAAO,6BAA6B;GACxC,gBAAgB;GAChB;GACA;EACF,CAAC;EACD,IAAI,qBAAqB,IAAI,GAAG;GAC9B,kBAAkB,IAAI;GACtB;EAC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AAM,aAAa,cAAc;EAC/B,UAAU;EACV,IAAI,gBAAgB;EACpB;EACA,SAAS,YAAY;EACrB,UAAU;EACV;CACF,CAAC;CACD,MAAM,QAAQ,WAAW,UAAU,MAAM;CACzC,MAAM,SAAS,mBAAmB,UAAU,MAAM;CAClD,MAAM,cAAc,kBAAkB;EACpC;EACA,OAAO;EACP;EACA;EACA;EACA,SAAS,YAAY;CACvB,CAAC;CACD,MAAM,SAAS,qBAAqB;EAClC;EACA,OAAO;EACP;EACA;CACF,CAAC;CAED,OACE,oBAAC,gBAAD;EACU;EACR,WAAW,SAAS,SAAS,IAAI;EACjC,QAAQ,cAAc,WAAW,UAAU;EAC3C,YAAY,oBAAoB,EAAE,YAAY,EAAE,QAAQ,OAAO,EAAE,CAAC;EAClE,QAAQ,UAAU,UAAU,CAAC;EAC7B,kBAAkB,SAAS;GACzB,IAAI,CAAC,cACH,MAAM,IAAI,MACR,6DACF;GAEF,aAAa;IACX,GAAG;IACH,QAAQ,KAAK;IACb,UAAU;KACR,GAAG,UAAU;KACb,SAAS;MACP,GAAG,UAAU,UAAU;MACvB,QAAQ,KAAK;KACf;IACF;GACF,CAAC;EACH;EACA,GAAK,SAAS,EAAE,OAAO,IAAI,CAAC;EACf;CACd,CAAA;AAEL;AAEA,SAAS,qBAAqB,EAAE,SAAoC;CAClE,MAAM,EAAE,OAAO,SAAS,qBAAqB,KAAK;CAClD,OACE,oBAAC,QAAD;EACE,qBAAmB;EACnB,WACE,UAAU,gBACN,6BACA;EAGL,UAAA;CACG,CAAA;AAEV;AAEA,SAAS,qBAAqB,QAAmC;CAC/D,QAAQ,QAAR;EACE,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,gBACH,OAAO;EACT,KAAK,eACH,OAAO;CACX;AACF"}
@@ -47,6 +47,42 @@ function timeFieldFormatRequired(fields, name) {
47
47
  const field = fields.find((entry) => entry.name === name);
48
48
  return !field || field.conflicting === true || require_esQueryOperators.fieldFamily(field) !== "date";
49
49
  }
50
+ var dateFormatLabels = {
51
+ strict_date_optional_time: "ISO 8601",
52
+ date_optional_time: "ISO 8601",
53
+ strict_date_optional_time_nanos: "ISO 8601",
54
+ date_optional_time_nanos: "ISO 8601",
55
+ epoch_second: "epoch seconds",
56
+ epoch_millis: "epoch milliseconds"
57
+ };
58
+ /**
59
+ * dateMappingFormatLabel reads an OpenSearch date format, which may chain
60
+ * several with "||", as a phrase. A format with no friendlier name is shown as
61
+ * written rather than guessed at.
62
+ */
63
+ function dateMappingFormatLabel(format) {
64
+ return format.split("||").map((part) => dateFormatLabels[part.trim()] ?? part.trim()).join(" or ");
65
+ }
66
+ /**
67
+ * timeFieldUnitReadout is what the time-field row says about a native date
68
+ * mapping's unit. A date field takes no epoch unit of its own (the backend
69
+ * rejects one), so the row reports what the mapping stores rather than asking.
70
+ * Callers pass a field that does not need an explicit unit.
71
+ */
72
+ function timeFieldUnitReadout(field) {
73
+ if (field.formatConflicting) return {
74
+ state: "conflicting",
75
+ text: "Date formats differ between indices"
76
+ };
77
+ if (!field.format) return {
78
+ state: "unreported",
79
+ text: "Date mapping, format not reported"
80
+ };
81
+ return {
82
+ state: "mapped",
83
+ text: `Stored as ${dateMappingFormatLabel(field.format)}`
84
+ };
85
+ }
50
86
  /** selectTimeField removes a numeric format when the next mapping is native. */
51
87
  function selectTimeField(search, fields, name) {
52
88
  const { timeField: _timeField, timeFieldFormat: _timeFieldFormat, ...rest } = search;
@@ -59,6 +95,7 @@ function selectTimeField(search, fields, name) {
59
95
  timeField: name
60
96
  };
61
97
  }
98
+ exports.dateMappingFormatLabel = dateMappingFormatLabel;
62
99
  exports.defaultParamValues = defaultParamValues;
63
100
  exports.esQueryFields = esQueryFields;
64
101
  exports.paramNames = paramNames;
@@ -66,5 +103,6 @@ exports.paramRoles = paramRoles;
66
103
  exports.selectTimeField = selectTimeField;
67
104
  exports.timeFieldFormatRequired = timeFieldFormatRequired;
68
105
  exports.timeFieldMappings = timeFieldMappings;
106
+ exports.timeFieldUnitReadout = timeFieldUnitReadout;
69
107
 
70
108
  //# sourceMappingURL=esQueryBuilderForm.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"esQueryBuilderForm.cjs","names":["fieldFamily"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilderForm.ts"],"sourcesContent":["/**\n * The pure helpers behind the query builder: which parameters exist, what they\n * default to, and the field mappings a schema describes.\n *\n * Kept apart from esQueryBuilder.tsx so that module exports only components\n * (react/only-export-components).\n */\n\nimport type { EsFieldMapping } from \"./esQueryOperators\";\nimport { fieldFamily } from \"./esQueryOperators\";\nimport type { EsSearch } from \"./esQueryBuilderModel\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\n\nconst integralTimeFieldTypes = new Set([\n \"byte\",\n \"short\",\n \"integer\",\n \"long\",\n \"unsigned_long\",\n]);\n\n/** paramNames lists the parameters an operand may bind, in declared order. */\nexport function paramNames(params: ParamDraft[] | undefined): string[] {\n return (params ?? [])\n .map((param) => param.name ?? \"\")\n .filter((name) => name !== \"\");\n}\n\n/** paramRoles is the name-to-role table the compiler folds roles from. */\nexport function paramRoles(\n params: ParamDraft[] | undefined,\n): Record<string, string> {\n const roles: Record<string, string> = {};\n for (const param of params ?? []) {\n if (param.name && param.role) roles[param.name] = param.role;\n }\n return roles;\n}\n\n/**\n * defaultParamValues is what the declared parameters resolve to before anyone\n * filters. The compiler needs them to bind a {param:…} operand and to\n * interpolate a {{.params.…}} one, so the preview shows the DSL a run produces.\n */\nexport function defaultParamValues(\n params: ParamDraft[] | undefined,\n): Record<string, unknown> {\n return Object.fromEntries(\n (params ?? [])\n .filter((param) => param.name && param.default !== undefined)\n .map((param) => [param.name as string, param.default]),\n );\n}\n\n/**\n * esQueryFields reads the field mappings off a browser inspection. Only an\n * OpenSearch target carries them, so anything else builds against free text.\n */\nexport function esQueryFields(completion: unknown): EsFieldMapping[] {\n const typed = completion as { kind?: string; fields?: EsFieldMapping[] };\n return typed?.kind === \"json-fields\" ? (typed.fields ?? []) : [];\n}\n\n/** timeFieldMappings lists mappings that can store an instant unambiguously. */\nexport function timeFieldMappings(fields: EsFieldMapping[]): EsFieldMapping[] {\n return fields.filter((field) => {\n if (field.conflicting) return false;\n const mapped = field.dataType ?? field.types?.[0] ?? \"\";\n return fieldFamily(field) === \"date\" || integralTimeFieldTypes.has(mapped);\n });\n}\n\n/** Numeric and custom time fields need an explicit epoch unit. */\nexport function timeFieldFormatRequired(\n fields: EsFieldMapping[],\n name: string | undefined,\n): boolean {\n if (!name) return false;\n const field = fields.find((entry) => entry.name === name);\n return !field || field.conflicting === true || fieldFamily(field) !== \"date\";\n}\n\n/** selectTimeField removes a numeric format when the next mapping is native. */\nexport function selectTimeField(\n search: EsSearch,\n fields: EsFieldMapping[],\n name: string,\n): EsSearch {\n const {\n timeField: _timeField,\n timeFieldFormat: _timeFieldFormat,\n ...rest\n } = search;\n if (!name) return rest;\n return timeFieldFormatRequired(fields, name)\n ? { ...search, timeField: name }\n : { ...rest, timeField: name };\n}\n"],"mappings":";;AAaA,IAAM,yCAAyB,IAAI,IAAI;CACrC;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,SAAgB,WAAW,QAA4C;CACrE,QAAQ,UAAU,CAAC,EAAA,CAChB,KAAK,UAAU,MAAM,QAAQ,EAAE,CAAC,CAChC,QAAQ,SAAS,SAAS,EAAE;AACjC;;AAGA,SAAgB,WACd,QACwB;CACxB,MAAM,QAAgC,CAAC;CACvC,KAAK,MAAM,SAAS,UAAU,CAAC,GAC7B,IAAI,MAAM,QAAQ,MAAM,MAAM,MAAM,MAAM,QAAQ,MAAM;CAE1D,OAAO;AACT;;;;;;AAOA,SAAgB,mBACd,QACyB;CACzB,OAAO,OAAO,aACX,UAAU,CAAC,EAAA,CACT,QAAQ,UAAU,MAAM,QAAQ,MAAM,YAAY,KAAA,CAAS,CAAC,CAC5D,KAAK,UAAU,CAAC,MAAM,MAAgB,MAAM,OAAO,CAAC,CACzD;AACF;;;;;AAMA,SAAgB,cAAc,YAAuC;CACnE,MAAM,QAAQ;CACd,OAAO,OAAO,SAAS,gBAAiB,MAAM,UAAU,CAAC,IAAK,CAAC;AACjE;;AAGA,SAAgB,kBAAkB,QAA4C;CAC5E,OAAO,OAAO,QAAQ,UAAU;EAC9B,IAAI,MAAM,aAAa,OAAO;EAC9B,MAAM,SAAS,MAAM,YAAY,MAAM,QAAQ,MAAM;EACrD,OAAOA,yBAAAA,YAAY,KAAK,MAAM,UAAU,uBAAuB,IAAI,MAAM;CAC3E,CAAC;AACH;;AAGA,SAAgB,wBACd,QACA,MACS;CACT,IAAI,CAAC,MAAM,OAAO;CAClB,MAAM,QAAQ,OAAO,MAAM,UAAU,MAAM,SAAS,IAAI;CACxD,OAAO,CAAC,SAAS,MAAM,gBAAgB,QAAQA,yBAAAA,YAAY,KAAK,MAAM;AACxE;;AAGA,SAAgB,gBACd,QACA,QACA,MACU;CACV,MAAM,EACJ,WAAW,YACX,iBAAiB,kBACjB,GAAG,SACD;CACJ,IAAI,CAAC,MAAM,OAAO;CAClB,OAAO,wBAAwB,QAAQ,IAAI,IACvC;EAAE,GAAG;EAAQ,WAAW;CAAK,IAC7B;EAAE,GAAG;EAAM,WAAW;CAAK;AACjC"}
1
+ {"version":3,"file":"esQueryBuilderForm.cjs","names":["fieldFamily"],"sources":["../../../src/profiles/elasticsearch/esQueryBuilderForm.ts"],"sourcesContent":["/**\n * The pure helpers behind the query builder: which parameters exist, what they\n * default to, and the field mappings a schema describes.\n *\n * Kept apart from esQueryBuilder.tsx so that module exports only components\n * (react/only-export-components).\n */\n\nimport type { EsFieldMapping } from \"./esQueryOperators\";\nimport { fieldFamily } from \"./esQueryOperators\";\nimport type { EsSearch } from \"./esQueryBuilderModel\";\nimport type { ParamDraft } from \"../wizard/profileWizardModel\";\n\nconst integralTimeFieldTypes = new Set([\n \"byte\",\n \"short\",\n \"integer\",\n \"long\",\n \"unsigned_long\",\n]);\n\n/** paramNames lists the parameters an operand may bind, in declared order. */\nexport function paramNames(params: ParamDraft[] | undefined): string[] {\n return (params ?? [])\n .map((param) => param.name ?? \"\")\n .filter((name) => name !== \"\");\n}\n\n/** paramRoles is the name-to-role table the compiler folds roles from. */\nexport function paramRoles(\n params: ParamDraft[] | undefined,\n): Record<string, string> {\n const roles: Record<string, string> = {};\n for (const param of params ?? []) {\n if (param.name && param.role) roles[param.name] = param.role;\n }\n return roles;\n}\n\n/**\n * defaultParamValues is what the declared parameters resolve to before anyone\n * filters. The compiler needs them to bind a {param:…} operand and to\n * interpolate a {{.params.…}} one, so the preview shows the DSL a run produces.\n */\nexport function defaultParamValues(\n params: ParamDraft[] | undefined,\n): Record<string, unknown> {\n return Object.fromEntries(\n (params ?? [])\n .filter((param) => param.name && param.default !== undefined)\n .map((param) => [param.name as string, param.default]),\n );\n}\n\n/**\n * esQueryFields reads the field mappings off a browser inspection. Only an\n * OpenSearch target carries them, so anything else builds against free text.\n */\nexport function esQueryFields(completion: unknown): EsFieldMapping[] {\n const typed = completion as { kind?: string; fields?: EsFieldMapping[] };\n return typed?.kind === \"json-fields\" ? (typed.fields ?? []) : [];\n}\n\n/** timeFieldMappings lists mappings that can store an instant unambiguously. */\nexport function timeFieldMappings(fields: EsFieldMapping[]): EsFieldMapping[] {\n return fields.filter((field) => {\n if (field.conflicting) return false;\n const mapped = field.dataType ?? field.types?.[0] ?? \"\";\n return fieldFamily(field) === \"date\" || integralTimeFieldTypes.has(mapped);\n });\n}\n\n/** Numeric and custom time fields need an explicit epoch unit. */\nexport function timeFieldFormatRequired(\n fields: EsFieldMapping[],\n name: string | undefined,\n): boolean {\n if (!name) return false;\n const field = fields.find((entry) => entry.name === name);\n return !field || field.conflicting === true || fieldFamily(field) !== \"date\";\n}\n\nconst dateFormatLabels: Record<string, string> = {\n strict_date_optional_time: \"ISO 8601\",\n date_optional_time: \"ISO 8601\",\n strict_date_optional_time_nanos: \"ISO 8601\",\n date_optional_time_nanos: \"ISO 8601\",\n epoch_second: \"epoch seconds\",\n epoch_millis: \"epoch milliseconds\",\n};\n\n/**\n * dateMappingFormatLabel reads an OpenSearch date format, which may chain\n * several with \"||\", as a phrase. A format with no friendlier name is shown as\n * written rather than guessed at.\n */\nexport function dateMappingFormatLabel(format: string): string {\n return format\n .split(\"||\")\n .map((part) => dateFormatLabels[part.trim()] ?? part.trim())\n .join(\" or \");\n}\n\nexport type TimeFieldUnitReadout = {\n state: \"mapped\" | \"unreported\" | \"conflicting\";\n text: string;\n};\n\n/**\n * timeFieldUnitReadout is what the time-field row says about a native date\n * mapping's unit. A date field takes no epoch unit of its own (the backend\n * rejects one), so the row reports what the mapping stores rather than asking.\n * Callers pass a field that does not need an explicit unit.\n */\nexport function timeFieldUnitReadout(\n field: EsFieldMapping,\n): TimeFieldUnitReadout {\n if (field.formatConflicting) {\n return { state: \"conflicting\", text: \"Date formats differ between indices\" };\n }\n if (!field.format) {\n return { state: \"unreported\", text: \"Date mapping, format not reported\" };\n }\n return {\n state: \"mapped\",\n text: `Stored as ${dateMappingFormatLabel(field.format)}`,\n };\n}\n\n/** selectTimeField removes a numeric format when the next mapping is native. */\nexport function selectTimeField(\n search: EsSearch,\n fields: EsFieldMapping[],\n name: string,\n): EsSearch {\n const {\n timeField: _timeField,\n timeFieldFormat: _timeFieldFormat,\n ...rest\n } = search;\n if (!name) return rest;\n return timeFieldFormatRequired(fields, name)\n ? { ...search, timeField: name }\n : { ...rest, timeField: name };\n}\n"],"mappings":";;AAaA,IAAM,yCAAyB,IAAI,IAAI;CACrC;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,SAAgB,WAAW,QAA4C;CACrE,QAAQ,UAAU,CAAC,EAAA,CAChB,KAAK,UAAU,MAAM,QAAQ,EAAE,CAAC,CAChC,QAAQ,SAAS,SAAS,EAAE;AACjC;;AAGA,SAAgB,WACd,QACwB;CACxB,MAAM,QAAgC,CAAC;CACvC,KAAK,MAAM,SAAS,UAAU,CAAC,GAC7B,IAAI,MAAM,QAAQ,MAAM,MAAM,MAAM,MAAM,QAAQ,M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M,aAAa,uBAAuB,MAAM,MAAM;CACxD;AACF;;AAGA,SAAgB,gBACd,QACA,QACA,MACU;CACV,MAAM,EACJ,WAAW,YACX,iBAAiB,kBACjB,GAAG,SACD;CACJ,IAAI,CAAC,MAAM,OAAO;CAClB,OAAO,wBAAwB,QAAQ,IAAI,IACvC;EAAE,GAAG;EAAQ,WAAW;CAAK,IAC7B;EAAE,GAAG;EAAM,WAAW;CAAK;AACjC"}
@@ -20,6 +20,23 @@ export declare function esQueryFields(completion: unknown): EsFieldMapping[];
20
20
  export declare function timeFieldMappings(fields: EsFieldMapping[]): EsFieldMapping[];
21
21
  /** Numeric and custom time fields need an explicit epoch unit. */
22
22
  export declare function timeFieldFormatRequired(fields: EsFieldMapping[], name: string | undefined): boolean;
23
+ /**
24
+ * dateMappingFormatLabel reads an OpenSearch date format, which may chain
25
+ * several with "||", as a phrase. A format with no friendlier name is shown as
26
+ * written rather than guessed at.
27
+ */
28
+ export declare function dateMappingFormatLabel(format: string): string;
29
+ export type TimeFieldUnitReadout = {
30
+ state: "mapped" | "unreported" | "conflicting";
31
+ text: string;
32
+ };
33
+ /**
34
+ * timeFieldUnitReadout is what the time-field row says about a native date
35
+ * mapping's unit. A date field takes no epoch unit of its own (the backend
36
+ * rejects one), so the row reports what the mapping stores rather than asking.
37
+ * Callers pass a field that does not need an explicit unit.
38
+ */
39
+ export declare function timeFieldUnitReadout(field: EsFieldMapping): TimeFieldUnitReadout;
23
40
  /** selectTimeField removes a numeric format when the next mapping is native. */
24
41
  export declare function selectTimeField(search: EsSearch, fields: EsFieldMapping[], name: string): EsSearch;
25
42
  //# sourceMappingURL=esQueryBuilderForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"esQueryBuilderForm.d.ts","sourceRoot":"","sources":["../../../src/profiles/elasticsearch/esQueryBuilderForm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAA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