@corva/ui 3.79.0-0 → 3.79.0-2

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 (415) hide show
  1. package/cjs-bundle/components/AddComment/Popover.js +1 -1
  2. package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
  3. package/cjs-bundle/components/AddComment/components/Content.js +1 -1
  4. package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
  5. package/cjs-bundle/components/AssetEditor/AssetEditorAutocomplete.js +1 -1
  6. package/cjs-bundle/components/AssetEditor/AssetEditorAutocomplete.js.map +1 -1
  7. package/cjs-bundle/components/AssetEditorV2/components/MultipleAssetsToggle.js +1 -1
  8. package/cjs-bundle/components/AssetEditorV2/components/MultipleAssetsToggle.js.map +1 -1
  9. package/cjs-bundle/components/AssetEditorV2/components/SelectItem.js +1 -1
  10. package/cjs-bundle/components/AssetEditorV2/components/SelectItem.js.map +1 -1
  11. package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/AssetSearch.js +1 -1
  12. package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/AssetSearch.js.map +1 -1
  13. package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/SectionItem.js +1 -1
  14. package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/SectionItem.js.map +1 -1
  15. package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
  16. package/cjs-bundle/components/BICOffsetPickerDialog/components/WellSection/index.js.map +1 -1
  17. package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
  18. package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
  19. package/cjs-bundle/components/Casing/CasingTable/CasingComponent.js +1 -1
  20. package/cjs-bundle/components/Casing/CasingTable/CasingComponent.js.map +1 -1
  21. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  22. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  23. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
  24. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  25. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  26. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  27. package/cjs-bundle/components/Casing/CasingTableV2/components/EditComponentDialog.js +1 -1
  28. package/cjs-bundle/components/Casing/CasingTableV2/components/EditComponentDialog.js.map +1 -1
  29. package/cjs-bundle/components/CollapsableSidebar.js +1 -1
  30. package/cjs-bundle/components/CollapsableSidebar.js.map +1 -1
  31. package/cjs-bundle/components/DevCenter/AppsDataProvider/AppsDataProvider.js +1 -1
  32. package/cjs-bundle/components/DevCenter/AppsDataProvider/AppsDataProvider.js.map +1 -1
  33. package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/constants.js.map +1 -1
  34. package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
  35. package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/dataResolvers.js.map +1 -1
  36. package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/useAppsData.js +1 -1
  37. package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/useAppsData.js.map +1 -1
  38. package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/utils.js +1 -1
  39. package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/utils.js.map +1 -1
  40. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
  41. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
  42. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
  43. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js.map +1 -1
  44. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js +1 -1
  45. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js.map +1 -1
  46. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/DevCenterAppDialogs.js.map +1 -1
  47. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js.map +1 -1
  48. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js +1 -1
  49. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js.map +1 -1
  50. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js +1 -1
  51. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js.map +1 -1
  52. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/constants.js +1 -1
  53. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/constants.js.map +1 -1
  54. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js +1 -1
  55. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js.map +1 -1
  56. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/effects/useDevCenterAppProps.js.map +1 -1
  57. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.js +2 -0
  58. package/cjs-bundle/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.js.map +1 -0
  59. package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js +1 -1
  60. package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js.map +1 -1
  61. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
  62. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
  63. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  64. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  65. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  66. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  67. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  68. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  69. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  70. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  71. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  72. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  73. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js +1 -1
  74. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js.map +1 -1
  75. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  76. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  77. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  78. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  79. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  80. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  81. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  82. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  83. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  84. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  85. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  86. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  87. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  88. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  89. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  90. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  91. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/CancelButton.js +1 -1
  92. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/CancelButton.js.map +1 -1
  93. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  94. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  95. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js +1 -1
  96. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js.map +1 -1
  97. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/MoreButton.js +1 -1
  98. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/MoreButton.js.map +1 -1
  99. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/SaveButton.js +1 -1
  100. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/SaveButton.js.map +1 -1
  101. package/cjs-bundle/components/Drillstring/BHATable/BHAComponent.js +1 -1
  102. package/cjs-bundle/components/Drillstring/BHATable/BHAComponent.js.map +1 -1
  103. package/cjs-bundle/components/FeedItem/FeedItem.js +1 -1
  104. package/cjs-bundle/components/FeedItem/FeedItem.js.map +1 -1
  105. package/cjs-bundle/components/IconMenu/index.js +1 -1
  106. package/cjs-bundle/components/IconMenu/index.js.map +1 -1
  107. package/cjs-bundle/components/OffsetWellChips/Chip.js +1 -1
  108. package/cjs-bundle/components/OffsetWellChips/Chip.js.map +1 -1
  109. package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js +1 -1
  110. package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
  111. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js +1 -1
  112. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js.map +1 -1
  113. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.js +1 -1
  114. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.js.map +1 -1
  115. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  116. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  117. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  118. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  119. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/index.js +1 -1
  120. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/index.js.map +1 -1
  121. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/AssetSearch.js +1 -1
  122. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/AssetSearch.js.map +1 -1
  123. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  124. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  125. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  126. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  127. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  128. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  129. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  130. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  131. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  132. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  133. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  134. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  135. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  136. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  137. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableRows.js +1 -1
  138. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableRows.js.map +1 -1
  139. package/cjs-bundle/components/OffsetWellPickerV3/index.js +1 -1
  140. package/cjs-bundle/components/OffsetWellPickerV3/index.js.map +1 -1
  141. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  142. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  143. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  144. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  145. package/cjs-bundle/components/PadOffsetsPicker/OffsetAssetChip.js +1 -1
  146. package/cjs-bundle/components/PadOffsetsPicker/OffsetAssetChip.js.map +1 -1
  147. package/cjs-bundle/components/PadOffsetsPicker/OffsetAssetsListExpander.js +1 -1
  148. package/cjs-bundle/components/PadOffsetsPicker/OffsetAssetsListExpander.js.map +1 -1
  149. package/cjs-bundle/components/PadOffsetsPicker/PadOffsetsPicker.js +1 -1
  150. package/cjs-bundle/components/PadOffsetsPicker/PadOffsetsPicker.js.map +1 -1
  151. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
  152. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  153. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  154. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  155. package/cjs-bundle/components/Search/Search.js +1 -1
  156. package/cjs-bundle/components/Search/Search.js.map +1 -1
  157. package/cjs-bundle/components/StatusBadge/components/DQAccordionDetailsContent.js +1 -1
  158. package/cjs-bundle/components/StatusBadge/components/DQAccordionDetailsContent.js.map +1 -1
  159. package/cjs-bundle/components/Template/TemplatePopover/index.js +1 -1
  160. package/cjs-bundle/components/Template/TemplatePopover/index.js.map +1 -1
  161. package/cjs-bundle/components/VirtualizedTable/VirtualizedTable.js +1 -1
  162. package/cjs-bundle/components/VirtualizedTable/VirtualizedTable.js.map +1 -1
  163. package/cjs-bundle/hocs/withAssetEditorLockHOC.js +1 -1
  164. package/cjs-bundle/hocs/withAssetEditorLockHOC.js.map +1 -1
  165. package/components/AddComment/Popover.js +1 -1
  166. package/components/AddComment/Popover.js.map +1 -1
  167. package/components/AddComment/components/Content.js +1 -1
  168. package/components/AddComment/components/Content.js.map +1 -1
  169. package/components/AssetEditor/AssetEditorAutocomplete.js +1 -1
  170. package/components/AssetEditor/AssetEditorAutocomplete.js.map +1 -1
  171. package/components/AssetEditorV2/components/MultipleAssetsToggle.js +1 -1
  172. package/components/AssetEditorV2/components/MultipleAssetsToggle.js.map +1 -1
  173. package/components/AssetEditorV2/components/SelectItem.d.ts.map +1 -1
  174. package/components/AssetEditorV2/components/SelectItem.js +1 -1
  175. package/components/AssetEditorV2/components/SelectItem.js.map +1 -1
  176. package/components/BICOffsetPickerDialog/components/WellSection/AssetSearch.js +1 -1
  177. package/components/BICOffsetPickerDialog/components/WellSection/AssetSearch.js.map +1 -1
  178. package/components/BICOffsetPickerDialog/components/WellSection/SectionItem.js +1 -1
  179. package/components/BICOffsetPickerDialog/components/WellSection/SectionItem.js.map +1 -1
  180. package/components/BICOffsetPickerDialog/components/WellSection/index.js +1 -1
  181. package/components/BICOffsetPickerDialog/components/WellSection/index.js.map +1 -1
  182. package/components/BICOffsetPickerDialog/index.js +1 -1
  183. package/components/BICOffsetPickerDialog/index.js.map +1 -1
  184. package/components/Casing/CasingTable/CasingComponent.js +1 -1
  185. package/components/Casing/CasingTable/CasingComponent.js.map +1 -1
  186. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  187. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  188. package/components/Casing/CasingTableV2/components/Component.js +1 -1
  189. package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  190. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  191. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  192. package/components/Casing/CasingTableV2/components/EditComponentDialog.d.ts.map +1 -1
  193. package/components/Casing/CasingTableV2/components/EditComponentDialog.js +1 -1
  194. package/components/Casing/CasingTableV2/components/EditComponentDialog.js.map +1 -1
  195. package/components/CollapsableSidebar.js +1 -1
  196. package/components/CollapsableSidebar.js.map +1 -1
  197. package/components/DevCenter/AppsDataProvider/AppsDataProvider.d.ts +3 -21
  198. package/components/DevCenter/AppsDataProvider/AppsDataProvider.d.ts.map +1 -1
  199. package/components/DevCenter/AppsDataProvider/AppsDataProvider.js +1 -1
  200. package/components/DevCenter/AppsDataProvider/AppsDataProvider.js.map +1 -1
  201. package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/assetDashboard/wellAssetDashboard/appWithDefaultSettings.d.ts +22 -2
  202. package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/assetDashboard/wellAssetDashboard/appWithDefaultSettings.d.ts.map +1 -1
  203. package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/completion/appWithFracFleetId.d.ts +23 -2
  204. package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/completion/appWithFracFleetId.d.ts.map +1 -1
  205. package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/completion/appWithPadId.d.ts +20 -2
  206. package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/completion/appWithPadId.d.ts.map +1 -1
  207. package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/drilling/appWithActiveWellId.d.ts +27 -2
  208. package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/drilling/appWithActiveWellId.d.ts.map +1 -1
  209. package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/drilling/appWithRigId.d.ts +49 -3
  210. package/components/DevCenter/AppsDataProvider/effects/__tests__/mocks/generalDashboard/drilling/appWithRigId.d.ts.map +1 -1
  211. package/components/DevCenter/AppsDataProvider/effects/__tests__/utils.test.d.ts +2 -0
  212. package/components/DevCenter/AppsDataProvider/effects/__tests__/utils.test.d.ts.map +1 -0
  213. package/components/DevCenter/AppsDataProvider/effects/constants.d.ts +2 -7
  214. package/components/DevCenter/AppsDataProvider/effects/constants.d.ts.map +1 -1
  215. package/components/DevCenter/AppsDataProvider/effects/constants.js.map +1 -1
  216. package/components/DevCenter/AppsDataProvider/effects/dataResolvers.d.ts +14 -10
  217. package/components/DevCenter/AppsDataProvider/effects/dataResolvers.d.ts.map +1 -1
  218. package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
  219. package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js.map +1 -1
  220. package/components/DevCenter/AppsDataProvider/effects/index.d.ts.map +1 -1
  221. package/components/DevCenter/AppsDataProvider/effects/useAppsData.d.ts +5 -5
  222. package/components/DevCenter/AppsDataProvider/effects/useAppsData.d.ts.map +1 -1
  223. package/components/DevCenter/AppsDataProvider/effects/useAppsData.js +1 -1
  224. package/components/DevCenter/AppsDataProvider/effects/useAppsData.js.map +1 -1
  225. package/components/DevCenter/AppsDataProvider/effects/utils.d.ts +33 -54
  226. package/components/DevCenter/AppsDataProvider/effects/utils.d.ts.map +1 -1
  227. package/components/DevCenter/AppsDataProvider/effects/utils.js +1 -1
  228. package/components/DevCenter/AppsDataProvider/effects/utils.js.map +1 -1
  229. package/components/DevCenter/AppsDataProvider/index.d.ts +1 -0
  230. package/components/DevCenter/AppsDataProvider/index.d.ts.map +1 -1
  231. package/components/DevCenter/AppsDataProvider/types.d.ts +216 -0
  232. package/components/DevCenter/AppsDataProvider/types.d.ts.map +1 -0
  233. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts.map +1 -1
  234. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js +1 -1
  235. package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
  236. package/components/DevCenter/DevCenterAppContainer/__tests__/getAppDataEntryFromContext.test.d.ts +2 -0
  237. package/components/DevCenter/DevCenterAppContainer/__tests__/getAppDataEntryFromContext.test.d.ts.map +1 -0
  238. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.d.ts.map +1 -1
  239. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js +1 -1
  240. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js.map +1 -1
  241. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js +1 -1
  242. package/components/DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js.map +1 -1
  243. package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppDialogs.d.ts +1 -1
  244. package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppDialogs.d.ts.map +1 -1
  245. package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppDialogs.js.map +1 -1
  246. package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.d.ts +5 -3
  247. package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.d.ts.map +1 -1
  248. package/components/DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js.map +1 -1
  249. package/components/DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js +1 -1
  250. package/components/DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js.map +1 -1
  251. package/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js +1 -1
  252. package/components/DevCenter/DevCenterAppContainer/components/LegacyAppActions.js.map +1 -1
  253. package/components/DevCenter/DevCenterAppContainer/constants.d.ts +0 -2
  254. package/components/DevCenter/DevCenterAppContainer/constants.d.ts.map +1 -1
  255. package/components/DevCenter/DevCenterAppContainer/constants.js +1 -1
  256. package/components/DevCenter/DevCenterAppContainer/constants.js.map +1 -1
  257. package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.d.ts +1 -1
  258. package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.d.ts.map +1 -1
  259. package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js +1 -1
  260. package/components/DevCenter/DevCenterAppContainer/effects/useAnnotationsData.js.map +1 -1
  261. package/components/DevCenter/DevCenterAppContainer/effects/useDevCenterAppProps.d.ts +7 -1
  262. package/components/DevCenter/DevCenterAppContainer/effects/useDevCenterAppProps.d.ts.map +1 -1
  263. package/components/DevCenter/DevCenterAppContainer/effects/useDevCenterAppProps.js.map +1 -1
  264. package/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.d.ts +12 -0
  265. package/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.d.ts.map +1 -0
  266. package/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.js +2 -0
  267. package/components/DevCenter/DevCenterAppContainer/getAppDataEntryFromContext.js.map +1 -0
  268. package/components/DevCenter/DevCenterAppContainer/types.d.ts +1 -6
  269. package/components/DevCenter/DevCenterAppContainer/types.d.ts.map +1 -1
  270. package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js +1 -1
  271. package/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js.map +1 -1
  272. package/components/DocumentViewer/DocumentViewer.js +1 -1
  273. package/components/DocumentViewer/DocumentViewer.js.map +1 -1
  274. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  275. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  276. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  277. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  278. package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  279. package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  280. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  281. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  282. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  283. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  284. package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.d.ts.map +1 -1
  285. package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js +1 -1
  286. package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js.map +1 -1
  287. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  288. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  289. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  290. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  291. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  292. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  293. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  294. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  295. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  296. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  297. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  298. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  299. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  300. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  301. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  302. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  303. package/components/Drillstring/BHAComponentsTable/components/shared/CancelButton.js +1 -1
  304. package/components/Drillstring/BHAComponentsTable/components/shared/CancelButton.js.map +1 -1
  305. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  306. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  307. package/components/Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.d.ts.map +1 -1
  308. package/components/Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js +1 -1
  309. package/components/Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js.map +1 -1
  310. package/components/Drillstring/BHAComponentsTable/components/shared/MoreButton.js +1 -1
  311. package/components/Drillstring/BHAComponentsTable/components/shared/MoreButton.js.map +1 -1
  312. package/components/Drillstring/BHAComponentsTable/components/shared/SaveButton.js +1 -1
  313. package/components/Drillstring/BHAComponentsTable/components/shared/SaveButton.js.map +1 -1
  314. package/components/Drillstring/BHATable/BHAComponent.js +1 -1
  315. package/components/Drillstring/BHATable/BHAComponent.js.map +1 -1
  316. package/components/FeedItem/FeedItem.js +1 -1
  317. package/components/FeedItem/FeedItem.js.map +1 -1
  318. package/components/IconMenu/index.js +1 -1
  319. package/components/IconMenu/index.js.map +1 -1
  320. package/components/OffsetWellChips/Chip.js +1 -1
  321. package/components/OffsetWellChips/Chip.js.map +1 -1
  322. package/components/OffsetWellMap/OffsetWellMap.d.ts.map +1 -1
  323. package/components/OffsetWellMap/OffsetWellMap.js +1 -1
  324. package/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
  325. package/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js +1 -1
  326. package/components/OffsetWellPickerV2/components/Filter/NonEngineeredWellsSwitch.js.map +1 -1
  327. package/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.d.ts.map +1 -1
  328. package/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.js +1 -1
  329. package/components/OffsetWellPickerV2/components/Filter/ToggleFiltersButton.js.map +1 -1
  330. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.d.ts.map +1 -1
  331. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  332. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  333. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  334. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  335. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/index.js +1 -1
  336. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Filter/index.js.map +1 -1
  337. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/AssetSearch.d.ts.map +1 -1
  338. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/AssetSearch.js +1 -1
  339. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/AssetSearch.js.map +1 -1
  340. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  341. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  342. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  343. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  344. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  345. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  346. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.d.ts.map +1 -1
  347. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  348. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  349. package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  350. package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  351. package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  352. package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  353. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  354. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  355. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableRows.js +1 -1
  356. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableRows.js.map +1 -1
  357. package/components/OffsetWellPickerV3/index.js +1 -1
  358. package/components/OffsetWellPickerV3/index.js.map +1 -1
  359. package/components/OffsetWellPickerV4/OffsetWellPickerV4.d.ts.map +1 -1
  360. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  361. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  362. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  363. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  364. package/components/PadOffsetsPicker/OffsetAssetChip.js +1 -1
  365. package/components/PadOffsetsPicker/OffsetAssetChip.js.map +1 -1
  366. package/components/PadOffsetsPicker/OffsetAssetsListExpander.d.ts.map +1 -1
  367. package/components/PadOffsetsPicker/OffsetAssetsListExpander.js +1 -1
  368. package/components/PadOffsetsPicker/OffsetAssetsListExpander.js.map +1 -1
  369. package/components/PadOffsetsPicker/PadOffsetsPicker.js +1 -1
  370. package/components/PadOffsetsPicker/PadOffsetsPicker.js.map +1 -1
  371. package/components/PadOffsetsPicker/StagesSelector.js +1 -1
  372. package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  373. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  374. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  375. package/components/Search/Search.js +1 -1
  376. package/components/Search/Search.js.map +1 -1
  377. package/components/StatusBadge/components/DQAccordionDetailsContent.d.ts.map +1 -1
  378. package/components/StatusBadge/components/DQAccordionDetailsContent.js +1 -1
  379. package/components/StatusBadge/components/DQAccordionDetailsContent.js.map +1 -1
  380. package/components/Template/TemplatePopover/index.d.ts.map +1 -1
  381. package/components/Template/TemplatePopover/index.js +1 -1
  382. package/components/Template/TemplatePopover/index.js.map +1 -1
  383. package/components/VirtualizedTable/VirtualizedTable.d.ts.map +1 -1
  384. package/components/VirtualizedTable/VirtualizedTable.js +1 -1
  385. package/components/VirtualizedTable/VirtualizedTable.js.map +1 -1
  386. package/hocs/withAssetEditorLockHOC.d.ts.map +1 -1
  387. package/hocs/withAssetEditorLockHOC.js +1 -1
  388. package/hocs/withAssetEditorLockHOC.js.map +1 -1
  389. package/mcp-server/server.mjs +6 -6
  390. package/package.json +1 -1
  391. package/tsconfig.tsbuildinfo +1 -1
  392. package/cjs-bundle/ext-esm/@material-ui/icons/esm/ExpandLess.js +0 -2
  393. package/cjs-bundle/ext-esm/@material-ui/icons/esm/ExpandLess.js.map +0 -1
  394. package/cjs-bundle/ext-esm/@material-ui/icons/esm/ExpandMore.js +0 -2
  395. package/cjs-bundle/ext-esm/@material-ui/icons/esm/ExpandMore.js.map +0 -1
  396. package/cjs-bundle/ext-esm/@material-ui/icons/esm/Map.js +0 -2
  397. package/cjs-bundle/ext-esm/@material-ui/icons/esm/Map.js.map +0 -1
  398. package/cjs-bundle/ext-esm/@material-ui/icons/esm/UnfoldLess.js +0 -2
  399. package/cjs-bundle/ext-esm/@material-ui/icons/esm/UnfoldLess.js.map +0 -1
  400. package/cjs-bundle/ext-esm/@material-ui/icons/esm/UnfoldMore.js +0 -2
  401. package/cjs-bundle/ext-esm/@material-ui/icons/esm/UnfoldMore.js.map +0 -1
  402. package/cjs-bundle/ext-esm/@material-ui/icons/esm/utils/createSvgIcon.js +0 -2
  403. package/cjs-bundle/ext-esm/@material-ui/icons/esm/utils/createSvgIcon.js.map +0 -1
  404. package/ext-esm/@material-ui/icons/esm/ExpandLess.js +0 -2
  405. package/ext-esm/@material-ui/icons/esm/ExpandLess.js.map +0 -1
  406. package/ext-esm/@material-ui/icons/esm/ExpandMore.js +0 -2
  407. package/ext-esm/@material-ui/icons/esm/ExpandMore.js.map +0 -1
  408. package/ext-esm/@material-ui/icons/esm/Map.js +0 -2
  409. package/ext-esm/@material-ui/icons/esm/Map.js.map +0 -1
  410. package/ext-esm/@material-ui/icons/esm/UnfoldLess.js +0 -2
  411. package/ext-esm/@material-ui/icons/esm/UnfoldLess.js.map +0 -1
  412. package/ext-esm/@material-ui/icons/esm/UnfoldMore.js +0 -2
  413. package/ext-esm/@material-ui/icons/esm/UnfoldMore.js.map +0 -1
  414. package/ext-esm/@material-ui/icons/esm/utils/createSvgIcon.js +0 -2
  415. package/ext-esm/@material-ui/icons/esm/utils/createSvgIcon.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useAppsData.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/useAppsData.js"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { mapValues, keyBy, omit, merge } from 'lodash';\n\nimport {\n getInitialAppsDataState,\n getAppHash,\n isAppNeedingInterventionUnitWellRefresh,\n} from './utils';\nimport { resolveAppsData } from './dataResolvers';\n\nimport { isDCAppMultiRig, isDevCenterApp } from '~/utils/devcenter';\nimport { APPS_DATA_REQUESTS } from '~/components/DevCenter/AppsDataProvider/effects/constants';\n\nconst MINUTE = 60_000;\nconst FRAC_FLEETS_REFRESH_INTERVAL = 5 * MINUTE;\nconst INTERVENTION_UNITS_REFRESH_INTERVAL = 5 * MINUTE;\n\nfunction useAppsData({ apps: allApps, dashboardAssetId, dashboardMeta }) {\n const [appsData, setAppsData] = useState({});\n const refreshFracFleetsInterval = useRef();\n const refreshInterventionUnitsInterval = useRef();\n const resolveAppsDataParamsRef = useRef({});\n\n const cache = useRef({\n wellsById: {},\n rigsById: {},\n fracFleetsById: {},\n interventionUnitsById: {},\n deprecatedAssetData: {},\n });\n\n const apps = allApps.reduce((acc, app) => {\n const isMultiRig = isDCAppMultiRig({\n uiSettings: app.app?.ui_settings,\n isChiplessDashboard: dashboardMeta?.isChiplessDashboard,\n });\n\n if (isDevCenterApp(app) && !isMultiRig) acc.push({ ...app, appHash: getAppHash(app) });\n return acc;\n }, []);\n\n const handleResolvedAppsData = resolvedAppsData =>\n setAppsData(prevAppsData =>\n mapValues(prevAppsData, prevAppData => {\n const appData = resolvedAppsData[prevAppData.id] || {};\n\n return {\n ...prevAppData,\n ...appData,\n isLoading: false,\n };\n })\n );\n\n const updateCache = updates => {\n cache.current = merge(cache.current, updates);\n };\n\n useEffect(() => {\n const appsDataValues = Object.values(appsData);\n\n // NOTE: empty dashboard\n if (!apps.length && !appsDataValues.length) {\n return;\n }\n\n // NOTE: app was removed from db\n if (apps.length < appsDataValues.length) {\n const appsById = keyBy(apps, 'id');\n const removedAppId = appsDataValues.find(appData => !appsById[appData.id]).id;\n setAppsData(prevAppsData => omit(prevAppsData, removedAppId));\n return;\n }\n\n const changedApps = apps.filter(\n app => !appsData[app.id] || appsData[app.id].appHash !== app.appHash\n );\n setAppsData(prevAppsData => ({ ...prevAppsData, ...getInitialAppsDataState(changedApps) }));\n resolveAppsData({ apps, dashboardAssetId, cache, updateCache }).then(handleResolvedAppsData);\n }, [String(apps.map(({ appHash }) => appHash)), dashboardAssetId]);\n\n // NOTE: Keep this data in ref to avoid closure in setInterval\n resolveAppsDataParamsRef.current = { apps, dashboardAssetId, cache, updateCache };\n\n useEffect(() => {\n // NOTE: Refresh fracfleet wells and pad wells every 5 minutes\n refreshFracFleetsInterval.current = setInterval(() => {\n resolveAppsData({\n ...resolveAppsDataParamsRef.current,\n requests: [APPS_DATA_REQUESTS.FRAC_FLEET_WELLS, APPS_DATA_REQUESTS.PAD_WELLS],\n }).then(handleResolvedAppsData);\n }, FRAC_FLEETS_REFRESH_INTERVAL);\n\n return () => clearInterval(refreshFracFleetsInterval.current);\n }, []);\n\n const hasAppsNeedingInterventionUnitRefresh = apps.some(isAppNeedingInterventionUnitWellRefresh);\n\n useEffect(() => {\n if (!hasAppsNeedingInterventionUnitRefresh) return;\n\n refreshInterventionUnitsInterval.current = setInterval(async () => {\n const currentApps = resolveAppsDataParamsRef.current.apps;\n const interventionUnitAppIds = new Set(\n currentApps.filter(isAppNeedingInterventionUnitWellRefresh).map(app => app.id)\n );\n\n const resolvedAppsData = await resolveAppsData({\n ...resolveAppsDataParamsRef.current,\n requests: [APPS_DATA_REQUESTS.INTERVENTION_UNIT_WELLS],\n });\n\n setAppsData(prevAppsData => {\n const entries = Object.entries(prevAppsData);\n const hasChanges = entries.some(([appId, prevAppData]) => {\n if (!interventionUnitAppIds.has(appId)) return false;\n const newData = resolvedAppsData[appId];\n if (!newData) return false;\n return newData.well?.id !== prevAppData.well?.id;\n });\n\n if (!hasChanges) return prevAppsData;\n\n return entries.reduce((acc, [appId, prevAppData]) => {\n if (!interventionUnitAppIds.has(appId)) {\n acc[appId] = prevAppData;\n return acc;\n }\n\n const newData = resolvedAppsData[appId];\n if (!newData || newData.well?.id === prevAppData.well?.id) {\n acc[appId] = prevAppData;\n return acc;\n }\n\n acc[appId] = { ...prevAppData, ...newData, isLoading: false };\n return acc;\n }, {});\n });\n }, INTERVENTION_UNITS_REFRESH_INTERVAL);\n\n // eslint-disable-next-line consistent-return\n return () => clearInterval(refreshInterventionUnitsInterval.current);\n }, [hasAppsNeedingInterventionUnitRefresh]);\n\n return appsData;\n}\n\nexport default useAppsData;\n"],"names":["useAppsData","_ref","allApps","apps","dashboardAssetId","dashboardMeta","_useState","useState","_useState2","_slicedToArray","appsData","setAppsData","refreshFracFleetsInterval","useRef","refreshInterventionUnitsInterval","resolveAppsDataParamsRef","cache","wellsById","rigsById","fracFleetsById","interventionUnitsById","deprecatedAssetData","reduce","acc","app","_app$app","isMultiRig","isDCAppMultiRig","uiSettings","ui_settings","isChiplessDashboard","isDevCenterApp","push","_objectSpread","appHash","getAppHash","handleResolvedAppsData","resolvedAppsData","prevAppsData","mapValues","prevAppData","appData","id","isLoading","updateCache","updates","current","merge","useEffect","appsDataValues","Object","values","length","appsById","keyBy","removedAppId","find","omit","changedApps","filter","getInitialAppsDataState","resolveAppsData","then","String","map","_ref2","setInterval","requests","APPS_DATA_REQUESTS","FRAC_FLEET_WELLS","PAD_WELLS","clearInterval","hasAppsNeedingInterventionUnitRefresh","some","isAppNeedingInterventionUnitWellRefresh","_asyncToGenerator","_regeneratorRuntime","mark","_callee","currentApps","interventionUnitAppIds","wrap","_context","prev","next","Set","INTERVENTION_UNIT_WELLS","sent","entries","_ref4","_newData$well","_prevAppData$well","_ref5","appId","has","newData","well","_ref6","_newData$well2","_prevAppData$well2","_ref7","stop"],"mappings":"wrCAiBA,SAASA,EAAgEC,GAAA,IAA5CC,IAANC,KAAeC,IAAAA,iBAAkBC,IAAAA,cACtDC,EAAgCC,EAAS,IAAGC,EAAAC,EAAAH,EAAA,GAArCI,EAAQF,EAAA,GAAEG,EAAWH,EAAA,GACtBI,EAA4BC,IAC5BC,EAAmCD,IACnCE,EAA2BF,EAAO,CAAA,GAElCG,EAAQH,EAAO,CACnBI,UAAW,CAAE,EACbC,SAAU,CAA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D,IAAKZ,EAAuBc,IAAID,GAAQ,OAAO,EAC/C,IAAME,EAAU1D,EAAiBwD,GACjC,QAAKE,IACE,QAAAA,EAAAA,EAAQC,YAAR,IAAAN,OAAA,EAAAA,EAAchD,OAAuB,QAArBiD,EAAKnD,EAAYwD,YAAI,IAAAL,OAAA,EAAhBA,EAAkBjD,GAChD,IAIO8C,EAAQlE,QAAO,SAACC,EAA8B0E,GAAA,IAAAC,EAAAC,EAAAC,EAAA3F,EAAAwF,EAAA,GAAxBJ,EAAKO,EAAA,GAAE5D,EAAW4D,EAAA,GAC7C,IAAKpB,EAAuBc,IAAID,GAE9B,OADAtE,EAAIsE,GAASrD,EACNjB,EAGT,IAAMwE,EAAU1D,EAAiBwD,GACjC,OAAKE,IAAuB,QAAZA,EAAAA,EAAQC,YAAI,IAAAE,OAAA,EAAZA,EAAcxD,OAAO,UAAAF,EAAYwD,YAAZ,IAAAG,OAAA,EAAAA,EAAkBzD,KAKvDnB,EAAIsE,GAAcrD,EAAAA,EAAAA,EAAAA,CAAAA,EAAAA,GAAgBuD,GAAO,GAAA,CAAEpD,WAAW,IAC/CpB,IALLA,EAAIsE,GAASrD,EACNjB,EAKV,GAAE,CAAE,GAhBmBe,CAiB1B,IAAG,KAAA,EAAA,IAAA,MAAA,OAAA4C,EAAAmB,OAAA,GAAAvB,OA3HmC,KA+HjC,WAAA,OAAMP,cAAczD,EAAiCgC,QAAQ,CACtE,GAAG,CAAC0B,IAEG9D,CACT"}
1
+ {"version":3,"file":"useAppsData.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/useAppsData.ts"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { merge } from 'lodash';\n\nimport type {\n AppDataEntry,\n AppDataPatches,\n AppId,\n AppsDataCache,\n AppsDataCacheUpdate,\n PreparedProviderApp,\n UseAppsDataParams,\n} from '../types';\n\nimport {\n getInitialAppsDataState,\n getAppHash,\n isAppNeedingInterventionUnitWellRefresh,\n} from './utils';\nimport { resolveAppsData } from './dataResolvers';\n\nimport { isDCAppMultiRig, isDevCenterApp } from '~/utils/devcenter';\nimport { APPS_DATA_REQUESTS } from '~/components/DevCenter/AppsDataProvider/effects/constants';\n\nconst MINUTE = 60_000;\nconst FRAC_FLEETS_REFRESH_INTERVAL = 5 * MINUTE;\nconst INTERVENTION_UNITS_REFRESH_INTERVAL = 5 * MINUTE;\n\ntype LoadedAppData = Record<string, AppDataEntry & { id: AppId }>;\n\nconst useAppsData = ({ apps: allApps, dashboardAssetId, dashboardMeta }: UseAppsDataParams) => {\n const [appsData, setAppsData] = useState<LoadedAppData>({});\n const resolveAppsDataParamsRef = useRef<Parameters<typeof resolveAppsData>[0] | null>(null);\n\n const cache = useRef<AppsDataCache>({\n wellsById: {},\n rigsById: {},\n fracFleetsById: {},\n interventionUnitsById: {},\n deprecatedAssetData: {},\n });\n\n const apps = allApps.reduce<PreparedProviderApp[]>((acc, app) => {\n const isMultiRig = isDCAppMultiRig({\n uiSettings: app.app?.ui_settings,\n isChiplessDashboard: dashboardMeta?.isChiplessDashboard,\n });\n\n if (isDevCenterApp(app) && !isMultiRig) acc.push({ ...app, appHash: getAppHash(app) });\n return acc;\n }, []);\n\n const handleResolvedAppsData = (resolvedAppsData: AppDataPatches) =>\n setAppsData(prevAppsData =>\n Object.fromEntries(\n Object.entries(prevAppsData).map(([appId, prevAppData]) => [\n appId,\n { ...prevAppData, ...resolvedAppsData[prevAppData.id], isLoading: false },\n ])\n )\n );\n\n const updateCache = (updates: AppsDataCacheUpdate) => {\n cache.current = merge(cache.current, updates);\n };\n\n useEffect(() => {\n const appsDataValues = Object.values(appsData);\n\n // NOTE: empty dashboard\n if (!apps.length && !appsDataValues.length) {\n return;\n }\n\n // NOTE: app was removed from db\n if (apps.length < appsDataValues.length) {\n const appIds = new Set(apps.map(app => String(app.id)));\n const removedApp = appsDataValues.find(appData => !appIds.has(String(appData.id)));\n if (!removedApp) return;\n\n setAppsData(prevAppsData =>\n Object.fromEntries(\n Object.entries(prevAppsData).filter(([appId]) => appId !== String(removedApp.id))\n )\n );\n return;\n }\n\n const changedApps = apps.filter(\n app => !appsData[app.id] || appsData[app.id].appHash !== app.appHash\n );\n setAppsData(prevAppsData => ({ ...prevAppsData, ...getInitialAppsDataState(changedApps) }));\n resolveAppsData({ apps, dashboardAssetId, cache, updateCache }).then(handleResolvedAppsData);\n }, [String(apps.map(({ appHash }) => appHash)), dashboardAssetId]);\n\n // NOTE: Keep this data in ref to avoid closure in setInterval\n resolveAppsDataParamsRef.current = { apps, dashboardAssetId, cache, updateCache };\n\n useEffect(() => {\n // NOTE: Refresh fracfleet wells and pad wells every 5 minutes\n const interval = setInterval(() => {\n const params = resolveAppsDataParamsRef.current;\n if (!params) return;\n\n resolveAppsData({\n ...params,\n requests: [APPS_DATA_REQUESTS.FRAC_FLEET_WELLS, APPS_DATA_REQUESTS.PAD_WELLS],\n }).then(handleResolvedAppsData);\n }, FRAC_FLEETS_REFRESH_INTERVAL);\n\n return () => clearInterval(interval);\n }, []);\n\n const hasAppsNeedingInterventionUnitRefresh = apps.some(isAppNeedingInterventionUnitWellRefresh);\n\n useEffect((): (() => void) | undefined => {\n if (!hasAppsNeedingInterventionUnitRefresh) return;\n\n const interval = setInterval(async () => {\n const params = resolveAppsDataParamsRef.current;\n if (!params) return;\n\n const currentApps = params.apps;\n const interventionUnitAppIds = new Set(\n currentApps.filter(isAppNeedingInterventionUnitWellRefresh).map(app => app.id)\n );\n\n const resolvedAppsData = await resolveAppsData({\n ...params,\n requests: [APPS_DATA_REQUESTS.INTERVENTION_UNIT_WELLS],\n });\n\n setAppsData(prevAppsData => {\n const entries = Object.entries(prevAppsData);\n const hasChanges = entries.some(([appId, prevAppData]) => {\n if (!interventionUnitAppIds.has(appId)) return false;\n const newData = resolvedAppsData[appId];\n if (!newData) return false;\n return newData.well?.id !== prevAppData.well?.id;\n });\n\n if (!hasChanges) return prevAppsData;\n\n return entries.reduce<LoadedAppData>((acc, [appId, prevAppData]) => {\n if (!interventionUnitAppIds.has(appId)) {\n acc[appId] = prevAppData;\n return acc;\n }\n\n const newData = resolvedAppsData[appId];\n if (!newData || newData.well?.id === prevAppData.well?.id) {\n acc[appId] = prevAppData;\n return acc;\n }\n\n acc[appId] = { ...prevAppData, ...newData, isLoading: false };\n return acc;\n }, {});\n });\n }, INTERVENTION_UNITS_REFRESH_INTERVAL);\n\n return () => clearInterval(interval);\n }, [hasAppsNeedingInterventionUnitRefresh]);\n\n return appsData;\n};\n\nexport default useAppsData;\n"],"names":["useAppsData","_ref","allApps","apps","dashboardAssetId","dashboardMeta","_useState","useState","_useState2","_slicedToArray","appsData","setAppsData","resolveAppsDataParamsRef","useRef","cache","wellsById","rigsById","fracFleetsById","interventionUnitsById","deprecatedAssetData","reduce","acc","app","_app$app","isMultiRig","isDCAppMultiRig","uiSettings","ui_settings","isChiplessDashboard","isDevCenterApp","push","_objectSpread","appHash","getAppHash","handleResolvedAppsData","resolvedAppsData","prevAppsData","Object","fromEntries","entries","map","_ref2","_ref3","appId","prevAppData","id","isLoading","updateCache","updates","current","merge","useEffect","appsDataValues","values","length","appIds","Set","String","removedApp","find","appData","has","filter","_ref4","changedApps","getInitialAppsDataState","resolveAppsData","then","_ref6","interval","setInterval","params","requests","APPS_DATA_REQUESTS","FRAC_FLEET_WELLS","PAD_WELLS","clearInterval","hasAppsNeedingInterventionUnitRefresh","some","isAppNeedingInterventionUnitWellRefresh","_asyncToGenerator","_regeneratorRuntime","mark","_callee","currentApps","interventionUnitAppIds","wrap","_context","prev","next","abrupt","INTERVENTION_UNIT_WELLS","sent","_ref8","_newData$well","_prevAppData$well","_ref9","newData","well","_ref10","_newData$well2","_prevAppData$well2","_ref11","stop"],"mappings":"opCAuBA,IAMMA,EAAc,SAA2EC,GAAA,IAAlEC,IAANC,KAAeC,IAAAA,iBAAkBC,IAAAA,cACtDC,EAAgCC,EAAwB,IAAGC,EAAAC,EAAAH,EAAA,GAApDI,EAAQF,EAAA,GAAEG,EAAWH,EAAA,GACtBI,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ApImC,KAuIxC,OAAO,WAAA,OAAMP,cAAcP,EAAS,CA7CQ,CA8C9C,GAAG,CAACQ,IAEGnE,CACT"}
@@ -1,56 +1,35 @@
1
- export declare const getAppAssetSpecificTypeId: (app: any, typeId: any) => number;
2
- export declare const getUniqAssetIds: (assetIds: any, cachedAssetIds: any) => any[];
3
- export declare function fetchWells(ids: any): Promise<any>;
4
- export declare function fetchRigs(ids: any): Promise<any>;
5
- export declare function fetchAssetEntitiesByAssetIds(assetIds: any): Promise<any>;
6
- export declare const getAppsDataByWells: (appsWellIds: any, wellsById: any) => any;
7
- export declare const getAppsDataByRigs: (appsRigIds: any, rigsById: any) => any;
8
- export declare const getAppsDataByFFs: (appsFracFleetIds: any, ffsById: any, ffWellsData: any) => any;
9
- export declare const getAppsDataByPads: (appsPadIds: any, padWellsData: any) => any;
10
- export declare const getAppsDataByInterventionUnits: (appsInterventionUnitIds: any, interventionUnitsById: any, appsWellIds: any, wellsById: any) => any;
11
- export declare function fetchFracFleets(ids: any): Promise<import("jsona/lib/JsonaTypes").TJsonaModel[] | import("jsona/lib/JsonaTypes").TJsonaModel | null>;
12
- export declare function fetchInterventionUnits(ids: any): Promise<any>;
13
- export declare function fetchFracFleetWells(appsFFIds: any, apps: any): Promise<any>;
14
- export declare function fetchPadWells(appsPadIds: any, apps: any): Promise<any>;
15
- export declare const getAppHash: (app: any) => string;
16
- export declare const isAppWithSettings: (app: any) => boolean;
17
- export declare const getInitialAppData: (app: any) => {
18
- id: any;
19
- rig: null;
20
- well: null;
21
- fracFleet: null;
22
- interventionUnit: null;
23
- program: {
24
- id: null;
25
- name: null;
26
- };
27
- completionWellInfo: {
28
- fracFleet: {
29
- id: null;
30
- name: null;
31
- };
32
- pad: {
33
- id: null;
34
- name: null;
35
- };
36
- };
37
- wells: null;
38
- isLoading: boolean;
39
- appHash: string;
40
- };
41
- export declare const getInitialAppsDataState: (apps: any) => any;
42
- export declare const isAppNeedingInterventionUnitWellRefresh: (app: any) => 0 | boolean;
43
- export declare const prepareDataForResolver: (apps: any, cache: any) => {
44
- appsWellIds: any[];
45
- appsRigIds: any[];
46
- appsFracFleetIds: any[];
47
- appsPadIds: any[];
48
- appIds: any[];
49
- appsFracFleetToFetchWellsIds: any[];
50
- appsInterventionUnitIds: any[];
51
- uniqueWellIds: any[];
52
- uniqueRigIds: any[];
53
- uniqueFFIds: any[];
54
- uniqueInterventionUnitIds: any[];
1
+ import type { AppAssetIdPair, AppDataCompletionWell, AppDataFracFleet, AppDataPatches, AppsDataCacheRef, AssetId, InitializedAppDataDictionary, InitializedAppDataEntry, InterventionUnitResource, JsonApiCollectionResponse, JsonApiResource, PreparedProviderApp, PreparedResolverData, ProviderApp, RigResource, WellResource } from '../types';
2
+ type ResolvedAssetResource = JsonApiResource & {
3
+ attributes: {
4
+ asset_id: AssetId;
5
+ } & Record<string, unknown>;
55
6
  };
7
+ export type ResolvedAssetResponse = Record<string, Array<{
8
+ data: ResolvedAssetResource;
9
+ }>>;
10
+ export declare const getAppAssetSpecificTypeId: (app: ProviderApp, typeId: string) => number;
11
+ export declare const getUniqAssetIds: (assetIds: AppAssetIdPair[], cachedAssetIds: string[]) => number[];
12
+ export declare const fetchWells: (ids: number[]) => Promise<JsonApiCollectionResponse<WellResource> | null>;
13
+ export declare const fetchRigs: (ids: number[]) => Promise<JsonApiCollectionResponse<RigResource> | null>;
14
+ export declare const fetchAssetEntitiesByAssetIds: (assetIds: Array<AssetId | null | undefined>) => Promise<ResolvedAssetResponse | null>;
15
+ export declare const getAppsDataByWells: (appsWellIds: AppAssetIdPair[], wellsById: Record<string, WellResource>) => AppDataPatches;
16
+ export declare const getAppsDataByRigs: (appsRigIds: AppAssetIdPair[], rigsById: Record<string, RigResource>) => AppDataPatches;
17
+ export declare const getAppsDataByFFs: (appsFracFleetIds: AppAssetIdPair[], ffsById: Record<string, AppDataFracFleet>, ffWellsData: Record<string, AppDataCompletionWell[]> | null | false) => AppDataPatches;
18
+ export declare const getAppsDataByPads: (appsPadIds: AppAssetIdPair[], padWellsData: Record<string, AppDataCompletionWell[]> | null | false) => AppDataPatches;
19
+ export declare const getAppsDataByInterventionUnits: (appsInterventionUnitIds: AppAssetIdPair[], interventionUnitsById: Record<string, InterventionUnitResource>, appsWellIds: AppAssetIdPair[], wellsById: Record<string, WellResource>) => AppDataPatches;
20
+ export declare const fetchFracFleets: (ids: number[]) => Promise<AppDataFracFleet[] | null>;
21
+ export declare const fetchInterventionUnits: (ids: number[]) => Promise<JsonApiCollectionResponse | null>;
22
+ export declare const fetchFracFleetWells: (appsFFIds: AppAssetIdPair[], apps: ProviderApp[]) => Promise<Record<string, AppDataCompletionWell[]>>;
23
+ export declare const fetchPadWells: (appsPadIds: AppAssetIdPair[], apps: ProviderApp[]) => Promise<Record<string, AppDataCompletionWell[]>>;
24
+ export declare const getAppHash: (app: ProviderApp) => string;
25
+ export declare const isAppWithSettings: (app: ProviderApp) => boolean;
26
+ export declare const getInitialAppData: (app: ProviderApp) => InitializedAppDataEntry;
27
+ export declare const getInitialAppsDataState: (apps: ProviderApp[]) => InitializedAppDataDictionary;
28
+ export declare const isAppNeedingInterventionUnitWellRefresh: (app: ProviderApp) => boolean;
29
+ export declare const prepareDataForResolver: (apps: PreparedProviderApp[], cache: AppsDataCacheRef) => PreparedResolverData;
30
+ export declare const buildWellCache: (response: JsonApiCollectionResponse<WellResource>) => Record<string, WellResource>;
31
+ export declare const buildRigCache: (response: JsonApiCollectionResponse<RigResource>) => Record<string, RigResource>;
32
+ export declare const buildInterventionUnitCache: (response: JsonApiCollectionResponse) => Record<string, InterventionUnitResource>;
33
+ export declare const buildFracFleetCache: (fracFleets: AppDataFracFleet[]) => Record<string, AppDataFracFleet>;
34
+ export {};
56
35
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/utils.js"],"names":[],"mappings":"AAkBA,eAAO,MAAM,yBAAyB,mCAAmD,CAAC;AAE1F,eAAO,MAAM,eAAe,+CAKzB,CAAC;AAEJ,wBAAsB,UAAU,CAAC,GAAG,KAAA,gBAgCnC;AAED,wBAAsB,SAAS,CAAC,GAAG,KAAA,gBA4BlC;AAED,wBAAsB,4BAA4B,CAAC,QAAQ,KAAA,gBAW1D;AAwCD,eAAO,MAAM,kBAAkB,2CAW9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,yCAS7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,gEAkB5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,6CAY7B,CAAC;AAEF,eAAO,MAAM,8BAA8B,qGAsB1C,CAAC;AAEF,wBAAsB,eAAe,CAAC,GAAG,KAAA,6GAqBxC;AAED,wBAAsB,sBAAsB,CAAC,GAAG,KAAA,gBAY/C;AAED,wBAAsB,mBAAmB,CAAC,SAAS,KAAA,EAAE,IAAI,KAAA,gBAwBxD;AAED,wBAAsB,aAAa,CAAC,UAAU,KAAA,EAAE,IAAI,KAAA,gBAwBnD;AAED,eAAO,MAAM,UAAU,sBAUV,CAAC;AAEd,eAAO,MAAM,iBAAiB,uBAO3B,CAAC;AAEJ,eAAO,MAAM,iBAAiB;IAC5B,EAAE;IACF,GAAG;IACH,IAAI;IACJ,SAAS;IACT,gBAAgB;IAChB,OAAO;QACL,EAAE;QACF,IAAI;;IAEN,kBAAkB;QAChB,SAAS;YACP,EAAE;YACF,IAAI;;QAEN,GAAG;YACD,EAAE;YACF,IAAI;;;IAGR,KAAK;IACL,SAAS;IACT,OAAO;CACP,CAAC;AAEH,eAAO,MAAM,uBAAuB,oBAOjC,CAAC;AAEJ,eAAO,MAAM,uCAAuC,2BAInD,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;CA+DlC,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/utils.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB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W,KAAG,OAK1E,CAAC;AAEF,eAAO,MAAM,sBAAsB,SAC3B,mBAAmB,EAAE,SACpB,gBAAgB,KACtB,oBAoDF,CAAC;AAEF,eAAO,MAAM,cAAc,aACf,yBAAyB,CAAC,YAAY,CAAC,KAChD,MAAM,CAAC,MAAM,EAAE,YAAY,CAe3B,CAAC;AAEJ,eAAO,MAAM,aAAa,aACd,yBAAyB,CAAC,WAAW,CAAC,KAC/C,MAAM,CAAC,MAAM,EAAE,WAAW,CAW1B,CAAC;AAEJ,eAAO,MAAM,0BAA0B,aAC3B,yBAAyB,KAClC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAgBvC,CAAC;AAEJ,eAAO,MAAM,mBAAmB,eAClB,gBAAgB,EAAE,KAC7B,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAK1B,CAAC"}
@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import i from"jsona";import{get as a,uniq as u,isEmpty as l,keyBy as s}from"lodash";import{getWells as o,getRigs as c,getFracFleets as p,getInterventionUnits as d,getFracFleetWells as f,getPadWells as m,getResolvedAssets as v}from"../../../../clients/jsonApi/index.js";import{DEV_CENTER_CLI_APP_ID as w}from"../../../../constants/devcenter.js";import"../../../../constants/goals.js";import"../../../../constants/segment.js";import"../../../../constants/alerts.js";import"../../../../constants/apps.js";import"../../../../constants/drillstring.js";import"../../../../constants/completion.js";import"../../../../constants/appPackages.js";import"../../../../constants/notifications.js";import"../../../../constants/feed.js";import"../../../../constants/bha.js";import{ASSET_TYPES as b}from"../../../../constants/assetTypes.js";import"../../../../constants/corvaCompanyId.js";import"../../../GradientManager/configuration/constants.js";import{getAppSegment as h}from"../../../../utils/devcenter.js";function _(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function g(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}var y=new i,j=function(e,r){return+a(e,["settings",r])},x=function(e,r){return u(e.map((function(e){var r=t(e,2);return r[0],r[1]})).filter((function(e){return Number.isFinite(e)&&!r.includes(String(e))})))};function k(e){return I.apply(this,arguments)}function I(){return(I=r(n.mark((function e(r){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,o({ids:r,fields:["well.name","well.settings","well.custom_properties","well.company","well.asset_id","well.last_active_at","well.program","well.pad","well.frac_fleet","well.id","well.rig","rig.name","rig.asset_id","company.id","well.status","well.archivation","well.lon_lat"],include_arhivation_data:!0});case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function O(e){return F.apply(this,arguments)}function F(){return(F=r(n.mark((function e(r){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,c({ids:r,fields:["rig.name","rig.settings","rig.asset_id","rig.active_well","rig.last_active_well","well.name","well.settings","well.custom_properties","well.company","rig.program","well.asset_id","well.last_active_at","well.id","well.company.id","well.lon_lat"]});case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function P(e){return B.apply(this,arguments)}function B(){return(B=r(n.mark((function e(r){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,v({assets:r});case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}var U=function(e,r,t){return g(g({well:e&&g(g({},e.attributes),{},{id:e.id,companyId:a(e,"relationships.company.data.id")}),rig:{name:a(r,"attributes.name"),id:a(r,"id"),asset_id:a(r,"attributes.asset_id")},program:{id:a(r,"program.id")||null,name:a(r,"program.attributes.name")||null}},t&&{interventionUnit:{id:+t.id,name:t.name,active_well:t.active_well}}),{},{completionWellInfo:{pad:{id:a(e,"pad.id")||null,name:a(e,"pad.attributes.name")||null},fracFleet:{id:a(e,"fracFleet.id")||null,name:a(e,"fracFleet.attributes.name")||null}}})},W=function(e,r){return!r||l(r)?{}:e.reduce((function(e,n){var i=t(n,2),a=i[0],u=i[1],l=r[u];return l?(e[a]=U(l,l.rig),e):e}),{})},q=function(e,r){return!r||l(r)?{}:e.reduce((function(e,n){var i=t(n,2),a=i[0],u=i[1],l=r[u];return e[a]=U(null==l?void 0:l.well,l),e}),{})},D=function(e,r,n){return r||n?e.reduce((function(e,i){var a,u,l=t(i,2),s=l[0],o=l[1],c=null==r?void 0:r[o],p=null==n?void 0:n[s];return e[s]={fracFleet:c,wells:p,program:{id:(null==c||null===(a=c.program)||void 0===a?void 0:a.id)||null,name:(null==c||null===(u=c.program)||void 0===u?void 0:u.name)||null}},e}),{}):{}},T=function(e,r){return e||r?e.reduce((function(e,n){var i=t(n,2),a=i[0];i[1];var u=null==r?void 0:r[a];return e[a]={wells:u},e}),{}):{}},z=function(e,r,n,i){return!r||l(r)?{}:e.reduce((function(e,a){var u,l=t(a,2),s=l[0],o=l[1],c=r[o],p=null===(u=n.find((function(e){return e[0]===s})))||void 0===u?void 0:u[1],d=i[p]||c.well;return e[s]=U(d,null==d?void 0:d.rig,g(g({},c),c.well&&{active_well:g({id:c.well.id},c.well.attributes)})),e}),{})};function A(e){return E.apply(this,arguments)}function E(){return(E=r(n.mark((function e(r){var t;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,p({ids:r,fields:["frac_fleet.name","frac_fleet.pads","frac_fleet.program","frac_fleet.current_pad_id","frac_fleet.pad_frac_fleets","frac_fleet.pad_frac_fleet.frac_fleet_lines"]});case 5:return t=e.sent,e.abrupt("return",t?y.deserialize(t):[]);case 9:return e.prev=9,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",[]);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function S(e){return G.apply(this,arguments)}function G(){return(G=r(n.mark((function e(r){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,d({ids:r,fields:["intervention_unit.name","intervention_unit.type","intervention_unit.active_well"]});case 5:return e.abrupt("return",e.sent);case 8:return e.prev=8,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function R(e,r){return C.apply(this,arguments)}function C(){return C=r(n.mark((function e(i,u){var l,o,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=s(u,"id"),o=i.map(function(){var e=r(n.mark((function e(r){var i,u,s,o,c,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t(r,2),u=i[0],s=i[1],o={fields:"all",frac_fleet_id:s},c=l[u],u===w?o.app_key=a(c,["app","app_key"]):o.app_id=a(c,["app","id"]),e.prev=4,e.next=7,f(o);case 7:return p=e.sent,e.abrupt("return",p?y.deserialize(p):[]);case 11:return e.prev=11,e.t0=e.catch(4),console.error(e.t0),e.abrupt("return",[]);case 15:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(r){return e.apply(this,arguments)}}()),e.next=4,Promise.all(o);case 4:return c=e.sent,e.abrupt("return",c.reduce((function(e,r,t){return e[i[t][0]]=r,e}),{}));case 6:case"end":return e.stop()}}),e)}))),C.apply(this,arguments)}function H(e,r){return L.apply(this,arguments)}function L(){return L=r(n.mark((function e(i,u){var l,o,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=s(u,"id"),o=i.map(function(){var e=r(n.mark((function e(r){var i,u,s,o,c,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t(r,2),u=i[0],s=i[1],o={fields:"all"},c=l[u],u===w?o.app_key=a(c,["app","app_key"]):o.app_id=a(c,["app","id"]),e.prev=4,e.next=7,m(s,o);case 7:return p=e.sent,e.abrupt("return",p?y.deserialize(p):[]);case 11:return e.prev=11,e.t0=e.catch(4),console.error(e.t0),e.abrupt("return",[]);case 15:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(r){return e.apply(this,arguments)}}()),e.next=4,Promise.all(o);case 4:return c=e.sent,e.abrupt("return",c.reduce((function(e,r,t){return e[i[t][0]]=r,e}),{}));case 6:case"end":return e.stop()}}),e)}))),L.apply(this,arguments)}var M=function(e){return[e.id,j(e,b.well.id),j(e,b.rig.id),j(e,b.frac_fleet.id),j(e,b.pad.id),j(e,b.intervention_unit.id),j(e,"deprecatedAssetId"),h(e)].join("-")},N=function(e){return Boolean(j(e,b.well.id)||j(e,b.rig.id)||j(e,b.frac_fleet.id)||j(e,b.pad.id)||j(e,b.intervention_unit.id))},J=function(e){return{id:e.id,rig:null,well:null,fracFleet:null,interventionUnit:null,program:{id:null,name:null},completionWellInfo:{fracFleet:{id:null,name:null},pad:{id:null,name:null}},wells:null,isLoading:!0,appHash:M(e)}},K=function(r){return r.reduce((function(r,t){return g(g({},r),{},e({},t.id,J(t)))}),{})},Q=function(e){var r=j(e,b.intervention_unit.id),t=j(e,b.well.id);return r&&!t},V=function(e,r){var t=[],n=[],i=[],a=[],u=[],l=[],s=[];e.forEach((function(e){var r=j(e,b.well.id),o=j(e,b.rig.id),c=j(e,b.frac_fleet.id),p=j(e,b.pad.id),d=j(e,b.intervention_unit.id),f=e.id;s.push([f]),d?(a.push([f,d]),r&&t.push([f,r])):r?t.push([f,r]):o?n.push([f,o]):c&&(i.push([f,c]),p?l.push([f,p]):u.push([f,c]))}));var o=r.current,c=o.rigsById,p=o.wellsById,d=o.fracFleetsById,f=o.interventionUnitsById,m=x(t,Object.keys(p)),v=x(n,Object.keys(c)),w=x(i,Object.keys(d)),h=x(a,Object.keys(f));return{appsWellIds:t,appsRigIds:n,appsFracFleetIds:i,appsPadIds:l,appIds:s,appsFracFleetToFetchWellsIds:u,appsInterventionUnitIds:a,uniqueWellIds:m,uniqueRigIds:v,uniqueFFIds:w,uniqueInterventionUnitIds:h}};export{P as fetchAssetEntitiesByAssetIds,R as fetchFracFleetWells,A as fetchFracFleets,S as fetchInterventionUnits,H as fetchPadWells,O as fetchRigs,k as fetchWells,j as getAppAssetSpecificTypeId,M as getAppHash,D as getAppsDataByFFs,z as getAppsDataByInterventionUnits,T as getAppsDataByPads,q as getAppsDataByRigs,W as getAppsDataByWells,J as getInitialAppData,K as getInitialAppsDataState,x as getUniqAssetIds,Q as isAppNeedingInterventionUnitWellRefresh,N as isAppWithSettings,V as prepareDataForResolver};
1
+ import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/toConsumableArray";import i from"@babel/runtime/regenerator";import u from"jsona";import{getWells as a,getRigs as l,getFracFleets as o,getInterventionUnits as c,getFracFleetWells as s,getPadWells as p,getResolvedAssets as d}from"../../../../clients/jsonApi/index.js";import{DEV_CENTER_CLI_APP_ID as f}from"../../../../constants/devcenter.js";import"../../../../constants/goals.js";import"../../../../constants/segment.js";import"../../../../constants/alerts.js";import"../../../../constants/apps.js";import"../../../../constants/drillstring.js";import"../../../../constants/completion.js";import"../../../../constants/appPackages.js";import"../../../../constants/notifications.js";import"../../../../constants/feed.js";import"../../../../constants/bha.js";import{ASSET_TYPES as v}from"../../../../constants/assetTypes.js";import"../../../../constants/corvaCompanyId.js";import"lodash";import"../../../GradientManager/configuration/constants.js";import{getAppSegment as m}from"../../../../utils/devcenter.js";function w(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function b(r){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){e(r,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}var g=new u,_=function(e){var r=g.deserialize(e);if(!Array.isArray(r))throw new TypeError("Expected a JSON:API collection response");return r},h=function(e,r){var n,t,i=null==e||null===(n=e.relationships)||void 0===n||null===(t=n[r])||void 0===t?void 0:t.data;return i&&!Array.isArray(i)?i.id:void 0},y=function(e,r,n){return e.included.find((function(e){return e.type===r&&e.id===n}))},j=function(e){return"well"===(null==e?void 0:e.type)},k=function(e){return e.reduce((function(e,r){return e[r.id]=r,e}),{})},x=function(e,r){var n;return Number(null===(n=e.settings)||void 0===n?void 0:n[r])},O=function(e,r){return t(new Set(e.map((function(e){var r=n(e,2);return r[0],r[1]})).filter((function(e){return Number.isFinite(e)&&!r.includes(String(e))}))))},I=function(){var e=r(i.mark((function e(r){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,a({ids:r,fields:["well.name","well.settings","well.custom_properties","well.company","well.asset_id","well.last_active_at","well.program","well.pad","well.frac_fleet","well.id","well.rig","rig.name","rig.asset_id","company.id","well.status","well.archivation","well.lon_lat"],include_arhivation_data:!0});case 5:return n=e.sent,e.abrupt("return",n);case 9:return e.prev=9,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(r){return e.apply(this,arguments)}}(),F=function(){var e=r(i.mark((function e(r){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,l({ids:r,fields:["rig.name","rig.settings","rig.asset_id","rig.active_well","rig.last_active_well","well.name","well.settings","well.custom_properties","well.company","rig.program","well.asset_id","well.last_active_at","well.id","well.company.id","well.lon_lat"]});case 5:return n=e.sent,e.abrupt("return",n);case 9:return e.prev=9,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(r){return e.apply(this,arguments)}}(),P=function(){var e=r(i.mark((function e(r){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,d({assets:r});case 5:return n=e.sent,e.abrupt("return",n);case 9:return e.prev=9,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(r){return e.apply(this,arguments)}}(),A=function(e,r,n){var t,i,u,a,l,o,c,s,p,d,f,v=e?b(b({},e.attributes),{},{id:e.id,companyId:h(e,"company")}):void 0,m=n?{id:Number(n.id),name:n.name,active_well:n.active_well}:void 0;return b(b({well:v,rig:{name:null==r||null===(t=r.attributes)||void 0===t?void 0:t.name,id:null==r?void 0:r.id,asset_id:null==r||null===(i=r.attributes)||void 0===i?void 0:i.asset_id},program:{id:(null==r||null===(u=r.program)||void 0===u?void 0:u.id)||null,name:(null==r||null===(a=r.program)||void 0===a||null===(l=a.attributes)||void 0===l?void 0:l.name)||null}},m&&{interventionUnit:m}),{},{completionWellInfo:{pad:{id:(null==e||null===(o=e.pad)||void 0===o?void 0:o.id)||null,name:(null==e||null===(c=e.pad)||void 0===c||null===(s=c.attributes)||void 0===s?void 0:s.name)||null},fracFleet:{id:(null==e||null===(p=e.fracFleet)||void 0===p?void 0:p.id)||null,name:(null==e||null===(d=e.fracFleet)||void 0===d||null===(f=d.attributes)||void 0===f?void 0:f.name)||null}}})},B=function(e,r){return Object.keys(r).length?e.reduce((function(e,t){var i=n(t,2),u=i[0],a=i[1],l=r[a];return l?(e[u]=A(l,l.rig),e):e}),{}):{}},E=function(e,r){return Object.keys(r).length?e.reduce((function(e,t){var i=n(t,2),u=i[0],a=i[1],l=r[a];return e[u]=A(null==l?void 0:l.well,l),e}),{}):{}},S=function(e,r,t){return Object.keys(r).length||t?e.reduce((function(e,i){var u=n(i,2),a=u[0],l=u[1],o=r[l],c=t?t[a]:void 0,s=null==o?void 0:o.program;return e[a]={fracFleet:o,wells:c,program:{id:(null==s?void 0:s.id)||null,name:(null==s?void 0:s.name)||null}},e}),{}):{}},T=function(e,r){return e.length||r?e.reduce((function(e,t){var i=n(t,1)[0];return e[i]={wells:r?r[i]:void 0},e}),{}):{}},U=function(e,r,t,i){return Object.keys(r).length?e.reduce((function(e,u){var a,l=n(u,2),o=l[0],c=l[1],s=r[c],p=null===(a=t.find((function(e){return n(e,1)[0]===o})))||void 0===a?void 0:a[1],d=p&&i[p]||s.well;return e[o]=A(d,null==d?void 0:d.rig,b(b({},s),s.well&&{active_well:b({id:s.well.id},s.well.attributes)})),e}),{}):{}},W=function(){var e=r(i.mark((function e(r){var n,t;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,o({ids:r,fields:["frac_fleet.name","frac_fleet.pads","frac_fleet.program","frac_fleet.current_pad_id","frac_fleet.pad_frac_fleets","frac_fleet.pad_frac_fleet.frac_fleet_lines"]});case 5:if(n=e.sent){e.next=8;break}return e.abrupt("return",[]);case 8:return t=_(n),e.abrupt("return",t);case 12:return e.prev=12,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",[]);case 16:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(r){return e.apply(this,arguments)}}(),q=function(){var e=r(i.mark((function e(r){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.length){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,c({ids:r,fields:["intervention_unit.name","intervention_unit.type","intervention_unit.active_well"]});case 5:return n=e.sent,e.abrupt("return",n);case 9:return e.prev=9,e.t0=e.catch(2),console.error(e.t0),e.abrupt("return",null);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(r){return e.apply(this,arguments)}}(),D=function(){var e=r(i.mark((function e(t,u){var a,l,o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=k(u),l=t.map(function(){var e=r(i.mark((function e(r){var t,u,l,o,c,p,d,v,m;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=n(r,2),o=l[0],c=l[1],p=a[o],d={fields:"all",frac_fleet_id:c},o===f?d.app_key=null==p||null===(t=p.app)||void 0===t?void 0:t.app_key:d.app_id=null==p||null===(u=p.app)||void 0===u?void 0:u.id,e.prev=4,e.next=7,s(d);case 7:if(v=e.sent){e.next=10;break}return e.abrupt("return",[]);case 10:return m=_(v),e.abrupt("return",m);case 14:return e.prev=14,e.t0=e.catch(4),console.error(e.t0),e.abrupt("return",[]);case 18:case"end":return e.stop()}}),e,null,[[4,14]])})));return function(r){return e.apply(this,arguments)}}()),e.next=4,Promise.all(l);case 4:return o=e.sent,e.abrupt("return",o.reduce((function(e,r,n){return e[t[n][0]]=r,e}),{}));case 6:case"end":return e.stop()}}),e)})));return function(r,n){return e.apply(this,arguments)}}(),N=function(){var e=r(i.mark((function e(t,u){var a,l,o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=k(u),l=t.map(function(){var e=r(i.mark((function e(r){var t,u,l,o,c,s,d,v,m;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=n(r,2),o=l[0],c=l[1],s=a[o],d={fields:"all"},o===f?d.app_key=null==s||null===(t=s.app)||void 0===t?void 0:t.app_key:d.app_id=null==s||null===(u=s.app)||void 0===u?void 0:u.id,e.prev=4,e.next=7,p(c,d);case 7:if(v=e.sent){e.next=10;break}return e.abrupt("return",[]);case 10:return m=_(v),e.abrupt("return",m);case 14:return e.prev=14,e.t0=e.catch(4),console.error(e.t0),e.abrupt("return",[]);case 18:case"end":return e.stop()}}),e,null,[[4,14]])})));return function(r){return e.apply(this,arguments)}}()),e.next=4,Promise.all(l);case 4:return o=e.sent,e.abrupt("return",o.reduce((function(e,r,n){return e[t[n][0]]=r,e}),{}));case 6:case"end":return e.stop()}}),e)})));return function(r,n){return e.apply(this,arguments)}}(),C=function(e){return[e.id,x(e,v.well.id),x(e,v.rig.id),x(e,v.frac_fleet.id),x(e,v.pad.id),x(e,v.intervention_unit.id),x(e,"deprecatedAssetId"),m(e)].join("-")},G=function(e){return Boolean(x(e,v.well.id)||x(e,v.rig.id)||x(e,v.frac_fleet.id)||x(e,v.pad.id)||x(e,v.intervention_unit.id))},R=function(e){return{id:e.id,rig:null,well:null,fracFleet:null,interventionUnit:null,program:{id:null,name:null},completionWellInfo:{fracFleet:{id:null,name:null},pad:{id:null,name:null}},wells:null,isLoading:!0,appHash:C(e)}},z=function(e){return e.reduce((function(e,r){return e[r.id]=R(r),e}),{})},H=function(e){var r=x(e,v.intervention_unit.id),n=x(e,v.well.id);return Boolean(r&&!n)},J=function(e,r){var n=[],t=[],i=[],u=[],a=[],l=[],o=[];e.forEach((function(e){var r=x(e,v.well.id),c=x(e,v.rig.id),s=x(e,v.frac_fleet.id),p=x(e,v.pad.id),d=x(e,v.intervention_unit.id),f=e.id;o.push([f]),d?(u.push([f,d]),r&&n.push([f,r])):r?n.push([f,r]):c?t.push([f,c]):s&&(i.push([f,s]),p?l.push([f,p]):a.push([f,s]))}));var c=r.current,s=c.rigsById,p=c.wellsById,d=c.fracFleetsById,f=c.interventionUnitsById;return{appsWellIds:n,appsRigIds:t,appsFracFleetIds:i,appsPadIds:l,appIds:o,appsFracFleetToFetchWellsIds:a,appsInterventionUnitIds:u,uniqueWellIds:O(n,Object.keys(p)),uniqueRigIds:O(t,Object.keys(s)),uniqueFFIds:O(i,Object.keys(d)),uniqueInterventionUnitIds:O(u,Object.keys(f))}},L=function(e){return k(e.data.map((function(r){var n=y(e,"rig",h(r,"rig")),t=y(e,"program",h(r,"program")),i=y(e,"frac_fleet",h(r,"frac_fleet")),u=y(e,"pad",h(r,"pad")),a=b(b({},n),{},{program:t});return b(b({},r),{},{rig:a,fracFleet:i,pad:u})})))},M=function(e){return k(e.data.map((function(r){var n=h(r,"active_well")||h(r,"last_active_well"),t=y(e,"well",n),i=y(e,"program",h(r,"program")),u=j(t)?t:void 0;return b(b({},r),{},{well:u,program:i})})))},K=function(e){return k(e.data.map((function(r){var n,t=y(e,"well",h(r,"active_well")),i=j(t)?t:void 0;return b(b({},r),{},{name:null===(n=r.attributes)||void 0===n?void 0:n.name,well:i})})))},Q=function(e){return e.reduce((function(e,r){return void 0!==r.id&&(e[r.id]=r),e}),{})};export{Q as buildFracFleetCache,K as buildInterventionUnitCache,M as buildRigCache,L as buildWellCache,P as fetchAssetEntitiesByAssetIds,D as fetchFracFleetWells,W as fetchFracFleets,q as fetchInterventionUnits,N as fetchPadWells,F as fetchRigs,I as fetchWells,x as getAppAssetSpecificTypeId,C as getAppHash,S as getAppsDataByFFs,U as getAppsDataByInterventionUnits,T as getAppsDataByPads,E as getAppsDataByRigs,B as getAppsDataByWells,R as getInitialAppData,z as getInitialAppsDataState,O as getUniqAssetIds,H as isAppNeedingInterventionUnitWellRefresh,G as isAppWithSettings,J as prepareDataForResolver};
2
2
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/utils.js"],"sourcesContent":["import Jsona from 'jsona';\nimport { get, isEmpty, keyBy, uniq } from 'lodash';\n\nimport {\n getFracFleets,\n getFracFleetWells,\n getInterventionUnits,\n getPadWells,\n getResolvedAssets,\n getRigs,\n getWells,\n} from '~/clients/jsonApi';\nimport { DEV_CENTER_CLI_APP_ID } from '~constants';\nimport { ASSET_TYPES } from '~/constants/assetTypes';\nimport { getAppSegment } from '~/utils/devcenter';\n\nconst dataFormatter = new Jsona();\n\nexport const getAppAssetSpecificTypeId = (app, typeId) => +get(app, ['settings', typeId]);\n\nexport const getUniqAssetIds = (assetIds, cachedAssetIds) =>\n uniq(\n assetIds\n .map(([_appId, assetId]) => assetId)\n .filter(assetId => Number.isFinite(assetId) && !cachedAssetIds.includes(String(assetId)))\n );\n\nexport async function fetchWells(ids) {\n if (!ids.length) return null;\n\n try {\n // eslint-disable-next-line no-return-await\n return await getWells({\n ids,\n fields: [\n 'well.name',\n 'well.settings',\n 'well.custom_properties',\n 'well.company',\n 'well.asset_id',\n 'well.last_active_at',\n 'well.program',\n 'well.pad',\n 'well.frac_fleet',\n 'well.id',\n 'well.rig',\n 'rig.name',\n 'rig.asset_id',\n 'company.id',\n 'well.status',\n 'well.archivation',\n 'well.lon_lat',\n ],\n include_arhivation_data: true,\n });\n } catch (e) {\n console.error(e);\n return null;\n }\n}\n\nexport async function fetchRigs(ids) {\n if (!ids.length) return null;\n\n try {\n return await getRigs({\n ids,\n fields: [\n 'rig.name',\n 'rig.settings',\n 'rig.asset_id',\n 'rig.active_well',\n 'rig.last_active_well',\n 'well.name',\n 'well.settings',\n 'well.custom_properties',\n 'well.company',\n 'rig.program',\n 'well.asset_id',\n 'well.last_active_at',\n 'well.id',\n 'well.company.id',\n 'well.lon_lat',\n ],\n });\n } catch (e) {\n console.error(e);\n return null;\n }\n}\n\nexport async function fetchAssetEntitiesByAssetIds(assetIds) {\n if (!assetIds.length) return null;\n\n try {\n return await getResolvedAssets({\n assets: assetIds,\n });\n } catch (e) {\n console.error(e);\n return null;\n }\n}\n\nconst getWellObjectFromWellData = (well, rig, interventionUnit) => {\n return {\n well: well && {\n ...well.attributes,\n id: well.id,\n // NOTE: API doesn't return active child company id\n companyId: get(well, 'relationships.company.data.id'),\n },\n rig: {\n name: get(rig, 'attributes.name'),\n id: get(rig, 'id'),\n asset_id: get(rig, 'attributes.asset_id'),\n },\n program: {\n id: get(rig, 'program.id') || null,\n name: get(rig, 'program.attributes.name') || null,\n },\n ...(interventionUnit && {\n interventionUnit: {\n id: +interventionUnit.id,\n name: interventionUnit.name,\n active_well: interventionUnit.active_well,\n },\n }),\n // NOTE: Support ff/pad in mixpanel for Asset Dashboards\n completionWellInfo: {\n pad: {\n id: get(well, 'pad.id') || null,\n name: get(well, 'pad.attributes.name') || null,\n },\n fracFleet: {\n id: get(well, 'fracFleet.id') || null,\n name: get(well, 'fracFleet.attributes.name') || null,\n },\n },\n };\n};\n\nexport const getAppsDataByWells = (appsWellIds, wellsById) => {\n if (!wellsById || isEmpty(wellsById)) return {};\n\n return appsWellIds.reduce((acc, [appId, wellId]) => {\n const well = wellsById[wellId];\n if (!well) return acc;\n\n acc[appId] = getWellObjectFromWellData(well, well.rig);\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByRigs = (appsRigIds, rigsById) => {\n if (!rigsById || isEmpty(rigsById)) return {};\n\n return appsRigIds.reduce((acc, [appId, rigId]) => {\n const rig = rigsById[rigId];\n acc[appId] = getWellObjectFromWellData(rig?.well, rig);\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByFFs = (appsFracFleetIds, ffsById, ffWellsData) => {\n if (!ffsById && !ffWellsData) return {};\n\n return appsFracFleetIds.reduce((acc, [appId, ffId]) => {\n const fracFleet = ffsById?.[ffId];\n const wells = ffWellsData?.[appId];\n\n acc[appId] = {\n fracFleet,\n wells,\n program: {\n id: fracFleet?.program?.id || null,\n name: fracFleet?.program?.name || null,\n },\n };\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByPads = (appsPadIds, padWellsData) => {\n if (!appsPadIds && !padWellsData) return {};\n\n return appsPadIds.reduce((acc, [appId, _padId]) => {\n const wells = padWellsData?.[appId];\n\n acc[appId] = {\n wells,\n };\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByInterventionUnits = (\n appsInterventionUnitIds,\n interventionUnitsById,\n appsWellIds,\n wellsById\n) => {\n if (!interventionUnitsById || isEmpty(interventionUnitsById)) return {};\n\n return appsInterventionUnitIds.reduce((acc, [appId, interventionUnitId]) => {\n const interventionUnit = interventionUnitsById[interventionUnitId];\n const appWellId = appsWellIds.find(appWellId => appWellId[0] === appId)?.[1];\n const well = wellsById[appWellId] || interventionUnit.well;\n\n acc[appId] = getWellObjectFromWellData(well, well?.rig, {\n ...interventionUnit,\n ...(interventionUnit.well && {\n active_well: { id: interventionUnit.well.id, ...interventionUnit.well.attributes },\n }),\n });\n\n return acc;\n }, {});\n};\n\nexport async function fetchFracFleets(ids) {\n if (!ids.length) return null;\n\n try {\n const response = await getFracFleets({\n ids,\n fields: [\n 'frac_fleet.name',\n 'frac_fleet.pads',\n 'frac_fleet.program',\n 'frac_fleet.current_pad_id',\n 'frac_fleet.pad_frac_fleets',\n 'frac_fleet.pad_frac_fleet.frac_fleet_lines',\n ],\n });\n\n return response ? dataFormatter.deserialize(response) : [];\n } catch (e) {\n console.error(e);\n return [];\n }\n}\n\nexport async function fetchInterventionUnits(ids) {\n if (!ids.length) return null;\n\n try {\n return await getInterventionUnits({\n ids,\n fields: ['intervention_unit.name', 'intervention_unit.type', 'intervention_unit.active_well'],\n });\n } catch (e) {\n console.error(e);\n return null;\n }\n}\n\nexport async function fetchFracFleetWells(appsFFIds, apps) {\n const appsById = keyBy(apps, 'id');\n const requests = appsFFIds.map(async ([appId, fracFleetId]) => {\n const options = { fields: 'all', frac_fleet_id: fracFleetId };\n\n const app = appsById[appId];\n\n if (appId === DEV_CENTER_CLI_APP_ID) options.app_key = get(app, ['app', 'app_key']);\n else options.app_id = get(app, ['app', 'id']);\n try {\n const response = await getFracFleetWells(options);\n return response ? dataFormatter.deserialize(response) : [];\n } catch (e) {\n console.error(e);\n return [];\n }\n });\n\n const responses = await Promise.all(requests);\n\n return responses.reduce((acc, currFFWells, i) => {\n acc[appsFFIds[i][0]] = currFFWells;\n return acc;\n }, {});\n}\n\nexport async function fetchPadWells(appsPadIds, apps) {\n const appsById = keyBy(apps, 'id');\n const requests = appsPadIds.map(async ([appId, padId]) => {\n const options = { fields: 'all' };\n\n const app = appsById[appId];\n\n if (appId === DEV_CENTER_CLI_APP_ID) options.app_key = get(app, ['app', 'app_key']);\n else options.app_id = get(app, ['app', 'id']);\n try {\n const response = await getPadWells(padId, options);\n return response ? dataFormatter.deserialize(response) : [];\n } catch (e) {\n console.error(e);\n return [];\n }\n });\n\n const responses = await Promise.all(requests);\n\n return responses.reduce((acc, currFFWells, i) => {\n acc[appsPadIds[i][0]] = currFFWells;\n return acc;\n }, {});\n}\n\nexport const getAppHash = app =>\n [\n app.id,\n getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id),\n getAppAssetSpecificTypeId(app, 'deprecatedAssetId'),\n getAppSegment(app),\n ].join('-');\n\nexport const isAppWithSettings = app =>\n Boolean(\n getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id)\n );\n\nexport const getInitialAppData = app => ({\n id: app.id,\n rig: null,\n well: null,\n fracFleet: null,\n interventionUnit: null,\n program: {\n id: null,\n name: null,\n },\n completionWellInfo: {\n fracFleet: {\n id: null,\n name: null,\n },\n pad: {\n id: null,\n name: null,\n },\n },\n wells: null,\n isLoading: true,\n appHash: getAppHash(app),\n});\n\nexport const getInitialAppsDataState = apps =>\n apps.reduce(\n (acc, app) => ({\n ...acc,\n [app.id]: getInitialAppData(app),\n }),\n {}\n );\n\nexport const isAppNeedingInterventionUnitWellRefresh = app => {\n const interventionUnitId = getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id);\n const wellId = getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id);\n return interventionUnitId && !wellId;\n};\n\nexport const prepareDataForResolver = (apps, cache) => {\n const appsWellIds = [];\n const appsRigIds = [];\n const appsFracFleetIds = [];\n const appsInterventionUnitIds = [];\n const appsFracFleetToFetchWellsIds = [];\n const appsPadIds = [];\n const appIds = [];\n\n apps.forEach(app => {\n const appWellId = getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id);\n const appRigId = getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id);\n const appFracFleetId = getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id);\n const appPadId = getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id);\n const appInterventionUnitId = getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id);\n\n const appId = app.id;\n appIds.push([appId]);\n\n if (appInterventionUnitId) {\n appsInterventionUnitIds.push([appId, appInterventionUnitId]);\n // NOTE: we need to fetch well for intervention unit as there is no well in intervention unit\n if (appWellId) {\n appsWellIds.push([appId, appWellId]);\n }\n } else if (appWellId) {\n appsWellIds.push([appId, appWellId]);\n } else if (appRigId) {\n appsRigIds.push([appId, appRigId]);\n } else if (appFracFleetId) {\n appsFracFleetIds.push([appId, appFracFleetId]);\n if (appPadId) {\n appsPadIds.push([appId, appPadId]);\n } else {\n appsFracFleetToFetchWellsIds.push([appId, appFracFleetId]);\n }\n }\n });\n\n const { rigsById, wellsById, fracFleetsById, interventionUnitsById } = cache.current;\n\n const uniqueWellIds = getUniqAssetIds(appsWellIds, Object.keys(wellsById));\n const uniqueRigIds = getUniqAssetIds(appsRigIds, Object.keys(rigsById));\n const uniqueFFIds = getUniqAssetIds(appsFracFleetIds, Object.keys(fracFleetsById));\n const uniqueInterventionUnitIds = getUniqAssetIds(\n appsInterventionUnitIds,\n Object.keys(interventionUnitsById)\n );\n\n return {\n appsWellIds,\n appsRigIds,\n appsFracFleetIds,\n appsPadIds,\n appIds,\n appsFracFleetToFetchWellsIds,\n appsInterventionUnitIds,\n\n uniqueWellIds,\n uniqueRigIds,\n uniqueFFIds,\n uniqueInterventionUnitIds,\n };\n};\n"],"names":["dataFormatter","Jsona","getAppAssetSpecificTypeId","app","typeId","get","getUniqAssetIds","assetIds","cachedAssetIds","uniq","map","_ref","_ref2","_slicedToArray","filter","assetId","Number","isFinite","includes","String","fetchWells","_x","_fetchWells","apply","this","arguments","_asyncToGenerator","_regeneratorRuntime","mark","ids","wrap","_context","prev","next","length","abrupt","getWells","fields","include_arhivation_data","sent","t0","console","error","stop","_callee","fetchRigs","_x2","_fetchRigs","_context2","getRigs","_callee2","fetchAssetEntitiesByAssetIds","_x3","_fetchAssetEntitiesByAssetIds","_context3","getResolvedAssets","assets","_callee3","getWellObjectFromWellData","well","rig","interventionUnit","_objectSpread","attributes","id","companyId","name","asset_id","program","active_well","completionWellInfo","pad","fracFleet","getAppsDataByWells","appsWellIds","wellsById","isEmpty","reduce","acc","_ref3","_ref4","appId","wellId","getAppsDataByRigs","appsRigIds","rigsById","_ref5","_ref6","rigId","getAppsDataByFFs","appsFracFleetIds","ffsById","ffWellsData","_ref7","_fracFleet$program","_fracFleet$program2","_ref8","ffId","wells","getAppsDataByPads","appsPadIds","padWellsData","_ref9","_ref10","getAppsDataByInterventionUnits","appsInterventionUnitIds","interventionUnitsById","_ref11","_appsWellIds$find","_ref12","interventionUnitId","appWellId","find","fetchFracFleets","_x4","_fetchFracFleets","response","_context4","getFracFleets","deserialize","_callee4","fetchInterventionUnits","_x5","_fetchInterventionUnits","_context5","getInterventionUnits","_callee5","fetchFracFleetWells","_x6","_x7","_fetchFracFleetWells","_callee7","appsFFIds","apps","appsById","requests","responses","_context7","keyBy","_ref14","_callee6","_ref13","_ref15","fracFleetId","options","_context6","frac_fleet_id","DEV_CENTER_CLI_APP_ID","app_key","app_id","getFracFleetWells","_x10","Promise","all","currFFWells","i","fetchPadWells","_x8","_x9","_fetchPadWells","_callee9","_context9","_ref17","_callee8","_ref16","_ref18","padId","_context8","getPadWells","_x11","getAppHash","ASSET_TYPES","frac_fleet","intervention_unit","getAppSegment","join","isAppWithSettings","Boolean","getInitialAppData","isLoading","appHash","getInitialAppsDataState","isAppNeedingInterventionUnitWellRefresh","prepareDataForResolver","cache","appsFracFleetToFetchWellsIds","appIds","forEach","appRigId","appFracFleetId","appPadId","appInterventionUnitId","push","current","fracFleetsById","uniqueWellIds","Object","keys","uniqueRigIds","uniqueFFIds","uniqueInterventionUnitIds"],"mappings":"4uDAgBA,IAAMA,EAAgB,IAAIC,EAEbC,EAA4B,SAACC,EAAKC,GAAM,OAAMC,EAAIF,EAAK,CAAC,WAAYC,GAAQ,EAE5EE,EAAkB,SAACC,EAAUC,GAAc,OACtDC,EACEF,EACGG,KAAI,SAAAC,GAAA,IAAAC,EAAAC,EAAAF,EAAA,GAAiB,OAATC,EAAA,GAASA,EAAA,EAAa,IAClCE,QAAO,SAAAC,GAAO,OAAIC,OAAOC,SAASF,KAAaP,EAAeU,SAASC,OAAOJ,GAAS,IAC3F,EAEH,SAAsBK,EAAUC,GAAA,OAAAC,EAAAC,MAAAC,KAAAC,UAAA,CAgC/B,SAAAH,IAAA,OAAAA,EAAAI,EAAAC,EAAAC,MAhCM,WAA0BC,GAAG,OAAAF,EAAAG,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAAA,GAC7BJ,EAAIK,OAAM,CAAAH,EAAAE,KAAA,EAAA,KAAA,CAAA,OAAAF,EAAAI,OAAA,SAAS,MAAI,KAAA,EAAA,OAAAJ,EAAAC,KAA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iB3L,EAA0BC,EAAKwK,EAAYC,WAAW5G,IACvE8H,EAAW5L,EAA0BC,EAAKwK,EAAYpG,IAAIP,IAC1D+H,EAAwB7L,EAA0BC,EAAKwK,EAAYE,kBAAkB7G,IAErFiB,EAAQ9E,EAAI6D,GAClB0H,EAAOM,KAAK,CAAC/G,IAET8G,GACFtF,EAAwBuF,KAAK,CAAC/G,EAAO8G,IAEjChF,GACFrC,EAAYsH,KAAK,CAAC/G,EAAO8B,KAElBA,EACTrC,EAAYsH,KAAK,CAAC/G,EAAO8B,IAChB6E,EACTxG,EAAW4G,KAAK,CAAC/G,EAAO2G,IACfC,IACTnG,EAAiBsG,KAAK,CAAC/G,EAAO4G,IAC1BC,EACF1F,EAAW4F,KAAK,CAAC/G,EAAO6G,IAExBL,EAA6BO,KAAK,CAAC/G,EAAO4G,IAGhD,IAEA,IAAuEL,EAAAA,EAAMS,QAArE5G,IAAAA,SAAUV,IAAAA,UAAWuH,IAAAA,eAAgBxF,IAAAA,sBAEvCyF,EAAgB7L,EAAgBoE,EAAa0H,OAAOC,KAAK1H,IACzD2H,EAAehM,EAAgB8E,EAAYgH,OAAOC,KAAKhH,IACvDkH,EAAcjM,EAAgBoF,EAAkB0G,OAAOC,KAAKH,IAC5DM,EAA4BlM,EAChCmG,EACA2F,OAAOC,KAAK3F,IAGd,MAAO,CACLhC,YAAAA,EACAU,WAAAA,EACAM,iBAAAA,EACAU,WAAAA,EACAsF,OAAAA,EACAD,6BAAAA,EACAhF,wBAAAA,EAEA0F,cAAAA,EACAG,aAAAA,EACAC,YAAAA,EACAC,0BAAAA,EAEJ"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/utils.ts"],"sourcesContent":["import Jsona from 'jsona';\n\nimport {\n getFracFleets,\n getFracFleetWells,\n getInterventionUnits,\n getPadWells,\n getResolvedAssets,\n getRigs,\n getWells,\n} from '~/clients/jsonApi';\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport { ASSET_TYPES } from '~/constants/assetTypes';\nimport { getAppSegment } from '~/utils/devcenter';\n\nimport type {\n AppAssetIdPair,\n AppDataCompletionWell,\n AppDataFracFleet,\n AppDataInterventionUnit,\n AppDataPatch,\n AppDataPatches,\n AppsDataCacheRef,\n AssetId,\n InitializedAppDataDictionary,\n InitializedAppDataEntry,\n InterventionUnitResource,\n JsonApiCollectionResponse,\n JsonApiResource,\n LinkedRigResource,\n PreparedProviderApp,\n PreparedResolverData,\n ProviderApp,\n RigResource,\n WellResource,\n} from '../types';\n\nconst dataFormatter = new Jsona();\n\ntype ResolvedAssetResource = JsonApiResource & {\n attributes: { asset_id: AssetId } & Record<string, unknown>;\n};\n\nexport type ResolvedAssetResponse = Record<string, Array<{ data: ResolvedAssetResource }>>;\n\ntype JsonaInput = Parameters<typeof dataFormatter.deserialize>[0];\n\nconst deserializeCollection = (response: JsonaInput) => {\n const deserialized = dataFormatter.deserialize(response);\n\n if (!Array.isArray(deserialized)) {\n throw new TypeError('Expected a JSON:API collection response');\n }\n\n return deserialized;\n};\n\nconst getRelationshipId = (resource: JsonApiResource | undefined, name: string) => {\n const data = resource?.relationships?.[name]?.data;\n\n return data && !Array.isArray(data) ? data.id : undefined;\n};\n\nconst findIncludedResource = (\n response: JsonApiCollectionResponse,\n type: string,\n id: AssetId | undefined\n) => response.included.find(item => item.type === type && item.id === id);\n\nconst isWellResource = (resource: JsonApiResource | undefined): resource is WellResource =>\n resource?.type === 'well';\n\nconst keyResourcesById = <Resource extends { id: AssetId }>(resources: Resource[]) =>\n resources.reduce<Record<string, Resource>>((acc, resource) => {\n acc[resource.id] = resource;\n\n return acc;\n }, {});\n\nexport const getAppAssetSpecificTypeId = (app: ProviderApp, typeId: string): number =>\n Number(app.settings?.[typeId]);\n\nexport const getUniqAssetIds = (assetIds: AppAssetIdPair[], cachedAssetIds: string[]): number[] => [\n ...new Set(\n assetIds\n .map(([_appId, assetId]) => assetId)\n .filter(assetId => Number.isFinite(assetId) && !cachedAssetIds.includes(String(assetId)))\n ),\n];\n\nexport const fetchWells = async (\n ids: number[]\n): Promise<JsonApiCollectionResponse<WellResource> | null> => {\n if (!ids.length) return null;\n\n try {\n const response: JsonApiCollectionResponse<WellResource> = await getWells({\n ids,\n fields: [\n 'well.name',\n 'well.settings',\n 'well.custom_properties',\n 'well.company',\n 'well.asset_id',\n 'well.last_active_at',\n 'well.program',\n 'well.pad',\n 'well.frac_fleet',\n 'well.id',\n 'well.rig',\n 'rig.name',\n 'rig.asset_id',\n 'company.id',\n 'well.status',\n 'well.archivation',\n 'well.lon_lat',\n ],\n include_arhivation_data: true,\n });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nexport const fetchRigs = async (\n ids: number[]\n): Promise<JsonApiCollectionResponse<RigResource> | null> => {\n if (!ids.length) return null;\n\n try {\n const response: JsonApiCollectionResponse<RigResource> = await getRigs({\n ids,\n fields: [\n 'rig.name',\n 'rig.settings',\n 'rig.asset_id',\n 'rig.active_well',\n 'rig.last_active_well',\n 'well.name',\n 'well.settings',\n 'well.custom_properties',\n 'well.company',\n 'rig.program',\n 'well.asset_id',\n 'well.last_active_at',\n 'well.id',\n 'well.company.id',\n 'well.lon_lat',\n ],\n });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nexport const fetchAssetEntitiesByAssetIds = async (\n assetIds: Array<AssetId | null | undefined>\n): Promise<ResolvedAssetResponse | null> => {\n if (!assetIds.length) return null;\n\n try {\n const response: ResolvedAssetResponse = await getResolvedAssets({ assets: assetIds });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nconst getWellObjectFromWellData = (\n well: WellResource | undefined,\n rig: RigResource | LinkedRigResource | undefined,\n interventionUnit?: InterventionUnitResource\n): AppDataPatch => {\n const appDataWell = well\n ? {\n ...well.attributes,\n id: well.id,\n // NOTE: API doesn't return active child company id\n companyId: getRelationshipId(well, 'company'),\n }\n : undefined;\n\n const appDataInterventionUnit: AppDataInterventionUnit | undefined = interventionUnit\n ? {\n id: Number(interventionUnit.id),\n name: interventionUnit.name,\n active_well: interventionUnit.active_well,\n }\n : undefined;\n\n return {\n well: appDataWell,\n rig: {\n name: rig?.attributes?.name,\n id: rig?.id,\n asset_id: rig?.attributes?.asset_id,\n },\n program: {\n id: rig?.program?.id || null,\n name: rig?.program?.attributes?.name || null,\n },\n ...(appDataInterventionUnit && { interventionUnit: appDataInterventionUnit }),\n // NOTE: Support ff/pad in mixpanel for Asset Dashboards\n completionWellInfo: {\n pad: {\n id: well?.pad?.id || null,\n name: well?.pad?.attributes?.name || null,\n },\n fracFleet: {\n id: well?.fracFleet?.id || null,\n name: well?.fracFleet?.attributes?.name || null,\n },\n },\n };\n};\n\nexport const getAppsDataByWells = (\n appsWellIds: AppAssetIdPair[],\n wellsById: Record<string, WellResource>\n): AppDataPatches => {\n if (!Object.keys(wellsById).length) return {};\n\n return appsWellIds.reduce<AppDataPatches>((acc, [appId, wellId]) => {\n const well = wellsById[wellId];\n if (!well) return acc;\n\n acc[appId] = getWellObjectFromWellData(well, well.rig);\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByRigs = (\n appsRigIds: AppAssetIdPair[],\n rigsById: Record<string, RigResource>\n): AppDataPatches => {\n if (!Object.keys(rigsById).length) return {};\n\n return appsRigIds.reduce<AppDataPatches>((acc, [appId, rigId]) => {\n const rig = rigsById[rigId];\n acc[appId] = getWellObjectFromWellData(rig?.well, rig);\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByFFs = (\n appsFracFleetIds: AppAssetIdPair[],\n ffsById: Record<string, AppDataFracFleet>,\n ffWellsData: Record<string, AppDataCompletionWell[]> | null | false\n): AppDataPatches => {\n if (!Object.keys(ffsById).length && !ffWellsData) return {};\n\n return appsFracFleetIds.reduce<AppDataPatches>((acc, [appId, ffId]) => {\n const fracFleet = ffsById[ffId];\n const wells = ffWellsData ? ffWellsData[appId] : undefined;\n const program = fracFleet?.program;\n\n acc[appId] = {\n fracFleet,\n wells,\n program: {\n id: program?.id || null,\n name: program?.name || null,\n },\n };\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByPads = (\n appsPadIds: AppAssetIdPair[],\n padWellsData: Record<string, AppDataCompletionWell[]> | null | false\n): AppDataPatches => {\n if (!appsPadIds.length && !padWellsData) return {};\n\n return appsPadIds.reduce<AppDataPatches>((acc, [appId]) => {\n acc[appId] = { wells: padWellsData ? padWellsData[appId] : undefined };\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByInterventionUnits = (\n appsInterventionUnitIds: AppAssetIdPair[],\n interventionUnitsById: Record<string, InterventionUnitResource>,\n appsWellIds: AppAssetIdPair[],\n wellsById: Record<string, WellResource>\n): AppDataPatches => {\n if (!Object.keys(interventionUnitsById).length) return {};\n\n return appsInterventionUnitIds.reduce<AppDataPatches>((acc, [appId, interventionUnitId]) => {\n const interventionUnit = interventionUnitsById[interventionUnitId];\n const appWellId = appsWellIds.find(([wellAppId]) => wellAppId === appId)?.[1];\n const well = (appWellId && wellsById[appWellId]) || interventionUnit.well;\n\n acc[appId] = getWellObjectFromWellData(well, well?.rig, {\n ...interventionUnit,\n ...(interventionUnit.well && {\n active_well: { id: interventionUnit.well.id, ...interventionUnit.well.attributes },\n }),\n });\n\n return acc;\n }, {});\n};\n\nexport const fetchFracFleets = async (ids: number[]): Promise<AppDataFracFleet[] | null> => {\n if (!ids.length) return null;\n\n try {\n const response = await getFracFleets({\n ids,\n fields: [\n 'frac_fleet.name',\n 'frac_fleet.pads',\n 'frac_fleet.program',\n 'frac_fleet.current_pad_id',\n 'frac_fleet.pad_frac_fleets',\n 'frac_fleet.pad_frac_fleet.frac_fleet_lines',\n ],\n });\n if (!response) return [];\n\n const fracFleets: AppDataFracFleet[] = deserializeCollection(response);\n\n return fracFleets;\n } catch (error) {\n console.error(error);\n return [];\n }\n};\n\nexport const fetchInterventionUnits = async (\n ids: number[]\n): Promise<JsonApiCollectionResponse | null> => {\n if (!ids.length) return null;\n\n try {\n const response: JsonApiCollectionResponse = await getInterventionUnits({\n ids,\n fields: ['intervention_unit.name', 'intervention_unit.type', 'intervention_unit.active_well'],\n });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nexport const fetchFracFleetWells = async (\n appsFFIds: AppAssetIdPair[],\n apps: ProviderApp[]\n): Promise<Record<string, AppDataCompletionWell[]>> => {\n const appsById = keyResourcesById(apps);\n const requests = appsFFIds.map(async ([appId, fracFleetId]) => {\n const app = appsById[appId];\n const options: Record<string, unknown> = { fields: 'all', frac_fleet_id: fracFleetId };\n\n if (appId === DEV_CENTER_CLI_APP_ID) options.app_key = app?.app?.app_key;\n else options.app_id = app?.app?.id;\n\n try {\n const response = await getFracFleetWells(options);\n if (!response) return [];\n\n const wells: AppDataCompletionWell[] = deserializeCollection(response);\n\n return wells;\n } catch (error) {\n console.error(error);\n return [];\n }\n });\n\n const responses = await Promise.all(requests);\n\n return responses.reduce<Record<string, AppDataCompletionWell[]>>((acc, wells, index) => {\n acc[appsFFIds[index][0]] = wells;\n\n return acc;\n }, {});\n};\n\nexport const fetchPadWells = async (\n appsPadIds: AppAssetIdPair[],\n apps: ProviderApp[]\n): Promise<Record<string, AppDataCompletionWell[]>> => {\n const appsById = keyResourcesById(apps);\n const requests = appsPadIds.map(async ([appId, padId]) => {\n const app = appsById[appId];\n const options: Record<string, unknown> = { fields: 'all' };\n\n if (appId === DEV_CENTER_CLI_APP_ID) options.app_key = app?.app?.app_key;\n else options.app_id = app?.app?.id;\n\n try {\n const response = await getPadWells(padId, options);\n if (!response) return [];\n\n const wells: AppDataCompletionWell[] = deserializeCollection(response);\n\n return wells;\n } catch (error) {\n console.error(error);\n return [];\n }\n });\n\n const responses = await Promise.all(requests);\n\n return responses.reduce<Record<string, AppDataCompletionWell[]>>((acc, wells, index) => {\n acc[appsPadIds[index][0]] = wells;\n\n return acc;\n }, {});\n};\n\nexport const getAppHash = (app: ProviderApp): string =>\n [\n app.id,\n getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id),\n getAppAssetSpecificTypeId(app, 'deprecatedAssetId'),\n getAppSegment(app),\n ].join('-');\n\nexport const isAppWithSettings = (app: ProviderApp): boolean =>\n Boolean(\n getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id)\n );\n\nexport const getInitialAppData = (app: ProviderApp): InitializedAppDataEntry => ({\n id: app.id,\n rig: null,\n well: null,\n fracFleet: null,\n interventionUnit: null,\n program: { id: null, name: null },\n completionWellInfo: {\n fracFleet: { id: null, name: null },\n pad: { id: null, name: null },\n },\n wells: null,\n isLoading: true,\n appHash: getAppHash(app),\n});\n\nexport const getInitialAppsDataState = (apps: ProviderApp[]): InitializedAppDataDictionary =>\n apps.reduce<InitializedAppDataDictionary>((acc, app) => {\n acc[app.id] = getInitialAppData(app);\n\n return acc;\n }, {});\n\nexport const isAppNeedingInterventionUnitWellRefresh = (app: ProviderApp): boolean => {\n const interventionUnitId = getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id);\n const wellId = getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id);\n\n return Boolean(interventionUnitId && !wellId);\n};\n\nexport const prepareDataForResolver = (\n apps: PreparedProviderApp[],\n cache: AppsDataCacheRef\n): PreparedResolverData => {\n const appsWellIds: AppAssetIdPair[] = [];\n const appsRigIds: AppAssetIdPair[] = [];\n const appsFracFleetIds: AppAssetIdPair[] = [];\n const appsInterventionUnitIds: AppAssetIdPair[] = [];\n const appsFracFleetToFetchWellsIds: AppAssetIdPair[] = [];\n const appsPadIds: AppAssetIdPair[] = [];\n const appIds: [ProviderApp['id']][] = [];\n\n apps.forEach(app => {\n const appWellId = getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id);\n const appRigId = getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id);\n const appFracFleetId = getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id);\n const appPadId = getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id);\n const appInterventionUnitId = getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id);\n const appId = app.id;\n\n appIds.push([appId]);\n\n if (appInterventionUnitId) {\n appsInterventionUnitIds.push([appId, appInterventionUnitId]);\n // NOTE: we need to fetch well for intervention unit as there is no well in intervention unit\n if (appWellId) appsWellIds.push([appId, appWellId]);\n } else if (appWellId) {\n appsWellIds.push([appId, appWellId]);\n } else if (appRigId) {\n appsRigIds.push([appId, appRigId]);\n } else if (appFracFleetId) {\n appsFracFleetIds.push([appId, appFracFleetId]);\n if (appPadId) appsPadIds.push([appId, appPadId]);\n else appsFracFleetToFetchWellsIds.push([appId, appFracFleetId]);\n }\n });\n\n const { rigsById, wellsById, fracFleetsById, interventionUnitsById } = cache.current;\n\n return {\n appsWellIds,\n appsRigIds,\n appsFracFleetIds,\n appsPadIds,\n appIds,\n appsFracFleetToFetchWellsIds,\n appsInterventionUnitIds,\n uniqueWellIds: getUniqAssetIds(appsWellIds, Object.keys(wellsById)),\n uniqueRigIds: getUniqAssetIds(appsRigIds, Object.keys(rigsById)),\n uniqueFFIds: getUniqAssetIds(appsFracFleetIds, Object.keys(fracFleetsById)),\n uniqueInterventionUnitIds: getUniqAssetIds(\n appsInterventionUnitIds,\n Object.keys(interventionUnitsById)\n ),\n };\n};\n\nexport const buildWellCache = (\n response: JsonApiCollectionResponse<WellResource>\n): Record<string, WellResource> =>\n keyResourcesById(\n response.data.map(well => {\n const rigResource = findIncludedResource(response, 'rig', getRelationshipId(well, 'rig'));\n const program = findIncludedResource(response, 'program', getRelationshipId(well, 'program'));\n const fracFleet = findIncludedResource(\n response,\n 'frac_fleet',\n getRelationshipId(well, 'frac_fleet')\n );\n const pad = findIncludedResource(response, 'pad', getRelationshipId(well, 'pad'));\n const rig = { ...rigResource, program };\n\n return { ...well, rig, fracFleet, pad };\n })\n );\n\nexport const buildRigCache = (\n response: JsonApiCollectionResponse<RigResource>\n): Record<string, RigResource> =>\n keyResourcesById(\n response.data.map(rig => {\n const wellId =\n getRelationshipId(rig, 'active_well') || getRelationshipId(rig, 'last_active_well');\n const wellResource = findIncludedResource(response, 'well', wellId);\n const program = findIncludedResource(response, 'program', getRelationshipId(rig, 'program'));\n const well = isWellResource(wellResource) ? wellResource : undefined;\n\n return { ...rig, well, program };\n })\n );\n\nexport const buildInterventionUnitCache = (\n response: JsonApiCollectionResponse\n): Record<string, InterventionUnitResource> =>\n keyResourcesById(\n response.data.map(interventionUnit => {\n const wellResource = findIncludedResource(\n response,\n 'well',\n getRelationshipId(interventionUnit, 'active_well')\n );\n const well = isWellResource(wellResource) ? wellResource : undefined;\n\n return {\n ...interventionUnit,\n name: interventionUnit.attributes?.name,\n well,\n };\n })\n );\n\nexport const buildFracFleetCache = (\n fracFleets: AppDataFracFleet[]\n): Record<string, AppDataFracFleet> =>\n fracFleets.reduce<Record<string, AppDataFracFleet>>((acc, fracFleet) => {\n if (fracFleet.id !== undefined) acc[fracFleet.id] = fracFleet;\n\n return acc;\n }, {});\n"],"names":["dataFormatter","Jsona","deserializeCollection","response","deserialized","deserialize","Array","isArray","TypeError","getRelationshipId","resource","name","_resource$relationshi","_resource$relationshi2","data","relationships","id","undefined","findIncludedResource","type","included","find","item","isWellResource","keyResourcesById","resources","reduce","acc","getAppAssetSpecificTypeId","app","typeId","_app$settings","Number","settings","getUniqAssetIds","assetIds","cachedAssetIds","_toConsumableArray","Set","map","_ref","_ref2","_slicedToArray","filter","assetId","isFinite","includes","String","fetchWells","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","ids","wrap","_context","prev","next","length","abrupt","getWells","fields","include_arhivation_data","sent","t0","console","error","stop","_callee","_x","apply","this","arguments","fetchRigs","_ref4","_context2","getRigs","_callee2","_x2","fetchAssetEntitiesByAssetIds","_ref5","_context3","getResolvedAssets","assets","_callee3","_x3","getWellObjectFromWellData","well","rig","interventionUnit","_rig$attributes","_rig$attributes2","_rig$program","_rig$program2","_rig$program2$attribu","_well$pad","_well$pad2","_well$pad2$attributes","_well$fracFleet","_well$fracFleet2","_well$fracFleet2$attr","appDataWell","attributes","companyId","appDataInterventionUnit","active_well","_objectSpread","asset_id","program","completionWellInfo","pad","fracFleet","getAppsDataByWells","appsWellIds","wellsById","Object","keys","_ref6","_ref7","appId","wellId","getAppsDataByRigs","appsRigIds","rigsById","_ref8","_ref9","rigId","getAppsDataByFFs","appsFracFleetIds","ffsById","ffWellsData","_ref10","_ref11","ffId","wells","getAppsDataByPads","appsPadIds","padWellsData","_ref12","getAppsDataByInterventionUnits","appsInterventionUnitIds","interventionUnitsById","_ref14","_appsWellIds$find","_ref15","interventionUnitId","appWellId","_ref16","fetchFracFleets","_ref18","fracFleets","_context4","getFracFleets","_callee4","_x4","fetchInterventionUnits","_ref19","_context5","getInterventionUnits","_callee5","_x5","fetchFracFleetWells","_ref20","_callee7","appsFFIds","apps","appsById","requests","responses","_context7","_ref22","_callee6","_ref21","_app$app","_app$app2","_ref23","fracFleetId","options","_context6","frac_fleet_id","DEV_CENTER_CLI_APP_ID","app_key","app_id","getFracFleetWells","_x8","Promise","all","index","_x6","_x7","fetchPadWells","_ref24","_callee9","_context9","_ref26","_callee8","_ref25","_app$app3","_app$app4","_ref27","padId","_context8","getPadWells","_x11","_x9","_x10","getAppHash","ASSET_TYPES","frac_fleet","intervention_unit","getAppSegment","join","isAppWithSettings","Boolean","getInitialAppData","isLoading","appHash","getInitialAppsDataState","isAppNeedingInterventionUnitWellRefresh","prepareDataForResolver","cache","appsFracFleetToFetchWellsIds","appIds","forEach","appRigId","appFracFleetId","appPadId","appInterventionUnitId","push","current","fracFleetsById","uniqueWellIds","uniqueRigIds","uniqueFFIds","uniqueInterventionUnitIds","buildWellCache","rigResource","buildRigCache","wellResource","buildInterventionUnitCache","_interventionUnit$att","buildFracFleetCache"],"mappings":"ovDAqCA,IAAMA,EAAgB,IAAIC,EAUpBC,EAAwB,SAACC,GAC7B,IAAMC,EAAeJ,EAAcK,YAAYF,GAE/C,IAAKG,MAAMC,QAAQH,GACjB,MAAM,IAAII,UAAU,2CAGtB,OAAOJ,CACT,EAEMK,EAAoB,SAACC,EAAuCC,GAAiB,IAAAC,EAAAC,EAC3EC,EAAOJ,iBAAAA,EAAAA,EAAUK,4BAAqB,UAA/BH,EAA0BD,UAAK,IAAAE,OAA/BH,EAAAG,EAAiCC,KAE9C,OAAOA,IAASR,MAAMC,QAAQO,GAAQA,EAAKE,QAAKC,CAClD,EAEMC,EAAuB,SAC3Bf,EACAgB,EACAH,GAAuB,OACpBb,EAASiB,SAASC,MAAK,SAAAC,GAAI,OAAIA,EAAKH,OAASA,GAAQG,EAAKN,KAAOA,IAAG,EAEnEO,EAAiB,SAACb,GAAqC,MACxC,UAAnBA,eAAAA,EAAUS,KAAe,EAErBK,EAAmB,SAAmCC,GAAqB,OAC/EA,EAAUC,QAAiC,SAACC,EAAKjB,GAG/C,OAFAiB,EAAIjB,EAASM,IAAMN,EAEZiB,CACR,GAAE,CAAE,EAAC,EAEKC,EAA4B,SAACC,EAAkBC,GAAc,IAAAC,EAAA,OACxEC,OAAO,UAAAH,EAAII,gBAAJ,IAAAF,OAAA,EAAAA,EAAeD,GAAQ,EAEnBI,EAAkB,SAACC,EAA4BC,GAAwB,OAAAC,EAC/E,IAAIC,IACLH,EACGI,KAAI,SAAAC,GAAA,IAAAC,EAAAC,EAAAF,EAAA,GAAiB,OAATC,EAAA,GAASA,EAAA,EAAa,IAClCE,QAAO,SAAAC,GAAO,OAAIZ,OAAOa,SAASD,KAAaR,EAAeU,SA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ACC,EAAKoF,GAGxD,YAFqB9F,IAAjB8F,EAAU/F,KAAkBW,EAAIoF,EAAU/F,IAAM+F,GAE7CpF,CACR,GAAE,CAAE,EAAC"}
@@ -1,2 +1,3 @@
1
1
  export { default } from './AppsDataProvider';
2
+ export type { AppDataAssets, AppDataDictionary, AppDataEntry, AppsDataProviderProps, InitializedAppDataEntry, ProviderApp, UseAppsDataParams, } from './types';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppsDataProvider/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppsDataProvider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,216 @@
1
+ import type { ReactNode } from 'react';
2
+ export type AppId = string | number;
3
+ export type AssetId = string | number;
4
+ export type DashboardAssetId = AssetId | null | undefined;
5
+ export type AppSettings = {
6
+ wellId?: AssetId | null;
7
+ rigId?: AssetId | null;
8
+ fracFleetId?: AssetId | null;
9
+ padId?: AssetId | null;
10
+ interventionUnitId?: AssetId | null;
11
+ deprecatedAssetId?: AssetId | null;
12
+ segment?: string;
13
+ } & Record<string, unknown>;
14
+ export type ProviderApp = {
15
+ id: AppId;
16
+ settings?: AppSettings;
17
+ platform?: string;
18
+ segment?: string[];
19
+ category?: string;
20
+ app?: {
21
+ id?: AppId;
22
+ app_key?: string;
23
+ platform?: string;
24
+ ui_settings?: {
25
+ multi_rig?: boolean;
26
+ multi_rig_on_chipless_dashboard?: boolean;
27
+ } & Record<string, unknown>;
28
+ } & Record<string, unknown>;
29
+ } & Record<string, unknown>;
30
+ export type PreparedProviderApp = ProviderApp & {
31
+ appHash: string;
32
+ };
33
+ export type DashboardMeta = {
34
+ isChiplessDashboard?: boolean;
35
+ } & Record<string, unknown>;
36
+ export type AppsDataProviderProps = {
37
+ children: ReactNode;
38
+ dashboardAssetId?: DashboardAssetId;
39
+ apps: ProviderApp[];
40
+ dashboardMeta?: DashboardMeta;
41
+ };
42
+ export type UseAppsDataParams = Omit<AppsDataProviderProps, 'children'>;
43
+ export type JsonApiIdentifier = {
44
+ id: AssetId;
45
+ type: string;
46
+ };
47
+ export type JsonApiRelationship = {
48
+ data: JsonApiIdentifier | JsonApiIdentifier[] | null;
49
+ };
50
+ export type JsonApiAttributes = {
51
+ name?: string | null;
52
+ asset_id?: number;
53
+ } & Record<string, unknown>;
54
+ export type JsonApiResource = JsonApiIdentifier & {
55
+ attributes?: JsonApiAttributes;
56
+ relationships?: Record<string, JsonApiRelationship>;
57
+ };
58
+ export type JsonApiCollectionResponse<Resource extends JsonApiResource = JsonApiResource> = {
59
+ data: Resource[];
60
+ included: JsonApiResource[];
61
+ };
62
+ export type WellAttributes = {
63
+ name?: string | null;
64
+ asset_id?: number;
65
+ settings?: Record<string, unknown> | null;
66
+ custom_properties?: Record<string, unknown> | null;
67
+ last_active_at?: string | null;
68
+ status?: string | null;
69
+ archivation?: Record<string, unknown> | null;
70
+ lon_lat?: unknown;
71
+ } & Record<string, unknown>;
72
+ export type RigAttributes = {
73
+ name?: string | null;
74
+ asset_id?: number;
75
+ settings?: Record<string, unknown> | null;
76
+ last_active_at?: string | null;
77
+ } & Record<string, unknown>;
78
+ export type WellResource = JsonApiResource & {
79
+ attributes?: WellAttributes;
80
+ rig?: LinkedRigResource;
81
+ fracFleet?: JsonApiResource;
82
+ pad?: JsonApiResource;
83
+ };
84
+ export type RigResource = JsonApiResource & {
85
+ attributes?: RigAttributes;
86
+ well?: WellResource;
87
+ program?: JsonApiResource;
88
+ };
89
+ export type LinkedRigResource = Partial<RigResource>;
90
+ export type InterventionUnitResource = JsonApiResource & {
91
+ name?: string | null;
92
+ well?: WellResource;
93
+ active_well?: AppDataWell;
94
+ };
95
+ /** Selected API attributes remain open because sparse fieldsets and app payloads are extensible. */
96
+ export type AppDataWell = WellAttributes & {
97
+ id?: AssetId;
98
+ companyId?: AssetId;
99
+ /** Supported only for legacy external AppContext producers. */
100
+ company_id?: number;
101
+ };
102
+ export type AppDataRig = {
103
+ id?: AssetId;
104
+ name?: string | null;
105
+ asset_id?: number;
106
+ /** Supported only for legacy external AppContext producers. */
107
+ company_id?: number;
108
+ } & Record<string, unknown>;
109
+ export type AppDataProgram = {
110
+ id: AssetId | null;
111
+ name: string | null;
112
+ };
113
+ export type AppDataAssetSummary = {
114
+ id: AssetId | null;
115
+ name: string | null;
116
+ };
117
+ /** Jsona keeps all requested frac-fleet attributes and included relationships on this object. */
118
+ export type AppDataFracFleet = {
119
+ id?: AssetId;
120
+ name?: string | null;
121
+ current_pad_id?: number | null;
122
+ lon_lat?: unknown;
123
+ frac_fleet_vendor?: string | null;
124
+ last_active_at?: string | null;
125
+ program?: {
126
+ id?: AssetId;
127
+ name?: string | null;
128
+ };
129
+ } & Record<string, unknown>;
130
+ /** Jsona output from WellDetailSerializer; fields beyond those read here stay forward-compatible. */
131
+ export type AppDataCompletionWell = {
132
+ id?: AssetId;
133
+ name?: string | null;
134
+ asset_id?: number;
135
+ status?: string | null;
136
+ stats?: Record<string, unknown> | null;
137
+ last_active_at?: string | null;
138
+ custom_properties?: Record<string, unknown> | null;
139
+ lon_lat?: unknown;
140
+ is_active?: boolean;
141
+ } & Record<string, unknown>;
142
+ export type AppDataInterventionUnit = {
143
+ id?: number;
144
+ name?: string | null;
145
+ active_well?: AppDataWell;
146
+ };
147
+ /** Public context entries may be partial when supplied by legacy external producers. */
148
+ export type AppDataEntry = {
149
+ id?: AppId;
150
+ rig?: AppDataRig | null;
151
+ well?: AppDataWell | null;
152
+ fracFleet?: AppDataFracFleet | null;
153
+ interventionUnit?: AppDataInterventionUnit | null;
154
+ program?: AppDataProgram;
155
+ completionWellInfo?: {
156
+ pad: AppDataAssetSummary;
157
+ fracFleet: AppDataAssetSummary;
158
+ };
159
+ wells?: AppDataCompletionWell[] | null;
160
+ settings?: AppSettings;
161
+ isLoading?: boolean;
162
+ appHash?: string;
163
+ };
164
+ type AppDataAssetKey = 'well' | 'rig' | 'fracFleet' | 'wells' | 'interventionUnit';
165
+ export type AppDataAssets = {
166
+ [Key in AppDataAssetKey]?: Exclude<AppDataEntry[Key], null | undefined>;
167
+ };
168
+ export type InitializedAppDataEntry = AppDataEntry & {
169
+ id: AppId;
170
+ rig: null;
171
+ well: null;
172
+ fracFleet: null;
173
+ interventionUnit: null;
174
+ program: AppDataProgram;
175
+ completionWellInfo: {
176
+ pad: AppDataAssetSummary;
177
+ fracFleet: AppDataAssetSummary;
178
+ };
179
+ wells: null;
180
+ isLoading: true;
181
+ appHash: string;
182
+ };
183
+ export type AppDataDictionary = Record<string, AppDataEntry>;
184
+ export type InitializedAppDataDictionary = Record<string, InitializedAppDataEntry>;
185
+ export type AppDataPatch = Omit<AppDataEntry, 'id' | 'isLoading' | 'appHash'>;
186
+ export type AppDataPatches = Record<string, AppDataPatch>;
187
+ export type AppAssetIdPair = [AppId, number];
188
+ export type AppsDataCache = {
189
+ wellsById: Record<string, WellResource>;
190
+ rigsById: Record<string, RigResource>;
191
+ fracFleetsById: Record<string, AppDataFracFleet>;
192
+ interventionUnitsById: Record<string, InterventionUnitResource>;
193
+ deprecatedAssetData: Record<string, AppSettings>;
194
+ /** Legacy typo retained during the migration to avoid changing cache behavior. */
195
+ cachedDeprecatedAssetData?: Record<string, AppSettings>;
196
+ };
197
+ export type AppsDataCacheRef = {
198
+ current: AppsDataCache;
199
+ };
200
+ export type AppsDataCacheUpdate = Partial<AppsDataCache>;
201
+ export type UpdateAppsDataCache = (updates: AppsDataCacheUpdate) => void;
202
+ export type PreparedResolverData = {
203
+ appsWellIds: AppAssetIdPair[];
204
+ appsRigIds: AppAssetIdPair[];
205
+ appsFracFleetIds: AppAssetIdPair[];
206
+ appsPadIds: AppAssetIdPair[];
207
+ appIds: [AppId][];
208
+ appsFracFleetToFetchWellsIds: AppAssetIdPair[];
209
+ appsInterventionUnitIds: AppAssetIdPair[];
210
+ uniqueWellIds: number[];
211
+ uniqueRigIds: number[];
212
+ uniqueFFIds: number[];
213
+ uniqueInterventionUnitIds: number[];
214
+ };
215
+ export {};
216
+ //# sourceMappingURL=types.d.ts.map