@oneuptime/common 12.0.9 → 12.0.11

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 (262) hide show
  1. package/Models/DatabaseModels/NetworkDevice.ts +44 -0
  2. package/Models/DatabaseModels/NetworkDeviceLink.ts +116 -0
  3. package/Models/DatabaseModels/RunnerJob.ts +17 -2
  4. package/Server/API/LlmProviderAPI.ts +8 -0
  5. package/Server/Infrastructure/Postgres/SchemaMigrations/1787400000000-AddDeviceRoleAndDeclaredLinkParent.ts +52 -0
  6. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
  7. package/Server/Services/NetworkDeviceLabelRuleEngineService.ts +240 -0
  8. package/Server/Services/NetworkDeviceLinkService.ts +338 -2
  9. package/Server/Services/NetworkDeviceService.ts +265 -12
  10. package/Server/Services/RunnerJobService.ts +24 -1
  11. package/Server/Types/Billing/MeteredPlan/AllMeteredPlans.ts +19 -5
  12. package/Server/Types/Database/JSONColumnQuery.ts +42 -4
  13. package/Server/Utils/LLM/LLMService.ts +108 -19
  14. package/Server/Utils/Monitor/MonitorAlert.ts +22 -115
  15. package/Server/Utils/Monitor/MonitorIncident.ts +7 -337
  16. package/Server/Utils/Monitor/MonitorMaintenanceSuppression.ts +27 -2
  17. package/Server/Utils/Monitor/SeriesResourceLabels.ts +32 -0
  18. package/Server/Utils/Monitor/SeriesResourceLinker.ts +469 -0
  19. package/Server/Utils/SSRFProtection.ts +5 -4
  20. package/Server/Utils/Telemetry/InventoryEntityRegistry.ts +186 -38
  21. package/Tests/App/AdminDashboard/AdminUsersBulkAddToProject.test.tsx +955 -0
  22. package/Tests/App/AdminDashboard/BulkAddUsersToProject.test.ts +778 -0
  23. package/Tests/App/AdminDashboard/BulkAddUsersToProjectModal.test.tsx +1051 -0
  24. package/Tests/App/Dashboard/AdminNotificationRulesPage.test.tsx +420 -112
  25. package/Tests/App/Dashboard/OnCallReadinessSurfaces.test.tsx +81 -6
  26. package/Tests/App/Dashboard/PayAsYouGoConsentGate.test.tsx +543 -0
  27. package/Tests/App/Dashboard/PayAsYouGoFreePlan.test.ts +125 -0
  28. package/Tests/App/Dashboard/PayAsYouGoNotices.test.tsx +612 -0
  29. package/Tests/App/Dashboard/SloWidgetChartRendering.test.tsx +536 -0
  30. package/Tests/App/Dashboard/UserElementEmail.test.tsx +447 -0
  31. package/Tests/App/Dashboard/UserEmailCallSites.test.tsx +284 -0
  32. package/Tests/Models/AnalyticsModels/CommonModel.test.ts +312 -0
  33. package/Tests/Server/Infrastructure/Postgres/DeviceRoleAndDeclaredLinkParentMigration.test.ts +250 -0
  34. package/Tests/Server/Infrastructure/Postgres/EpisodeMemberNotifyIndexesMigration.test.ts +46 -18
  35. package/Tests/Server/Services/NetworkDeviceLabelRuleRun.test.ts +618 -0
  36. package/Tests/Server/Services/NetworkDeviceLinkParentValidation.test.ts +1043 -0
  37. package/Tests/Server/Services/NetworkSiteAssignmentRuleRun.test.ts +706 -0
  38. package/Tests/Server/Services/RunnerJobEnqueue.test.ts +412 -0
  39. package/Tests/Server/Types/Billing/PayAsYouGoMeteredPricing.test.ts +125 -0
  40. package/Tests/Server/Types/Database/JSONColumnQuery.test.ts +508 -0
  41. package/Tests/Server/Utils/AI/LLMServiceRequestPolicy.test.ts +2 -2
  42. package/Tests/Server/Utils/AI/LLMServiceRetryPolicy.test.ts +450 -0
  43. package/Tests/Server/Utils/Monitor/MonitorAlertResourceLinking.test.ts +556 -0
  44. package/Tests/Server/Utils/Monitor/MonitorIncidentResourceLinking.test.ts +547 -0
  45. package/Tests/Server/Utils/Monitor/MonitorMaintenanceSuppression.test.ts +30 -0
  46. package/Tests/Server/Utils/Monitor/SeriesResourceLinker.test.ts +699 -0
  47. package/Tests/Server/Utils/SeriesResourceLabels.test.ts +55 -0
  48. package/Tests/Server/Utils/Telemetry/InventoryEntityRegistry.test.ts +668 -0
  49. package/Tests/Types/API/URLMalformedTolerance.test.ts +301 -0
  50. package/Tests/Types/API/URLTelScheme.test.ts +261 -0
  51. package/Tests/Types/API/URLUnsupportedScheme.test.ts +148 -0
  52. package/Tests/Types/Billing/PayAsYouGoPricing.test.ts +64 -0
  53. package/Tests/Types/CustomField/CustomFieldTypeCorrespondence.test.ts +107 -0
  54. package/Tests/Types/Monitor/MonitorType.test.ts +62 -0
  55. package/Tests/Types/NetworkAutomation/RuleRunResult.test.ts +184 -0
  56. package/Tests/Types/Runbook/RunbookStepType.test.ts +124 -0
  57. package/Tests/Types/Workflow/BaseModelComponents.test.ts +17 -0
  58. package/Tests/UI/Components/Button.test.tsx +279 -0
  59. package/Tests/UI/Components/Charts/ChartXAxisDataKey.test.tsx +256 -0
  60. package/Tests/UI/Components/Charts/DataPointUtil.test.ts +323 -0
  61. package/Tests/UI/Components/DictionaryValuePlaceholderAndSuggestions.test.tsx +595 -0
  62. package/Tests/UI/Components/Icon.test.tsx +57 -0
  63. package/Tests/UI/Components/List.test.tsx +20 -3
  64. package/Tests/UI/Components/LogsSavedViewsDropdown.test.tsx +304 -0
  65. package/Tests/UI/Components/LogsViewerClearSavedView.test.tsx +179 -0
  66. package/Tests/UI/Components/ModelTable/CustomFieldColumns.test.tsx +349 -1
  67. package/Tests/UI/Components/Pagination.test.tsx +721 -146
  68. package/Tests/UI/Components/PaginationIntegration.test.tsx +386 -0
  69. package/Tests/UI/Components/PaginationUtil.test.ts +417 -0
  70. package/Tests/UI/Components/TelemetrySavedViewsDropdown.test.tsx +343 -0
  71. package/Tests/UI/Components/Workflow/ColumnEditor/ColumnControl.test.ts +289 -0
  72. package/Tests/UI/Components/Workflow/ColumnEditor/ColumnOperators.test.ts +271 -0
  73. package/Tests/UI/Components/Workflow/ColumnEditor/ColumnRow.test.ts +119 -0
  74. package/Tests/UI/Components/Workflow/ColumnEditor/ColumnRowSerialization.test.ts +968 -0
  75. package/Tests/UI/Components/Workflow/ModelColumnEditor.render.test.tsx +766 -0
  76. package/Tests/UI/Utils/RunNetworkRule.test.ts +320 -0
  77. package/Tests/Utils/APIRetryPolicy.test.ts +823 -0
  78. package/Tests/Utils/Monitor/NetworkDeviceRoleUtil.test.ts +502 -0
  79. package/Tests/Utils/Monitor/NetworkTopologyDeclaredHierarchy.test.ts +759 -0
  80. package/Tests/Utils/NetworkAutomation/RuleRunSummary.test.ts +286 -0
  81. package/Tests/Utils/Schema/BaseSchema.test.ts +651 -0
  82. package/Types/API/Protocol.ts +9 -0
  83. package/Types/API/URL.ts +286 -20
  84. package/Types/Billing/PayAsYouGoPricing.ts +47 -0
  85. package/Types/CustomField/CustomFieldType.ts +28 -0
  86. package/Types/Monitor/MonitorType.ts +11 -0
  87. package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +13 -0
  88. package/Types/NetworkAutomation/RuleRunResult.ts +121 -0
  89. package/Types/Runbook/RunbookStepType.ts +23 -0
  90. package/UI/Components/AutocompleteTextInput/AutocompleteTextInput.tsx +7 -0
  91. package/UI/Components/Button/Button.tsx +14 -22
  92. package/UI/Components/Charts/Area/AreaChart.tsx +4 -2
  93. package/UI/Components/Charts/Bar/BarChart.tsx +4 -2
  94. package/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.ts +13 -0
  95. package/UI/Components/Charts/Line/LineChart.tsx +4 -2
  96. package/UI/Components/Charts/Types/XAxis/XAxis.ts +6 -0
  97. package/UI/Components/Charts/Utils/DataPoint.ts +15 -12
  98. package/UI/Components/Dictionary/Dictionary.tsx +4 -39
  99. package/UI/Components/Icon/Icon.tsx +1 -1
  100. package/UI/Components/LogsViewer/LogsViewer.tsx +5 -1
  101. package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +8 -0
  102. package/UI/Components/LogsViewer/components/LogsPagination.tsx +29 -91
  103. package/UI/Components/LogsViewer/components/LogsViewerToolbar.tsx +2 -0
  104. package/UI/Components/LogsViewer/components/SavedViewsDropdown.tsx +66 -1
  105. package/UI/Components/ModelTable/CustomFieldColumns.tsx +55 -0
  106. package/UI/Components/Pagination/Pagination.tsx +373 -328
  107. package/UI/Components/Pagination/PaginationUtil.ts +263 -0
  108. package/UI/Components/Pagination/Screenshots/README.md +15 -0
  109. package/UI/Components/Pagination/Screenshots/pagination-before-after.png +0 -0
  110. package/UI/Components/Pagination/Screenshots/pagination-go-to-page-modal.png +0 -0
  111. package/UI/Components/Pagination/Screenshots/pagination-long-list.png +0 -0
  112. package/UI/Components/Pagination/Screenshots/pagination-mobile.png +0 -0
  113. package/UI/Components/Pagination/Screenshots/pagination-telemetry.png +0 -0
  114. package/UI/Components/TelemetryViewer/components/SavedViewsDropdown.tsx +66 -1
  115. package/UI/Components/TelemetryViewer/components/TelemetryPagination.tsx +38 -92
  116. package/UI/Components/TextArea/TextArea.tsx +3 -0
  117. package/UI/Components/Workflow/ArgumentsForm.tsx +18 -1
  118. package/UI/Components/Workflow/ColumnEditor/AddColumnDropdown.tsx +177 -0
  119. package/UI/Components/Workflow/ColumnEditor/ColumnConditionRow.tsx +243 -0
  120. package/UI/Components/Workflow/ColumnEditor/ColumnControl.ts +255 -0
  121. package/UI/Components/Workflow/ColumnEditor/ColumnFieldRow.tsx +178 -0
  122. package/UI/Components/Workflow/ColumnEditor/ColumnOperators.ts +206 -0
  123. package/UI/Components/Workflow/ColumnEditor/ColumnRow.ts +157 -0
  124. package/UI/Components/Workflow/ColumnEditor/ColumnRowSerialization.ts +517 -0
  125. package/UI/Components/Workflow/ColumnEditor/ColumnValueInput.tsx +482 -0
  126. package/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.tsx +131 -0
  127. package/UI/Components/Workflow/ColumnEditor/ModelRecordForm.tsx +163 -0
  128. package/UI/Components/Workflow/ModelColumnEditor.tsx +284 -100
  129. package/UI/Utils/NetworkAutomation/RunNetworkRule.ts +122 -0
  130. package/Utils/API.ts +243 -36
  131. package/Utils/Monitor/NetworkDeviceRoleUtil.ts +45 -0
  132. package/Utils/Monitor/NetworkTopologyUtil.ts +42 -2
  133. package/Utils/NetworkAutomation/RuleRunSummary.ts +147 -0
  134. package/build/dist/Models/DatabaseModels/NetworkDevice.js +45 -0
  135. package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
  136. package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js +115 -0
  137. package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js.map +1 -1
  138. package/build/dist/Models/DatabaseModels/RunnerJob.js +17 -2
  139. package/build/dist/Models/DatabaseModels/RunnerJob.js.map +1 -1
  140. package/build/dist/Server/API/LlmProviderAPI.js +9 -1
  141. package/build/dist/Server/API/LlmProviderAPI.js.map +1 -1
  142. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787400000000-AddDeviceRoleAndDeclaredLinkParent.js +33 -0
  143. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787400000000-AddDeviceRoleAndDeclaredLinkParent.js.map +1 -0
  144. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
  145. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  146. package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js +202 -0
  147. package/build/dist/Server/Services/NetworkDeviceLabelRuleEngineService.js.map +1 -1
  148. package/build/dist/Server/Services/NetworkDeviceLinkService.js +253 -1
  149. package/build/dist/Server/Services/NetworkDeviceLinkService.js.map +1 -1
  150. package/build/dist/Server/Services/NetworkDeviceService.js +223 -12
  151. package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
  152. package/build/dist/Server/Services/RunnerJobService.js +20 -2
  153. package/build/dist/Server/Services/RunnerJobService.js.map +1 -1
  154. package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js +12 -5
  155. package/build/dist/Server/Types/Billing/MeteredPlan/AllMeteredPlans.js.map +1 -1
  156. package/build/dist/Server/Types/Database/JSONColumnQuery.js +40 -4
  157. package/build/dist/Server/Types/Database/JSONColumnQuery.js.map +1 -1
  158. package/build/dist/Server/Utils/LLM/LLMService.js +78 -22
  159. package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
  160. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +22 -98
  161. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  162. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +7 -254
  163. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  164. package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js +14 -2
  165. package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js.map +1 -1
  166. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js +27 -0
  167. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js.map +1 -1
  168. package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js +285 -0
  169. package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js.map +1 -0
  170. package/build/dist/Server/Utils/SSRFProtection.js +5 -4
  171. package/build/dist/Server/Utils/SSRFProtection.js.map +1 -1
  172. package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js +128 -35
  173. package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js.map +1 -1
  174. package/build/dist/Types/API/Protocol.js +9 -0
  175. package/build/dist/Types/API/Protocol.js.map +1 -1
  176. package/build/dist/Types/API/URL.js +241 -18
  177. package/build/dist/Types/API/URL.js.map +1 -1
  178. package/build/dist/Types/Billing/PayAsYouGoPricing.js +41 -0
  179. package/build/dist/Types/Billing/PayAsYouGoPricing.js.map +1 -0
  180. package/build/dist/Types/CustomField/CustomFieldType.js +26 -0
  181. package/build/dist/Types/CustomField/CustomFieldType.js.map +1 -1
  182. package/build/dist/Types/Monitor/MonitorType.js +10 -0
  183. package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
  184. package/build/dist/Types/NetworkAutomation/RuleRunResult.js +39 -0
  185. package/build/dist/Types/NetworkAutomation/RuleRunResult.js.map +1 -0
  186. package/build/dist/Types/Runbook/RunbookStepType.js +21 -0
  187. package/build/dist/Types/Runbook/RunbookStepType.js.map +1 -1
  188. package/build/dist/UI/Components/AutocompleteTextInput/AutocompleteTextInput.js +1 -1
  189. package/build/dist/UI/Components/AutocompleteTextInput/AutocompleteTextInput.js.map +1 -1
  190. package/build/dist/UI/Components/Button/Button.js +10 -16
  191. package/build/dist/UI/Components/Button/Button.js.map +1 -1
  192. package/build/dist/UI/Components/Charts/Area/AreaChart.js +2 -1
  193. package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
  194. package/build/dist/UI/Components/Charts/Bar/BarChart.js +2 -1
  195. package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
  196. package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js +12 -0
  197. package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js.map +1 -1
  198. package/build/dist/UI/Components/Charts/Line/LineChart.js +2 -1
  199. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  200. package/build/dist/UI/Components/Charts/Utils/DataPoint.js +17 -10
  201. package/build/dist/UI/Components/Charts/Utils/DataPoint.js.map +1 -1
  202. package/build/dist/UI/Components/Dictionary/Dictionary.js +4 -18
  203. package/build/dist/UI/Components/Dictionary/Dictionary.js.map +1 -1
  204. package/build/dist/UI/Components/Icon/Icon.js +1 -1
  205. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  206. package/build/dist/UI/Components/LogsViewer/LogsViewer.js +3 -3
  207. package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
  208. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +5 -1
  209. package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js.map +1 -1
  210. package/build/dist/UI/Components/LogsViewer/components/LogsPagination.js +14 -44
  211. package/build/dist/UI/Components/LogsViewer/components/LogsPagination.js.map +1 -1
  212. package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js +1 -1
  213. package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js.map +1 -1
  214. package/build/dist/UI/Components/LogsViewer/components/SavedViewsDropdown.js +20 -2
  215. package/build/dist/UI/Components/LogsViewer/components/SavedViewsDropdown.js.map +1 -1
  216. package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js +42 -0
  217. package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js.map +1 -1
  218. package/build/dist/UI/Components/Pagination/Pagination.js +174 -199
  219. package/build/dist/UI/Components/Pagination/Pagination.js.map +1 -1
  220. package/build/dist/UI/Components/Pagination/PaginationUtil.js +160 -0
  221. package/build/dist/UI/Components/Pagination/PaginationUtil.js.map +1 -0
  222. package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js +20 -2
  223. package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js.map +1 -1
  224. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryPagination.js +23 -47
  225. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryPagination.js.map +1 -1
  226. package/build/dist/UI/Components/TextArea/TextArea.js +1 -1
  227. package/build/dist/UI/Components/TextArea/TextArea.js.map +1 -1
  228. package/build/dist/UI/Components/Workflow/ArgumentsForm.js +14 -2
  229. package/build/dist/UI/Components/Workflow/ArgumentsForm.js.map +1 -1
  230. package/build/dist/UI/Components/Workflow/ColumnEditor/AddColumnDropdown.js +86 -0
  231. package/build/dist/UI/Components/Workflow/ColumnEditor/AddColumnDropdown.js.map +1 -0
  232. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnConditionRow.js +119 -0
  233. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnConditionRow.js.map +1 -0
  234. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnControl.js +206 -0
  235. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnControl.js.map +1 -0
  236. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnFieldRow.js +57 -0
  237. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnFieldRow.js.map +1 -0
  238. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnOperators.js +150 -0
  239. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnOperators.js.map +1 -0
  240. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnRow.js +67 -0
  241. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnRow.js.map +1 -0
  242. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnRowSerialization.js +309 -0
  243. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnRowSerialization.js.map +1 -0
  244. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnValueInput.js +204 -0
  245. package/build/dist/UI/Components/Workflow/ColumnEditor/ColumnValueInput.js.map +1 -0
  246. package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js +66 -0
  247. package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js.map +1 -0
  248. package/build/dist/UI/Components/Workflow/ColumnEditor/ModelRecordForm.js +83 -0
  249. package/build/dist/UI/Components/Workflow/ColumnEditor/ModelRecordForm.js.map +1 -0
  250. package/build/dist/UI/Components/Workflow/ModelColumnEditor.js +187 -68
  251. package/build/dist/UI/Components/Workflow/ModelColumnEditor.js.map +1 -1
  252. package/build/dist/UI/Utils/NetworkAutomation/RunNetworkRule.js +75 -0
  253. package/build/dist/UI/Utils/NetworkAutomation/RunNetworkRule.js.map +1 -0
  254. package/build/dist/Utils/API.js +175 -34
  255. package/build/dist/Utils/API.js.map +1 -1
  256. package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js +37 -0
  257. package/build/dist/Utils/Monitor/NetworkDeviceRoleUtil.js.map +1 -1
  258. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +25 -3
  259. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
  260. package/build/dist/Utils/NetworkAutomation/RuleRunSummary.js +78 -0
  261. package/build/dist/Utils/NetworkAutomation/RuleRunSummary.js.map +1 -0
  262. package/package.json +1 -1
@@ -0,0 +1,150 @@
1
+ /*
2
+ * Which comparisons a column can be filtered by, and what to call them.
3
+ *
4
+ * The old row editor offered all fourteen operators against every column, so a
5
+ * Boolean column offered "starts with" and an ID column offered "greater than".
6
+ * Both are accepted by the form and neither means anything - `uuid ILIKE '%x%'`
7
+ * needs a cast Postgres will not do for you.
8
+ *
9
+ * Only the labels change here. The DictionaryFilterOperator members, and
10
+ * therefore every byte that reaches the server, are exactly the ones the
11
+ * Dictionary form already emitted.
12
+ */
13
+ import { DICTIONARY_FILTER_OPERATOR_OPTIONS, DictionaryFilterOperator, getOperatorOption, } from "../../Dictionary/DictionaryFilterOperator";
14
+ import { ModelColumnControl } from "./ColumnRow";
15
+ const TEXT_OPERATORS = [
16
+ DictionaryFilterOperator.EqualTo,
17
+ DictionaryFilterOperator.NotEqual,
18
+ DictionaryFilterOperator.Contains,
19
+ DictionaryFilterOperator.NotContains,
20
+ DictionaryFilterOperator.StartsWith,
21
+ DictionaryFilterOperator.EndsWith,
22
+ DictionaryFilterOperator.IsAnyOf,
23
+ DictionaryFilterOperator.IsNoneOf,
24
+ DictionaryFilterOperator.IsEmpty,
25
+ DictionaryFilterOperator.IsNotEmpty,
26
+ ];
27
+ const NUMBER_OPERATORS = [
28
+ DictionaryFilterOperator.EqualTo,
29
+ DictionaryFilterOperator.NotEqual,
30
+ DictionaryFilterOperator.GreaterThan,
31
+ DictionaryFilterOperator.GreaterThanOrEqual,
32
+ DictionaryFilterOperator.LessThan,
33
+ DictionaryFilterOperator.LessThanOrEqual,
34
+ DictionaryFilterOperator.IsAnyOf,
35
+ DictionaryFilterOperator.IsNoneOf,
36
+ DictionaryFilterOperator.IsEmpty,
37
+ DictionaryFilterOperator.IsNotEmpty,
38
+ ];
39
+ const DATE_OPERATORS = [
40
+ DictionaryFilterOperator.EqualTo,
41
+ DictionaryFilterOperator.NotEqual,
42
+ DictionaryFilterOperator.GreaterThan,
43
+ DictionaryFilterOperator.GreaterThanOrEqual,
44
+ DictionaryFilterOperator.LessThan,
45
+ DictionaryFilterOperator.LessThanOrEqual,
46
+ DictionaryFilterOperator.IsEmpty,
47
+ DictionaryFilterOperator.IsNotEmpty,
48
+ ];
49
+ const IDENTIFIER_OPERATORS = [
50
+ DictionaryFilterOperator.EqualTo,
51
+ DictionaryFilterOperator.NotEqual,
52
+ DictionaryFilterOperator.IsAnyOf,
53
+ DictionaryFilterOperator.IsNoneOf,
54
+ DictionaryFilterOperator.IsEmpty,
55
+ DictionaryFilterOperator.IsNotEmpty,
56
+ ];
57
+ const BOOLEAN_OPERATORS = [
58
+ DictionaryFilterOperator.EqualTo,
59
+ DictionaryFilterOperator.NotEqual,
60
+ DictionaryFilterOperator.IsEmpty,
61
+ DictionaryFilterOperator.IsNotEmpty,
62
+ ];
63
+ /*
64
+ * A date reads far better as "is after" than as ">", and the ordering
65
+ * operators are the whole point of filtering on one. Anything not listed keeps
66
+ * the shared label from DICTIONARY_FILTER_OPERATOR_OPTIONS.
67
+ */
68
+ const DATE_OPERATOR_LABELS = {
69
+ [DictionaryFilterOperator.EqualTo]: "is",
70
+ [DictionaryFilterOperator.NotEqual]: "is not",
71
+ [DictionaryFilterOperator.GreaterThan]: "is after",
72
+ [DictionaryFilterOperator.GreaterThanOrEqual]: "is on or after",
73
+ [DictionaryFilterOperator.LessThan]: "is before",
74
+ [DictionaryFilterOperator.LessThanOrEqual]: "is on or before",
75
+ [DictionaryFilterOperator.IsEmpty]: "is not set",
76
+ [DictionaryFilterOperator.IsNotEmpty]: "is set",
77
+ };
78
+ const BOOLEAN_OPERATOR_LABELS = {
79
+ [DictionaryFilterOperator.EqualTo]: "is",
80
+ [DictionaryFilterOperator.NotEqual]: "is not",
81
+ [DictionaryFilterOperator.IsEmpty]: "is not set",
82
+ [DictionaryFilterOperator.IsNotEmpty]: "is set",
83
+ };
84
+ const DEFAULT_OPERATOR_LABELS = {
85
+ [DictionaryFilterOperator.IsEmpty]: "is not set",
86
+ [DictionaryFilterOperator.IsNotEmpty]: "is set",
87
+ };
88
+ /**
89
+ * The operators offered for a column, in the order they should be listed.
90
+ *
91
+ * `currentOperator` is always included even when the type filter would drop it.
92
+ * A query saved before this filter existed can hold "contains" on an ID column;
93
+ * leaving it out of the list would render a blank dropdown, and the next
94
+ * unrelated edit to that row would silently rewrite the operator to equals.
95
+ */
96
+ export const operatorsForControl = (control, currentOperator) => {
97
+ let operators;
98
+ switch (control) {
99
+ case ModelColumnControl.Number:
100
+ operators = NUMBER_OPERATORS;
101
+ break;
102
+ case ModelColumnControl.Date:
103
+ operators = DATE_OPERATORS;
104
+ break;
105
+ case ModelColumnControl.ObjectId:
106
+ case ModelColumnControl.Color:
107
+ operators = IDENTIFIER_OPERATORS;
108
+ break;
109
+ case ModelColumnControl.Boolean:
110
+ operators = BOOLEAN_OPERATORS;
111
+ break;
112
+ default:
113
+ /*
114
+ * Unsupported lands here too. It is never offered in the picker, but a
115
+ * stored condition on such a column still gets a row, and that row should
116
+ * have the widest set rather than the narrowest.
117
+ */
118
+ operators = TEXT_OPERATORS;
119
+ break;
120
+ }
121
+ if (currentOperator && !operators.includes(currentOperator)) {
122
+ return [...operators, currentOperator];
123
+ }
124
+ return [...operators];
125
+ };
126
+ export const defaultOperatorForControl = () => {
127
+ /*
128
+ * Equals for every type. It is the only operator that is right more often
129
+ * than not, and it is the one the value serializes without a wrapper.
130
+ */
131
+ return DictionaryFilterOperator.EqualTo;
132
+ };
133
+ export const operatorLabelFor = (operator, control) => {
134
+ const overrides = control === ModelColumnControl.Date
135
+ ? DATE_OPERATOR_LABELS
136
+ : control === ModelColumnControl.Boolean
137
+ ? BOOLEAN_OPERATOR_LABELS
138
+ : DEFAULT_OPERATOR_LABELS;
139
+ const override = overrides[operator];
140
+ if (override) {
141
+ return override;
142
+ }
143
+ return getOperatorOption(operator).label;
144
+ };
145
+ export const isKnownOperator = (value) => {
146
+ return DICTIONARY_FILTER_OPERATOR_OPTIONS.some((option) => {
147
+ return option.operator === value;
148
+ });
149
+ };
150
+ //# sourceMappingURL=ColumnOperators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColumnOperators.js","sourceRoot":"","sources":["../../../../../../UI/Components/Workflow/ColumnEditor/ColumnOperators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,kCAAkC,EAClC,wBAAwB,EAExB,iBAAiB,GAClB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,cAAc,GAAoC;IACtD,wBAAwB,CAAC,OAAO;IAChC,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,WAAW;IACpC,wBAAwB,CAAC,UAAU;IACnC,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,OAAO;IAChC,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,OAAO;IAChC,wBAAwB,CAAC,UAAU;CACpC,CAAC;AAEF,MAAM,gBAAgB,GAAoC;IACxD,wBAAwB,CAAC,OAAO;IAChC,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,WAAW;IACpC,wBAAwB,CAAC,kBAAkB;IAC3C,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,eAAe;IACxC,wBAAwB,CAAC,OAAO;IAChC,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,OAAO;IAChC,wBAAwB,CAAC,UAAU;CACpC,CAAC;AAEF,MAAM,cAAc,GAAoC;IACtD,wBAAwB,CAAC,OAAO;IAChC,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,WAAW;IACpC,wBAAwB,CAAC,kBAAkB;IAC3C,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,eAAe;IACxC,wBAAwB,CAAC,OAAO;IAChC,wBAAwB,CAAC,UAAU;CACpC,CAAC;AAEF,MAAM,oBAAoB,GAAoC;IAC5D,wBAAwB,CAAC,OAAO;IAChC,wBAAwB,CAAC,QAAQ;IACjC,wBAAwB,CAAC,OA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AC3C,CAAC,CAAC;AAIF,MAAM,CAAC,MAAM,eAAe,GAA4B,CACtD,KAAa,EACJ,EAAE;IACX,OAAO,kCAAkC,CAAC,IAAI,CAC5C,CAAC,MAAsC,EAAE,EAAE;QACzC,OAAO,MAAM,CAAC,QAAQ,KAAK,KAAK,CAAC;IACnC,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,67 @@
1
+ /*
2
+ * The row model shared by the record form and the query builder.
3
+ *
4
+ * A row is one column of the model plus the value the builder typed for it.
5
+ * Everything the editor knows about a row that is not the schema lives here,
6
+ * and the two React bodies hold no state of their own — ModelColumnEditor owns
7
+ * the array and hands it down, so a row can never disagree with the JSON the
8
+ * argument is stored as.
9
+ */
10
+ import { DictionaryFilterOperator } from "../../Dictionary/DictionaryFilterOperator";
11
+ /**
12
+ * The kind of control a column's value is typed into.
13
+ *
14
+ * Deliberately much smaller than TableColumnType: the builder does not need a
15
+ * different box for Email than for Slug, and every extra control is another
16
+ * thing that can render the wrong way round. What matters is the shape of the
17
+ * value that comes out — string, number, boolean, ISO date — because that is
18
+ * what ends up in the JSON the server parses.
19
+ */
20
+ export var ModelColumnControl;
21
+ (function (ModelColumnControl) {
22
+ ModelColumnControl["Text"] = "Text";
23
+ ModelColumnControl["LongText"] = "LongText";
24
+ ModelColumnControl["Number"] = "Number";
25
+ ModelColumnControl["Boolean"] = "Boolean";
26
+ ModelColumnControl["Date"] = "Date";
27
+ ModelColumnControl["ObjectId"] = "ObjectId";
28
+ ModelColumnControl["Color"] = "Color";
29
+ /** Buffers, files, nested JSON, monitor steps — no row can hold one. */
30
+ ModelColumnControl["Unsupported"] = "Unsupported";
31
+ })(ModelColumnControl || (ModelColumnControl = {}));
32
+ /**
33
+ * How the value in a row is being edited.
34
+ *
35
+ * Literal is the type-appropriate control. Reference is the {{ }} autocomplete,
36
+ * available on every column type because most creates are assembled out of an
37
+ * earlier step's return values. Raw is the escape hatch for a stored scalar
38
+ * whose JavaScript type disagrees with the column's — `{"port": "8080"}` on a
39
+ * numeric column — which is re-emitted exactly as it was read until the builder
40
+ * edits that one cell. Without Raw, opening a workflow and saving it again
41
+ * would quietly rewrite the stored bytes.
42
+ */
43
+ export var ColumnValueMode;
44
+ (function (ColumnValueMode) {
45
+ ColumnValueMode["Literal"] = "Literal";
46
+ ColumnValueMode["Reference"] = "Reference";
47
+ ColumnValueMode["Raw"] = "Raw";
48
+ })(ColumnValueMode || (ColumnValueMode = {}));
49
+ /*
50
+ * A counter rather than a random id, so a row's identity is reproducible and
51
+ * two editors mounted in the same page can never collide.
52
+ */
53
+ let nextRowKey = 0;
54
+ export const makeColumnRow = (row) => {
55
+ nextRowKey = nextRowKey + 1;
56
+ return Object.assign({ key: row.key || `row-${nextRowKey}`, columnId: row.columnId, operator: row.operator || DictionaryFilterOperator.EqualTo, valueMode: row.valueMode || ColumnValueMode.Literal, text: row.text === undefined ? "" : row.text, values: row.values || [], isSeeded: Boolean(row.isSeeded) }, (row.rawValue === undefined ? {} : { rawValue: row.rawValue }));
57
+ };
58
+ export const changeColumnRow = (row, change) => {
59
+ const next = Object.assign(Object.assign(Object.assign({}, row), change), {
60
+ // Any edit means the row is no longer just a blank the editor opened with.
61
+ isSeeded: false });
62
+ if (next.valueMode !== ColumnValueMode.Raw) {
63
+ delete next.rawValue;
64
+ }
65
+ return next;
66
+ };
67
+ //# sourceMappingURL=ColumnRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColumnRow.js","sourceRoot":"","sources":["../../../../../../UI/Components/Workflow/ColumnEditor/ColumnRow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAErF;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,2CAAqB,CAAA;IACrB,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;IACnB,mCAAa,CAAA;IACb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,IAAI,CAAC,SAAS,KAAK,eAAe,CAAC,GAAG,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
@@ -0,0 +1,309 @@
1
+ /*
2
+ * Stored JSON <-> rows, in both directions.
3
+ *
4
+ * The last step out is always buildColumnValueJson, and the operator wrappers
5
+ * are always built by buildDictionaryValue, so the bytes that reach the server
6
+ * are produced by exactly the code that produced them before this editor
7
+ * existed. Everything here decides *what* to hand those two functions.
8
+ *
9
+ * The rule that shapes the whole file: reading a value and writing it back
10
+ * unchanged must produce the same bytes. An editor that quietly rewrites
11
+ * {"port": "8080"} into {"port": 8080} the moment someone opens a workflow and
12
+ * saves it is worse than one that asks a question it should not have needed to
13
+ * ask.
14
+ */
15
+ import GreaterThan from "../../../../Types/BaseDatabase/GreaterThan";
16
+ import GreaterThanOrEqual from "../../../../Types/BaseDatabase/GreaterThanOrEqual";
17
+ import LessThan from "../../../../Types/BaseDatabase/LessThan";
18
+ import LessThanOrEqual from "../../../../Types/BaseDatabase/LessThanOrEqual";
19
+ import { getTemplateExpressionRegex } from "../../../../Types/Workflow/TemplateSyntax";
20
+ import { DictionaryFilterOperator, buildDictionaryValue, detectOperatorFromValue, getOperatorOption, } from "../../Dictionary/DictionaryFilterOperator";
21
+ import { ModelColumnEditorMode, buildColumnValueJson, } from "../ModelColumnEditor";
22
+ import { findColumn, requiredWritableColumns, } from "../ModelSchema";
23
+ import { controlForColumn, literalFitsControl } from "./ColumnControl";
24
+ import { ColumnValueMode, ModelColumnControl, makeColumnRow, } from "./ColumnRow";
25
+ /**
26
+ * Does this text hold a {{ }} reference?
27
+ *
28
+ * Uses the runtime's own matcher rather than a hand-rolled `/{{/`, so a value
29
+ * this editor calls a reference is one the runner will actually substitute.
30
+ */
31
+ export const containsTemplateExpression = (value) => {
32
+ return getTemplateExpressionRegex().test(value);
33
+ };
34
+ /*
35
+ * The scalar inside an operator wrapper, or the value itself when it is not
36
+ * one. detectOperatorFromValue gives back a string for display; this keeps the
37
+ * original JavaScript type so a stored number stays a number.
38
+ */
39
+ const unwrapOperatorValue = (value) => {
40
+ if (value && typeof value === "object" && "value" in value) {
41
+ return value.value;
42
+ }
43
+ return value;
44
+ };
45
+ const literalTextFor = (control, value) => {
46
+ if (value === undefined || value === null) {
47
+ return "";
48
+ }
49
+ /*
50
+ * Only a real boolean is spelled out. Mapping everything else to "false" put
51
+ * a stored "true" - or "yes", or 1 - on screen as the word "false", which is
52
+ * the opposite of what the workflow does, and this function also names the
53
+ * text of a raw row, where the value is by definition not a boolean.
54
+ */
55
+ if (control === ModelColumnControl.Boolean && typeof value === "boolean") {
56
+ return value ? "true" : "false";
57
+ }
58
+ return String(value);
59
+ };
60
+ /**
61
+ * Which of the three editing modes a stored value belongs in.
62
+ *
63
+ * Inferred once, when the value is read. Never guessed at render time - a cell
64
+ * that decided for itself what it was holding would flip modes as the builder
65
+ * typed.
66
+ */
67
+ export const classifyRowValue = (control, value) => {
68
+ if (typeof value === "string" && containsTemplateExpression(value)) {
69
+ return { valueMode: ColumnValueMode.Reference, text: value };
70
+ }
71
+ /*
72
+ * null is a real stored value and no empty control can express it: an empty
73
+ * control emits "", which a record drops entirely. So it is kept raw and
74
+ * re-emitted verbatim until the builder types over it.
75
+ */
76
+ if (value === null) {
77
+ return { valueMode: ColumnValueMode.Raw, text: "", rawValue: null };
78
+ }
79
+ if (literalFitsControl(control, value)) {
80
+ return {
81
+ valueMode: ColumnValueMode.Literal,
82
+ text: literalTextFor(control, value),
83
+ };
84
+ }
85
+ return {
86
+ valueMode: ColumnValueMode.Raw,
87
+ text: literalTextFor(control, value),
88
+ rawValue: value,
89
+ };
90
+ };
91
+ /**
92
+ * The stored object, as rows, in the order its keys were written.
93
+ *
94
+ * Order is never sorted. The picker is sorted (the endpoint does it by title),
95
+ * but the rows are the document, and reordering them is rewriting the stored
96
+ * bytes for nothing.
97
+ */
98
+ export const rowsFromParsedValue = (parsed, columns, mode) => {
99
+ if (!parsed) {
100
+ return [];
101
+ }
102
+ const isQuery = mode === ModelColumnEditorMode.Query;
103
+ const rows = [];
104
+ for (const key of Object.keys(parsed)) {
105
+ const value = parsed[key];
106
+ const column = findColumn(columns, key);
107
+ const control = controlForColumn(column);
108
+ if (!isQuery) {
109
+ rows.push(makeColumnRow(Object.assign({ columnId: key, operator: DictionaryFilterOperator.EqualTo }, classifyRowValue(control, value))));
110
+ continue;
111
+ }
112
+ const detected = detectOperatorFromValue(value);
113
+ const option = getOperatorOption(detected.operator);
114
+ if (option.expectsMultiValue) {
115
+ rows.push(makeColumnRow({
116
+ columnId: key,
117
+ operator: detected.operator,
118
+ values: detected.rawValues || [],
119
+ }));
120
+ continue;
121
+ }
122
+ if (option.hidesValueInput) {
123
+ rows.push(makeColumnRow({ columnId: key, operator: detected.operator }));
124
+ continue;
125
+ }
126
+ rows.push(makeColumnRow(Object.assign({ columnId: key, operator: detected.operator }, classifyRowValue(control, unwrapOperatorValue(value)))));
127
+ }
128
+ return rows;
129
+ };
130
+ /**
131
+ * One blank row per column a create must be given a value for, appended after
132
+ * whatever was stored.
133
+ *
134
+ * Appended, never inserted: the stored keys keep their order, so seeding cannot
135
+ * change the bytes of a workflow that is only opened and closed. Seeded rows
136
+ * hold "" and are dropped on the way out, so an untouched Create One still
137
+ * reads as empty to form validation and to the graph linter.
138
+ */
139
+ export const seedRequiredRows = (rows, columns) => {
140
+ const present = new Set(rows.map((row) => {
141
+ return row.columnId;
142
+ }));
143
+ const seeded = [];
144
+ for (const column of requiredWritableColumns(columns)) {
145
+ if (present.has(column.id)) {
146
+ continue;
147
+ }
148
+ seeded.push(makeColumnRow({ columnId: column.id, isSeeded: true }));
149
+ }
150
+ return [...rows, ...seeded];
151
+ };
152
+ /**
153
+ * A row's text, as the JSON value it stands for.
154
+ *
155
+ * "" is returned as "" rather than as null or omitted, because that is the
156
+ * marker buildColumnValueJson reads to drop a blank field from a record.
157
+ */
158
+ const emitLiteralValue = (control, text) => {
159
+ if (text === "") {
160
+ return "";
161
+ }
162
+ if (control === ModelColumnControl.Number) {
163
+ const asNumber = Number(text);
164
+ /*
165
+ * Text that is not a number is emitted as text, not dropped and not turned
166
+ * into NaN. The row shows why it is wrong; throwing the value away would
167
+ * take the builder's work with it.
168
+ */
169
+ if (text.trim() === "" || isNaN(asNumber)) {
170
+ return text;
171
+ }
172
+ return asNumber;
173
+ }
174
+ if (control === ModelColumnControl.Boolean) {
175
+ if (text === "true") {
176
+ return true;
177
+ }
178
+ if (text === "false") {
179
+ return false;
180
+ }
181
+ return text;
182
+ }
183
+ return text;
184
+ };
185
+ /**
186
+ * The value half of a row, before any operator wrapper is put around it.
187
+ */
188
+ export const emitRowValue = (row, control) => {
189
+ if (row.valueMode === ColumnValueMode.Raw) {
190
+ return row.rawValue;
191
+ }
192
+ /*
193
+ * A reference is always emitted as a string, on every column type. The
194
+ * runner substitutes the text and the result is parsed as JSON, so an
195
+ * unquoted substitution on a numeric column would be a gamble on what the
196
+ * referenced value happens to look like. Postgres casts '5' to 5 on the way
197
+ * into an integer column; it cannot rescue a document that does not parse.
198
+ */
199
+ if (row.valueMode === ColumnValueMode.Reference) {
200
+ return row.text;
201
+ }
202
+ return emitLiteralValue(control, row.text);
203
+ };
204
+ /*
205
+ * The ordering operators built over a string rather than a number.
206
+ *
207
+ * buildDictionaryValue does `new GreaterThan(Number(text))`, which is right for
208
+ * a number and silently destructive for anything else: a date or a {{ }}
209
+ * reference becomes NaN, and JSON.stringify writes NaN as null - a query
210
+ * against NULL that matches nothing and reports no error. These columns are
211
+ * declared CompareType = number | Date | string, so the string form is a value
212
+ * the wrapper was always able to hold.
213
+ */
214
+ const buildComparisonWrapper = (operator, value) => {
215
+ switch (operator) {
216
+ case DictionaryFilterOperator.GreaterThan:
217
+ return new GreaterThan(value);
218
+ case DictionaryFilterOperator.GreaterThanOrEqual:
219
+ return new GreaterThanOrEqual(value);
220
+ case DictionaryFilterOperator.LessThan:
221
+ return new LessThan(value);
222
+ case DictionaryFilterOperator.LessThanOrEqual:
223
+ return new LessThanOrEqual(value);
224
+ default:
225
+ return null;
226
+ }
227
+ };
228
+ /**
229
+ * A query row, wrapped in whatever its operator needs.
230
+ *
231
+ * Delegates to buildDictionaryValue for every case it handles correctly, so
232
+ * each wrapper class's own toJSON() still produces the bytes and the key order
233
+ * inside {_type, value} is unchanged.
234
+ */
235
+ export const buildOperatorValue = (row, control) => {
236
+ const option = getOperatorOption(row.operator);
237
+ if (option.hidesValueInput) {
238
+ return buildDictionaryValue({ operator: row.operator, rawValue: "" });
239
+ }
240
+ if (option.expectsMultiValue) {
241
+ return buildDictionaryValue({
242
+ operator: row.operator,
243
+ rawValue: "",
244
+ rawValues: row.values,
245
+ });
246
+ }
247
+ const emitted = emitRowValue(row, control);
248
+ /*
249
+ * Equality carries no wrapper at all - it is stored as the bare value, which
250
+ * is what every query written before operators existed looks like.
251
+ */
252
+ if (row.operator === DictionaryFilterOperator.EqualTo) {
253
+ return emitted;
254
+ }
255
+ if (option.expectsNumericValue && typeof emitted !== "number") {
256
+ const wrapper = buildComparisonWrapper(row.operator, typeof emitted === "string" ? emitted : String(emitted !== null && emitted !== void 0 ? emitted : ""));
257
+ if (wrapper !== null) {
258
+ return wrapper;
259
+ }
260
+ }
261
+ return buildDictionaryValue({
262
+ operator: row.operator,
263
+ rawValue: typeof emitted === "string" ? emitted : String(emitted !== null && emitted !== void 0 ? emitted : ""),
264
+ });
265
+ };
266
+ export const rowsToEntryDictionary = (rows, columns, mode) => {
267
+ const entries = {};
268
+ const isQuery = mode === ModelColumnEditorMode.Query;
269
+ for (const row of rows) {
270
+ if (row.columnId.trim() === "") {
271
+ continue;
272
+ }
273
+ const control = controlForColumn(findColumn(columns, row.columnId));
274
+ entries[row.columnId] = isQuery
275
+ ? buildOperatorValue(row, control)
276
+ : emitRowValue(row, control);
277
+ }
278
+ return entries;
279
+ };
280
+ /**
281
+ * The rows, as the string stored on the workflow argument.
282
+ *
283
+ * Ends in buildColumnValueJson, unchanged, which is what drops blank record
284
+ * fields and collapses an empty editor to "" rather than to "{}".
285
+ */
286
+ export const serializeColumnRows = (rows, columns, mode) => {
287
+ return buildColumnValueJson(rowsToEntryDictionary(rows, columns, mode), mode);
288
+ };
289
+ /**
290
+ * What is wrong with what has been typed into this row, in one sentence, or
291
+ * null when nothing is.
292
+ *
293
+ * Advisory only. Nothing here blocks saving: the value is still written, and
294
+ * the builder can still be right about a column this endpoint describes badly.
295
+ */
296
+ export const rowIssue = (row, column) => {
297
+ if (row.valueMode !== ColumnValueMode.Literal || row.text === "") {
298
+ return null;
299
+ }
300
+ const control = controlForColumn(column);
301
+ if (control === ModelColumnControl.Number && isNaN(Number(row.text))) {
302
+ return "This column takes a number.";
303
+ }
304
+ if (control === ModelColumnControl.Date && isNaN(Date.parse(row.text))) {
305
+ return "This column takes a date and time.";
306
+ }
307
+ return null;
308
+ };
309
+ //# sourceMappingURL=ColumnRowSerialization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColumnRowSerialization.js","sourceRoot":"","sources":["../../../../../../UI/Components/Workflow/ColumnEditor/ColumnRowSerialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,WAAW,MAAM,4CAA4C,CAAC;AACrE,OAAO,kBAAkB,MAAM,mDAAmD,CAAC;AACnF,OAAO,QAAQ,MAAM,yCAAyC,CAAC;AAC/D,OAAO,eAAe,MAAM,gDAAgD,CAAC;AAG7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAEL,wBAAwB,EAExB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,UAAU,EACV,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB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