synapse-react-client 4.0.46 → 4.0.47

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 (559) hide show
  1. package/dist/SWC.index.js +1 -1
  2. package/dist/aridhia-queries/useSubmitAridhiaDar.js +2 -2
  3. package/dist/aridhia-queries/useSubmitAridhiaDar.js.map +1 -1
  4. package/dist/components/AccessTokenPage/CreateAccessTokenModal.js +1 -1
  5. package/dist/components/AccessTokenPage/CreateAccessTokenModal.js.map +1 -1
  6. package/dist/components/AccountLevelBadges/AccountLevelBadges.js +1 -1
  7. package/dist/components/AccountLevelBadges/AccountLevelBadges.js.map +1 -1
  8. package/dist/components/AclEditor/AclEditor.test-utils.js +3 -5
  9. package/dist/components/AclEditor/AclEditor.test-utils.js.map +1 -1
  10. package/dist/components/Aridhia/AridhiaAccessStatus.d.ts.map +1 -1
  11. package/dist/components/Aridhia/AridhiaAccessStatus.js +43 -30
  12. package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
  13. package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts +6 -2
  14. package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts.map +1 -1
  15. package/dist/components/Aridhia/AridhiaDarStatusPopover.js +101 -31
  16. package/dist/components/Aridhia/AridhiaDarStatusPopover.js.map +1 -1
  17. package/dist/components/Aridhia/aridhiaAccessStatusUtils.d.ts +11 -9
  18. package/dist/components/Aridhia/aridhiaAccessStatusUtils.d.ts.map +1 -1
  19. package/dist/components/Aridhia/aridhiaAccessStatusUtils.js +24 -13
  20. package/dist/components/Aridhia/aridhiaAccessStatusUtils.js.map +1 -1
  21. package/dist/components/Authentication/LastLoginInfo.js +2 -2
  22. package/dist/components/Authentication/LastLoginInfo.js.map +1 -1
  23. package/dist/components/Authentication/RecoveryCodeForm.js +1 -1
  24. package/dist/components/Authentication/RecoveryCodeForm.js.map +1 -1
  25. package/dist/components/Authentication/RecoveryCodeGrid.js.map +1 -1
  26. package/dist/components/Authentication/TOTPForm.d.ts.map +1 -1
  27. package/dist/components/Authentication/TOTPForm.js +3 -3
  28. package/dist/components/Authentication/TOTPForm.js.map +1 -1
  29. package/dist/components/Authentication/index.d.ts +6 -6
  30. package/dist/components/Authentication/index.d.ts.map +1 -1
  31. package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js +1 -1
  32. package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js.map +1 -1
  33. package/dist/components/CardContainer/CardContainer.js +7 -7
  34. package/dist/components/CardContainer/CardContainer.js.map +1 -1
  35. package/dist/components/ChallengeRequirementsModal/ChallengeRequirementsModal.js +1 -1
  36. package/dist/components/ChallengeRequirementsModal/ChallengeRequirementsModal.js.map +1 -1
  37. package/dist/components/ChallengeSubmission/ChallengeSubmission.d.ts.map +1 -1
  38. package/dist/components/ChallengeSubmission/ChallengeSubmission.js +1 -1
  39. package/dist/components/ChallengeSubmission/ChallengeSubmission.js.map +1 -1
  40. package/dist/components/ChallengeTeamWizard/SelectChallengeTeam.js +1 -1
  41. package/dist/components/ChallengeTeamWizard/SelectChallengeTeam.js.map +1 -1
  42. package/dist/components/CitationPopover/CitationPopoverUtils.js +2 -2
  43. package/dist/components/CitationPopover/CitationPopoverUtils.js.map +1 -1
  44. package/dist/components/CohortBuilder/CohortBuilder.css +1 -0
  45. package/dist/components/CohortBuilder/CohortBuilder.d.ts +35 -0
  46. package/dist/components/CohortBuilder/CohortBuilder.d.ts.map +1 -0
  47. package/dist/components/CohortBuilder/CohortBuilder.js +108 -0
  48. package/dist/components/CohortBuilder/CohortBuilder.js.map +1 -0
  49. package/dist/components/CohortBuilder/CohortBuilder.module.js +10 -0
  50. package/dist/components/CohortBuilder/CohortBuilder.module.js.map +1 -0
  51. package/dist/components/CohortBuilder/CohortBuilder.module.scss +20 -0
  52. package/dist/components/CohortBuilder/CohortFilesPanel.d.ts +16 -0
  53. package/dist/components/CohortBuilder/CohortFilesPanel.d.ts.map +1 -0
  54. package/dist/components/CohortBuilder/CohortFilesPanel.js +124 -0
  55. package/dist/components/CohortBuilder/CohortFilesPanel.js.map +1 -0
  56. package/dist/components/CohortBuilder/cohortHandOff.d.ts +25 -0
  57. package/dist/components/CohortBuilder/cohortHandOff.d.ts.map +1 -0
  58. package/dist/components/CohortBuilder/cohortHandOff.js +26 -0
  59. package/dist/components/CohortBuilder/cohortHandOff.js.map +1 -0
  60. package/dist/components/ColumnFilter/ColumnFilter.d.ts.map +1 -1
  61. package/dist/components/ColumnFilter/ColumnFilter.js +14 -13
  62. package/dist/components/ColumnFilter/ColumnFilter.js.map +1 -1
  63. package/dist/components/DataExplorer/DataExplorer.d.ts.map +1 -1
  64. package/dist/components/DataExplorer/DataExplorer.js.map +1 -1
  65. package/dist/components/DataGrid/columns/AutocompleteColumn.d.ts +11 -2
  66. package/dist/components/DataGrid/columns/AutocompleteColumn.d.ts.map +1 -1
  67. package/dist/components/DataGrid/columns/AutocompleteColumn.js +115 -109
  68. package/dist/components/DataGrid/columns/AutocompleteColumn.js.map +1 -1
  69. package/dist/components/DataGrid/columns/NumberColumn.js +1 -1
  70. package/dist/components/DataGrid/columns/NumberColumn.js.map +1 -1
  71. package/dist/components/DataGrid/columns/NumberOrEnumColumn.d.ts +20 -0
  72. package/dist/components/DataGrid/columns/NumberOrEnumColumn.d.ts.map +1 -0
  73. package/dist/components/DataGrid/columns/NumberOrEnumColumn.js +18 -0
  74. package/dist/components/DataGrid/columns/NumberOrEnumColumn.js.map +1 -0
  75. package/dist/components/DataGrid/components/contextMenu.js +3 -3
  76. package/dist/components/DataGrid/components/contextMenu.js.map +1 -1
  77. package/dist/components/DataGrid/hooks/useGridUndoRedo.d.ts.map +1 -1
  78. package/dist/components/DataGrid/hooks/useGridUndoRedo.js +9 -7
  79. package/dist/components/DataGrid/hooks/useGridUndoRedo.js.map +1 -1
  80. package/dist/components/DataGrid/hooks/useStack.d.ts +1 -1
  81. package/dist/components/DataGrid/hooks/useStack.js +2 -2
  82. package/dist/components/DataGrid/hooks/useStack.js.map +1 -1
  83. package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
  84. package/dist/components/DataGrid/utils/columnFactory.js +47 -42
  85. package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
  86. package/dist/components/DataGrid/utils/extractColumnValidationMessages.js +7 -7
  87. package/dist/components/DataGrid/utils/extractColumnValidationMessages.js.map +1 -1
  88. package/dist/components/DataGrid/utils/json-rx/JsonRx.js +2 -2
  89. package/dist/components/DataGrid/utils/json-rx/JsonRx.js.map +1 -1
  90. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js +1 -1
  91. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js.map +1 -1
  92. package/dist/components/DownloadCart/MeetAccessRequirementCard.js +1 -1
  93. package/dist/components/DownloadCart/MeetAccessRequirementCard.js.map +1 -1
  94. package/dist/components/EntityDownloadConfirmation/EntityDownloadConfirmation.js +5 -5
  95. package/dist/components/EntityDownloadConfirmation/EntityDownloadConfirmation.js.map +1 -1
  96. package/dist/components/EntityFinder/details/view/DetailsView.d.ts.map +1 -1
  97. package/dist/components/EntityFinder/details/view/DetailsView.js +4 -4
  98. package/dist/components/EntityFinder/details/view/DetailsView.js.map +1 -1
  99. package/dist/components/EntityHeaderTable/EntityHeaderTable.js +4 -4
  100. package/dist/components/EntityHeaderTable/Filter.d.ts.map +1 -1
  101. package/dist/components/EntityHeaderTable/Filter.js +1 -1
  102. package/dist/components/EntityHeaderTable/Filter.js.map +1 -1
  103. package/dist/components/Evaluation/EvaluationRoundEditor.js.map +1 -1
  104. package/dist/components/FeaturedDataTabs/FacetPlotsCard.d.ts.map +1 -1
  105. package/dist/components/FeaturedDataTabs/FacetPlotsCard.js +80 -84
  106. package/dist/components/FeaturedDataTabs/FacetPlotsCard.js.map +1 -1
  107. package/dist/components/FormTemplateEditor/FormStructurePanel.js +7 -7
  108. package/dist/components/FormTemplateEditor/StepCard.js +9 -9
  109. package/dist/components/FormTemplateEditor/schemaFieldUtils.js +2 -2
  110. package/dist/components/FormTemplateEditor/schemaFieldUtils.js.map +1 -1
  111. package/dist/components/FullTextSearch/FullTextSearch.js +8 -8
  112. package/dist/components/GenericCard/CardUtils.js.map +1 -1
  113. package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +1 -1
  114. package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js.map +1 -1
  115. package/dist/components/GenericCard/DuoTermTags/duoTerms.js +1 -1
  116. package/dist/components/GenericCard/DuoTermTags/duoTerms.js.map +1 -1
  117. package/dist/components/GenericCard/TableRowGenericCard.js +37 -37
  118. package/dist/components/GoalsV3/GoalsV3.js +1 -1
  119. package/dist/components/GoalsV3/GoalsV3.js.map +1 -1
  120. package/dist/components/HexGrid/HexGrid.d.ts +3 -1
  121. package/dist/components/HexGrid/HexGrid.d.ts.map +1 -1
  122. package/dist/components/HexGrid/HexGrid.js +14 -13
  123. package/dist/components/HexGrid/HexGrid.js.map +1 -1
  124. package/dist/components/IconSvg/index.d.ts +1 -1
  125. package/dist/components/IconSvg/index.d.ts.map +1 -1
  126. package/dist/components/IconSvg/index.js.map +1 -1
  127. package/dist/components/JsonSchemaForm/templates/BaseInputTemplate.d.ts.map +1 -1
  128. package/dist/components/JsonSchemaForm/templates/BaseInputTemplate.js +3 -3
  129. package/dist/components/JsonSchemaForm/templates/BaseInputTemplate.js.map +1 -1
  130. package/dist/components/Markdown/MarkdownEditor.js +1 -1
  131. package/dist/components/Markdown/MarkdownEditor.js.map +1 -1
  132. package/dist/components/Markdown/widget/index.d.ts +1 -1
  133. package/dist/components/Markdown/widget/index.d.ts.map +1 -1
  134. package/dist/components/ModalDownload/ModalDownload.d.ts.map +1 -1
  135. package/dist/components/ModalDownload/ModalDownload.js +2 -1
  136. package/dist/components/ModalDownload/ModalDownload.js.map +1 -1
  137. package/dist/components/Plot/BarPlot.js +1 -1
  138. package/dist/components/Plot/BarPlot.js.map +1 -1
  139. package/dist/components/Plot/PlotPanelHeader.d.ts +3 -2
  140. package/dist/components/Plot/PlotPanelHeader.d.ts.map +1 -1
  141. package/dist/components/Plot/PlotPanelHeader.js.map +1 -1
  142. package/dist/components/ProgrammaticTableDownload/ProgrammaticTableDownload.js +1 -1
  143. package/dist/components/ProgrammaticTableDownload/ProgrammaticTableDownload.js.map +1 -1
  144. package/dist/components/ProvenanceGraph/ProvenanceExternalIcon.js +1 -1
  145. package/dist/components/ProvenanceGraph/ProvenanceExternalIcon.js.map +1 -1
  146. package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts.map +1 -1
  147. package/dist/components/ProvenanceGraph/ProvenanceGraph.js +3 -3
  148. package/dist/components/ProvenanceGraph/ProvenanceGraph.js.map +1 -1
  149. package/dist/components/QueryBuilder/FilterConditionRow.d.ts.map +1 -1
  150. package/dist/components/QueryBuilder/FilterConditionRow.js +28 -27
  151. package/dist/components/QueryBuilder/FilterConditionRow.js.map +1 -1
  152. package/dist/components/QueryBuilder/FilterGroupNode.d.ts.map +1 -1
  153. package/dist/components/QueryBuilder/FilterGroupNode.js +91 -75
  154. package/dist/components/QueryBuilder/FilterGroupNode.js.map +1 -1
  155. package/dist/components/QueryBuilder/QueryBuilderControls.css +1 -1
  156. package/dist/components/QueryBuilder/QueryBuilderControls.d.ts.map +1 -1
  157. package/dist/components/QueryBuilder/QueryBuilderControls.js +91 -79
  158. package/dist/components/QueryBuilder/QueryBuilderControls.js.map +1 -1
  159. package/dist/components/QueryBuilder/QueryBuilderControls.module.js +11 -11
  160. package/dist/components/QueryBuilder/QueryBuilderControls.module.js.map +1 -1
  161. package/dist/components/QueryBuilder/QueryBuilderControls.module.scss +2 -0
  162. package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts +2 -0
  163. package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts.map +1 -1
  164. package/dist/components/QueryBuilder/QueryBuilderInternalContext.js.map +1 -1
  165. package/dist/components/QueryBuilder/queryBuilderLimits.d.ts +18 -0
  166. package/dist/components/QueryBuilder/queryBuilderLimits.d.ts.map +1 -0
  167. package/dist/components/QueryBuilder/queryBuilderLimits.js +38 -0
  168. package/dist/components/QueryBuilder/queryBuilderLimits.js.map +1 -0
  169. package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts +0 -8
  170. package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts.map +1 -1
  171. package/dist/components/QueryBuilder/queryBuilderMetadata.js +6 -9
  172. package/dist/components/QueryBuilder/queryBuilderMetadata.js.map +1 -1
  173. package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts +5 -4
  174. package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts.map +1 -1
  175. package/dist/components/QueryBuilder/queryBuilderTranslation.js +58 -33
  176. package/dist/components/QueryBuilder/queryBuilderTranslation.js.map +1 -1
  177. package/dist/components/QueryBuilder/useQBCombinedSql.d.ts.map +1 -1
  178. package/dist/components/QueryBuilder/useQBCombinedSql.js +4 -4
  179. package/dist/components/QueryBuilder/useQBCombinedSql.js.map +1 -1
  180. package/dist/components/QueryBuilder/useQBValueDisplayName.d.ts.map +1 -1
  181. package/dist/components/QueryBuilder/useQBValueDisplayName.js +5 -5
  182. package/dist/components/QueryBuilder/useQBValueDisplayName.js.map +1 -1
  183. package/dist/components/QuerySortSelector.js +5 -5
  184. package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js +21 -21
  185. package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js.map +1 -1
  186. package/dist/components/QueryWrapper/AggregateQueryErrorNotice.d.ts +20 -0
  187. package/dist/components/QueryWrapper/AggregateQueryErrorNotice.d.ts.map +1 -0
  188. package/dist/components/QueryWrapper/AggregateQueryErrorNotice.js +50 -0
  189. package/dist/components/QueryWrapper/AggregateQueryErrorNotice.js.map +1 -0
  190. package/dist/components/QueryWrapper/TableQueryUseQueryOptions.d.ts +5 -3
  191. package/dist/components/QueryWrapper/TableQueryUseQueryOptions.d.ts.map +1 -1
  192. package/dist/components/QueryWrapper/TableQueryUseQueryOptions.js +7 -3
  193. package/dist/components/QueryWrapper/TableQueryUseQueryOptions.js.map +1 -1
  194. package/dist/components/QueryWrapper/downloadListFiles.d.ts +25 -0
  195. package/dist/components/QueryWrapper/downloadListFiles.d.ts.map +1 -0
  196. package/dist/components/QueryWrapper/downloadListFiles.js +39 -0
  197. package/dist/components/QueryWrapper/downloadListFiles.js.map +1 -0
  198. package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.d.ts +16 -0
  199. package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.d.ts.map +1 -0
  200. package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.js +50 -0
  201. package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.js.map +1 -0
  202. package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.d.ts +4 -1
  203. package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.d.ts.map +1 -1
  204. package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.js +15 -28
  205. package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.js.map +1 -1
  206. package/dist/components/QueryWrapper/useOnQueryDataChange.d.ts.map +1 -1
  207. package/dist/components/QueryWrapper/useOnQueryDataChange.js +7 -6
  208. package/dist/components/QueryWrapper/useOnQueryDataChange.js.map +1 -1
  209. package/dist/components/QueryWrapperErrorBoundary.d.ts +3 -1
  210. package/dist/components/QueryWrapperErrorBoundary.d.ts.map +1 -1
  211. package/dist/components/QueryWrapperErrorBoundary.js +26 -21
  212. package/dist/components/QueryWrapperErrorBoundary.js.map +1 -1
  213. package/dist/components/QueryWrapperPlotNav/LastUpdatedOn.js +7 -7
  214. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +2 -2
  215. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
  216. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +34 -32
  217. package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
  218. package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js +7 -7
  219. package/dist/components/QueryWrapperPlotNav/UseRowSet.d.ts.map +1 -1
  220. package/dist/components/QueryWrapperPlotNav/UseRowSet.js +12 -12
  221. package/dist/components/QueryWrapperPlotNav/UseRowSet.js.map +1 -1
  222. package/dist/components/RowDataTable/CategorizedRowDataTable.css +1 -0
  223. package/dist/components/RowDataTable/CategorizedRowDataTable.d.ts +33 -0
  224. package/dist/components/RowDataTable/CategorizedRowDataTable.d.ts.map +1 -0
  225. package/dist/components/RowDataTable/CategorizedRowDataTable.js +64 -0
  226. package/dist/components/RowDataTable/CategorizedRowDataTable.js.map +1 -0
  227. package/dist/components/RowDataTable/CategorizedRowDataTable.module.js +8 -0
  228. package/dist/components/RowDataTable/CategorizedRowDataTable.module.js.map +1 -0
  229. package/dist/components/RowDataTable/CategorizedRowDataTable.module.scss +18 -0
  230. package/dist/components/RowDataTable/RowDataTable.d.ts +13 -0
  231. package/dist/components/RowDataTable/RowDataTable.d.ts.map +1 -1
  232. package/dist/components/RowDataTable/RowDataTable.js +25 -8
  233. package/dist/components/RowDataTable/RowDataTable.js.map +1 -1
  234. package/dist/components/RssFeedCards/RssFeedCards.js +1 -1
  235. package/dist/components/RssFeedCards/RssFeedCards.js.map +1 -1
  236. package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.d.ts.map +1 -1
  237. package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.js +2 -2
  238. package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.js.map +1 -1
  239. package/dist/components/SchemaDrivenAnnotationEditor/template/ObjectFieldTemplate.js +1 -1
  240. package/dist/components/SchemaDrivenAnnotationEditor/template/ObjectFieldTemplate.js.map +1 -1
  241. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts +17 -9
  242. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
  243. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +39 -30
  244. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
  245. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js +24 -24
  246. package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js.map +1 -1
  247. package/dist/components/StandaloneQueryWrapper/StandaloneQueryWrapper.js +8 -8
  248. package/dist/components/SynapseChat/SynapseChatMessage.js +1 -1
  249. package/dist/components/SynapseChat/SynapseChatMessage.js.map +1 -1
  250. package/dist/components/SynapseForm/NavButtons.js.map +1 -1
  251. package/dist/components/SynapseForm/StepsSideNav.js.map +1 -1
  252. package/dist/components/SynapseSearchPageResults/HighlightedTypography.js +1 -1
  253. package/dist/components/SynapseSearchPageResults/HighlightedTypography.js.map +1 -1
  254. package/dist/components/SynapseSearchPageResults/SearchFacetPanel/SearchFacetPanelUtils.d.ts.map +1 -1
  255. package/dist/components/SynapseSearchPageResults/SearchFacetPanel/SearchFacetPanelUtils.js +3 -3
  256. package/dist/components/SynapseSearchPageResults/SearchFacetPanel/SearchFacetPanelUtils.js.map +1 -1
  257. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.d.ts.map +1 -1
  258. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +38 -44
  259. package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js.map +1 -1
  260. package/dist/components/SynapseTable/RowSelection/RowSelectionUI.js +4 -4
  261. package/dist/components/SynapseTable/SqlEditor.js +7 -7
  262. package/dist/components/SynapseTable/SynapseTable.js +8 -8
  263. package/dist/components/SynapseTable/SynapseTable.js.map +1 -1
  264. package/dist/components/SynapseTable/SynapseTableRenderers.d.ts.map +1 -1
  265. package/dist/components/SynapseTable/SynapseTableRenderers.js +73 -72
  266. package/dist/components/SynapseTable/SynapseTableRenderers.js.map +1 -1
  267. package/dist/components/SynapseTable/SynapseTableUtils.js +1 -1
  268. package/dist/components/SynapseTable/SynapseTableUtils.js.map +1 -1
  269. package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts.map +1 -1
  270. package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js +44 -45
  271. package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js.map +1 -1
  272. package/dist/components/SynapseTable/datasets/DatasetEditorVersionCell.js +1 -1
  273. package/dist/components/SynapseTable/datasets/DatasetEditorVersionCell.js.map +1 -1
  274. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.d.ts.map +1 -1
  275. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js +142 -142
  276. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
  277. package/dist/components/SynapseTable/export/ExportToAnalysisPlatformDialog.js +4 -4
  278. package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.js +12 -12
  279. package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.js.map +1 -1
  280. package/dist/components/SynapseTable/table-top/ColumnSelection.js +6 -6
  281. package/dist/components/SynapseTable/table-top/DownloadOptions.d.ts +0 -1
  282. package/dist/components/SynapseTable/table-top/DownloadOptions.d.ts.map +1 -1
  283. package/dist/components/SynapseTable/table-top/DownloadOptions.js +64 -57
  284. package/dist/components/SynapseTable/table-top/DownloadOptions.js.map +1 -1
  285. package/dist/components/SynapseTable/usePrefetchTableData.d.ts.map +1 -1
  286. package/dist/components/SynapseTable/usePrefetchTableData.js +3 -3
  287. package/dist/components/SynapseTable/usePrefetchTableData.js.map +1 -1
  288. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js +1 -1
  289. package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js.map +1 -1
  290. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorTestUtils.js +1 -1
  291. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorTestUtils.js.map +1 -1
  292. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js +2 -2
  293. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js.map +1 -1
  294. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js +60 -60
  295. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
  296. package/dist/components/TableColumnSchemaEditor/Validators/DatetimeSchema.js +1 -1
  297. package/dist/components/TableColumnSchemaEditor/Validators/DatetimeSchema.js.map +1 -1
  298. package/dist/components/TanStackTable/ColumnHeaderEnumFilter.js +1 -1
  299. package/dist/components/TanStackTable/ColumnHeaderEnumFilter.js.map +1 -1
  300. package/dist/components/TanStackTable/StyledTanStackTable.d.ts.map +1 -1
  301. package/dist/components/TanStackTable/StyledTanStackTable.js +1 -4
  302. package/dist/components/TanStackTable/StyledTanStackTable.js.map +1 -1
  303. package/dist/components/TermsAndConditions/TermsAndConditions.js.map +1 -1
  304. package/dist/components/TotalQueryResults.js +14 -14
  305. package/dist/components/Webhook/WebhookDashboard.d.ts.map +1 -1
  306. package/dist/components/Webhook/WebhookDashboard.js +2 -2
  307. package/dist/components/Webhook/WebhookDashboard.js.map +1 -1
  308. package/dist/components/download_list/DownloadConfirmationUtils.d.ts +5 -1
  309. package/dist/components/download_list/DownloadConfirmationUtils.d.ts.map +1 -1
  310. package/dist/components/download_list/DownloadConfirmationUtils.js +2 -2
  311. package/dist/components/download_list/DownloadConfirmationUtils.js.map +1 -1
  312. package/dist/components/error/ErrorBanner.d.ts.map +1 -1
  313. package/dist/components/error/ErrorBanner.js +49 -46
  314. package/dist/components/error/ErrorBanner.js.map +1 -1
  315. package/dist/components/file/upload/MultiFileUploadProgress.js +5 -5
  316. package/dist/components/row_renderers/Dataset.d.ts.map +1 -1
  317. package/dist/components/row_renderers/Dataset.js +6 -6
  318. package/dist/components/row_renderers/Dataset.js.map +1 -1
  319. package/dist/components/row_renderers/Funder.js +1 -1
  320. package/dist/components/row_renderers/Funder.js.map +1 -1
  321. package/dist/components/widgets/ElementWithTooltip.d.ts +6 -1
  322. package/dist/components/widgets/ElementWithTooltip.d.ts.map +1 -1
  323. package/dist/components/widgets/ElementWithTooltip.js +22 -14
  324. package/dist/components/widgets/ElementWithTooltip.js.map +1 -1
  325. package/dist/components/widgets/RangeSlider/RangeSlider.d.ts.map +1 -1
  326. package/dist/components/widgets/RangeSlider/RangeSlider.js +1 -1
  327. package/dist/components/widgets/RangeSlider/RangeSlider.js.map +1 -1
  328. package/dist/components/widgets/SynapseImage.js +1 -1
  329. package/dist/components/widgets/SynapseImage.js.map +1 -1
  330. package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts +16 -5
  331. package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts.map +1 -1
  332. package/dist/components/widgets/facet-nav/FacetNavPanel.js +115 -102
  333. package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
  334. package/dist/components/widgets/facet-nav/FacetPlotLegendList.d.ts.map +1 -1
  335. package/dist/components/widgets/facet-nav/FacetPlotLegendList.js +4 -2
  336. package/dist/components/widgets/facet-nav/FacetPlotLegendList.js.map +1 -1
  337. package/dist/components/widgets/facet-nav/FacetPlotLegendTable.js +1 -1
  338. package/dist/components/widgets/facet-nav/FacetPlotLegendTable.js.map +1 -1
  339. package/dist/components/widgets/facet-nav/FacetPlotLegendUtils.d.ts +2 -0
  340. package/dist/components/widgets/facet-nav/FacetPlotLegendUtils.d.ts.map +1 -1
  341. package/dist/components/widgets/facet-nav/FacetPlotLegendUtils.js.map +1 -1
  342. package/dist/components/widgets/facet-nav/PlotsContainer.d.ts +7 -0
  343. package/dist/components/widgets/facet-nav/PlotsContainer.d.ts.map +1 -1
  344. package/dist/components/widgets/facet-nav/PlotsContainer.js +47 -45
  345. package/dist/components/widgets/facet-nav/PlotsContainer.js.map +1 -1
  346. package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js +4 -4
  347. package/dist/components/widgets/facet-nav/useFacetPlots.d.ts +3 -2
  348. package/dist/components/widgets/facet-nav/useFacetPlots.d.ts.map +1 -1
  349. package/dist/components/widgets/facet-nav/useFacetPlots.js +16 -15
  350. package/dist/components/widgets/facet-nav/useFacetPlots.js.map +1 -1
  351. package/dist/components/widgets/query-filter/CombinedRangeFacetFilter.js +4 -4
  352. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts +2 -2
  353. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts.map +1 -1
  354. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js +62 -60
  355. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js.map +1 -1
  356. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts +2 -0
  357. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts.map +1 -1
  358. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js +10 -10
  359. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js.map +1 -1
  360. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts +1 -0
  361. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts.map +1 -1
  362. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js +2 -1
  363. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js.map +1 -1
  364. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUtils.d.ts +3 -2
  365. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUtils.d.ts.map +1 -1
  366. package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUtils.js.map +1 -1
  367. package/dist/components/widgets/query-filter/FacetFilterControls.d.ts +3 -2
  368. package/dist/components/widgets/query-filter/FacetFilterControls.d.ts.map +1 -1
  369. package/dist/components/widgets/query-filter/FacetFilterControls.js +63 -62
  370. package/dist/components/widgets/query-filter/FacetFilterControls.js.map +1 -1
  371. package/dist/components/widgets/query-filter/JsonColumnFacetFilters.d.ts.map +1 -1
  372. package/dist/components/widgets/query-filter/JsonColumnFacetFilters.js +30 -29
  373. package/dist/components/widgets/query-filter/JsonColumnFacetFilters.js.map +1 -1
  374. package/dist/components/widgets/query-filter/RangeFacetFilter.js +5 -5
  375. package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.d.ts +53 -0
  376. package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.d.ts.map +1 -0
  377. package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.js +391 -0
  378. package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.js.map +1 -0
  379. package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.d.ts +41 -0
  380. package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.d.ts.map +1 -0
  381. package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.js +379 -0
  382. package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.js.map +1 -0
  383. package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.d.ts +26 -0
  384. package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.d.ts.map +1 -0
  385. package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.js +112 -0
  386. package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.js.map +1 -0
  387. package/dist/mocks/mockAnnotationColumns.d.ts.map +1 -1
  388. package/dist/mocks/mockAnnotationColumns.js +1 -1
  389. package/dist/mocks/mockAnnotationColumns.js.map +1 -1
  390. package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +9 -0
  391. package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -1
  392. package/dist/mocks/msw/handlers/aridhiaHandlers.js +24 -15
  393. package/dist/mocks/msw/handlers/aridhiaHandlers.js.map +1 -1
  394. package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts +21 -2
  395. package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts.map +1 -1
  396. package/dist/mocks/msw/handlers/asyncJobHandlers.js +30 -22
  397. package/dist/mocks/msw/handlers/asyncJobHandlers.js.map +1 -1
  398. package/dist/mocks/msw/handlers/cohortBuilderHandlers.d.ts +27 -0
  399. package/dist/mocks/msw/handlers/cohortBuilderHandlers.d.ts.map +1 -0
  400. package/dist/mocks/msw/handlers/cohortBuilderHandlers.js +158 -0
  401. package/dist/mocks/msw/handlers/cohortBuilderHandlers.js.map +1 -0
  402. package/dist/mocks/msw/handlers/subscriptionHandlers.js +1 -1
  403. package/dist/mocks/msw/handlers/subscriptionHandlers.js.map +1 -1
  404. package/dist/mocks/msw/handlers/userProfileHandlers.d.ts.map +1 -1
  405. package/dist/mocks/msw/handlers/userProfileHandlers.js +2 -2
  406. package/dist/mocks/msw/handlers/userProfileHandlers.js.map +1 -1
  407. package/dist/mocks/query/mockColumnCategoryTable.d.ts +19 -0
  408. package/dist/mocks/query/mockColumnCategoryTable.d.ts.map +1 -0
  409. package/dist/mocks/query/mockColumnCategoryTable.js +188 -0
  410. package/dist/mocks/query/mockColumnCategoryTable.js.map +1 -0
  411. package/dist/stories/ColorPaletteInspector.d.ts.map +1 -1
  412. package/dist/stories/ColorPaletteInspector.js +2 -2
  413. package/dist/stories/ColorPaletteInspector.js.map +1 -1
  414. package/dist/style/components/facet_nav/_facet-nav-panel.scss +8 -0
  415. package/dist/style/main.css +1 -1
  416. package/dist/synapse-queries/auth/useOIDC.js +2 -2
  417. package/dist/synapse-queries/auth/useOIDC.js.map +1 -1
  418. package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js +2 -2
  419. package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js.map +1 -1
  420. package/dist/synapse-queries/challenge/useChallenge.js +2 -2
  421. package/dist/synapse-queries/challenge/useChallenge.js.map +1 -1
  422. package/dist/synapse-queries/chat/useChat.js +8 -8
  423. package/dist/synapse-queries/chat/useChat.js.map +1 -1
  424. package/dist/synapse-queries/curation/task/useCurationTask.js +10 -10
  425. package/dist/synapse-queries/curation/task/useCurationTask.js.map +1 -1
  426. package/dist/synapse-queries/dataaccess/useAccessRequirements.js +24 -24
  427. package/dist/synapse-queries/dataaccess/useAccessRequirements.js.map +1 -1
  428. package/dist/synapse-queries/dataaccess/useDataAccessSubmission.js +4 -4
  429. package/dist/synapse-queries/dataaccess/useDataAccessSubmission.js.map +1 -1
  430. package/dist/synapse-queries/dataaccess/useEDuc.js +6 -6
  431. package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
  432. package/dist/synapse-queries/dataaccess/useFormTemplate.js +4 -4
  433. package/dist/synapse-queries/dataaccess/useFormTemplate.js.map +1 -1
  434. package/dist/synapse-queries/download/index.js +2 -2
  435. package/dist/synapse-queries/download/useDownloadList.d.ts +5 -0
  436. package/dist/synapse-queries/download/useDownloadList.d.ts.map +1 -1
  437. package/dist/synapse-queries/download/useDownloadList.js +14 -13
  438. package/dist/synapse-queries/download/useDownloadList.js.map +1 -1
  439. package/dist/synapse-queries/entity/useEntity.d.ts.map +1 -1
  440. package/dist/synapse-queries/entity/useEntity.js +20 -20
  441. package/dist/synapse-queries/entity/useEntity.js.map +1 -1
  442. package/dist/synapse-queries/entity/useExportToADWorkbench.d.ts.map +1 -1
  443. package/dist/synapse-queries/entity/useExportToADWorkbench.js +2 -1
  444. package/dist/synapse-queries/entity/useExportToADWorkbench.js.map +1 -1
  445. package/dist/synapse-queries/entity/useExportToCavatica.d.ts.map +1 -1
  446. package/dist/synapse-queries/entity/useExportToCavatica.js +3 -2
  447. package/dist/synapse-queries/entity/useExportToCavatica.js.map +1 -1
  448. package/dist/synapse-queries/entity/useExportToPluto.d.ts.map +1 -1
  449. package/dist/synapse-queries/entity/useExportToPluto.js +2 -1
  450. package/dist/synapse-queries/entity/useExportToPluto.js.map +1 -1
  451. package/dist/synapse-queries/entity/useGetQueryResultBundle.d.ts.map +1 -1
  452. package/dist/synapse-queries/entity/useGetQueryResultBundle.js +4 -7
  453. package/dist/synapse-queries/entity/useGetQueryResultBundle.js.map +1 -1
  454. package/dist/synapse-queries/forum/useReply.js +6 -6
  455. package/dist/synapse-queries/forum/useReply.js.map +1 -1
  456. package/dist/synapse-queries/forum/useThread.js +14 -14
  457. package/dist/synapse-queries/forum/useThread.js.map +1 -1
  458. package/dist/synapse-queries/grid/useEstablishWebsocketConnection.js +1 -1
  459. package/dist/synapse-queries/grid/useEstablishWebsocketConnection.js.map +1 -1
  460. package/dist/synapse-queries/grid/useGridSession.js +4 -4
  461. package/dist/synapse-queries/grid/useGridSession.js.map +1 -1
  462. package/dist/synapse-queries/index.js +177 -176
  463. package/dist/synapse-queries/oauth/useOAuthClient.js +9 -9
  464. package/dist/synapse-queries/oauth/useOAuthClient.js.map +1 -1
  465. package/dist/synapse-queries/portal/usePortal.js +7 -7
  466. package/dist/synapse-queries/portal/usePortal.js.map +1 -1
  467. package/dist/synapse-queries/subscription/useSubscription.js +4 -4
  468. package/dist/synapse-queries/subscription/useSubscription.js.map +1 -1
  469. package/dist/synapse-queries/table/useTableUpdateTransaction.js +2 -2
  470. package/dist/synapse-queries/table/useTableUpdateTransaction.js.map +1 -1
  471. package/dist/synapse-queries/team/useTeam.js +2 -2
  472. package/dist/synapse-queries/team/useTeam.js.map +1 -1
  473. package/dist/synapse-queries/team/useTeamList.d.ts.map +1 -1
  474. package/dist/synapse-queries/team/useTeamList.js +3 -3
  475. package/dist/synapse-queries/team/useTeamList.js.map +1 -1
  476. package/dist/synapse-queries/team/useTeamMembers.js +8 -8
  477. package/dist/synapse-queries/team/useTeamMembers.js.map +1 -1
  478. package/dist/synapse-queries/termsOfService/useTermsOfService.js +2 -2
  479. package/dist/synapse-queries/termsOfService/useTermsOfService.js.map +1 -1
  480. package/dist/synapse-queries/trash/useTrashCan.js +4 -4
  481. package/dist/synapse-queries/trash/useTrashCan.js.map +1 -1
  482. package/dist/synapse-queries/user/useCertificationQuiz.js +2 -2
  483. package/dist/synapse-queries/user/useCertificationQuiz.js.map +1 -1
  484. package/dist/synapse-queries/user/useFavorites.js +4 -4
  485. package/dist/synapse-queries/user/useFavorites.js.map +1 -1
  486. package/dist/synapse-queries/user/useRevokeCertification.js +2 -2
  487. package/dist/synapse-queries/user/useRevokeCertification.js.map +1 -1
  488. package/dist/synapse-queries/wiki/useWiki.js +10 -10
  489. package/dist/synapse-queries/wiki/useWiki.js.map +1 -1
  490. package/dist/tsconfig.build.tsbuildinfo +1 -1
  491. package/dist/utils/ContentTypeUtils.js +4 -4
  492. package/dist/utils/ContentTypeUtils.js.map +1 -1
  493. package/dist/utils/PermissionLevelToAccessType.js +1 -1
  494. package/dist/utils/PermissionLevelToAccessType.js.map +1 -1
  495. package/dist/utils/analytics/useGoogleAnalytics.js +1 -1
  496. package/dist/utils/analytics/useGoogleAnalytics.js.map +1 -1
  497. package/dist/utils/context/DocumentMetadataContext.js +1 -1
  498. package/dist/utils/context/DocumentMetadataContext.js.map +1 -1
  499. package/dist/utils/functions/AccessControlListUtils.d.ts.map +1 -1
  500. package/dist/utils/functions/AccessControlListUtils.js +3 -3
  501. package/dist/utils/functions/AccessControlListUtils.js.map +1 -1
  502. package/dist/utils/functions/ArrayUtils.js +2 -2
  503. package/dist/utils/functions/ArrayUtils.js.map +1 -1
  504. package/dist/utils/functions/FileHandleUtils.js +1 -1
  505. package/dist/utils/functions/FileHandleUtils.js.map +1 -1
  506. package/dist/utils/functions/RegularExpressions.js +1 -1
  507. package/dist/utils/functions/RegularExpressions.js.map +1 -1
  508. package/dist/utils/functions/StringUtils.d.ts.map +1 -1
  509. package/dist/utils/functions/StringUtils.js +1 -2
  510. package/dist/utils/functions/StringUtils.js.map +1 -1
  511. package/dist/utils/functions/deepLinkingUtils.js +2 -2
  512. package/dist/utils/functions/deepLinkingUtils.js.map +1 -1
  513. package/dist/utils/functions/enumerationFacet.d.ts +26 -0
  514. package/dist/utils/functions/enumerationFacet.d.ts.map +1 -0
  515. package/dist/utils/functions/enumerationFacet.js +27 -0
  516. package/dist/utils/functions/enumerationFacet.js.map +1 -0
  517. package/dist/utils/functions/facetCountUtils.d.ts +12 -0
  518. package/dist/utils/functions/facetCountUtils.d.ts.map +1 -0
  519. package/dist/utils/functions/facetCountUtils.js +9 -0
  520. package/dist/utils/functions/facetCountUtils.js.map +1 -0
  521. package/dist/utils/functions/getEndpoint.js.map +1 -1
  522. package/dist/utils/functions/getUserData.js +1 -1
  523. package/dist/utils/functions/getUserData.js.map +1 -1
  524. package/dist/utils/functions/queryUtils.d.ts +1 -1
  525. package/dist/utils/functions/queryUtils.d.ts.map +1 -1
  526. package/dist/utils/functions/queryUtils.js +26 -22
  527. package/dist/utils/functions/queryUtils.js.map +1 -1
  528. package/dist/utils/functions/testDownloadSpeed.d.ts.map +1 -1
  529. package/dist/utils/functions/testDownloadSpeed.js +17 -26
  530. package/dist/utils/functions/testDownloadSpeed.js.map +1 -1
  531. package/dist/utils/functions/unCamelCase.js +1 -1
  532. package/dist/utils/functions/unCamelCase.js.map +1 -1
  533. package/dist/utils/hooks/useGetInfoFromIds.js +5 -5
  534. package/dist/utils/hooks/useGetInfoFromIds.js.map +1 -1
  535. package/dist/utils/hooks/useImmutableTableQuery/TableQueryReducerActions.js +1 -1
  536. package/dist/utils/hooks/useImmutableTableQuery/TableQueryReducerActions.js.map +1 -1
  537. package/dist/utils/hooks/useLogin.d.ts.map +1 -1
  538. package/dist/utils/hooks/useLogin.js +5 -5
  539. package/dist/utils/hooks/useLogin.js.map +1 -1
  540. package/dist/utils/hooks/useUploadFileEntity/useCreateFolderPath.js.map +1 -1
  541. package/dist/utils/jsonschema/collectTopLevelProperties.d.ts +6 -0
  542. package/dist/utils/jsonschema/collectTopLevelProperties.d.ts.map +1 -1
  543. package/dist/utils/jsonschema/collectTopLevelProperties.js +1 -1
  544. package/dist/utils/jsonschema/collectTopLevelProperties.js.map +1 -1
  545. package/dist/utils/jsonschema/getNumberOrEnumInfo.d.ts +22 -0
  546. package/dist/utils/jsonschema/getNumberOrEnumInfo.d.ts.map +1 -0
  547. package/dist/utils/jsonschema/getNumberOrEnumInfo.js +39 -0
  548. package/dist/utils/jsonschema/getNumberOrEnumInfo.js.map +1 -0
  549. package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.d.ts +1 -0
  550. package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.d.ts.map +1 -1
  551. package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.js +1 -1
  552. package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.js.map +1 -1
  553. package/dist/utils/jsonschema/getSchemaPropertyInfo.d.ts +5 -0
  554. package/dist/utils/jsonschema/getSchemaPropertyInfo.d.ts.map +1 -1
  555. package/dist/utils/jsonschema/getSchemaPropertyInfo.js +30 -15
  556. package/dist/utils/jsonschema/getSchemaPropertyInfo.js.map +1 -1
  557. package/dist/utils/jsonschema/submissionContext.js +2 -2
  558. package/dist/utils/jsonschema/submissionContext.js.map +1 -1
  559. package/package.json +6 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cohortBuilderSyntheticData.js","names":[],"sources":["../../../src/mocks/cohortBuilder/cohortBuilderSyntheticData.ts"],"sourcesContent":["import {\n CohortBuilderMockProfile,\n CORE_DATA_ATTRIBUTE_NAMES,\n DATA_REFERENCE_COLUMN_NAME,\n MockAssay,\n MockStudy,\n PARTICIPANT_ID_COLUMN_NAME,\n REFERENCE_TYPE_COLUMN_NAME,\n STUDY_COLUMN_NAME,\n WeightedValues,\n} from './cohortBuilderMockProfiles'\n\nexport type ReferenceType = 'FILE' | 'DATASET'\n\n/** One MATERIAL row: a participant joined to one file or dataset reference. */\nexport type MaterialRow = Readonly<Record<string, string>>\n\nexport type SyntheticDataReference = {\n id: string\n name: string\n referenceType: ReferenceType\n study: string\n attributes: Readonly<Record<string, string>>\n}\n\nexport type CohortBuilderSyntheticData = {\n profile: CohortBuilderMockProfile\n dataAttributeNames: readonly string[]\n references: ReadonlyMap<string, SyntheticDataReference>\n materialRows: readonly MaterialRow[]\n}\n\nexport const DEFAULT_SYNTHETIC_DATA_SEED = 42\n\n// Matrix-style files that each combine a handful of participants, alongside\n// the one-participant files.\nconst SMALL_BATCH_MIN_SIZE = 3\nconst SMALL_BATCH_MAX_SIZE = 12\nconst SMALL_BATCHES_PER_ASSAY = 4\n\n/** Mulberry32: a small, fast, seedable PRNG returning floats in [0, 1). */\nexport function createSeededRandom(seed: number): () => number {\n let state = seed >>> 0\n return () => {\n state = (state + 0x6d2b79f5) >>> 0\n let t = state\n t = Math.imul(t ^ (t >>> 15), t | 1)\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61)\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296\n }\n}\n\nfunction pickWeighted(random: () => number, values: WeightedValues): string {\n const entries = Object.entries(values)\n const total = entries.reduce((sum, [, weight]) => sum + weight, 0)\n let target = random() * total\n for (const [value, weight] of entries) {\n target -= weight\n if (target < 0) {\n return value\n }\n }\n return entries.at(-1)![0]\n}\n\nfunction pickOne<T>(random: () => number, values: readonly T[]): T {\n return values[Math.floor(random() * values.length)]\n}\n\nfunction pickSubset<T>(\n random: () => number,\n values: readonly T[],\n minSize: number,\n): T[] {\n const subset = values.filter(() => random() < 0.6)\n while (subset.length < minSize) {\n const candidate = pickOne(random, values)\n if (!subset.includes(candidate)) {\n subset.push(candidate)\n }\n }\n return subset\n}\n\ntype Participant = Readonly<Record<string, string>>\n\nfunction createParticipants(\n random: () => number,\n profile: CohortBuilderMockProfile,\n study: MockStudy,\n firstIndex: number,\n): Participant[] {\n return Array.from({ length: study.participantCount }, (_, offset) => {\n const participant: Record<string, string> = {\n [PARTICIPANT_ID_COLUMN_NAME]: `${profile.participantIdPrefix}-${String(\n firstIndex + offset,\n ).padStart(6, '0')}`,\n [STUDY_COLUMN_NAME]: study.name,\n }\n for (const attribute of profile.participantAttributes) {\n participant[attribute.name] = pickWeighted(random, attribute.values)\n }\n return participant\n })\n}\n\ntype SyntheticDataBuilder = {\n random: () => number\n references: Map<string, SyntheticDataReference>\n materialRows: MaterialRow[]\n addReference: (\n study: MockStudy,\n assay: MockAssay,\n referenceType: ReferenceType,\n name: string,\n ) => SyntheticDataReference\n link: (\n participants: readonly Participant[],\n reference: SyntheticDataReference,\n ) => void\n}\n\nfunction createSyntheticDataBuilder(\n random: () => number,\n profile: CohortBuilderMockProfile,\n): SyntheticDataBuilder {\n const references = new Map<string, SyntheticDataReference>()\n const materialRows: MaterialRow[] = []\n let nextEntityId = profile.firstReferenceEntityId\n return {\n random,\n references,\n materialRows,\n addReference(study, assay, referenceType, name) {\n const attributes: Record<string, string> = {\n dataType: assay.dataType,\n assay: assay.assay,\n fileFormat: pickOne(random, assay.fileFormats),\n }\n for (const attributeName of profile.extraDataAttributeNames) {\n attributes[attributeName] = pickOne(\n random,\n assay.extraAttributes[attributeName] ?? ['Unknown'],\n )\n }\n const reference: SyntheticDataReference = {\n id: `syn${nextEntityId++}`,\n name,\n referenceType,\n study: study.name,\n attributes,\n }\n references.set(reference.id, reference)\n return reference\n },\n link(participants, reference) {\n for (const participant of participants) {\n materialRows.push({\n ...participant,\n [DATA_REFERENCE_COLUMN_NAME]: reference.id,\n [REFERENCE_TYPE_COLUMN_NAME]: reference.referenceType,\n ...reference.attributes,\n })\n }\n },\n }\n}\n\n/** Many:many studies map every participant to every study dataset. */\nfunction addDatasetStudy(\n builder: SyntheticDataBuilder,\n study: MockStudy,\n participants: readonly Participant[],\n) {\n for (const assay of study.assays) {\n const dataset = builder.addReference(\n study,\n assay,\n 'DATASET',\n `${study.name} ${assay.assay} (synthetic)`,\n )\n builder.link(participants, dataset)\n }\n}\n\nfunction addBatchMatrixFiles(\n builder: SyntheticDataBuilder,\n study: MockStudy,\n assay: MockAssay,\n assayParticipants: readonly Participant[],\n) {\n const { random } = builder\n for (let batch = 1; batch <= SMALL_BATCHES_PER_ASSAY; batch++) {\n const batchSize =\n SMALL_BATCH_MIN_SIZE +\n Math.floor(random() * (SMALL_BATCH_MAX_SIZE - SMALL_BATCH_MIN_SIZE + 1))\n const batchFile = builder.addReference(\n study,\n assay,\n 'FILE',\n `${study.name}_${assay.assay}_batch${batch}_matrix`,\n )\n const start = Math.floor(\n random() * Math.max(1, assayParticipants.length - batchSize),\n )\n builder.link(assayParticipants.slice(start, start + batchSize), batchFile)\n }\n}\n\n/**\n * FILE studies give each participant a file per assay they took part in, plus\n * an all-participants matrix and several small batch matrices per assay.\n */\nfunction addFileStudy(\n builder: SyntheticDataBuilder,\n study: MockStudy,\n participants: readonly Participant[],\n) {\n const participantsByAssay = new Map<MockAssay, Participant[]>(\n study.assays.map(assay => [assay, []]),\n )\n for (const participant of participants) {\n for (const assay of pickSubset(builder.random, study.assays, 1)) {\n participantsByAssay.get(assay)!.push(participant)\n const file = builder.addReference(\n study,\n assay,\n 'FILE',\n `${study.name}_${assay.assay}_sample${String(builder.references.size).padStart(5, '0')}`,\n )\n builder.link([participant], file)\n }\n }\n\n for (const [assay, assayParticipants] of participantsByAssay) {\n if (assayParticipants.length === 0) {\n continue\n }\n const matrix = builder.addReference(\n study,\n assay,\n 'FILE',\n `${study.name}_${assay.assay}_all_participants_matrix`,\n )\n builder.link(assayParticipants, matrix)\n addBatchMatrixFiles(builder, study, assay, assayParticipants)\n }\n}\n\n/**\n * Generates a deterministic synthetic participant ⋈ file/dataset dataset (the\n * MATERIAL rows) from a mock profile.\n */\nexport function createCohortBuilderSyntheticData(\n profile: CohortBuilderMockProfile,\n seed: number = DEFAULT_SYNTHETIC_DATA_SEED,\n): CohortBuilderSyntheticData {\n const random = createSeededRandom(seed)\n const builder = createSyntheticDataBuilder(random, profile)\n let nextParticipantIndex = 1\n for (const study of profile.studies) {\n const participants = createParticipants(\n random,\n profile,\n study,\n nextParticipantIndex,\n )\n nextParticipantIndex += participants.length\n if (study.mapping === 'DATASET') {\n addDatasetStudy(builder, study, participants)\n } else {\n addFileStudy(builder, study, participants)\n }\n }\n return {\n profile,\n dataAttributeNames: [\n ...CORE_DATA_ATTRIBUTE_NAMES,\n ...profile.extraDataAttributeNames,\n ],\n references: builder.references,\n materialRows: builder.materialRows,\n }\n}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{"version":3,"file":"mockAnnotationColumns.d.ts","sourceRoot":"","sources":["../../src/mocks/mockAnnotationColumns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAKzE,eAAO,MAAM,+BAA+B,EAAE,uBAc7C,CAAA"}
1
+ {"version":3,"file":"mockAnnotationColumns.d.ts","sourceRoot":"","sources":["../../src/mocks/mockAnnotationColumns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAKzE,eAAO,MAAM,+BAA+B,EAAE,uBAY7C,CAAA"}
@@ -4,7 +4,7 @@ import { isEqual as n, pick as r } from "lodash-es";
4
4
  //#region src/mocks/mockAnnotationColumns.ts
5
5
  var i = {
6
6
  concreteType: "org.sagebionetworks.repo.model.table.ViewColumnModelResponse",
7
- results: [...e.columnModels.filter((e) => !t.find((t) => n(r(t, ["name", "columnType"]), r(e, ["name", "columnType"]))))],
7
+ results: e.columnModels.filter((e) => !t.some((t) => n(r(t, ["name", "columnType"]), r(e, ["name", "columnType"])))),
8
8
  nextPageToken: null
9
9
  };
10
10
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"mockAnnotationColumns.js","names":[],"sources":["../../src/mocks/mockAnnotationColumns.ts"],"sourcesContent":["import { ViewColumnModelResponse } from '@sage-bionetworks/synapse-types'\nimport { isEqual, pick } from 'lodash-es'\nimport { mockQueryResultBundle } from './mockFileViewQuery'\nimport defaultFileViewColumnModels from './query/defaultFileViewColumnModels'\n\nexport const MOCK_ANNOTATION_COLUMN_RESPONSE: ViewColumnModelResponse = {\n concreteType: 'org.sagebionetworks.repo.model.table.ViewColumnModelResponse',\n results: [\n ...mockQueryResultBundle.columnModels.filter(\n cm =>\n !defaultFileViewColumnModels.find(defaultCm =>\n isEqual(\n pick(defaultCm, ['name', 'columnType']),\n pick(cm, ['name', 'columnType']),\n ),\n ),\n ),\n ],\n nextPageToken: null,\n}\n"],"mappings":";;;;AAKA,IAAa,IAA2D;CACtE,cAAc;CACd,SAAS,CACP,GAAG,EAAsB,aAAa,QACpC,MACE,CAAC,EAA4B,MAAK,MAChC,EACE,EAAK,GAAW,CAAC,QAAQ,YAAY,CAAC,GACtC,EAAK,GAAI,CAAC,QAAQ,YAAY,CAAC,CACjC,CACF,CACJ,CACF;CACA,eAAe;AACjB"}
1
+ {"version":3,"file":"mockAnnotationColumns.js","names":[],"sources":["../../src/mocks/mockAnnotationColumns.ts"],"sourcesContent":["import { ViewColumnModelResponse } from '@sage-bionetworks/synapse-types'\nimport { isEqual, pick } from 'lodash-es'\nimport { mockQueryResultBundle } from './mockFileViewQuery'\nimport defaultFileViewColumnModels from './query/defaultFileViewColumnModels'\n\nexport const MOCK_ANNOTATION_COLUMN_RESPONSE: ViewColumnModelResponse = {\n concreteType: 'org.sagebionetworks.repo.model.table.ViewColumnModelResponse',\n results: mockQueryResultBundle.columnModels.filter(\n cm =>\n !defaultFileViewColumnModels.some(defaultCm =>\n isEqual(\n pick(defaultCm, ['name', 'columnType']),\n pick(cm, ['name', 'columnType']),\n ),\n ),\n ),\n nextPageToken: null,\n}\n"],"mappings":";;;;AAKA,IAAa,IAA2D;CACtE,cAAc;CACd,SAAS,EAAsB,aAAa,QAC1C,MACE,CAAC,EAA4B,MAAK,MAChC,EACE,EAAK,GAAW,CAAC,QAAQ,YAAY,CAAC,GACtC,EAAK,GAAI,CAAC,QAAQ,YAAY,CAAC,CACjC,CACF,CACJ;CACA,eAAe;AACjB"}
@@ -1,4 +1,5 @@
1
1
  import { FairField } from '@/aridhia-queries/FairFormPayload';
2
+ import { RequestListItem } from '@sage-bionetworks/aridhia-client/generated/models';
2
3
  import { HttpHandler, JsonBodyType } from 'msw';
3
4
  export declare const MOCK_ARIDHIA_GATEWAY = "https://mock-gateway.test";
4
5
  export declare const MOCK_ARIDHIA_FAIR_PORTAL_URL = "https://mock-fair-portal.test";
@@ -53,6 +54,14 @@ export declare const MOCK_ARIDHIA_ABOUT_FIELDS: FairField[];
53
54
  export declare const MOCK_ARIDHIA_PROJECT_FIELDS: FairField[];
54
55
  export declare const MOCK_ARIDHIA_WORKSPACE_FORM_FIELDS: FairField[];
55
56
  export declare function getAridhiaAuthenticateHandler(response?: object, status?: number): HttpHandler;
57
+ /**
58
+ * A `GET /fair/requests` list item covering `MOCK_ARIDHIA_DATASET_CODE`, created and last
59
+ * updated at `updatedAt`.
60
+ */
61
+ export declare function mockAridhiaRequestListItem(request: Pick<RequestListItem, 'code' | 'name' | 'status'> & {
62
+ updatedAt: string;
63
+ datasetCodes?: string[];
64
+ }): RequestListItem;
56
65
  export declare function getAridhiaRequestsHandler(items?: unknown[], errorResponse?: {
57
66
  status: number;
58
67
  body: object;
@@ -1 +1 @@
1
- {"version":3,"file":"aridhiaHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/aridhiaHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAE7D,OAAO,EAAQ,WAAW,EAAgB,YAAY,EAAE,MAAM,KAAK,CAAA;AAEnE,eAAO,MAAM,oBAAoB,8BAA8B,CAAA;AAC/D,eAAO,MAAM,4BAA4B,kCAAkC,CAAA;AAC3E,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;CAK7C,CAAA;AAED,eAAO,MAAM,mCAAmC;;;CAG/C,CAAA;AAED,eAAO,MAAM,kCAAkC;;;CAG9C,CAAA;AAED,eAAO,MAAM,yBAAyB;;;GAGrC,CAAA;AAED,eAAO,MAAM,gCAAgC;;;GAE5C,CAAA;AAED,eAAO,MAAM,uBAAuB;;;;;GAOnC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;CAIlC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,EAahD,CAAA;AAED,eAAO,MAAM,2BAA2B,EAAE,SAAS,EAOlD,CAAA;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ateway.test", i = "https://mock-fair-portal.test", a = "s
55
55
  function g(e = c, i = 200) {
56
56
  return n.post(`${r}/authenticate`, () => t.json(e, { status: i }));
57
57
  }
58
- function _(e = [], i) {
58
+ function _(e) {
59
+ let { updatedAt: t, datasetCodes: n = [a], ...r } = e;
60
+ return {
61
+ ...r,
62
+ datasets: n.map((e) => ({ code: e })),
63
+ created_at: t,
64
+ updated_at: t
65
+ };
66
+ }
67
+ function v(e = [], i) {
59
68
  return n.get(`${r}/fair/requests/`, () => i ? t.json(i.body, { status: i.status }) : t.json({
60
69
  items: e,
61
70
  paging: {
@@ -65,7 +74,7 @@ function _(e = [], i) {
65
74
  }
66
75
  }));
67
76
  }
68
- function v(e = {}) {
77
+ function y(e = {}) {
69
78
  return n.get(`${r}/fair/datasets/${a}/settings`, () => t.json({
70
79
  workflow_key: "rdca_access_request",
71
80
  allow_clear: !0,
@@ -74,7 +83,7 @@ function v(e = {}) {
74
83
  ...e
75
84
  }));
76
85
  }
77
- function y(e = {}) {
86
+ function b(e = {}) {
78
87
  let { about: i = p, project: a = m } = e;
79
88
  return n.get(`${r}/fair/workflows/rdca_access_request`, () => t.json({
80
89
  code: "rdca_access_request",
@@ -84,7 +93,7 @@ function y(e = {}) {
84
93
  }
85
94
  }));
86
95
  }
87
- function b(e = {
96
+ function x(e = {
88
97
  name: "Request a workspace",
89
98
  sections: { workspace: {
90
99
  label: "Workspace details",
@@ -93,44 +102,44 @@ function b(e = {
93
102
  }) {
94
103
  return n.get(`${r}/fair/workspaces-forms/workspace_request`, () => t.json(e));
95
104
  }
96
- function x(e = l) {
105
+ function S(e = l) {
97
106
  return n.get(`${r}/fair/datasets/${a}/dictionaries/`, () => t.json({ items: e }));
98
107
  }
99
- function S(e = u) {
108
+ function C(e = u) {
100
109
  return n.get(`${r}/fair/datasets/${a}/workspaces-locations`, () => t.json({ items: e }));
101
110
  }
102
- function C(e = d) {
111
+ function w(e = d) {
103
112
  return n.get(`${r}/fair/datasets/${a}/workspaces`, () => t.json({ items: e }));
104
113
  }
105
- function w(e = f) {
114
+ function T(e = f) {
106
115
  return n.get(`${r}/fair/datasets/${a}/catalogue`, () => t.json(e));
107
116
  }
108
- var T = {
117
+ var E = {
109
118
  code: e,
110
119
  name: "Data Access Request Message",
111
120
  grouping: "markdown",
112
121
  value: "Thank you for your request. The review process is usually completed within 2-3 business weeks.\n\nIf approved, the signatory will receive a **Data Use Agreement (DUA)**."
113
122
  };
114
- function E(i = T, a = 200) {
123
+ function D(i = E, a = 200) {
115
124
  return n.get(`${r}/fair/vocabularies/${e}`, ({ request: e }) => e.headers.get("Authorization") === `Bearer ${c.access_token}` ? t.json(i, { status: a }) : t.json({ error: "invalid_token" }, { status: 401 }));
116
125
  }
117
- function D(e) {
126
+ function O(e) {
118
127
  return n.post(`${r}/fair/requests/`, async ({ request: t }) => e(await t.json()));
119
128
  }
120
- function O() {
129
+ function k() {
121
130
  return [
122
131
  g(),
123
- v(),
124
132
  y(),
125
133
  b(),
126
134
  x(),
127
135
  S(),
128
136
  C(),
129
137
  w(),
130
- E()
138
+ T(),
139
+ D()
131
140
  ];
132
141
  }
133
142
  //#endregion
134
- export { p as MOCK_ARIDHIA_ABOUT_FIELDS, c as MOCK_ARIDHIA_ACCESS_TOKEN_RESPONSE, s as MOCK_ARIDHIA_AUTHENTICATION_REQUEST, f as MOCK_ARIDHIA_CATALOGUE, T as MOCK_ARIDHIA_DAR_MESSAGE, a as MOCK_ARIDHIA_DATASET_CODE, l as MOCK_ARIDHIA_DICTIONARIES, i as MOCK_ARIDHIA_FAIR_PORTAL_URL, r as MOCK_ARIDHIA_GATEWAY, o as MOCK_ARIDHIA_NOT_AUTHORIZED_ERROR, m as MOCK_ARIDHIA_PROJECT_FIELDS, d as MOCK_ARIDHIA_WORKSPACES, h as MOCK_ARIDHIA_WORKSPACE_FORM_FIELDS, u as MOCK_ARIDHIA_WORKSPACE_LOCATIONS, g as getAridhiaAuthenticateHandler, w as getAridhiaCatalogueHandler, E as getAridhiaDarMessageHandler, O as getAridhiaDarWizardHandlers, v as getAridhiaDatasetSettingsHandler, x as getAridhiaDictionariesHandler, _ as getAridhiaRequestsHandler, D as getAridhiaSubmitRequestHandler, y as getAridhiaWorkflowHandler, S as getAridhiaWorkspaceLocationsHandler, b as getAridhiaWorkspaceRequestFormHandler, C as getAridhiaWorkspacesHandler };
143
+ export { p as MOCK_ARIDHIA_ABOUT_FIELDS, c as MOCK_ARIDHIA_ACCESS_TOKEN_RESPONSE, s as MOCK_ARIDHIA_AUTHENTICATION_REQUEST, f as MOCK_ARIDHIA_CATALOGUE, E as MOCK_ARIDHIA_DAR_MESSAGE, a as MOCK_ARIDHIA_DATASET_CODE, l as MOCK_ARIDHIA_DICTIONARIES, i as MOCK_ARIDHIA_FAIR_PORTAL_URL, r as MOCK_ARIDHIA_GATEWAY, o as MOCK_ARIDHIA_NOT_AUTHORIZED_ERROR, m as MOCK_ARIDHIA_PROJECT_FIELDS, d as MOCK_ARIDHIA_WORKSPACES, h as MOCK_ARIDHIA_WORKSPACE_FORM_FIELDS, u as MOCK_ARIDHIA_WORKSPACE_LOCATIONS, g as getAridhiaAuthenticateHandler, T as getAridhiaCatalogueHandler, D as getAridhiaDarMessageHandler, k as getAridhiaDarWizardHandlers, y as getAridhiaDatasetSettingsHandler, S as getAridhiaDictionariesHandler, v as getAridhiaRequestsHandler, O as getAridhiaSubmitRequestHandler, b as getAridhiaWorkflowHandler, C as getAridhiaWorkspaceLocationsHandler, x as getAridhiaWorkspaceRequestFormHandler, w as getAridhiaWorkspacesHandler, _ as mockAridhiaRequestListItem };
135
144
 
136
145
  //# sourceMappingURL=aridhiaHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aridhiaHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/aridhiaHandlers.ts"],"sourcesContent":["import { FairField } from '@/aridhia-queries/FairFormPayload'\nimport { DAR_MESSAGE_VOCABULARY_CODE } from '@/aridhia-queries/useGetAridhiaVocabularyTerm'\nimport { http, HttpHandler, HttpResponse, JsonBodyType } from 'msw'\n\nexport const MOCK_ARIDHIA_GATEWAY = 'https://mock-gateway.test'\nexport const MOCK_ARIDHIA_FAIR_PORTAL_URL = 'https://mock-fair-portal.test'\nexport const MOCK_ARIDHIA_DATASET_CODE = 'sdtm_als1003'\n\n/**\n * The FAIR API's 403 response for a Synapse-authenticated user with no linked RDCA-DAP\n * account. Distinct from the gateway's own `/authenticate` OAuth-error envelope.\n */\nexport const MOCK_ARIDHIA_NOT_AUTHORIZED_ERROR = {\n status: 403,\n body: {\n error: { status: 403, message: 'Not authorised for this operation' },\n },\n}\n\nexport const MOCK_ARIDHIA_AUTHENTICATION_REQUEST = {\n subject_token_type: 'urn:ietf:params:oauth:token-type:access_token',\n subject_token_issuer: 'sage-prod',\n}\n\nexport const MOCK_ARIDHIA_ACCESS_TOKEN_RESPONSE = {\n access_token: 'mock-aridhia-token',\n expires_in: 300,\n}\n\nexport const MOCK_ARIDHIA_DICTIONARIES = [\n { code: 'dict_a', name: 'Dictionary A' },\n { code: 'dict_b', name: 'Dictionary B' },\n]\n\nexport const MOCK_ARIDHIA_WORKSPACE_LOCATIONS = [\n { value: 'uksouth', description: 'UK South' },\n]\n\nexport const MOCK_ARIDHIA_WORKSPACES = [\n {\n uuid: 'ws-uuid-1',\n name: 'My Workspace',\n location: 'uksouth',\n url: 'https://example.aridhia.com/workspaces/1',\n },\n]\n\nexport const MOCK_ARIDHIA_CATALOGUE = {\n title: 'SDTM ALS Dataset',\n publisher: { name: 'C-Path' },\n description: 'A dataset',\n}\n\n/**\n * Every FAIR form field carries a `label`, as real gateway payloads do, so that UI built from\n * these fixtures is reachable by its accessible name.\n */\nexport const MOCK_ARIDHIA_ABOUT_FIELDS: FairField[] = [\n {\n name: 'name',\n type: 'string',\n label: 'Your name',\n validation: { required: true },\n },\n {\n name: 'email',\n type: 'string',\n label: 'Email address',\n validation: { required: true },\n },\n]\n\nexport const MOCK_ARIDHIA_PROJECT_FIELDS: FairField[] = [\n {\n name: 'project_name',\n type: 'string',\n label: 'Project name',\n validation: { required: true },\n },\n]\n\nexport const MOCK_ARIDHIA_WORKSPACE_FORM_FIELDS: FairField[] = [\n {\n name: 'workspace_name',\n type: 'string',\n label: 'Workspace name',\n validation: { required: true },\n },\n]\n\nexport function getAridhiaAuthenticateHandler(\n response: object = MOCK_ARIDHIA_ACCESS_TOKEN_RESPONSE,\n status = 200,\n): HttpHandler {\n return http.post(`${MOCK_ARIDHIA_GATEWAY}/authenticate`, () =>\n HttpResponse.json(response, { status }),\n )\n}\n\nexport function getAridhiaRequestsHandler(\n items: unknown[] = [],\n errorResponse?: { status: number; body: object },\n): HttpHandler {\n return http.get(`${MOCK_ARIDHIA_GATEWAY}/fair/requests/`, () =>\n errorResponse\n ? HttpResponse.json(errorResponse.body, { status: errorResponse.status })\n : HttpResponse.json({\n items,\n paging: { page: 1, pageSize: 100, total: items.length },\n }),\n )\n}\n\nexport function getAridhiaDatasetSettingsHandler(\n overrides: Partial<{\n allow_clear: boolean\n allow_pseudonymised: boolean\n allow_manual: boolean\n }> = {},\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/datasets/${MOCK_ARIDHIA_DATASET_CODE}/settings`,\n () =>\n HttpResponse.json({\n workflow_key: 'rdca_access_request',\n allow_clear: true,\n allow_pseudonymised: false,\n allow_manual: false,\n ...overrides,\n }),\n )\n}\n\nexport function getAridhiaWorkflowHandler(\n fields: { about?: FairField[]; project?: FairField[] } = {},\n): HttpHandler {\n const {\n about = MOCK_ARIDHIA_ABOUT_FIELDS,\n project = MOCK_ARIDHIA_PROJECT_FIELDS,\n } = fields\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/workflows/rdca_access_request`,\n () =>\n HttpResponse.json({\n code: 'rdca_access_request',\n fields: { about, project },\n }),\n )\n}\n\n/**\n * `body` defaults to the shape confirmed against a real gateway capture: `GET\n * /workspaces-forms/{code}` returns the form object directly, not wrapped in the `items`\n * envelope its OpenAPI spec documents. See `useGetAridhiaWorkspaceRequestForm`. Pass a body to\n * exercise a different payload shape or field set.\n */\nexport function getAridhiaWorkspaceRequestFormHandler(\n body: JsonBodyType = {\n name: 'Request a workspace',\n sections: {\n workspace: {\n label: 'Workspace details',\n fields: MOCK_ARIDHIA_WORKSPACE_FORM_FIELDS,\n },\n },\n },\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/workspaces-forms/workspace_request`,\n () => HttpResponse.json(body),\n )\n}\n\nexport function getAridhiaDictionariesHandler(\n items: unknown[] = MOCK_ARIDHIA_DICTIONARIES,\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/datasets/${MOCK_ARIDHIA_DATASET_CODE}/dictionaries/`,\n () => HttpResponse.json({ items }),\n )\n}\n\nexport function getAridhiaWorkspaceLocationsHandler(\n items: unknown[] = MOCK_ARIDHIA_WORKSPACE_LOCATIONS,\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/datasets/${MOCK_ARIDHIA_DATASET_CODE}/workspaces-locations`,\n () => HttpResponse.json({ items }),\n )\n}\n\nexport function getAridhiaWorkspacesHandler(\n items: unknown[] = MOCK_ARIDHIA_WORKSPACES,\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/datasets/${MOCK_ARIDHIA_DATASET_CODE}/workspaces`,\n () => HttpResponse.json({ items }),\n )\n}\n\nexport function getAridhiaCatalogueHandler(\n body: JsonBodyType = MOCK_ARIDHIA_CATALOGUE,\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/datasets/${MOCK_ARIDHIA_DATASET_CODE}/catalogue`,\n () => HttpResponse.json(body),\n )\n}\n\nexport const MOCK_ARIDHIA_DAR_MESSAGE = {\n code: DAR_MESSAGE_VOCABULARY_CODE,\n name: 'Data Access Request Message',\n grouping: 'markdown',\n value:\n 'Thank you for your request. The review process is usually completed within 2-3 business weeks.\\n\\nIf approved, the signatory will receive a **Data Use Agreement (DUA)**.',\n}\n\n/** Responds only to a request bearing the token that `getAridhiaAuthenticateHandler` issues. */\nexport function getAridhiaDarMessageHandler(\n body: JsonBodyType = MOCK_ARIDHIA_DAR_MESSAGE,\n status = 200,\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/vocabularies/${DAR_MESSAGE_VOCABULARY_CODE}`,\n ({ request }) =>\n request.headers.get('Authorization') ===\n `Bearer ${MOCK_ARIDHIA_ACCESS_TOKEN_RESPONSE.access_token}`\n ? HttpResponse.json(body, { status })\n : HttpResponse.json({ error: 'invalid_token' }, { status: 401 }),\n )\n}\n\n/**\n * `respond` receives the submitted body, so a test can both assert on it and choose the\n * response (success, or a failure to exercise the retry path).\n */\nexport function getAridhiaSubmitRequestHandler<TBody = unknown>(\n respond: (body: TBody) => Response,\n): HttpHandler {\n return http.post(\n `${MOCK_ARIDHIA_GATEWAY}/fair/requests/`,\n async ({ request }) => respond((await request.json()) as TBody),\n )\n}\n\n/**\n * Everything the DAR wizard fetches to reach its first step and run through to submission,\n * excluding the submission itself — see `getAridhiaSubmitRequestHandler`.\n */\nexport function getAridhiaDarWizardHandlers(): HttpHandler[] {\n return [\n getAridhiaAuthenticateHandler(),\n getAridhiaDatasetSettingsHandler(),\n getAridhiaWorkflowHandler(),\n getAridhiaWorkspaceRequestFormHandler(),\n getAridhiaDictionariesHandler(),\n getAridhiaWorkspaceLocationsHandler(),\n getAridhiaWorkspacesHandler(),\n getAridhiaCatalogueHandler(),\n getAridhiaDarMessageHandler(),\n ]\n}\n"],"mappings":";;;AAIA,IAAa,IAAuB,6BACvB,IAA+B,iCAC/B,IAA4B,gBAM5B,IAAoC;CAC/C,QAAQ;CACR,MAAM,EACJ,OAAO;EAAE,QAAQ;EAAK,SAAS;CAAoC,EACrE;AACF,GAEa,IAAsC;CACjD,oBAAoB;CACpB,sBAAsB;AACxB,GAEa,IAAqC;CAChD,cAAc;CACd,YAAY;AACd,GAEa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OAAO,EAAK,KACV,GAAG,EAAqB,kBACxB,OAAO,EAAE,iBAAc,EAAS,MAAM,EAAQ,KAAK,CAAW,CAChE;AACF;AAMA,SAAgB,IAA6C;CAC3D,OAAO;EACL,EAA8B;EAC9B,EAAiC;EACjC,EAA0B;EAC1B,EAAsC;EACtC,EAA8B;EAC9B,EAAoC;EACpC,EAA4B;EAC5B,EAA2B;EAC3B,EAA4B;CAC9B;AACF"}
1
+ {"version":3,"file":"aridhiaHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/aridhiaHandlers.ts"],"sourcesContent":["import { FairField } from '@/aridhia-queries/FairFormPayload'\nimport { DAR_MESSAGE_VOCABULARY_CODE } from '@/aridhia-queries/useGetAridhiaVocabularyTerm'\nimport { RequestListItem } from '@sage-bionetworks/aridhia-client/generated/models'\nimport { http, HttpHandler, HttpResponse, JsonBodyType } from 'msw'\n\nexport const MOCK_ARIDHIA_GATEWAY = 'https://mock-gateway.test'\nexport const MOCK_ARIDHIA_FAIR_PORTAL_URL = 'https://mock-fair-portal.test'\nexport const MOCK_ARIDHIA_DATASET_CODE = 'sdtm_als1003'\n\n/**\n * The FAIR API's 403 response for a Synapse-authenticated user with no linked RDCA-DAP\n * account. Distinct from the gateway's own `/authenticate` OAuth-error envelope.\n */\nexport const MOCK_ARIDHIA_NOT_AUTHORIZED_ERROR = {\n status: 403,\n body: {\n error: { status: 403, message: 'Not authorised for this operation' },\n },\n}\n\nexport const MOCK_ARIDHIA_AUTHENTICATION_REQUEST = {\n subject_token_type: 'urn:ietf:params:oauth:token-type:access_token',\n subject_token_issuer: 'sage-prod',\n}\n\nexport const MOCK_ARIDHIA_ACCESS_TOKEN_RESPONSE = {\n access_token: 'mock-aridhia-token',\n expires_in: 300,\n}\n\nexport const MOCK_ARIDHIA_DICTIONARIES = [\n { code: 'dict_a', name: 'Dictionary A' },\n { code: 'dict_b', name: 'Dictionary B' },\n]\n\nexport const MOCK_ARIDHIA_WORKSPACE_LOCATIONS = [\n { value: 'uksouth', description: 'UK South' },\n]\n\nexport const MOCK_ARIDHIA_WORKSPACES = [\n {\n uuid: 'ws-uuid-1',\n name: 'My Workspace',\n location: 'uksouth',\n url: 'https://example.aridhia.com/workspaces/1',\n },\n]\n\nexport const MOCK_ARIDHIA_CATALOGUE = {\n title: 'SDTM ALS Dataset',\n publisher: { name: 'C-Path' },\n description: 'A dataset',\n}\n\n/**\n * Every FAIR form field carries a `label`, as real gateway payloads do, so that UI built from\n * these fixtures is reachable by its accessible name.\n */\nexport const MOCK_ARIDHIA_ABOUT_FIELDS: FairField[] = [\n {\n name: 'name',\n type: 'string',\n label: 'Your name',\n validation: { required: true },\n },\n {\n name: 'email',\n type: 'string',\n label: 'Email address',\n validation: { required: true },\n },\n]\n\nexport const MOCK_ARIDHIA_PROJECT_FIELDS: FairField[] = [\n {\n name: 'project_name',\n type: 'string',\n label: 'Project name',\n validation: { required: true },\n },\n]\n\nexport const MOCK_ARIDHIA_WORKSPACE_FORM_FIELDS: FairField[] = [\n {\n name: 'workspace_name',\n type: 'string',\n label: 'Workspace name',\n validation: { required: true },\n },\n]\n\nexport function getAridhiaAuthenticateHandler(\n response: object = MOCK_ARIDHIA_ACCESS_TOKEN_RESPONSE,\n status = 200,\n): HttpHandler {\n return http.post(`${MOCK_ARIDHIA_GATEWAY}/authenticate`, () =>\n HttpResponse.json(response, { status }),\n )\n}\n\n/**\n * A `GET /fair/requests` list item covering `MOCK_ARIDHIA_DATASET_CODE`, created and last\n * updated at `updatedAt`.\n */\nexport function mockAridhiaRequestListItem(\n request: Pick<RequestListItem, 'code' | 'name' | 'status'> & {\n updatedAt: string\n datasetCodes?: string[]\n },\n): RequestListItem {\n const {\n updatedAt,\n datasetCodes = [MOCK_ARIDHIA_DATASET_CODE],\n ...fields\n } = request\n return {\n ...fields,\n datasets: datasetCodes.map(code => ({ code })),\n created_at: updatedAt,\n updated_at: updatedAt,\n }\n}\n\nexport function getAridhiaRequestsHandler(\n items: unknown[] = [],\n errorResponse?: { status: number; body: object },\n): HttpHandler {\n return http.get(`${MOCK_ARIDHIA_GATEWAY}/fair/requests/`, () =>\n errorResponse\n ? HttpResponse.json(errorResponse.body, { status: errorResponse.status })\n : HttpResponse.json({\n items,\n paging: { page: 1, pageSize: 100, total: items.length },\n }),\n )\n}\n\nexport function getAridhiaDatasetSettingsHandler(\n overrides: Partial<{\n allow_clear: boolean\n allow_pseudonymised: boolean\n allow_manual: boolean\n }> = {},\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/datasets/${MOCK_ARIDHIA_DATASET_CODE}/settings`,\n () =>\n HttpResponse.json({\n workflow_key: 'rdca_access_request',\n allow_clear: true,\n allow_pseudonymised: false,\n allow_manual: false,\n ...overrides,\n }),\n )\n}\n\nexport function getAridhiaWorkflowHandler(\n fields: { about?: FairField[]; project?: FairField[] } = {},\n): HttpHandler {\n const {\n about = MOCK_ARIDHIA_ABOUT_FIELDS,\n project = MOCK_ARIDHIA_PROJECT_FIELDS,\n } = fields\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/workflows/rdca_access_request`,\n () =>\n HttpResponse.json({\n code: 'rdca_access_request',\n fields: { about, project },\n }),\n )\n}\n\n/**\n * `body` defaults to the shape confirmed against a real gateway capture: `GET\n * /workspaces-forms/{code}` returns the form object directly, not wrapped in the `items`\n * envelope its OpenAPI spec documents. See `useGetAridhiaWorkspaceRequestForm`. Pass a body to\n * exercise a different payload shape or field set.\n */\nexport function getAridhiaWorkspaceRequestFormHandler(\n body: JsonBodyType = {\n name: 'Request a workspace',\n sections: {\n workspace: {\n label: 'Workspace details',\n fields: MOCK_ARIDHIA_WORKSPACE_FORM_FIELDS,\n },\n },\n },\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/workspaces-forms/workspace_request`,\n () => HttpResponse.json(body),\n )\n}\n\nexport function getAridhiaDictionariesHandler(\n items: unknown[] = MOCK_ARIDHIA_DICTIONARIES,\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/datasets/${MOCK_ARIDHIA_DATASET_CODE}/dictionaries/`,\n () => HttpResponse.json({ items }),\n )\n}\n\nexport function getAridhiaWorkspaceLocationsHandler(\n items: unknown[] = MOCK_ARIDHIA_WORKSPACE_LOCATIONS,\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/datasets/${MOCK_ARIDHIA_DATASET_CODE}/workspaces-locations`,\n () => HttpResponse.json({ items }),\n )\n}\n\nexport function getAridhiaWorkspacesHandler(\n items: unknown[] = MOCK_ARIDHIA_WORKSPACES,\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/datasets/${MOCK_ARIDHIA_DATASET_CODE}/workspaces`,\n () => HttpResponse.json({ items }),\n )\n}\n\nexport function getAridhiaCatalogueHandler(\n body: JsonBodyType = MOCK_ARIDHIA_CATALOGUE,\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/datasets/${MOCK_ARIDHIA_DATASET_CODE}/catalogue`,\n () => HttpResponse.json(body),\n )\n}\n\nexport const MOCK_ARIDHIA_DAR_MESSAGE = {\n code: DAR_MESSAGE_VOCABULARY_CODE,\n name: 'Data Access Request Message',\n grouping: 'markdown',\n value:\n 'Thank you for your request. The review process is usually completed within 2-3 business weeks.\\n\\nIf approved, the signatory will receive a **Data Use Agreement (DUA)**.',\n}\n\n/** Responds only to a request bearing the token that `getAridhiaAuthenticateHandler` issues. */\nexport function getAridhiaDarMessageHandler(\n body: JsonBodyType = MOCK_ARIDHIA_DAR_MESSAGE,\n status = 200,\n): HttpHandler {\n return http.get(\n `${MOCK_ARIDHIA_GATEWAY}/fair/vocabularies/${DAR_MESSAGE_VOCABULARY_CODE}`,\n ({ request }) =>\n request.headers.get('Authorization') ===\n `Bearer ${MOCK_ARIDHIA_ACCESS_TOKEN_RESPONSE.access_token}`\n ? HttpResponse.json(body, { status })\n : HttpResponse.json({ error: 'invalid_token' }, { status: 401 }),\n )\n}\n\n/**\n * `respond` receives the submitted body, so a test can both assert on it and choose the\n * response (success, or a failure to exercise the retry path).\n */\nexport function getAridhiaSubmitRequestHandler<TBody = unknown>(\n respond: (body: TBody) => Response,\n): HttpHandler {\n return http.post(\n `${MOCK_ARIDHIA_GATEWAY}/fair/requests/`,\n async ({ request }) => respond((await request.json()) as TBody),\n )\n}\n\n/**\n * Everything the DAR wizard fetches to reach its first step and run through to submission,\n * excluding the submission itself — see `getAridhiaSubmitRequestHandler`.\n */\nexport function getAridhiaDarWizardHandlers(): HttpHandler[] {\n return [\n getAridhiaAuthenticateHandler(),\n getAridhiaDatasetSettingsHandler(),\n getAridhiaWorkflowHandler(),\n getAridhiaWorkspaceRequestFormHandler(),\n getAridhiaDictionariesHandler(),\n getAridhiaWorkspaceLocationsHandler(),\n getAridhiaWorkspacesHandler(),\n getAridhiaCatalogueHandler(),\n getAridhiaDarMessageHandler(),\n ]\n}\n"],"mappings":";;;AAKA,IAAa,IAAuB,6BACvB,IAA+B,iCAC/B,IAA4B,gBAM5B,IAAoC;CAC/C,QAAQ;CACR,MAAM,EACJ,OAAO;EAAE,QAAQ;EAAK,SAAS;CAAoC,EACrE;AACF,GAEa,IAAsC;CACjD,oBAAoB;CACpB,sBAAsB;AACxB,GAEa,IAAqC;CAChD,cAAc;CACd,YAAY;AACd,GAEa,IAA4B,CACvC;CAAE,MAAM;CAAU,MAAM;AAAe,GACvC;CAAE,MAAM;CAAU,MAAM;AAAe,CACzC,GAEa,IAAmC,CAC9C;CAAE,OAAO;CAAW,aAAa;AAAW,CAC9C,GAEa,IAA0B,CACrC;CACE,MAAM;CACN,MAAM;CACN,UAAU;CACV,KAAK;AACP,CACF,GAEa,IAAyB;CACpC,OAAO;CACP,WAAW,EAAE,MAAM,SAAS;CAC5B,aAAa;AACf,GAMa,IAAyC,CACpD;CACE,MAAM;CACN,MAAM;CACN,OAAO;CACP,YAAY,EAAE,UAAU,GAAK;AAC/B,GACA;CACE,MA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;EAC9B,EAAoC;EACpC,EAA4B;EAC5B,EAA2B;EAC3B,EAA4B;CAC9B;AACF"}
@@ -1,9 +1,28 @@
1
1
  import { AsynchronousRequestBody, ErrorResponse } from '@sage-bionetworks/synapse-client';
2
2
  import { DefaultBodyType, HttpHandler } from 'msw';
3
+ /**
4
+ * A dispatch result that makes a mocked job FAIL: the job status reports `FAILED`
5
+ * and the job's response endpoint returns `body` with the given HTTP `status`.
6
+ */
7
+ export declare class AsyncJobFailure {
8
+ readonly status: number;
9
+ /** An ErrorResponse or one of its subtypes, e.g. BelowThresholdErrorResponse. */
10
+ readonly body: {
11
+ concreteType: string;
12
+ reason?: string;
13
+ };
14
+ constructor(status: number,
15
+ /** An ErrorResponse or one of its subtypes, e.g. BelowThresholdErrorResponse. */
16
+ body: {
17
+ concreteType: string;
18
+ reason?: string;
19
+ });
20
+ }
21
+ type AsyncJobResult = DefaultBodyType | ErrorResponse | AsyncJobFailure;
3
22
  /**
4
23
  * Maps a job request's `concreteType` to a function producing that job's response body.
5
24
  */
6
- export type AsynchronousJobDispatch = Record<string, (request: AsynchronousRequestBody) => DefaultBodyType | ErrorResponse>;
25
+ export type AsynchronousJobDispatch = Record<string, (request: AsynchronousRequestBody) => AsyncJobResult>;
7
26
  /**
8
27
  * Build a single-entry `AsynchronousJobDispatch` for one `concreteType`, narrowing `handler`'s
9
28
  * request parameter to that type's variant of `AsynchronousRequestBody` so callers never have to
@@ -11,7 +30,7 @@ export type AsynchronousJobDispatch = Record<string, (request: AsynchronousReque
11
30
  */
12
31
  export declare function dispatchEntry<T extends AsynchronousRequestBody['concreteType']>(concreteType: T, handler: (request: Extract<AsynchronousRequestBody, {
13
32
  concreteType: T;
14
- }>) => DefaultBodyType | ErrorResponse): AsynchronousJobDispatch;
33
+ }>) => AsyncJobResult): AsynchronousJobDispatch;
15
34
  /**
16
35
  * A dedicated async service-specific start/get path pair.
17
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"asyncJobHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/asyncJobHandlers.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,uBAAuB,EACvB,aAAa,EACd,MAAM,kCAAkC,CAAA;AAMzC,OAAO,EAAE,eAAe,EAAQ,WAAW,EAAgB,MAAM,KAAK,CAAA;AAiBtE;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C,MAAM,EACN,CAAC,OAAO,EAAE,uBAAuB,KAAK,eAAe,GAAG,aAAa,CACtE,CAAA;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,CAAC,SAAS,uBAAuB,CAAC,cAAc,CAAC,EAEjD,YAAY,EAAE,CAAC,EACf,OAAO,EAAE,CACP,OAAO,EAAE,OAAO,CAAC,uBAAuB,EAAE;IAAE,YAAY,EAAE,CAAC,CAAA;CAAE,CAAC,KAC3D,eAAe,GAAG,aAAa,GACnC,uBAAuB,CAKzB;AAED;;GAEG;AACH,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAA;CAC7C,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,uBAAuB,EACjC,OAAO,GAAE;IACP,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,qCAAqC,CAAC,EAAE,MAAM,CAAA;CAC1C,GACL,WAAW,EAAE,CA0Hf"}
1
+ {"version":3,"file":"asyncJobHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/asyncJobHandlers.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,uBAAuB,EACvB,aAAa,EACd,MAAM,kCAAkC,CAAA;AAMzC,OAAO,EAAE,eAAe,EAAQ,WAAW,EAAgB,MAAM,KAAK,CAAA;AAGtE;;;GAGG;AACH,qBAAa,eAAe;IAExB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;gBAF/C,MAAM,EAAE,MAAM;IACvB,iFAAiF;IACxE,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;CAE3D;AAED,KAAK,cAAc,GAAG,eAAe,GAAG,aAAa,GAAG,eAAe,CAAA;AAgBvE;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C,MAAM,EACN,CAAC,OAAO,EAAE,uBAAuB,KAAK,cAAc,CACrD,CAAA;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,CAAC,SAAS,uBAAuB,CAAC,cAAc,CAAC,EAEjD,YAAY,EAAE,CAAC,EACf,OAAO,EAAE,CACP,OAAO,EAAE,OAAO,CAAC,uBAAuB,EAAE;IAAE,YAAY,EAAE,CAAC,CAAA;CAAE,CAAC,KAC3D,cAAc,GAClB,uBAAuB,CAKzB;AAED;;GAEG;AACH,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAA;CAC7C,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,uBAAuB,EACjC,OAAO,GAAE;IACP,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,qCAAqC,CAAC,EAAE,MAAM,CAAA;CAC1C,GACL,WAAW,EAAE,CA6Hf"}
@@ -3,42 +3,48 @@ import { ASYNCHRONOUS_JOB as n, ASYNCHRONOUS_JOB_TOKEN as r } from "../../../uti
3
3
  import i from "../util/BasicMockedCrudService.js";
4
4
  import { HttpResponse as a, http as o } from "msw";
5
5
  //#region src/mocks/msw/handlers/asyncJobHandlers.ts
6
- var s = new i({
6
+ var s = class {
7
+ status;
8
+ body;
9
+ constructor(e, t) {
10
+ this.status = e, this.body = t;
11
+ }
12
+ }, c = new i({
7
13
  idField: "id",
8
14
  autoGenerateId: !0
9
15
  });
10
- function c(e, t) {
16
+ function l(e, t) {
11
17
  return { [e]: (e) => t(e) };
12
18
  }
13
- function l(i, c = {}) {
14
- let { asyncTypeServicePaths: l, backendOrigin: u = t(e.REPO_ENDPOINT), serviceSpecificEndpointResponseStatus: d = 201 } = c;
15
- if (l && Object.keys(i).length !== 1) throw Error("generateAsyncJobHandlers: asyncTypeServicePaths requires exactly one dispatch entry, since the dedicated path already disambiguates the job type.");
16
- let f = d < 400 ? "COMPLETE" : "FAILED";
17
- function p(e) {
19
+ function u(i, l = {}) {
20
+ let { asyncTypeServicePaths: u, backendOrigin: d = t(e.REPO_ENDPOINT), serviceSpecificEndpointResponseStatus: f = 201 } = l;
21
+ if (u && Object.keys(i).length !== 1) throw Error("generateAsyncJobHandlers: asyncTypeServicePaths requires exactly one dispatch entry, since the dedicated path already disambiguates the job type.");
22
+ let p = f < 400 ? "COMPLETE" : "FAILED";
23
+ function m(e) {
18
24
  let t = i[e.concreteType];
19
25
  if (!t) throw Error(`generateAsyncJobHandlers: unsupported concreteType "${e.concreteType}"`);
20
26
  return t(e);
21
27
  }
22
- let m = l?.requestPath ?? n, h = [o.post(`${u}${m}`, async ({ request: e }) => {
23
- let t = await e.json(), n = s.create({
28
+ let h = u?.requestPath ?? n, g = [o.post(`${d}${h}`, async ({ request: e }) => {
29
+ let t = await e.json(), n = c.create({
24
30
  request: t,
25
- response: p(t)
26
- }), r = l ? { token: n.id } : {
31
+ response: m(t)
32
+ }), r = u ? { token: n.id } : {
27
33
  jobId: n.id,
28
34
  jobState: "PROCESSING"
29
35
  };
30
36
  return a.json(r, { status: 201 });
31
- }), o.get(`${u}${r(":id")}`, ({ params: e }) => {
32
- let t = e.id, n = s.getOneById(t);
37
+ }), o.get(`${d}${r(":id")}`, ({ params: e }) => {
38
+ let t = e.id, n = c.getOneById(t);
33
39
  if (!t || !n) return a.json({ message: "The mocked asynchronous job was not found" }, { status: 404 });
34
- let { request: r, response: i } = n;
40
+ let { request: r, response: i } = n, o = i instanceof s ? i : null;
35
41
  return a.json({
36
- jobState: f,
42
+ jobState: o ? "FAILED" : p,
37
43
  jobCanceling: !1,
38
44
  requestBody: r,
39
45
  etag: "00000000-0000-0000-0000-000000000000",
40
46
  jobId: t,
41
- responseBody: i,
47
+ responseBody: o ? void 0 : i,
42
48
  startedByUserId: 0,
43
49
  startedOn: "",
44
50
  changedOn: "",
@@ -46,17 +52,19 @@ function l(i, c = {}) {
46
52
  progressCurrent: 100,
47
53
  progressTotal: 100,
48
54
  exception: "",
49
- errorMessage: "",
55
+ errorMessage: o?.body.reason ?? "",
50
56
  errorDetails: "",
51
57
  runtimeMS: 100
52
58
  }, { status: 200 });
53
59
  })];
54
- return l && h.push(o.get(`${u}${l.responsePath(":asyncJobToken")}`, ({ params: e }) => {
55
- let t = e.asyncJobToken, n = s.getOneById(t);
56
- return !t || !n ? a.json({ message: "The mocked asynchronous job was not found" }, { status: 404 }) : a.json(n.response, { status: d });
57
- })), h;
60
+ return u && g.push(o.get(`${d}${u.responsePath(":asyncJobToken")}`, ({ params: e }) => {
61
+ let t = e.asyncJobToken, n = c.getOneById(t);
62
+ if (!t || !n) return a.json({ message: "The mocked asynchronous job was not found" }, { status: 404 });
63
+ let { response: r } = n;
64
+ return r instanceof s ? a.json(r.body, { status: r.status }) : a.json(r, { status: f });
65
+ })), g;
58
66
  }
59
67
  //#endregion
60
- export { c as dispatchEntry, l as generateAsyncJobHandlers };
68
+ export { s as AsyncJobFailure, l as dispatchEntry, u as generateAsyncJobHandlers };
61
69
 
62
70
  //# sourceMappingURL=asyncJobHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"asyncJobHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/asyncJobHandlers.ts"],"sourcesContent":["import { ASYNCHRONOUS_JOB, ASYNCHRONOUS_JOB_TOKEN } from '@/utils/APIConstants'\nimport {\n BackendDestinationEnum,\n getEndpoint,\n} from '@/utils/functions/getEndpoint'\nimport {\n AsynchronousRequestBody,\n ErrorResponse,\n} from '@sage-bionetworks/synapse-client'\nimport {\n AsynchJobState,\n AsynchronousJobStatus,\n AsyncJobId,\n} from '@sage-bionetworks/synapse-types'\nimport { DefaultBodyType, http, HttpHandler, HttpResponse } from 'msw'\nimport BasicMockedCrudService from '../util/BasicMockedCrudService'\n\ntype AsyncJobDetails = {\n id: string\n request: AsynchronousRequestBody\n response: DefaultBodyType | ErrorResponse\n}\n\nconst mockAsynchronousJobService = new BasicMockedCrudService<\n AsyncJobDetails,\n 'id'\n>({\n idField: 'id',\n autoGenerateId: true,\n})\n\n/**\n * Maps a job request's `concreteType` to a function producing that job's response body.\n */\nexport type AsynchronousJobDispatch = Record<\n string,\n (request: AsynchronousRequestBody) => DefaultBodyType | ErrorResponse\n>\n\n/**\n * Build a single-entry `AsynchronousJobDispatch` for one `concreteType`, narrowing `handler`'s\n * request parameter to that type's variant of `AsynchronousRequestBody` so callers never have to\n * re-cast the generic request themselves.\n */\nexport function dispatchEntry<\n T extends AsynchronousRequestBody['concreteType'],\n>(\n concreteType: T,\n handler: (\n request: Extract<AsynchronousRequestBody, { concreteType: T }>,\n ) => DefaultBodyType | ErrorResponse,\n): AsynchronousJobDispatch {\n return {\n [concreteType]: request =>\n handler(request as Extract<AsynchronousRequestBody, { concreteType: T }>),\n }\n}\n\n/**\n * A dedicated async service-specific start/get path pair.\n */\ntype AsyncTypeServicePaths = {\n requestPath: string\n responsePath: (tokenParam: string) => string\n}\n\n/**\n * Generates MSW handlers for asynchronous jobs, dispatching by request `concreteType`.\n *\n * By default, registers the generic endpoint pair used by every job type dispatched through\n * `postRepoV1AsynchronousJob`/`getRepoV1AsynchronousJobJobId`\n * (`POST /repo/v1/asynchronous/job` + `GET /repo/v1/asynchronous/job/{jobId}`). Callers that need\n * to support more than one `concreteType` in the same test/story MUST merge their entries into a\n * single `dispatch` map and call this once.\n *\n * @param dispatch maps each supported request `concreteType` to a function producing that job's response body\n * @param options.asyncTypeServicePaths registers a dedicated start/get path pair instead of the generic endpoint; see {@link AsyncTypeServicePaths}\n * @param options.backendOrigin the backend origin to use for the handlers\n * @param options.serviceSpecificEndpointResponseStatus the status code for the dedicated response path (`asyncTypeServicePaths` only); also determines whether both GET endpoints report `COMPLETE` or `FAILED`\n */\nexport function generateAsyncJobHandlers(\n dispatch: AsynchronousJobDispatch,\n options: {\n asyncTypeServicePaths?: AsyncTypeServicePaths\n backendOrigin?: string\n serviceSpecificEndpointResponseStatus?: number\n } = {},\n): HttpHandler[] {\n const {\n asyncTypeServicePaths,\n backendOrigin = getEndpoint(BackendDestinationEnum.REPO_ENDPOINT),\n serviceSpecificEndpointResponseStatus = 201,\n } = options\n\n if (asyncTypeServicePaths && Object.keys(dispatch).length !== 1) {\n throw new Error(\n 'generateAsyncJobHandlers: asyncTypeServicePaths requires exactly one dispatch entry, since the dedicated path already disambiguates the job type.',\n )\n }\n\n const jobState: AsynchJobState =\n serviceSpecificEndpointResponseStatus < 400 ? 'COMPLETE' : 'FAILED'\n\n function resolveResponse(\n body: AsynchronousRequestBody,\n ): DefaultBodyType | ErrorResponse {\n const handler = dispatch[body.concreteType]\n if (!handler) {\n throw new Error(\n `generateAsyncJobHandlers: unsupported concreteType \"${body.concreteType}\"`,\n )\n }\n return handler(body)\n }\n\n const requestPath = asyncTypeServicePaths?.requestPath ?? ASYNCHRONOUS_JOB\n\n const handlers: HttpHandler[] = [\n // Handler for the asynchronous job request endpoint.\n http.post(`${backendOrigin}${requestPath}`, async ({ request }) => {\n const body = (await request.json()) as AsynchronousRequestBody\n const createdJob = mockAsynchronousJobService.create({\n request: body,\n response: resolveResponse(body),\n })\n\n // The generic endpoint's response is a full AsynchronousJobStatus (read via `.jobId`).\n // The per-service endpoints respond with an AsyncJobId (read via `.token`).\n const responseBody:\n | AsyncJobId\n | Partial<\n AsynchronousJobStatus<AsynchronousRequestBody, DefaultBodyType>\n > = asyncTypeServicePaths\n ? { token: createdJob.id }\n : { jobId: createdJob.id, jobState: 'PROCESSING' }\n\n return HttpResponse.json(responseBody, { status: 201 })\n }),\n\n // Generic async job response handler. Since this implementation is the same for all services and references the global map, it's fine if this is overridden.\n http.get(\n `${backendOrigin}${ASYNCHRONOUS_JOB_TOKEN(':id')}`,\n ({ params }) => {\n const id = params.id as string\n const asyncJobDetails = mockAsynchronousJobService.getOneById(id)\n if (!id || !asyncJobDetails) {\n return HttpResponse.json(\n { message: 'The mocked asynchronous job was not found' },\n { status: 404 },\n )\n }\n const { request, response } = asyncJobDetails\n\n return HttpResponse.json<\n AsynchronousJobStatus<AsynchronousRequestBody, DefaultBodyType>\n >(\n {\n jobState,\n jobCanceling: false,\n requestBody: request,\n etag: '00000000-0000-0000-0000-000000000000',\n jobId: id,\n responseBody: response as DefaultBodyType,\n startedByUserId: 0,\n startedOn: '',\n changedOn: '',\n progressMessage: '',\n progressCurrent: 100,\n progressTotal: 100,\n exception: '',\n errorMessage: '',\n errorDetails: '',\n runtimeMS: 100,\n },\n {\n // This endpoint returns a successful status code regardless of the job status\n status: 200,\n },\n )\n },\n ),\n ]\n\n if (asyncTypeServicePaths) {\n // Dedicated service-specific response endpoint, polled directly by type-specific services instead of\n // the generic async job response handler above.\n handlers.push(\n http.get<{ asyncJobToken: string }>(\n `${backendOrigin}${asyncTypeServicePaths.responsePath(':asyncJobToken')}`,\n ({ params }) => {\n const asyncJobToken = params.asyncJobToken\n const asyncJobDetails =\n mockAsynchronousJobService.getOneById(asyncJobToken)\n if (!asyncJobToken || !asyncJobDetails) {\n return HttpResponse.json(\n { message: 'The mocked asynchronous job was not found' },\n { status: 404 },\n )\n }\n\n return HttpResponse.json(asyncJobDetails.response, {\n status: serviceSpecificEndpointResponseStatus,\n })\n },\n ),\n )\n }\n\n return handlers\n}\n"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N,OAAO;GACP,cAAc;GACd,iBAAiB;GACjB,WAAW;GACX,WAAW;GACX,iBAAiB;GACjB,iBAAiB;GACjB,eAAe;GACf,WAAW;GACX,cAAc;GACd,cAAc;GACd,WAAW;EACb,GACA,EAEE,QAAQ,IACV,CACF;CACF,CACF,CACF;CA2BA,OAzBI,KAGF,EAAS,KACP,EAAK,IACH,GAAG,IAAgB,EAAsB,aAAa,gBAAgB,MACrE,EAAE,gBAAa;EACd,IAAM,IAAgB,EAAO,eACvB,IACJ,EAA2B,WAAW,CAAa;EAQrD,OAPI,CAAC,KAAiB,CAAC,IACd,EAAa,KAClB,EAAE,SAAS,4CAA4C,GACvD,EAAE,QAAQ,IAAI,CAChB,IAGK,EAAa,KAAK,EAAgB,UAAU,EACjD,QAAQ,EACV,CAAC;CACH,CACF,CACF,GAGK;AACT"}
1
+ {"version":3,"file":"asyncJobHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/asyncJobHandlers.ts"],"sourcesContent":["import { ASYNCHRONOUS_JOB, ASYNCHRONOUS_JOB_TOKEN } from '@/utils/APIConstants'\nimport {\n BackendDestinationEnum,\n getEndpoint,\n} from '@/utils/functions/getEndpoint'\nimport {\n AsynchronousRequestBody,\n ErrorResponse,\n} from '@sage-bionetworks/synapse-client'\nimport {\n AsynchJobState,\n AsynchronousJobStatus,\n AsyncJobId,\n} from '@sage-bionetworks/synapse-types'\nimport { DefaultBodyType, http, HttpHandler, HttpResponse } from 'msw'\nimport BasicMockedCrudService from '../util/BasicMockedCrudService'\n\n/**\n * A dispatch result that makes a mocked job FAIL: the job status reports `FAILED`\n * and the job's response endpoint returns `body` with the given HTTP `status`.\n */\nexport class AsyncJobFailure {\n constructor(\n readonly status: number,\n /** An ErrorResponse or one of its subtypes, e.g. BelowThresholdErrorResponse. */\n readonly body: { concreteType: string; reason?: string },\n ) {}\n}\n\ntype AsyncJobResult = DefaultBodyType | ErrorResponse | AsyncJobFailure\n\ntype AsyncJobDetails = {\n id: string\n request: AsynchronousRequestBody\n response: AsyncJobResult\n}\n\nconst mockAsynchronousJobService = new BasicMockedCrudService<\n AsyncJobDetails,\n 'id'\n>({\n idField: 'id',\n autoGenerateId: true,\n})\n\n/**\n * Maps a job request's `concreteType` to a function producing that job's response body.\n */\nexport type AsynchronousJobDispatch = Record<\n string,\n (request: AsynchronousRequestBody) => AsyncJobResult\n>\n\n/**\n * Build a single-entry `AsynchronousJobDispatch` for one `concreteType`, narrowing `handler`'s\n * request parameter to that type's variant of `AsynchronousRequestBody` so callers never have to\n * re-cast the generic request themselves.\n */\nexport function dispatchEntry<\n T extends AsynchronousRequestBody['concreteType'],\n>(\n concreteType: T,\n handler: (\n request: Extract<AsynchronousRequestBody, { concreteType: T }>,\n ) => AsyncJobResult,\n): AsynchronousJobDispatch {\n return {\n [concreteType]: request =>\n handler(request as Extract<AsynchronousRequestBody, { concreteType: T }>),\n }\n}\n\n/**\n * A dedicated async service-specific start/get path pair.\n */\ntype AsyncTypeServicePaths = {\n requestPath: string\n responsePath: (tokenParam: string) => string\n}\n\n/**\n * Generates MSW handlers for asynchronous jobs, dispatching by request `concreteType`.\n *\n * By default, registers the generic endpoint pair used by every job type dispatched through\n * `postRepoV1AsynchronousJob`/`getRepoV1AsynchronousJobJobId`\n * (`POST /repo/v1/asynchronous/job` + `GET /repo/v1/asynchronous/job/{jobId}`). Callers that need\n * to support more than one `concreteType` in the same test/story MUST merge their entries into a\n * single `dispatch` map and call this once.\n *\n * @param dispatch maps each supported request `concreteType` to a function producing that job's response body\n * @param options.asyncTypeServicePaths registers a dedicated start/get path pair instead of the generic endpoint; see {@link AsyncTypeServicePaths}\n * @param options.backendOrigin the backend origin to use for the handlers\n * @param options.serviceSpecificEndpointResponseStatus the status code for the dedicated response path (`asyncTypeServicePaths` only); also determines whether both GET endpoints report `COMPLETE` or `FAILED`\n */\nexport function generateAsyncJobHandlers(\n dispatch: AsynchronousJobDispatch,\n options: {\n asyncTypeServicePaths?: AsyncTypeServicePaths\n backendOrigin?: string\n serviceSpecificEndpointResponseStatus?: number\n } = {},\n): HttpHandler[] {\n const {\n asyncTypeServicePaths,\n backendOrigin = getEndpoint(BackendDestinationEnum.REPO_ENDPOINT),\n serviceSpecificEndpointResponseStatus = 201,\n } = options\n\n if (asyncTypeServicePaths && Object.keys(dispatch).length !== 1) {\n throw new Error(\n 'generateAsyncJobHandlers: asyncTypeServicePaths requires exactly one dispatch entry, since the dedicated path already disambiguates the job type.',\n )\n }\n\n const defaultJobState: AsynchJobState =\n serviceSpecificEndpointResponseStatus < 400 ? 'COMPLETE' : 'FAILED'\n\n function resolveResponse(body: AsynchronousRequestBody): AsyncJobResult {\n const handler = dispatch[body.concreteType]\n if (!handler) {\n throw new Error(\n `generateAsyncJobHandlers: unsupported concreteType \"${body.concreteType}\"`,\n )\n }\n return handler(body)\n }\n\n const requestPath = asyncTypeServicePaths?.requestPath ?? ASYNCHRONOUS_JOB\n\n const handlers: HttpHandler[] = [\n // Handler for the asynchronous job request endpoint.\n http.post(`${backendOrigin}${requestPath}`, async ({ request }) => {\n const body = (await request.json()) as AsynchronousRequestBody\n const createdJob = mockAsynchronousJobService.create({\n request: body,\n response: resolveResponse(body),\n })\n\n // The generic endpoint's response is a full AsynchronousJobStatus (read via `.jobId`).\n // The per-service endpoints respond with an AsyncJobId (read via `.token`).\n const responseBody:\n | AsyncJobId\n | Partial<\n AsynchronousJobStatus<AsynchronousRequestBody, DefaultBodyType>\n > = asyncTypeServicePaths\n ? { token: createdJob.id }\n : { jobId: createdJob.id, jobState: 'PROCESSING' }\n\n return HttpResponse.json(responseBody, { status: 201 })\n }),\n\n // Generic async job response handler. Since this implementation is the same for all services and references the global map, it's fine if this is overridden.\n http.get(\n `${backendOrigin}${ASYNCHRONOUS_JOB_TOKEN(':id')}`,\n ({ params }) => {\n const id = params.id as string\n const asyncJobDetails = mockAsynchronousJobService.getOneById(id)\n if (!id || !asyncJobDetails) {\n return HttpResponse.json(\n { message: 'The mocked asynchronous job was not found' },\n { status: 404 },\n )\n }\n const { request, response } = asyncJobDetails\n const failure = response instanceof AsyncJobFailure ? response : null\n\n return HttpResponse.json<\n AsynchronousJobStatus<AsynchronousRequestBody, DefaultBodyType>\n >(\n {\n jobState: failure ? 'FAILED' : defaultJobState,\n jobCanceling: false,\n requestBody: request,\n etag: '00000000-0000-0000-0000-000000000000',\n jobId: id,\n responseBody: failure ? undefined : (response as DefaultBodyType),\n startedByUserId: 0,\n startedOn: '',\n changedOn: '',\n progressMessage: '',\n progressCurrent: 100,\n progressTotal: 100,\n exception: '',\n errorMessage: failure?.body.reason ?? '',\n errorDetails: '',\n runtimeMS: 100,\n },\n {\n // This endpoint returns a successful status code regardless of the job status\n status: 200,\n },\n )\n },\n ),\n ]\n\n if (asyncTypeServicePaths) {\n // Dedicated service-specific response endpoint, polled directly by type-specific services instead of\n // the generic async job response handler above.\n handlers.push(\n http.get<{ asyncJobToken: string }>(\n `${backendOrigin}${asyncTypeServicePaths.responsePath(':asyncJobToken')}`,\n ({ params }) => {\n const asyncJobToken = params.asyncJobToken\n const asyncJobDetails =\n mockAsynchronousJobService.getOneById(asyncJobToken)\n if (!asyncJobToken || !asyncJobDetails) {\n return HttpResponse.json(\n { message: 'The mocked asynchronous job was not found' },\n { status: 404 },\n )\n }\n\n const { response } = asyncJobDetails\n if (response instanceof AsyncJobFailure) {\n return HttpResponse.json(response.body, { status: response.status })\n }\n return HttpResponse.json(response, {\n status: serviceSpecificEndpointResponseStatus,\n })\n },\n ),\n )\n }\n\n return handlers\n}\n"],"mappings":";;;;;AAqBA,IAAa,IAAb,MAA6B;CAEhB;CAEA;CAHX,YACE,GAEA,GACA;EADS,AAFA,KAAA,SAAA,GAEA,KAAA,OAAA;CACR;AACL,GAUM,IAA6B,IAAI,EAGrC;CACA,SAAS;CACT,gBAAgB;AAClB,CAAC;AAeD,SAAgB,EAGd,GACA,GAGyB;CACzB,OAAO,GACJ,KAAe,MACd,EAAQ,CAAgE,EAC5E;AACF;AAwBA,SAAgB,EACd,GACA,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AAS,KAAK,UAAU;GACtC,cAAc;GACd,WAAW;EACb,GACA,EAEE,QAAQ,IACV,CACF;CACF,CACF,CACF;CA+BA,OA7BI,KAGF,EAAS,KACP,EAAK,IACH,GAAG,IAAgB,EAAsB,aAAa,gBAAgB,MACrE,EAAE,gBAAa;EACd,IAAM,IAAgB,EAAO,eACvB,IACJ,EAA2B,WAAW,CAAa;EACrD,IAAI,CAAC,KAAiB,CAAC,GACrB,OAAO,EAAa,KAClB,EAAE,SAAS,4CAA4C,GACvD,EAAE,QAAQ,IAAI,CAChB;EAGF,IAAM,EAAE,gBAAa;EAIrB,OAHI,aAAoB,IACf,EAAa,KAAK,EAAS,MAAM,EAAE,QAAQ,EAAS,OAAO,CAAC,IAE9D,EAAa,KAAK,GAAU,EACjC,QAAQ,EACV,CAAC;CACH,CACF,CACF,GAGK;AACT"}
@@ -0,0 +1,27 @@
1
+ import { CohortBuilderMockProfile } from '@/mocks/cohortBuilder/cohortBuilderMockProfiles';
2
+ import { CohortBuilderAccess, CohortBuilderMockQueryOptions } from '@/mocks/cohortBuilder/cohortBuilderMockQueryEngine';
3
+ import { CohortBuilderSyntheticData } from '@/mocks/cohortBuilder/cohortBuilderSyntheticData';
4
+ import { HttpHandler } from 'msw';
5
+ /** Synthetic files have no file handles; each is reported at this size in Download List statistics. */
6
+ export declare const MOCK_COHORT_FILE_SIZE_BYTES: number;
7
+ /** The file handle of every mock Files/Datasets CSV export. */
8
+ export declare const MOCK_COHORT_CSV_FILE_HANDLE_ID = "90000003";
9
+ /** Synthetic data for a profile, generated once per profile and reused across handlers. */
10
+ export declare function getCohortBuilderSyntheticData(profile: CohortBuilderMockProfile): CohortBuilderSyntheticData;
11
+ export type CohortBuilderHandlersOptions = CohortBuilderMockQueryOptions & {
12
+ profile?: CohortBuilderMockProfile;
13
+ access?: CohortBuilderAccess;
14
+ backendOrigin?: string;
15
+ };
16
+ /**
17
+ * MSW handlers that emulate the Cohort Builder 2.0 VirtualTables (participant
18
+ * and file/dataset perspectives) over synthetic data, including the
19
+ * AGGREGATE_DATA behavior an unapproved caller sees.
20
+ */
21
+ export declare function getCohortBuilderHandlers(options?: CohortBuilderHandlersOptions): HttpHandler[];
22
+ /**
23
+ * Storybook MSW handler groups that serve the Cohort Builder mocks on the mock stack. They replace the `entity` group so
24
+ * they run before the stock entity handlers, which answer 404 for unknown entity IDs.
25
+ */
26
+ export declare function getCohortBuilderStorybookHandlers(options?: Omit<CohortBuilderHandlersOptions, 'backendOrigin'>): Record<string, HttpHandler[]>;
27
+ //# sourceMappingURL=cohortBuilderHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cohortBuilderHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/cohortBuilderHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EAMzB,MAAM,iDAAiD,CAAA;AACxD,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAG9B,MAAM,oDAAoD,CAAA;AAC3D,OAAO,EACL,0BAA0B,EAE3B,MAAM,kDAAkD,CAAA;AAuBzD,OAAO,EAAQ,WAAW,EAAgB,MAAM,KAAK,CAAA;AAmBrD,uGAAuG;AACvG,eAAO,MAAM,2BAA2B,QAAmB,CAAA;AAC3D,+DAA+D;AAC/D,eAAO,MAAM,8BAA8B,aAAa,CAAA;AAOxD,2FAA2F;AAC3F,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,wBAAwB,GAChC,0BAA0B,CAO5B;AA6DD,MAAM,MAAM,4BAA4B,GAAG,6BAA6B,GAAG;IACzE,OAAO,CAAC,EAAE,wBAAwB,CAAA;IAClC,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,4BAAiC,GACzC,WAAW,EAAE,CAmOf;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,IAAI,CAAC,4BAA4B,EAAE,eAAe,CAAM,GAChE,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAU/B"}
@@ -0,0 +1,158 @@
1
+ import "../../../utils/SynapseConstants.js";
2
+ import { BackendDestinationEnum as e, MOCK_REPO_ORIGIN as t, getEndpoint as n } from "../../../utils/functions/getEndpoint.js";
3
+ import { ENTITY_HEADERS as r, ENTITY_ID as i, TABLE_QUERY_ASYNC_GET as a, TABLE_QUERY_ASYNC_START as o } from "../../../utils/APIConstants.js";
4
+ import { AsyncJobFailure as s, dispatchEntry as c, generateAsyncJobHandlers as l } from "./asyncJobHandlers.js";
5
+ import { getEntityHandlers as u } from "./entityHandlers.js";
6
+ import { DATA_REFERENCE_COLUMN_NAME as d, ELITE_MOCK_PROFILE as f, PARTICIPANT_ID_COLUMN_NAME as p, REFERENCE_TYPE_COLUMN_NAME as m, STUDY_COLUMN_NAME as h } from "../../cohortBuilder/cohortBuilderMockProfiles.js";
7
+ import { createCohortBuilderSyntheticData as g } from "../../cohortBuilder/cohortBuilderSyntheticData.js";
8
+ import { getCohortBuilderColumnModels as _, runCohortBuilderMockQuery as v } from "../../cohortBuilder/cohortBuilderMockQueryEngine.js";
9
+ import { ColumnSingleValueFilterOperator as y } from "@sage-bionetworks/synapse-types";
10
+ import { HttpResponse as b, http as x } from "msw";
11
+ //#region src/mocks/msw/handlers/cohortBuilderHandlers.ts
12
+ var S = "syn_MATERIAL", C = "/repo/v1/download/list/add/async/start", w = (e) => `/repo/v1/download/list/add/async/get/${e}`, T = "/repo/v1/download/list/add/stats/async/start", E = (e) => `/repo/v1/download/list/add/stats/async/get/${e}`, D = "/repo/v1/download/list/add", O = 10 * 1024 * 1024, k = "90000003", A = /* @__PURE__ */ new Map();
13
+ function j(e) {
14
+ let t = A.get(e);
15
+ return t || (t = g(e), A.set(e, t)), t;
16
+ }
17
+ function M(e) {
18
+ let { profile: t, dataAttributeNames: n } = e, r = _(e), i = [
19
+ p,
20
+ h,
21
+ ...t.participantAttributes.map((e) => e.name)
22
+ ].join(", "), a = n.map((e) => `CAST(CONCAT('[', GROUP_CONCAT(DISTINCT CONCAT('"', ${e}, '"')), ']') AS <STRING_LIST column>) AS ${e}`).join(", "), o = [
23
+ m,
24
+ h,
25
+ ...n
26
+ ].join(", "), s = (e, t, n, r) => ({
27
+ id: e,
28
+ name: t,
29
+ concreteType: "org.sagebionetworks.repo.model.table.VirtualTable",
30
+ parentId: "syn90000000",
31
+ etag: "00000000-0000-0000-0000-000000000000",
32
+ createdOn: "2026-10-01T00:00:00.000Z",
33
+ modifiedOn: "2026-10-01T00:00:00.000Z",
34
+ createdBy: "0",
35
+ modifiedBy: "0",
36
+ versionNumber: 1,
37
+ versionLabel: "in progress",
38
+ isLatestVersion: !0,
39
+ isSearchEnabled: !1,
40
+ definingSQL: n,
41
+ columnIds: r
42
+ });
43
+ return [s(t.participantsVirtualTableId, `${t.portalName} Cohort Builder Participants (synthetic)`, `SELECT ${i}, ${a} FROM ${S} GROUP BY ${i}`, r.participants.map((e) => e.id)), s(t.dataVirtualTableId, `${t.portalName} Cohort Builder Files and Datasets (synthetic)`, `SELECT ${d} AS id, name, ${o} FROM ${S} GROUP BY ${d}, name, ${o}`, r.dataReferences.map((e) => e.id))];
44
+ }
45
+ function N(t = {}) {
46
+ let { profile: u = f, access: d = "AGGREGATE_ONLY", maxCohortValues: p, backendOrigin: h = n(e.REPO_ENDPOINT) } = t, g = j(u), _ = M(g).map((e) => x.get(`${h}${i(e.id)}`, () => b.json(e))), S = x.post(`${h}${r}`, async ({ request: e }) => {
47
+ let { references: t } = await e.clone().json(), n = t.flatMap((e) => {
48
+ let t = g.references.get(e.targetId);
49
+ return t ? [{
50
+ id: t.id,
51
+ name: t.name,
52
+ type: t.referenceType === "FILE" ? "org.sagebionetworks.repo.model.FileEntity" : "org.sagebionetworks.repo.model.table.Dataset",
53
+ versionNumber: 1,
54
+ isLatestVersion: !0,
55
+ benefactorId: 9e7,
56
+ createdOn: "2026-10-01T00:00:00.000Z",
57
+ modifiedOn: "2026-10-01T00:00:00.000Z",
58
+ createdBy: "0",
59
+ modifiedBy: "0"
60
+ }] : [];
61
+ });
62
+ return n.length > 0 ? b.json({ results: n }) : void 0;
63
+ }), A = [u.participantsVirtualTableId, u.dataVirtualTableId].flatMap((e) => l(c("org.sagebionetworks.repo.model.table.QueryBundleRequest", (e) => {
64
+ let t = v(g, e, d, { maxCohortValues: p });
65
+ return t.status === 200 ? t.body : new s(t.status, t.body);
66
+ }), {
67
+ asyncTypeServicePaths: {
68
+ requestPath: o(e),
69
+ responsePath: (t) => a(e, t)
70
+ },
71
+ backendOrigin: h
72
+ }));
73
+ function N(e, t) {
74
+ let n = e, r = {
75
+ concreteType: "org.sagebionetworks.repo.model.table.ColumnSingleValueQueryFilter",
76
+ columnName: m,
77
+ operator: y.EQUAL,
78
+ values: ["FILE"]
79
+ }, i = v(g, {
80
+ concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest",
81
+ entityId: u.dataVirtualTableId,
82
+ partMask: 2,
83
+ query: t ? {
84
+ ...n,
85
+ additionalFilters: [...n.additionalFilters ?? [], r]
86
+ } : n
87
+ }, d, { maxCohortValues: p });
88
+ return "queryCount" in i.body ? i.body.queryCount ?? 0 : new s(i.status, i.body);
89
+ }
90
+ let P = [
91
+ ...l(c("org.sagebionetworks.repo.model.download.AddToDownloadListStatsRequest", (e) => {
92
+ let t = N(e.request?.query, !1), n = N(e.request?.query, !0);
93
+ return t instanceof s ? t : n instanceof s ? n : {
94
+ concreteType: "org.sagebionetworks.repo.model.download.AddToDownloadListStatsResponse",
95
+ fileCount: t,
96
+ fileSize: n * O,
97
+ isFileCountAndSizeEstimate: !1
98
+ };
99
+ }), {
100
+ asyncTypeServicePaths: {
101
+ requestPath: T,
102
+ responsePath: E
103
+ },
104
+ backendOrigin: h
105
+ }),
106
+ ...l(c("org.sagebionetworks.repo.model.download.AddToDownloadListRequest", (e) => {
107
+ if (e.useVersionNumber !== !1 && e.query?.selectFileVersionColumn === void 0) return new s(400, {
108
+ concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
109
+ reason: `'${u.dataVirtualTableId}' is not a file view or a dataset, the query.selectFileVersionColumn must be specified`
110
+ });
111
+ let t = N(e.query, !0);
112
+ return t instanceof s ? t : {
113
+ concreteType: "org.sagebionetworks.repo.model.download.AddToDownloadListResponse",
114
+ numberOfFilesAdded: t
115
+ };
116
+ }), {
117
+ asyncTypeServicePaths: {
118
+ requestPath: C,
119
+ responsePath: w
120
+ },
121
+ backendOrigin: h
122
+ }),
123
+ x.post(`${h}${D}`, async ({ request: e }) => {
124
+ let { batchToAdd: t } = await e.json(), n = t.filter((e) => g.references.get(e.fileEntityId)?.referenceType === "FILE").length;
125
+ return b.json({ numberOfFilesAdded: n });
126
+ })
127
+ ], F = l(c("org.sagebionetworks.repo.model.table.DownloadFromTableRequest", (e) => {
128
+ let t = N(e, !1);
129
+ return t instanceof s ? t : {
130
+ concreteType: "org.sagebionetworks.repo.model.table.DownloadFromTableResult",
131
+ resultsFileHandleId: k,
132
+ tableId: u.dataVirtualTableId
133
+ };
134
+ }), {
135
+ asyncTypeServicePaths: {
136
+ requestPath: `/repo/v1/entity/${u.dataVirtualTableId}/table/download/csv/async/start`,
137
+ responsePath: (e) => `/repo/v1/entity/${u.dataVirtualTableId}/table/download/csv/async/get/${e}`
138
+ },
139
+ backendOrigin: h
140
+ });
141
+ return [
142
+ ..._,
143
+ S,
144
+ ...A,
145
+ ...P,
146
+ ...F
147
+ ];
148
+ }
149
+ function P(e = {}) {
150
+ return { entity: [...N({
151
+ ...e,
152
+ backendOrigin: t
153
+ }), ...u(t)] };
154
+ }
155
+ //#endregion
156
+ export { k as MOCK_COHORT_CSV_FILE_HANDLE_ID, O as MOCK_COHORT_FILE_SIZE_BYTES, N as getCohortBuilderHandlers, P as getCohortBuilderStorybookHandlers, j as getCohortBuilderSyntheticData };
157
+
158
+ //# sourceMappingURL=cohortBuilderHandlers.js.map