@flightctl/ui-components 0.0.1

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 (408) hide show
  1. package/dist/__mocks__/fileMock.js +3 -0
  2. package/dist/__mocks__/fileMock.js.map +1 -0
  3. package/dist/__mocks__/styleMock.js +3 -0
  4. package/dist/__mocks__/styleMock.js.map +1 -0
  5. package/dist/jest.config.js +24 -0
  6. package/dist/jest.config.js.map +1 -0
  7. package/dist/src/components/DetailsPage/DetailsNotFound.js +69 -0
  8. package/dist/src/components/DetailsPage/DetailsNotFound.js.map +1 -0
  9. package/dist/src/components/DetailsPage/DetailsPage.css +3 -0
  10. package/dist/src/components/DetailsPage/DetailsPage.js +42 -0
  11. package/dist/src/components/DetailsPage/DetailsPage.js.map +1 -0
  12. package/dist/src/components/DetailsPage/DetailsPage.spec.js +81 -0
  13. package/dist/src/components/DetailsPage/DetailsPage.spec.js.map +1 -0
  14. package/dist/src/components/DetailsPage/DetailsPageActions.js +30 -0
  15. package/dist/src/components/DetailsPage/DetailsPageActions.js.map +1 -0
  16. package/dist/src/components/DetailsPage/DetailsPageCard.css +8 -0
  17. package/dist/src/components/DetailsPage/DetailsPageCard.js +12 -0
  18. package/dist/src/components/DetailsPage/DetailsPageCard.js.map +1 -0
  19. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +27 -0
  20. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -0
  21. package/dist/src/components/DetailsPage/Tables/ConditionsTable.js +24 -0
  22. package/dist/src/components/DetailsPage/Tables/ConditionsTable.js.map +1 -0
  23. package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js +22 -0
  24. package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js.map +1 -0
  25. package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js +40 -0
  26. package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js.map +1 -0
  27. package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js +63 -0
  28. package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js.map +1 -0
  29. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +57 -0
  30. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -0
  31. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.css +4 -0
  32. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +114 -0
  33. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -0
  34. package/dist/src/components/Device/DeviceDetails/DeviceFleet.css +3 -0
  35. package/dist/src/components/Device/DeviceDetails/DeviceFleet.js +50 -0
  36. package/dist/src/components/Device/DeviceDetails/DeviceFleet.js.map +1 -0
  37. package/dist/src/components/Device/DeviceDetails/DeviceStatusDebugModal.css +3 -0
  38. package/dist/src/components/Device/DeviceDetails/DeviceStatusDebugModal.js +34 -0
  39. package/dist/src/components/Device/DeviceDetails/DeviceStatusDebugModal.js.map +1 -0
  40. package/dist/src/components/Device/DeviceDetails/SystemdTable.js +38 -0
  41. package/dist/src/components/Device/DeviceDetails/SystemdTable.js.map +1 -0
  42. package/dist/src/components/Device/DeviceDetails/TerminalTab.js +31 -0
  43. package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -0
  44. package/dist/src/components/Device/DeviceList/DeviceFilterSelect.js +87 -0
  45. package/dist/src/components/Device/DeviceList/DeviceFilterSelect.js.map +1 -0
  46. package/dist/src/components/Device/DeviceList/DeviceList.js +157 -0
  47. package/dist/src/components/Device/DeviceList/DeviceList.js.map +1 -0
  48. package/dist/src/components/Device/DeviceList/DeviceTableRow.js +62 -0
  49. package/dist/src/components/Device/DeviceList/DeviceTableRow.js.map +1 -0
  50. package/dist/src/components/Device/DeviceList/DeviceTableToolbar.js +80 -0
  51. package/dist/src/components/Device/DeviceList/DeviceTableToolbar.js.map +1 -0
  52. package/dist/src/components/Device/DeviceList/types.js +4 -0
  53. package/dist/src/components/Device/DeviceList/types.js.map +1 -0
  54. package/dist/src/components/Device/DeviceList/useDeviceBackendFilters.js +94 -0
  55. package/dist/src/components/Device/DeviceList/useDeviceBackendFilters.js.map +1 -0
  56. package/dist/src/components/Device/DeviceList/useDeviceFilters.js +16 -0
  57. package/dist/src/components/Device/DeviceList/useDeviceFilters.js.map +1 -0
  58. package/dist/src/components/Device/DeviceList/useDeviceLikeResources.js +98 -0
  59. package/dist/src/components/Device/DeviceList/useDeviceLikeResources.js.map +1 -0
  60. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.css +4 -0
  61. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +92 -0
  62. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -0
  63. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.js +32 -0
  64. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.js.map +1 -0
  65. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js +36 -0
  66. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js.map +1 -0
  67. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +171 -0
  68. package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -0
  69. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +15 -0
  70. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -0
  71. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.js +22 -0
  72. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.js.map +1 -0
  73. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.css +3 -0
  74. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.js +96 -0
  75. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.js.map +1 -0
  76. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js +94 -0
  77. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js.map +1 -0
  78. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +45 -0
  79. package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -0
  80. package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.js +48 -0
  81. package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.js.map +1 -0
  82. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js +45 -0
  83. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js.map +1 -0
  84. package/dist/src/components/Device/EditDeviceWizard/types.js +3 -0
  85. package/dist/src/components/Device/EditDeviceWizard/types.js.map +1 -0
  86. package/dist/src/components/Device/EditDeviceWizard/useEditDevice.js +35 -0
  87. package/dist/src/components/Device/EditDeviceWizard/useEditDevice.js.map +1 -0
  88. package/dist/src/components/Device/EditDeviceWizard/utils.js +65 -0
  89. package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -0
  90. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js +39 -0
  91. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js.map +1 -0
  92. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.js +46 -0
  93. package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.js.map +1 -0
  94. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.css +3 -0
  95. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +103 -0
  96. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -0
  97. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js +42 -0
  98. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js.map +1 -0
  99. package/dist/src/components/ErrorAlert/ErrorAlert.js +13 -0
  100. package/dist/src/components/ErrorAlert/ErrorAlert.js.map +1 -0
  101. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.css +3 -0
  102. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +82 -0
  103. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -0
  104. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js +32 -0
  105. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js.map +1 -0
  106. package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js +85 -0
  107. package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js.map +1 -0
  108. package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.js +30 -0
  109. package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.js.map +1 -0
  110. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +46 -0
  111. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -0
  112. package/dist/src/components/Fleet/CreateFleet/types.js +3 -0
  113. package/dist/src/components/Fleet/CreateFleet/types.js.map +1 -0
  114. package/dist/src/components/Fleet/CreateFleet/useEditFleet.js +35 -0
  115. package/dist/src/components/Fleet/CreateFleet/useEditFleet.js.map +1 -0
  116. package/dist/src/components/Fleet/CreateFleet/utils.js +143 -0
  117. package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -0
  118. package/dist/src/components/Fleet/DeleteFleetModal/DeleteFleetModal.js +55 -0
  119. package/dist/src/components/Fleet/DeleteFleetModal/DeleteFleetModal.js.map +1 -0
  120. package/dist/src/components/Fleet/FleetDetails/FleetDetails.js +49 -0
  121. package/dist/src/components/Fleet/FleetDetails/FleetDetails.js.map +1 -0
  122. package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js +69 -0
  123. package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js.map +1 -0
  124. package/dist/src/components/Fleet/FleetDetails/FleetDevices.js +40 -0
  125. package/dist/src/components/Fleet/FleetDetails/FleetDevices.js.map +1 -0
  126. package/dist/src/components/Fleet/FleetDetails/FleetOwnerLink.js +37 -0
  127. package/dist/src/components/Fleet/FleetDetails/FleetOwnerLink.js.map +1 -0
  128. package/dist/src/components/Fleet/FleetDetails/chartUtils.js +29 -0
  129. package/dist/src/components/Fleet/FleetDetails/chartUtils.js.map +1 -0
  130. package/dist/src/components/Fleet/FleetList.js +130 -0
  131. package/dist/src/components/Fleet/FleetList.js.map +1 -0
  132. package/dist/src/components/Fleet/FleetRow.js +64 -0
  133. package/dist/src/components/Fleet/FleetRow.js.map +1 -0
  134. package/dist/src/components/Fleet/FleetStatus.js +34 -0
  135. package/dist/src/components/Fleet/FleetStatus.js.map +1 -0
  136. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.css +3 -0
  137. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js +106 -0
  138. package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js.map +1 -0
  139. package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +69 -0
  140. package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -0
  141. package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.js +31 -0
  142. package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.js.map +1 -0
  143. package/dist/src/components/Fleet/ImportFleetWizard/steps/ReviewStep.js +37 -0
  144. package/dist/src/components/Fleet/ImportFleetWizard/steps/ReviewStep.js.map +1 -0
  145. package/dist/src/components/Fleet/ImportFleetWizard/types.js +3 -0
  146. package/dist/src/components/Fleet/ImportFleetWizard/types.js.map +1 -0
  147. package/dist/src/components/Fleet/ResourceSyncRow.js +36 -0
  148. package/dist/src/components/Fleet/ResourceSyncRow.js.map +1 -0
  149. package/dist/src/components/ListPage/ListPage.js +12 -0
  150. package/dist/src/components/ListPage/ListPage.js.map +1 -0
  151. package/dist/src/components/ListPage/ListPageActions.js +30 -0
  152. package/dist/src/components/ListPage/ListPageActions.js.map +1 -0
  153. package/dist/src/components/ListPage/ListPageBody.js +21 -0
  154. package/dist/src/components/ListPage/ListPageBody.js.map +1 -0
  155. package/dist/src/components/ListPage/types.js +3 -0
  156. package/dist/src/components/ListPage/types.js.map +1 -0
  157. package/dist/src/components/NavItem/NavItem.js +20 -0
  158. package/dist/src/components/NavItem/NavItem.js.map +1 -0
  159. package/dist/src/components/OverviewPage/Cards/Status/ApplicationStatusChart.js +30 -0
  160. package/dist/src/components/OverviewPage/Cards/Status/ApplicationStatusChart.js.map +1 -0
  161. package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js +32 -0
  162. package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js.map +1 -0
  163. package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +61 -0
  164. package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js.map +1 -0
  165. package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js +64 -0
  166. package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js.map +1 -0
  167. package/dist/src/components/OverviewPage/Cards/Status/SystemUpdateStatusChart.js +30 -0
  168. package/dist/src/components/OverviewPage/Cards/Status/SystemUpdateStatusChart.js.map +1 -0
  169. package/dist/src/components/OverviewPage/Cards/Status/utils.js +31 -0
  170. package/dist/src/components/OverviewPage/Cards/Status/utils.js.map +1 -0
  171. package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js +46 -0
  172. package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js.map +1 -0
  173. package/dist/src/components/OverviewPage/Overview.js +16 -0
  174. package/dist/src/components/OverviewPage/Overview.js.map +1 -0
  175. package/dist/src/components/OverviewPage/OverviewPage.js +17 -0
  176. package/dist/src/components/OverviewPage/OverviewPage.js.map +1 -0
  177. package/dist/src/components/Repository/CreateRepository/CreateRepository.js +102 -0
  178. package/dist/src/components/Repository/CreateRepository/CreateRepository.js.map +1 -0
  179. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.css +7 -0
  180. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +215 -0
  181. package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -0
  182. package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js +31 -0
  183. package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js.map +1 -0
  184. package/dist/src/components/Repository/CreateRepository/types.js +3 -0
  185. package/dist/src/components/Repository/CreateRepository/types.js.map +1 -0
  186. package/dist/src/components/Repository/CreateRepository/utils.js +454 -0
  187. package/dist/src/components/Repository/CreateRepository/utils.js.map +1 -0
  188. package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js +93 -0
  189. package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js.map +1 -0
  190. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js +39 -0
  191. package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js.map +1 -0
  192. package/dist/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.js +64 -0
  193. package/dist/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.js.map +1 -0
  194. package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js +18 -0
  195. package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js.map +1 -0
  196. package/dist/src/components/Repository/RepositoryDetails/RepositorySource.js +24 -0
  197. package/dist/src/components/Repository/RepositoryDetails/RepositorySource.js.map +1 -0
  198. package/dist/src/components/Repository/RepositoryDetails/RepositorySourceList.js +64 -0
  199. package/dist/src/components/Repository/RepositoryDetails/RepositorySourceList.js.map +1 -0
  200. package/dist/src/components/Repository/RepositoryList.js +133 -0
  201. package/dist/src/components/Repository/RepositoryList.js.map +1 -0
  202. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.css +7 -0
  203. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +140 -0
  204. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -0
  205. package/dist/src/components/ResourceSync/ResourceSyncStatus.js +65 -0
  206. package/dist/src/components/ResourceSync/ResourceSyncStatus.js.map +1 -0
  207. package/dist/src/components/ResourceSync/ResourceSyncToRepository.js +49 -0
  208. package/dist/src/components/ResourceSync/ResourceSyncToRepository.js.map +1 -0
  209. package/dist/src/components/Status/ApplicationStatus.js +23 -0
  210. package/dist/src/components/Status/ApplicationStatus.js.map +1 -0
  211. package/dist/src/components/Status/ApplicationSummaryStatus.js +23 -0
  212. package/dist/src/components/Status/ApplicationSummaryStatus.js.map +1 -0
  213. package/dist/src/components/Status/DeviceResourceStatus.js +84 -0
  214. package/dist/src/components/Status/DeviceResourceStatus.js.map +1 -0
  215. package/dist/src/components/Status/DeviceStatus.js +18 -0
  216. package/dist/src/components/Status/DeviceStatus.js.map +1 -0
  217. package/dist/src/components/Status/EnrollmentRequestStatus.js +18 -0
  218. package/dist/src/components/Status/EnrollmentRequestStatus.js.map +1 -0
  219. package/dist/src/components/Status/IntegrityStatus.js +17 -0
  220. package/dist/src/components/Status/IntegrityStatus.js.map +1 -0
  221. package/dist/src/components/Status/RepositoryStatus.js +37 -0
  222. package/dist/src/components/Status/RepositoryStatus.js.map +1 -0
  223. package/dist/src/components/Status/StatusDisplay.css +9 -0
  224. package/dist/src/components/Status/StatusDisplay.js +33 -0
  225. package/dist/src/components/Status/StatusDisplay.js.map +1 -0
  226. package/dist/src/components/Status/SystemUpdateStatus.js +24 -0
  227. package/dist/src/components/Status/SystemUpdateStatus.js.map +1 -0
  228. package/dist/src/components/Status/SystemdStatus.js +21 -0
  229. package/dist/src/components/Status/SystemdStatus.js.map +1 -0
  230. package/dist/src/components/Status/utils.js +10 -0
  231. package/dist/src/components/Status/utils.js.map +1 -0
  232. package/dist/src/components/Table/Table.js +28 -0
  233. package/dist/src/components/Table/Table.js.map +1 -0
  234. package/dist/src/components/Table/TableActions.js +16 -0
  235. package/dist/src/components/Table/TableActions.js.map +1 -0
  236. package/dist/src/components/Table/TableTextSearch.js +13 -0
  237. package/dist/src/components/Table/TableTextSearch.js.map +1 -0
  238. package/dist/src/components/Terminal/Terminal.css +1 -0
  239. package/dist/src/components/Terminal/Terminal.js +79 -0
  240. package/dist/src/components/Terminal/Terminal.js.map +1 -0
  241. package/dist/src/components/UserPreferences/UserPreferencesModal.js +34 -0
  242. package/dist/src/components/UserPreferences/UserPreferencesModal.js.map +1 -0
  243. package/dist/src/components/UserPreferences/UserPreferencesProvider.js +19 -0
  244. package/dist/src/components/UserPreferences/UserPreferencesProvider.js.map +1 -0
  245. package/dist/src/components/charts/DonutChart.css +10 -0
  246. package/dist/src/components/charts/DonutChart.js +47 -0
  247. package/dist/src/components/charts/DonutChart.js.map +1 -0
  248. package/dist/src/components/common/CopyButton.js +18 -0
  249. package/dist/src/components/common/CopyButton.js.map +1 -0
  250. package/dist/src/components/common/EditableLabelControl.js +39 -0
  251. package/dist/src/components/common/EditableLabelControl.js.map +1 -0
  252. package/dist/src/components/common/ErrorBoundary.js +36 -0
  253. package/dist/src/components/common/ErrorBoundary.js.map +1 -0
  254. package/dist/src/components/common/HelperTextItems.js +25 -0
  255. package/dist/src/components/common/HelperTextItems.js.map +1 -0
  256. package/dist/src/components/common/LabelsView.css +9 -0
  257. package/dist/src/components/common/LabelsView.js +18 -0
  258. package/dist/src/components/common/LabelsView.js.map +1 -0
  259. package/dist/src/components/common/LeaveFormConfirmation.js +51 -0
  260. package/dist/src/components/common/LeaveFormConfirmation.js.map +1 -0
  261. package/dist/src/components/common/ResourceLink.css +29 -0
  262. package/dist/src/components/common/ResourceLink.js +30 -0
  263. package/dist/src/components/common/ResourceLink.js.map +1 -0
  264. package/dist/src/components/common/ResourceListEmptyState.js +10 -0
  265. package/dist/src/components/common/ResourceListEmptyState.js.map +1 -0
  266. package/dist/src/components/common/WithHelperText.css +3 -0
  267. package/dist/src/components/common/WithHelperText.js +16 -0
  268. package/dist/src/components/common/WithHelperText.js.map +1 -0
  269. package/dist/src/components/common/WithTooltip.js +8 -0
  270. package/dist/src/components/common/WithTooltip.js.map +1 -0
  271. package/dist/src/components/form/CheckboxField.js +29 -0
  272. package/dist/src/components/form/CheckboxField.js.map +1 -0
  273. package/dist/src/components/form/FieldHelperText.js +27 -0
  274. package/dist/src/components/form/FieldHelperText.js.map +1 -0
  275. package/dist/src/components/form/FilterSelect.css +8 -0
  276. package/dist/src/components/form/FilterSelect.js +30 -0
  277. package/dist/src/components/form/FilterSelect.js.map +1 -0
  278. package/dist/src/components/form/FlightCtlActionGroup.css +9 -0
  279. package/dist/src/components/form/FlightCtlActionGroup.js +10 -0
  280. package/dist/src/components/form/FlightCtlActionGroup.js.map +1 -0
  281. package/dist/src/components/form/FlightCtlForm.js +13 -0
  282. package/dist/src/components/form/FlightCtlForm.js.map +1 -0
  283. package/dist/src/components/form/FormSelect.css +8 -0
  284. package/dist/src/components/form/FormSelect.js +50 -0
  285. package/dist/src/components/form/FormSelect.js.map +1 -0
  286. package/dist/src/components/form/LabelsField.js +61 -0
  287. package/dist/src/components/form/LabelsField.js.map +1 -0
  288. package/dist/src/components/form/NameField.js +63 -0
  289. package/dist/src/components/form/NameField.js.map +1 -0
  290. package/dist/src/components/form/RadioField.js +32 -0
  291. package/dist/src/components/form/RadioField.js.map +1 -0
  292. package/dist/src/components/form/RichValidationTextField.js +66 -0
  293. package/dist/src/components/form/RichValidationTextField.js.map +1 -0
  294. package/dist/src/components/form/TextAreaField.js +28 -0
  295. package/dist/src/components/form/TextAreaField.js.map +1 -0
  296. package/dist/src/components/form/TextField.js +29 -0
  297. package/dist/src/components/form/TextField.js.map +1 -0
  298. package/dist/src/components/form/validations.js +286 -0
  299. package/dist/src/components/form/validations.js.map +1 -0
  300. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.js +36 -0
  301. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.js.map +1 -0
  302. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js +43 -0
  303. package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js.map +1 -0
  304. package/dist/src/components/modals/ApproveDeviceModal/DeviceLabelMatch.css +24 -0
  305. package/dist/src/components/modals/ApproveDeviceModal/DeviceLabelMatch.js +62 -0
  306. package/dist/src/components/modals/ApproveDeviceModal/DeviceLabelMatch.js.map +1 -0
  307. package/dist/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.js +14 -0
  308. package/dist/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.js.map +1 -0
  309. package/dist/src/components/modals/DeleteModal/DeleteModal.js +41 -0
  310. package/dist/src/components/modals/DeleteModal/DeleteModal.js.map +1 -0
  311. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +63 -0
  312. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -0
  313. package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.css +4 -0
  314. package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js +126 -0
  315. package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js.map +1 -0
  316. package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js +64 -0
  317. package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js.map +1 -0
  318. package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js +84 -0
  319. package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js.map +1 -0
  320. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js +94 -0
  321. package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js.map +1 -0
  322. package/dist/src/components/modals/massModals/MassDeleteResourceSyncModal/MassDeleteResourceSyncModal.js +62 -0
  323. package/dist/src/components/modals/massModals/MassDeleteResourceSyncModal/MassDeleteResourceSyncModal.js.map +1 -0
  324. package/dist/src/constants.js +8 -0
  325. package/dist/src/constants.js.map +1 -0
  326. package/dist/src/hooks/useAppContext.js +61 -0
  327. package/dist/src/hooks/useAppContext.js.map +1 -0
  328. package/dist/src/hooks/useDeviceLabelMatch.js +78 -0
  329. package/dist/src/hooks/useDeviceLabelMatch.js.map +1 -0
  330. package/dist/src/hooks/useDocumentTitle.js +17 -0
  331. package/dist/src/hooks/useDocumentTitle.js.map +1 -0
  332. package/dist/src/hooks/useFetch.js +10 -0
  333. package/dist/src/hooks/useFetch.js.map +1 -0
  334. package/dist/src/hooks/useFetchPeriodically.js +75 -0
  335. package/dist/src/hooks/useFetchPeriodically.js.map +1 -0
  336. package/dist/src/hooks/useNavigate.js +65 -0
  337. package/dist/src/hooks/useNavigate.js.map +1 -0
  338. package/dist/src/hooks/useTableSelect.js +45 -0
  339. package/dist/src/hooks/useTableSelect.js.map +1 -0
  340. package/dist/src/hooks/useTableSort.js +38 -0
  341. package/dist/src/hooks/useTableSort.js.map +1 -0
  342. package/dist/src/hooks/useTableTextSearch.js +23 -0
  343. package/dist/src/hooks/useTableTextSearch.js.map +1 -0
  344. package/dist/src/hooks/useTemplateVersion.js +22 -0
  345. package/dist/src/hooks/useTemplateVersion.js.map +1 -0
  346. package/dist/src/hooks/useThemePreferences.js +61 -0
  347. package/dist/src/hooks/useThemePreferences.js.map +1 -0
  348. package/dist/src/hooks/useTranslation.js +12 -0
  349. package/dist/src/hooks/useTranslation.js.map +1 -0
  350. package/dist/src/hooks/useUserPreferences.js +16 -0
  351. package/dist/src/hooks/useUserPreferences.js.map +1 -0
  352. package/dist/src/hooks/useWebSocket.js +69 -0
  353. package/dist/src/hooks/useWebSocket.js.map +1 -0
  354. package/dist/src/setupTests.js +24 -0
  355. package/dist/src/setupTests.js.map +1 -0
  356. package/dist/src/tests/test-utils.js +21 -0
  357. package/dist/src/tests/test-utils.js.map +1 -0
  358. package/dist/src/types/deviceSpec.js +20 -0
  359. package/dist/src/types/deviceSpec.js.map +1 -0
  360. package/dist/src/types/extraTypes.js +20 -0
  361. package/dist/src/types/extraTypes.js.map +1 -0
  362. package/dist/src/types/typeUtils.js +12 -0
  363. package/dist/src/types/typeUtils.js.map +1 -0
  364. package/dist/src/utils/api.js +68 -0
  365. package/dist/src/utils/api.js.map +1 -0
  366. package/dist/src/utils/dates.js +53 -0
  367. package/dist/src/utils/dates.js.map +1 -0
  368. package/dist/src/utils/devices.js +37 -0
  369. package/dist/src/utils/devices.js.map +1 -0
  370. package/dist/src/utils/error.js +25 -0
  371. package/dist/src/utils/error.js.map +1 -0
  372. package/dist/src/utils/labels.js +44 -0
  373. package/dist/src/utils/labels.js.map +1 -0
  374. package/dist/src/utils/metrics.js +48 -0
  375. package/dist/src/utils/metrics.js.map +1 -0
  376. package/dist/src/utils/patch.js +108 -0
  377. package/dist/src/utils/patch.js.map +1 -0
  378. package/dist/src/utils/resource.js +6 -0
  379. package/dist/src/utils/resource.js.map +1 -0
  380. package/dist/src/utils/search.js +14 -0
  381. package/dist/src/utils/search.js.map +1 -0
  382. package/dist/src/utils/sort/device.js +89 -0
  383. package/dist/src/utils/sort/device.js.map +1 -0
  384. package/dist/src/utils/sort/fleet.js +20 -0
  385. package/dist/src/utils/sort/fleet.js.map +1 -0
  386. package/dist/src/utils/sort/generic.js +34 -0
  387. package/dist/src/utils/sort/generic.js.map +1 -0
  388. package/dist/src/utils/sort/repository.js +28 -0
  389. package/dist/src/utils/sort/repository.js.map +1 -0
  390. package/dist/src/utils/sort/resourceSync.js +29 -0
  391. package/dist/src/utils/sort/resourceSync.js.map +1 -0
  392. package/dist/src/utils/status/applications.js +56 -0
  393. package/dist/src/utils/status/applications.js.map +1 -0
  394. package/dist/src/utils/status/common.js +63 -0
  395. package/dist/src/utils/status/common.js.map +1 -0
  396. package/dist/src/utils/status/devices.js +65 -0
  397. package/dist/src/utils/status/devices.js.map +1 -0
  398. package/dist/src/utils/status/enrollmentRequest.js +49 -0
  399. package/dist/src/utils/status/enrollmentRequest.js.map +1 -0
  400. package/dist/src/utils/status/fleet.js +38 -0
  401. package/dist/src/utils/status/fleet.js.map +1 -0
  402. package/dist/src/utils/status/integrity.js +28 -0
  403. package/dist/src/utils/status/integrity.js.map +1 -0
  404. package/dist/src/utils/status/repository.js +88 -0
  405. package/dist/src/utils/status/repository.js.map +1 -0
  406. package/dist/src/utils/status/system.js +29 -0
  407. package/dist/src/utils/status/system.js.map +1 -0
  408. package/package.json +48 -0
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const React = tslib_1.__importStar(require("react"));
5
+ const formik_1 = require("formik");
6
+ const react_core_1 = require("@patternfly/react-core");
7
+ const minus_circle_icon_1 = require("@patternfly/react-icons/dist/js/icons/minus-circle-icon");
8
+ const plus_circle_icon_1 = require("@patternfly/react-icons/dist/js/icons/plus-circle-icon");
9
+ const useTranslation_1 = require("../../../hooks/useTranslation");
10
+ const TextField_1 = tslib_1.__importDefault(require("../../form/TextField"));
11
+ const WithHelperText_1 = tslib_1.__importDefault(require("../../common/WithHelperText"));
12
+ const NameField_1 = tslib_1.__importDefault(require("../../form/NameField"));
13
+ const validations_1 = require("../../form/validations");
14
+ const CreateResourceSyncsForm = () => {
15
+ const { t } = (0, useTranslation_1.useTranslation)();
16
+ const { values } = (0, formik_1.useFormikContext)();
17
+ return (React.createElement(formik_1.FieldArray, { name: "resourceSyncs" }, ({ remove, push }) => (React.createElement(React.Fragment, null,
18
+ values.resourceSyncs.map((resourceSync, index) => (React.createElement(react_core_1.FormSection, { key: index },
19
+ React.createElement(NameField_1.default, { name: `resourceSyncs[${index}].name`, "aria-label": t('Resource sync name'), value: resourceSync.name, isRequired: true, isDisabled: resourceSync.exists, resourceType: "resourcesyncs", validations: (0, validations_1.getDnsSubdomainValidations)(t) }),
20
+ React.createElement(react_core_1.FormGroup, { label: t('Target revision'), isRequired: true, labelIcon: React.createElement(WithHelperText_1.default, { ariaLabel: t('Target revision'), content: t('Name of a branch or a tag.') }) },
21
+ React.createElement(TextField_1.default, { name: `resourceSyncs[${index}].targetRevision`, "aria-label": t('Target revision'), value: resourceSync.targetRevision, helperText: t('For example: main') })),
22
+ React.createElement(react_core_1.FormGroup, { label: t('Path'), isRequired: true, labelIcon: React.createElement(WithHelperText_1.default, { ariaLabel: t('Path'), content: t('The absolute path of a file or directory in the repository. If a directory, the directory should contain only resource definitions with no subdirectories.') }) },
23
+ React.createElement(TextField_1.default, { name: `resourceSyncs[${index}].path`, "aria-label": t('Path'), value: resourceSync.path, helperText: t('For example: {{exampleFile}}', {
24
+ exampleFile: '/demos/basic-nginx-demo/deployment/fleet.yaml',
25
+ }) })),
26
+ React.createElement(react_core_1.FormGroup, { isInline: true }, values.resourceSyncs.length > 1 && (React.createElement(react_core_1.Button, { variant: "link", icon: React.createElement(minus_circle_icon_1.MinusCircleIcon, null), iconPosition: "left", onClick: () => remove(index) }, t('Remove resource sync'))))))),
27
+ React.createElement("div", null,
28
+ React.createElement(react_core_1.Button, { variant: "link", icon: React.createElement(plus_circle_icon_1.PlusCircleIcon, null), iconPosition: "left", onClick: () => push({ name: '', path: '', targetRevision: '' }) }, t('Add another resource sync')))))));
29
+ };
30
+ exports.default = CreateResourceSyncsForm;
31
+ //# sourceMappingURL=CreateResourceSyncsForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateResourceSyncsForm.js","sourceRoot":"","sources":["../../../../../src/components/Repository/CreateRepository/CreateResourceSyncsForm.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,mCAAsD;AACtD,uDAAwE;AACxE,+FAA0F;AAC1F,6FAAwF;AACxF,kEAA+D;AAE/D,6EAA6C;AAC7C,yFAAyD;AAEzD,6EAA6C;AAC7C,wDAAoE;AAEpE,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACnC,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IAC/B,MAAM,EAAE,MAAM,EAA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AK,EAAE,YAAY,CAAC,IAAI,EACxB,UAAU,EAAE,CAAC,CAAC,8BAA8B,EAAE;wBAC5C,WAAW,EAAE,+CAA+C;qBAC7D,CAAC,GACF,CACQ;YACZ,oBAAC,sBAAS,IAAC,QAAQ,UAChB,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAClC,oBAAC,mBAAM,IAAC,OAAO,EAAC,MAAM,EAAC,IAAI,EAAE,oBAAC,mCAAe,OAAG,EAAE,YAAY,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAC/F,CAAC,CAAC,sBAAsB,CAAC,CACnB,CACV,CACS,CACA,CACf,CAAC;QACF;YACE,oBAAC,mBAAM,IACL,OAAO,EAAC,MAAM,EACd,IAAI,EAAE,oBAAC,iCAAc,OAAG,EACxB,YAAY,EAAC,MAAM,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAA2B,CAAC,IAEvF,CAAC,CAAC,2BAA2B,CAAC,CACxB,CACL,CACL,CACJ,CACU,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,uBAAuB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/components/Repository/CreateRepository/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,454 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handlePromises = exports.getResourceSync = exports.getRepository = exports.repositorySchema = exports.repoSyncSchema = exports.getResourceSyncEditPatch = exports.getRepositoryPatches = exports.getInitValues = exports.isSshRepoSpec = exports.isHttpRepoSpec = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Yup = tslib_1.__importStar(require("yup"));
6
+ const types_1 = require("@flightctl/types");
7
+ const constants_1 = require("../../../constants");
8
+ const error_1 = require("../../../utils/error");
9
+ const patch_1 = require("../../../utils/patch");
10
+ const validations_1 = require("../../form/validations");
11
+ const MAX_PATH_LENGTH = 2048;
12
+ const gitRepoUrlRegex = new RegExp(/^((http|git|ssh|http(s)|file|\/?)|(git@[\w.]+))(:(\/\/)?)([\w.@:/\-~]+)(\.git)?(\/)?$/);
13
+ const httpRepoUrlRegex = /^(http|https)/;
14
+ const pathRegex = /\/.+/;
15
+ const jwtTokenRegexp = /^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$/;
16
+ const isHttpRepoSpec = (repoSpec) => !!repoSpec['httpConfig'];
17
+ exports.isHttpRepoSpec = isHttpRepoSpec;
18
+ const isSshRepoSpec = (repoSpec) => !!repoSpec['sshConfig'];
19
+ exports.isSshRepoSpec = isSshRepoSpec;
20
+ const getInitValues = ({ repository, resourceSyncs, options, }) => {
21
+ var _a, _b, _c, _d;
22
+ const useRSs = (_a = options === null || options === void 0 ? void 0 : options.canUseResourceSyncs) !== null && _a !== void 0 ? _a : true;
23
+ if (!repository) {
24
+ const selectedRepoType = ((_b = options === null || options === void 0 ? void 0 : options.allowedRepoTypes) === null || _b === void 0 ? void 0 : _b.length) === 1 ? options.allowedRepoTypes[0] : types_1.RepoSpecType.GIT;
25
+ return {
26
+ exists: false,
27
+ repoType: selectedRepoType,
28
+ allowedRepoTypes: options === null || options === void 0 ? void 0 : options.allowedRepoTypes,
29
+ showRepoTypes: (_c = options === null || options === void 0 ? void 0 : options.showRepoTypes) !== null && _c !== void 0 ? _c : true,
30
+ name: '',
31
+ url: '',
32
+ useAdvancedConfig: false,
33
+ configType: 'http',
34
+ canUseResourceSyncs: useRSs,
35
+ useResourceSyncs: useRSs,
36
+ resourceSyncs: [
37
+ {
38
+ name: '',
39
+ path: '',
40
+ targetRevision: '',
41
+ },
42
+ ],
43
+ };
44
+ }
45
+ const formValues = {
46
+ exists: true,
47
+ name: repository.metadata.name || '',
48
+ url: repository.spec.url || '',
49
+ repoType: repository.spec.type,
50
+ allowedRepoTypes: options === null || options === void 0 ? void 0 : options.allowedRepoTypes,
51
+ showRepoTypes: (_d = options === null || options === void 0 ? void 0 : options.showRepoTypes) !== null && _d !== void 0 ? _d : true,
52
+ useResourceSyncs: !!(resourceSyncs === null || resourceSyncs === void 0 ? void 0 : resourceSyncs.length),
53
+ useAdvancedConfig: false,
54
+ configType: 'http',
55
+ canUseResourceSyncs: useRSs,
56
+ resourceSyncs: (resourceSyncs === null || resourceSyncs === void 0 ? void 0 : resourceSyncs.length)
57
+ ? resourceSyncs
58
+ .filter((rs) => rs.spec.repository === repository.metadata.name)
59
+ .map((rs) => ({
60
+ name: rs.metadata.name || '',
61
+ path: rs.spec.path || '',
62
+ targetRevision: rs.spec.targetRevision || '',
63
+ exists: true,
64
+ }))
65
+ : [{ name: '', path: '', targetRevision: '' }],
66
+ };
67
+ if ((0, exports.isHttpRepoSpec)(repository.spec)) {
68
+ formValues.useAdvancedConfig = true;
69
+ formValues.configType = 'http';
70
+ formValues.httpConfig = {
71
+ caCrt: repository.spec.httpConfig['ca.crt'] ? atob(repository.spec.httpConfig['ca.crt']) : undefined,
72
+ basicAuth: {
73
+ username: repository.spec.httpConfig.username,
74
+ password: repository.spec.httpConfig.password,
75
+ use: !!repository.spec.httpConfig.username || !!repository.spec.httpConfig.password,
76
+ },
77
+ mTlsAuth: {
78
+ tlsCrt: repository.spec.httpConfig['tls.crt'],
79
+ tlsKey: repository.spec.httpConfig['tls.key'],
80
+ use: !!repository.spec.httpConfig['tls.crt'] || !!repository.spec.httpConfig['tls.key'],
81
+ },
82
+ skipServerVerification: repository.spec.httpConfig.skipServerVerification,
83
+ token: repository.spec.httpConfig.token,
84
+ };
85
+ }
86
+ else if ((0, exports.isSshRepoSpec)(repository.spec)) {
87
+ formValues.useAdvancedConfig = true;
88
+ formValues.configType = 'ssh';
89
+ formValues.sshConfig = {
90
+ privateKeyPassphrase: repository.spec.sshConfig.privateKeyPassphrase,
91
+ skipServerVerification: repository.spec.sshConfig.skipServerVerification,
92
+ sshPrivateKey: repository.spec.sshConfig.sshPrivateKey,
93
+ };
94
+ }
95
+ return formValues;
96
+ };
97
+ exports.getInitValues = getInitValues;
98
+ const getRepositoryPatches = (values, repository) => {
99
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
100
+ const patches = [];
101
+ (0, patch_1.appendJSONPatch)({
102
+ patches,
103
+ newValue: values.repoType,
104
+ originalValue: repository.spec.type,
105
+ path: '/spec/type',
106
+ });
107
+ (0, patch_1.appendJSONPatch)({
108
+ patches,
109
+ newValue: values.url,
110
+ originalValue: repository.spec.url,
111
+ path: '/spec/url',
112
+ });
113
+ if (!values.useAdvancedConfig) {
114
+ if ((0, exports.isHttpRepoSpec)(repository.spec)) {
115
+ patches.push({
116
+ op: 'remove',
117
+ path: '/spec/httpConfig',
118
+ });
119
+ }
120
+ if ((0, exports.isSshRepoSpec)(repository.spec)) {
121
+ patches.push({
122
+ op: 'remove',
123
+ path: '/spec/sshConfig',
124
+ });
125
+ }
126
+ return patches;
127
+ }
128
+ if (values.configType === 'http') {
129
+ if ((0, exports.isSshRepoSpec)(repository.spec)) {
130
+ patches.push({
131
+ op: 'remove',
132
+ path: '/spec/sshConfig',
133
+ });
134
+ }
135
+ if (!(0, exports.isHttpRepoSpec)(repository.spec)) {
136
+ const value = {
137
+ skipServerVerification: (_a = values.httpConfig) === null || _a === void 0 ? void 0 : _a.skipServerVerification,
138
+ };
139
+ if (((_b = values.httpConfig) === null || _b === void 0 ? void 0 : _b.caCrt) && !value.skipServerVerification) {
140
+ value['ca.crt'] = btoa(values.httpConfig.caCrt);
141
+ }
142
+ if ((_d = (_c = values.httpConfig) === null || _c === void 0 ? void 0 : _c.basicAuth) === null || _d === void 0 ? void 0 : _d.use) {
143
+ value.password = values.httpConfig.basicAuth.password;
144
+ value.username = values.httpConfig.basicAuth.username;
145
+ }
146
+ if ((_f = (_e = values.httpConfig) === null || _e === void 0 ? void 0 : _e.mTlsAuth) === null || _f === void 0 ? void 0 : _f.use) {
147
+ if (values.httpConfig.mTlsAuth.tlsCrt) {
148
+ value['tls.crt'] = btoa(values.httpConfig.mTlsAuth.tlsCrt);
149
+ }
150
+ if (values.httpConfig.mTlsAuth.tlsKey) {
151
+ value['tls.key'] = btoa(values.httpConfig.mTlsAuth.tlsKey);
152
+ }
153
+ }
154
+ if ((_g = values.httpConfig) === null || _g === void 0 ? void 0 : _g.token) {
155
+ value.token = values.httpConfig.token;
156
+ }
157
+ patches.push({
158
+ op: 'add',
159
+ path: '/spec/httpConfig',
160
+ value,
161
+ });
162
+ }
163
+ else {
164
+ (0, patch_1.appendJSONPatch)({
165
+ patches,
166
+ newValue: (_h = values.httpConfig) === null || _h === void 0 ? void 0 : _h.skipServerVerification,
167
+ originalValue: repository.spec.httpConfig.skipServerVerification,
168
+ path: '/spec/httpConfig/skipServerVerification',
169
+ });
170
+ if ((_j = values.httpConfig) === null || _j === void 0 ? void 0 : _j.skipServerVerification) {
171
+ if (repository.spec.httpConfig['ca.crt']) {
172
+ patches.push({
173
+ op: 'remove',
174
+ path: '/spec/httpConfig/ca.crt',
175
+ });
176
+ }
177
+ }
178
+ else {
179
+ const caCrt = (_k = values.httpConfig) === null || _k === void 0 ? void 0 : _k.caCrt;
180
+ (0, patch_1.appendJSONPatch)({
181
+ patches,
182
+ newValue: caCrt ? btoa(caCrt) : caCrt,
183
+ originalValue: repository.spec.httpConfig['ca.crt'],
184
+ path: '/spec/httpConfig/ca.crt',
185
+ });
186
+ }
187
+ if (!((_m = (_l = values.httpConfig) === null || _l === void 0 ? void 0 : _l.basicAuth) === null || _m === void 0 ? void 0 : _m.use)) {
188
+ if (repository.spec.httpConfig.password) {
189
+ patches.push({
190
+ op: 'remove',
191
+ path: '/spec/httpConfig/password',
192
+ });
193
+ }
194
+ if (repository.spec.httpConfig.username) {
195
+ patches.push({
196
+ op: 'remove',
197
+ path: '/spec/httpConfig/username',
198
+ });
199
+ }
200
+ }
201
+ else {
202
+ (0, patch_1.appendJSONPatch)({
203
+ patches,
204
+ newValue: (_o = values.httpConfig) === null || _o === void 0 ? void 0 : _o.basicAuth.password,
205
+ originalValue: repository.spec.httpConfig.password,
206
+ path: '/spec/httpConfig/password',
207
+ });
208
+ (0, patch_1.appendJSONPatch)({
209
+ patches,
210
+ newValue: (_p = values.httpConfig) === null || _p === void 0 ? void 0 : _p.basicAuth.username,
211
+ originalValue: repository.spec.httpConfig.username,
212
+ path: '/spec/httpConfig/username',
213
+ });
214
+ }
215
+ if (!((_r = (_q = values.httpConfig) === null || _q === void 0 ? void 0 : _q.mTlsAuth) === null || _r === void 0 ? void 0 : _r.use)) {
216
+ if (repository.spec.httpConfig['tls.crt']) {
217
+ patches.push({
218
+ op: 'remove',
219
+ path: '/spec/httpConfig/tls.crt',
220
+ });
221
+ }
222
+ if (repository.spec.httpConfig['tls.key']) {
223
+ patches.push({
224
+ op: 'remove',
225
+ path: '/spec/httpConfig/tls.key',
226
+ });
227
+ }
228
+ }
229
+ else {
230
+ (0, patch_1.appendJSONPatch)({
231
+ patches,
232
+ newValue: (_s = values.httpConfig) === null || _s === void 0 ? void 0 : _s.mTlsAuth.tlsCrt,
233
+ originalValue: repository.spec.httpConfig['tls.crt'],
234
+ path: '/spec/httpConfig/tls.crt',
235
+ encodeB64: true,
236
+ });
237
+ (0, patch_1.appendJSONPatch)({
238
+ patches,
239
+ newValue: (_t = values.httpConfig) === null || _t === void 0 ? void 0 : _t.mTlsAuth.tlsKey,
240
+ originalValue: repository.spec.httpConfig['tls.key'],
241
+ path: '/spec/httpConfig/tls.key',
242
+ encodeB64: true,
243
+ });
244
+ }
245
+ if (!((_u = values.httpConfig) === null || _u === void 0 ? void 0 : _u.token)) {
246
+ if (repository.spec.httpConfig.token) {
247
+ patches.push({
248
+ op: 'remove',
249
+ path: '/spec/httpConfig/token',
250
+ });
251
+ }
252
+ }
253
+ else {
254
+ (0, patch_1.appendJSONPatch)({
255
+ patches,
256
+ newValue: (_v = values.httpConfig) === null || _v === void 0 ? void 0 : _v.token,
257
+ originalValue: repository.spec.httpConfig.token,
258
+ path: '/spec/httpConfig/token',
259
+ });
260
+ }
261
+ }
262
+ }
263
+ else if (values.configType === 'ssh') {
264
+ if ((0, exports.isHttpRepoSpec)(repository.spec)) {
265
+ patches.push({
266
+ op: 'remove',
267
+ path: '/spec/httpConfig',
268
+ });
269
+ }
270
+ if (!(0, exports.isSshRepoSpec)(repository.spec)) {
271
+ const value = {
272
+ privateKeyPassphrase: (_w = values.sshConfig) === null || _w === void 0 ? void 0 : _w.privateKeyPassphrase,
273
+ skipServerVerification: (_x = values.sshConfig) === null || _x === void 0 ? void 0 : _x.skipServerVerification,
274
+ };
275
+ if ((_y = values.sshConfig) === null || _y === void 0 ? void 0 : _y.sshPrivateKey) {
276
+ value.sshPrivateKey = btoa(values.sshConfig.sshPrivateKey);
277
+ }
278
+ patches.push({
279
+ op: 'add',
280
+ path: '/spec/sshConfig',
281
+ value,
282
+ });
283
+ }
284
+ else {
285
+ (0, patch_1.appendJSONPatch)({
286
+ patches,
287
+ newValue: (_z = values.sshConfig) === null || _z === void 0 ? void 0 : _z.privateKeyPassphrase,
288
+ originalValue: repository.spec.sshConfig.privateKeyPassphrase,
289
+ path: '/spec/sshConfig/privateKeyPassphrase',
290
+ });
291
+ (0, patch_1.appendJSONPatch)({
292
+ patches,
293
+ newValue: (_0 = values.sshConfig) === null || _0 === void 0 ? void 0 : _0.skipServerVerification,
294
+ originalValue: repository.spec.sshConfig.skipServerVerification,
295
+ path: '/spec/sshConfig/skipServerVerification',
296
+ });
297
+ (0, patch_1.appendJSONPatch)({
298
+ patches,
299
+ newValue: (_1 = values.sshConfig) === null || _1 === void 0 ? void 0 : _1.sshPrivateKey,
300
+ originalValue: repository.spec.sshConfig.sshPrivateKey,
301
+ path: '/spec/sshConfig/sshPrivateKey',
302
+ encodeB64: true,
303
+ });
304
+ }
305
+ }
306
+ return patches;
307
+ };
308
+ exports.getRepositoryPatches = getRepositoryPatches;
309
+ const getResourceSyncEditPatch = (rs) => {
310
+ // The patch is always an edition because adding / deleting RS can only be done via POST / DELETE api calls.
311
+ return [
312
+ {
313
+ op: 'replace',
314
+ path: '/spec/path',
315
+ value: rs.path,
316
+ },
317
+ {
318
+ op: 'replace',
319
+ path: '/spec/targetRevision',
320
+ value: rs.targetRevision,
321
+ },
322
+ ];
323
+ };
324
+ exports.getResourceSyncEditPatch = getResourceSyncEditPatch;
325
+ const repoSyncSchema = (t, values) => {
326
+ return Yup.array()
327
+ .of(Yup.object().shape({
328
+ name: (0, validations_1.validKubernetesDnsSubdomain)(t, { isRequired: true }).test('Must be unique', t('Must be unique'), (value) => {
329
+ if (!value) {
330
+ return true;
331
+ }
332
+ return values.filter((v) => v.name === value).length === 1;
333
+ }),
334
+ targetRevision: (0, validations_1.maxLengthString)(t, {
335
+ maxLength: validations_1.MAX_TARGET_REVISION_LENGTH,
336
+ fieldName: t('Target revision'),
337
+ }).defined(t('Target revision is required.')),
338
+ path: (0, validations_1.maxLengthString)(t, { maxLength: MAX_PATH_LENGTH, fieldName: t('Path') })
339
+ .matches(pathRegex, t('Must be an absolute path.'))
340
+ .defined(t('Path is required.')),
341
+ }))
342
+ .required();
343
+ };
344
+ exports.repoSyncSchema = repoSyncSchema;
345
+ const repositorySchema = (t, repository) => (values) => {
346
+ var _a, _b, _c, _d, _e, _f, _g, _h;
347
+ return Yup.object({
348
+ name: (0, validations_1.validKubernetesDnsSubdomain)(t, { isRequired: !repository }),
349
+ url: Yup.string().when('repoType', {
350
+ is: (repoType) => repoType === types_1.RepoSpecType.GIT,
351
+ then: () => Yup.string()
352
+ .matches(gitRepoUrlRegex, t('Enter a valid repository URL. Example: https://github.com/flightctl/flightctl-demos'))
353
+ .defined(t('Repository URL is required')),
354
+ otherwise: () => Yup.string()
355
+ .matches(httpRepoUrlRegex, t('Enter a valid HTTP service URL. Example: https://my-service-url'))
356
+ .defined(t('HTTP service URL is required')),
357
+ }),
358
+ configType: values.useAdvancedConfig ? Yup.string().required(t('Repository type is required')) : Yup.string(),
359
+ httpConfig: Yup.object({
360
+ basicAuth: Yup.object({
361
+ username: ((_b = (_a = values.httpConfig) === null || _a === void 0 ? void 0 : _a.basicAuth) === null || _b === void 0 ? void 0 : _b.use) ? Yup.string().required(t('Username is required')) : Yup.string(),
362
+ password: ((_d = (_c = values.httpConfig) === null || _c === void 0 ? void 0 : _c.basicAuth) === null || _d === void 0 ? void 0 : _d.use) ? Yup.string().required(t('Password is required')) : Yup.string(),
363
+ }),
364
+ mTlsAuth: Yup.object({
365
+ tlsCrt: ((_f = (_e = values.httpConfig) === null || _e === void 0 ? void 0 : _e.mTlsAuth) === null || _f === void 0 ? void 0 : _f.use)
366
+ ? Yup.string().required(t('Client TLS certificate is required'))
367
+ : Yup.string(),
368
+ tlsKey: ((_h = (_g = values.httpConfig) === null || _g === void 0 ? void 0 : _g.mTlsAuth) === null || _h === void 0 ? void 0 : _h.use)
369
+ ? Yup.string().required(t('Client TLS key is required'))
370
+ : Yup.string(),
371
+ }),
372
+ token: Yup.string().matches(jwtTokenRegexp, t('Must be a valid JWT token')),
373
+ }),
374
+ useResourceSyncs: Yup.boolean(),
375
+ resourceSyncs: values.useResourceSyncs ? (0, exports.repoSyncSchema)(t, values.resourceSyncs) : Yup.array(),
376
+ });
377
+ };
378
+ exports.repositorySchema = repositorySchema;
379
+ const getRepository = (values) => {
380
+ var _a, _b;
381
+ const spec = {
382
+ url: values.url,
383
+ type: values.repoType,
384
+ };
385
+ if (values.configType === 'http' && values.httpConfig) {
386
+ const httpRepoSpec = spec;
387
+ httpRepoSpec.httpConfig = {
388
+ skipServerVerification: values.httpConfig.skipServerVerification,
389
+ };
390
+ const caCrt = values.httpConfig.caCrt;
391
+ if (caCrt && !values.httpConfig.skipServerVerification) {
392
+ httpRepoSpec.httpConfig['ca.crt'] = btoa(caCrt);
393
+ }
394
+ if ((_a = values.httpConfig.basicAuth) === null || _a === void 0 ? void 0 : _a.use) {
395
+ httpRepoSpec.httpConfig.username = values.httpConfig.basicAuth.username;
396
+ httpRepoSpec.httpConfig.password = values.httpConfig.basicAuth.password;
397
+ }
398
+ if ((_b = values.httpConfig.mTlsAuth) === null || _b === void 0 ? void 0 : _b.use) {
399
+ const tlsCrt = values.httpConfig.mTlsAuth.tlsCrt;
400
+ if (tlsCrt) {
401
+ httpRepoSpec.httpConfig['tls.crt'] = btoa(tlsCrt);
402
+ }
403
+ const tlsKey = values.httpConfig.mTlsAuth.tlsKey;
404
+ if (tlsKey) {
405
+ httpRepoSpec.httpConfig['tls.key'] = btoa(tlsKey);
406
+ }
407
+ }
408
+ if (spec.type === types_1.RepoSpecType.HTTP && values.httpConfig.token) {
409
+ httpRepoSpec.httpConfig.token = values.httpConfig.token;
410
+ }
411
+ }
412
+ else if (values.configType === 'ssh' && values.sshConfig) {
413
+ const sshRepoSpec = spec;
414
+ sshRepoSpec.sshConfig = {
415
+ privateKeyPassphrase: values.sshConfig.privateKeyPassphrase,
416
+ skipServerVerification: values.sshConfig.skipServerVerification,
417
+ };
418
+ const sshPrivateKey = values.sshConfig.sshPrivateKey;
419
+ if (sshPrivateKey) {
420
+ sshRepoSpec.sshConfig.sshPrivateKey = btoa(sshPrivateKey);
421
+ }
422
+ }
423
+ return {
424
+ apiVersion: constants_1.API_VERSION,
425
+ kind: 'Repository',
426
+ metadata: {
427
+ name: values.name,
428
+ },
429
+ spec,
430
+ };
431
+ };
432
+ exports.getRepository = getRepository;
433
+ const getResourceSync = (repositoryId, values) => {
434
+ return {
435
+ apiVersion: constants_1.API_VERSION,
436
+ kind: 'ResourceSync',
437
+ metadata: {
438
+ name: values.name,
439
+ },
440
+ spec: {
441
+ repository: repositoryId,
442
+ targetRevision: values.targetRevision,
443
+ path: values.path,
444
+ },
445
+ };
446
+ };
447
+ exports.getResourceSync = getResourceSync;
448
+ const handlePromises = (promises) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
449
+ const results = yield Promise.allSettled(promises);
450
+ const failedPromises = results.filter((r) => r.status === 'rejected');
451
+ return failedPromises.map((fp) => (0, error_1.getErrorMessage)(fp.reason));
452
+ });
453
+ exports.handlePromises = handlePromises;
454
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/components/Repository/CreateRepository/utils.ts"],"names":[],"mappings":";;;;AAAA,iDAA2B;AAE3B,4CAU0B;AAG1B,kDAAiD;AACjD,gDAAuD;AACvD,gDAAuD;AACvD,wDAAkH;AAElH,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,eAAe,GAAG,IAAI,MAAM,CAChC,uFAAuF,CACxF,CAAC;AACF,MAAM,gBAAgB,GAAG,eAAe,CAAC;AACzC,MAAM,SAAS,GAAG,MAAM,CAAC;AACzB,MAAM,cAAc,GAAG,yDAAyD,CAAC;AAE1E,MAAM,cAAc,GAAG,CAAC,QAAwB,EAA4B,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAAlG,QAAA,cAAc,kBAAoF;AACxG,MAAM,aAAa,GAAG,CAAC,QAAwB,EAA2B,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAA/F,QAAA,aAAa,iBAAkF;AAErG,MAAM,aAAa,GAAG,CAAC,EAC5B,UAAU,EACV,aAAa,EACb,OAAO,GASR,EAAwB,EAAE;;IACzB,MAAM,MAAM,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB,mCAAI,IAAI,CAAC;IAEpD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,gBAAgB,GAAG,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,0C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A,cAAc,kBAIzB"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const React = tslib_1.__importStar(require("react"));
5
+ const react_1 = require("react");
6
+ const react_core_1 = require("@patternfly/react-core");
7
+ const error_1 = require("../../../utils/error");
8
+ const useFetch_1 = require("../../../hooks/useFetch");
9
+ const react_i18next_1 = require("react-i18next");
10
+ const useTranslation_1 = require("../../../hooks/useTranslation");
11
+ const DeleteRepositoryModal = ({ repositoryId, onClose, onDeleteSuccess }) => {
12
+ const { t } = (0, useTranslation_1.useTranslation)();
13
+ const { get, remove } = (0, useFetch_1.useFetch)();
14
+ const [isDeleting, setIsDeleting] = React.useState(false);
15
+ const [error, setError] = React.useState();
16
+ const [rsError, setRsError] = React.useState();
17
+ const [message, setMessage] = React.useState();
18
+ const [resourceSyncIds, setResourceSyncIds] = React.useState();
19
+ const isLoadingRSs = resourceSyncIds === undefined;
20
+ const hasResourceSyncs = !isLoadingRSs && resourceSyncIds.length > 0;
21
+ const deleteRepositoryAndResourceSyncs = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
22
+ const toDeleteRSs = (resourceSyncIds === null || resourceSyncIds === void 0 ? void 0 : resourceSyncIds.length) || 0;
23
+ let deletedCount = 0;
24
+ if (toDeleteRSs > 0) {
25
+ setMessage(t('Deleting {{count}} resource sync', { count: toDeleteRSs }));
26
+ const promises = (resourceSyncIds || []).map((id) => remove(`resourcesyncs/${id}`));
27
+ const results = yield Promise.allSettled(promises);
28
+ deletedCount = results.filter((result) => result.status === 'fulfilled').length;
29
+ }
30
+ const nonDeletedRSs = toDeleteRSs - deletedCount;
31
+ if (nonDeletedRSs !== 0) {
32
+ setError(t('{{count}} resource sync could not be deleted. Try deleting it manually.', { count: nonDeletedRSs }));
33
+ return false;
34
+ }
35
+ yield remove(`repositories/${repositoryId}`);
36
+ return true;
37
+ });
38
+ const loadRS = React.useCallback(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
39
+ try {
40
+ const resourceSyncs = yield get(`resourcesyncs?repository=${repositoryId}`);
41
+ setResourceSyncIds(resourceSyncs.items.map((rs) => rs.metadata.name || ''));
42
+ setRsError(undefined);
43
+ }
44
+ catch (e) {
45
+ setRsError(t(`The repository cannot be safely deleted at this moment, as we couldn't determine if the repository contains resource syncs. Detail: {{detail}}`, { detail: (0, error_1.getErrorMessage)(e) }));
46
+ setResourceSyncIds([]);
47
+ }
48
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49
+ }), [get, repositoryId]);
50
+ (0, react_1.useEffect)(() => {
51
+ void loadRS();
52
+ }, [loadRS]);
53
+ const deleteAction = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
54
+ setError(undefined);
55
+ try {
56
+ setIsDeleting(true);
57
+ const success = yield deleteRepositoryAndResourceSyncs();
58
+ if (success) {
59
+ onDeleteSuccess();
60
+ }
61
+ }
62
+ catch (err) {
63
+ setError((0, error_1.getErrorMessage)(err));
64
+ }
65
+ finally {
66
+ setIsDeleting(false);
67
+ }
68
+ });
69
+ return (React.createElement(react_core_1.Modal, { title: t('Delete repository ?'), isOpen: true, titleIconVariant: "warning", onClose: onClose, variant: hasResourceSyncs ? 'medium' : 'small', actions: [
70
+ rsError ? (React.createElement(react_core_1.Button, { variant: "primary", onClick: loadRS }, t('Reload resource syncs'))) : (React.createElement(react_core_1.Button, { key: "confirm", variant: "danger", isDanger: hasResourceSyncs, isDisabled: isLoadingRSs || isDeleting, isLoading: isLoadingRSs || isDeleting, onClick: deleteAction }, t('Delete repository'))),
71
+ React.createElement(react_core_1.Button, { key: "cancel", variant: "link", onClick: onClose, isDisabled: isDeleting }, t('Cancel')),
72
+ ] },
73
+ React.createElement(react_core_1.Stack, { hasGutter: true },
74
+ hasResourceSyncs && (React.createElement(react_core_1.StackItem, null,
75
+ React.createElement(react_core_1.TextContent, null,
76
+ React.createElement(react_core_1.Text, null,
77
+ t('This repository defines resource syncs. By deleting the repository, its resource syncs will also be deleted.'),
78
+ t(`Any fleet that is being managed by this repository's resource syncs, will stop being managed by the service.`))))),
79
+ rsError ? (React.createElement(react_core_1.Alert, { isInline: true, variant: "warning", title: t('Cannot delete repository') }, rsError)) : (React.createElement(react_core_1.StackItem, null,
80
+ React.createElement(react_i18next_1.Trans, { t: t },
81
+ "Are you sure you want to delete the repository ",
82
+ React.createElement("b", null, repositoryId),
83
+ "?"))),
84
+ (isDeleting && message) ||
85
+ (isLoadingRSs && (React.createElement(react_core_1.StackItem, null,
86
+ React.createElement(react_core_1.Spinner, { size: "sm" }),
87
+ " ",
88
+ isLoadingRSs ? t('Checking if the repository has resource syncs') : message))),
89
+ error && (React.createElement(react_core_1.StackItem, null,
90
+ React.createElement(react_core_1.Alert, { isInline: true, variant: "danger", title: t('An error occurred') }, error))))));
91
+ };
92
+ exports.default = DeleteRepositoryModal;
93
+ //# sourceMappingURL=DeleteRepositoryModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeleteRepositoryModal.js","sourceRoot":"","sources":["../../../../../src/components/Repository/RepositoryDetails/DeleteRepositoryModal.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,iCAAkC;AAClC,uDAA4G;AAE5G,gDAAuD;AACvD,sDAAmD;AAEnD,iDAAsC;AACtC,kEAA+D;AAQ/D,MAAM,qBAAqB,GAAG,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAA8B,EAAE,EAAE;IACvG,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IAC/B,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAA,mBAAQ,GAAE,CAAC;IACnC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IACnD,MAAM,CAAC,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