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
@@ -1 +1 @@
1
- {"version":3,"file":"collectTopLevelProperties.d.ts","sourceRoot":"","sources":["../../../src/utils/jsonschema/collectTopLevelProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAKhE,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;AAmF/D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,WAAW,GAAG,SAAS,GAC5B,kBAAkB,CAOpB"}
1
+ {"version":3,"file":"collectTopLevelProperties.d.ts","sourceRoot":"","sources":["../../../src/utils/jsonschema/collectTopLevelProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAIhE,KAAK,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAA;AAC1D,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;AAY/D;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,WAAW,GAAG,SAAS,GACnC,WAAW,GAAG,SAAS,CAIzB;AAgED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,WAAW,GAAG,SAAS,GAC5B,kBAAkB,CAOpB"}
@@ -26,6 +26,6 @@ function a(e) {
26
26
  return e && i(e, e.definitions, /* @__PURE__ */ new Set(), t), t;
27
27
  }
28
28
  //#endregion
29
- export { a as collectTopLevelProperties };
29
+ export { a as collectTopLevelProperties, n as resolveRef };
30
30
 
31
31
  //# sourceMappingURL=collectTopLevelProperties.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collectTopLevelProperties.js","names":[],"sources":["../../../src/utils/jsonschema/collectTopLevelProperties.ts"],"sourcesContent":["import { JSONSchema7, JSONSchema7Definition } from 'json-schema'\n\nconst DEFINITIONS_PREFIX = '#/definitions/'\n\ntype Definitions = NonNullable<JSONSchema7['definitions']>\ntype TopLevelProperties = Record<string, JSONSchema7Definition>\n\n/**\n * Given a full `#/definitions/X` reference, return the relative key (`X`) used in the definitions\n * map. A reference that is already a bare key is returned as-is.\n */\nfunction getRelativeRef(ref: string): string {\n return ref.startsWith(DEFINITIONS_PREFIX)\n ? ref.substring(DEFINITIONS_PREFIX.length)\n : ref\n}\n\nfunction resolveRef(\n ref: string,\n definitions: Definitions | undefined,\n): JSONSchema7 | undefined {\n const resolved = definitions?.[getRelativeRef(ref)]\n // A boolean schema (`true`/`false`) carries no properties to collect\n return typeof resolved === 'object' ? resolved : undefined\n}\n\n/**\n * Resolve a property value: if it is a `$ref` it is replaced with the referenced schema. A dangling\n * or unresolvable `$ref` returns the raw node so the property name is preserved with an unknown type.\n */\nfunction resolveProperty(\n property: JSONSchema7Definition,\n definitions: Definitions | undefined,\n): JSONSchema7Definition {\n if (typeof property !== 'object' || !property.$ref) {\n return property\n }\n return resolveRef(property.$ref, definitions) ?? property\n}\n\nfunction collect(\n node: JSONSchema7Definition | undefined,\n definitions: Definitions | undefined,\n visitedRefs: Set<string>,\n result: TopLevelProperties,\n): void {\n if (typeof node !== 'object') {\n return\n }\n\n // Follow a combination $ref to the schema it references. Nothing else on a $ref node contributes.\n if (node.$ref) {\n if (visitedRefs.has(node.$ref)) {\n return\n }\n visitedRefs.add(node.$ref)\n collect(\n resolveRef(node.$ref, definitions),\n definitions,\n visitedRefs,\n result,\n )\n return\n }\n\n if (node.properties) {\n for (const [name, propertySchema] of Object.entries(node.properties)) {\n if (!(name in result)) {\n result[name] = resolveProperty(propertySchema, definitions)\n }\n }\n }\n\n // Recurse through combination keywords in a fixed, deterministic order.\n node.allOf?.forEach(member =>\n collect(member, definitions, visitedRefs, result),\n )\n node.anyOf?.forEach(member =>\n collect(member, definitions, visitedRefs, result),\n )\n node.oneOf?.forEach(member =>\n collect(member, definitions, visitedRefs, result),\n )\n collect(node.if, definitions, visitedRefs, result)\n collect(node.then, definitions, visitedRefs, result)\n collect(node.else, definitions, visitedRefs, result)\n}\n\n/**\n * Collects the names that could appear as a top-level property of an instance validated by the given\n * JSON Schema, keyed by property name. Each value is the `$ref`-resolved schema for that property.\n *\n * The walk follows schema combination keywords (`$ref`, `allOf`, `anyOf`, `oneOf`, `if`, `then`,\n * `else`) so that properties declared in referenced or composed sub-schemas are included. It does\n * NOT descend into a property's own value, `items`, `contains`, `additionalProperties`, or `not`, so\n * the nested properties of an object or the elements of an array are never surfaced as top-level\n * properties.\n *\n * Insertion order is the order in which properties were first encountered, and the first occurrence\n * of a name wins -- so a schema's own properties take precedence over composed/inherited ones.\n *\n * This mirrors the backend's `JsonSchemaProperties.collectTopLevelProperties`, which is what defines\n * a RecordSet's schema columns. Only draft-07 `definitions` references are resolved (not `$defs`),\n * matching that implementation.\n */\nexport function collectTopLevelProperties(\n root: JSONSchema7 | undefined,\n): TopLevelProperties {\n const result: TopLevelProperties = {}\n if (!root) {\n return result\n }\n collect(root, root.definitions, new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{"version":3,"file":"collectTopLevelProperties.js","names":[],"sources":["../../../src/utils/jsonschema/collectTopLevelProperties.ts"],"sourcesContent":["import { JSONSchema7, JSONSchema7Definition } from 'json-schema'\n\nconst DEFINITIONS_PREFIX = '#/definitions/'\n\ntype Definitions = NonNullable<JSONSchema7['definitions']>\ntype TopLevelProperties = Record<string, JSONSchema7Definition>\n\n/**\n * Given a full `#/definitions/X` reference, return the relative key (`X`) used in the definitions\n * map. A reference that is already a bare key is returned as-is.\n */\nfunction getRelativeRef(ref: string): string {\n return ref.startsWith(DEFINITIONS_PREFIX)\n ? ref.substring(DEFINITIONS_PREFIX.length)\n : ref\n}\n\n/**\n * Resolve a local `#/definitions/X` reference (or bare `X` key) against the root schema's `definitions`.\n * Returns undefined for a dangling reference or a boolean schema.\n */\nexport function resolveRef(\n ref: string,\n definitions: Definitions | undefined,\n): JSONSchema7 | undefined {\n const resolved = definitions?.[getRelativeRef(ref)]\n // A boolean schema (`true`/`false`) carries no properties to collect\n return typeof resolved === 'object' ? resolved : undefined\n}\n\n/**\n * Resolve a property value: if it is a `$ref` it is replaced with the referenced schema. A dangling\n * or unresolvable `$ref` returns the raw node so the property name is preserved with an unknown type.\n */\nfunction resolveProperty(\n property: JSONSchema7Definition,\n definitions: Definitions | undefined,\n): JSONSchema7Definition {\n if (typeof property !== 'object' || !property.$ref) {\n return property\n }\n return resolveRef(property.$ref, definitions) ?? property\n}\n\nfunction collect(\n node: JSONSchema7Definition | undefined,\n definitions: Definitions | undefined,\n visitedRefs: Set<string>,\n result: TopLevelProperties,\n): void {\n if (typeof node !== 'object') {\n return\n }\n\n // Follow a combination $ref to the schema it references. Nothing else on a $ref node contributes.\n if (node.$ref) {\n if (visitedRefs.has(node.$ref)) {\n return\n }\n visitedRefs.add(node.$ref)\n collect(\n resolveRef(node.$ref, definitions),\n definitions,\n visitedRefs,\n result,\n )\n return\n }\n\n if (node.properties) {\n for (const [name, propertySchema] of Object.entries(node.properties)) {\n if (!(name in result)) {\n result[name] = resolveProperty(propertySchema, definitions)\n }\n }\n }\n\n // Recurse through combination keywords in a fixed, deterministic order.\n node.allOf?.forEach(member =>\n collect(member, definitions, visitedRefs, result),\n )\n node.anyOf?.forEach(member =>\n collect(member, definitions, visitedRefs, result),\n )\n node.oneOf?.forEach(member =>\n collect(member, definitions, visitedRefs, result),\n )\n collect(node.if, definitions, visitedRefs, result)\n collect(node.then, definitions, visitedRefs, result)\n collect(node.else, definitions, visitedRefs, result)\n}\n\n/**\n * Collects the names that could appear as a top-level property of an instance validated by the given\n * JSON Schema, keyed by property name. Each value is the `$ref`-resolved schema for that property.\n *\n * The walk follows schema combination keywords (`$ref`, `allOf`, `anyOf`, `oneOf`, `if`, `then`,\n * `else`) so that properties declared in referenced or composed sub-schemas are included. It does\n * NOT descend into a property's own value, `items`, `contains`, `additionalProperties`, or `not`, so\n * the nested properties of an object or the elements of an array are never surfaced as top-level\n * properties.\n *\n * Insertion order is the order in which properties were first encountered, and the first occurrence\n * of a name wins -- so a schema's own properties take precedence over composed/inherited ones.\n *\n * This mirrors the backend's `JsonSchemaProperties.collectTopLevelProperties`, which is what defines\n * a RecordSet's schema columns. Only draft-07 `definitions` references are resolved (not `$defs`),\n * matching that implementation.\n */\nexport function collectTopLevelProperties(\n root: JSONSchema7 | undefined,\n): TopLevelProperties {\n const result: TopLevelProperties = {}\n if (!root) {\n return result\n }\n collect(root, root.definitions, new Set<string>(), result)\n return result\n}\n"],"mappings":";AAEA,IAAM,IAAqB;AAS3B,SAAS,EAAe,GAAqB;CAC3C,OAAO,EAAI,WAAW,CAAkB,IACpC,EAAI,UAAU,EAAyB,IACvC;AACN;AAMA,SAAgB,EACd,GACA,GACyB;CACzB,IAAM,IAAW,IAAc,EAAe,CAAG;CAEjD,OAAO,OAAO,KAAa,WAAW,IAAW,KAAA;AACnD;AAMA,SAAS,EACP,GACA,GACuB;CAIvB,OAHI,OAAO,KAAa,YAAY,CAAC,EAAS,OACrC,IAEF,EAAW,EAAS,MAAM,CAAW,KAAK;AACnD;AAEA,SAAS,EACP,GACA,GACA,GACA,GACM;CACF,WAAO,KAAS,UAKpB;MAAI,EAAK,MAAM;GACb,IAAI,EAAY,IAAI,EAAK,IAAI,GAC3B;GAGF,AADA,EAAY,IAAI,EAAK,IAAI,GACzB,EACE,EAAW,EAAK,MAAM,CAAW,GACjC,GACA,GACA,CACF;GACA;EACF;EAEA,IAAI,EAAK,iBACF,IAAM,CAAC,GAAM,MAAmB,OAAO,QAAQ,EAAK,UAAU,GACjE,AAAM,KAAQ,MACZ,EAAO,KAAQ,EAAgB,GAAgB,CAAW;EAiBhE,AAXA,EAAK,OAAO,SAAQ,MAClB,EAAQ,GAAQ,GAAa,GAAa,CAAM,CAClD,GACA,EAAK,OAAO,SAAQ,MAClB,EAAQ,GAAQ,GAAa,GAAa,CAAM,CAClD,GACA,EAAK,OAAO,SAAQ,MAClB,EAAQ,GAAQ,GAAa,GAAa,CAAM,CAClD,GACA,EAAQ,EAAK,IAAI,GAAa,GAAa,CAAM,GACjD,EAAQ,EAAK,MAAM,GAAa,GAAa,CAAM,GACnD,EAAQ,EAAK,MAAM,GAAa,GAAa,CAAM;CAtBnD;AAuBF;AAmBA,SAAgB,EACd,GACoB;CACpB,IAAM,IAA6B,CAAC;CAKpC,OAJK,KAGL,EAAQ,GAAM,EAAK,6BAAa,IAAI,IAAY,GAAG,CAAM,GAFhD;AAIX"}
@@ -0,0 +1,22 @@
1
+ import { JSONSchema7, JSONSchema7Definition } from 'json-schema';
2
+ export type NumberOrEnumInfo = {
3
+ numericType: 'number' | 'integer';
4
+ enumValues: string[];
5
+ };
6
+ type Definitions = JSONSchema7['definitions'];
7
+ /**
8
+ * Detects a property whose values are either a number or one of a closed set of
9
+ * strings, such as a masked age (`43` or ">= 90") or a measurement that may be
10
+ * "N/A". The property must be an `anyOf` (or `oneOf`) with exactly one `number`
11
+ * or `integer` branch and one or more branches that each allow only strings,
12
+ * through an `enum` or a `const`. Branches may appear in any order, may be local
13
+ * `#/definitions/` references, and may be accompanied by `null` branches.
14
+ *
15
+ * @param propertySchema the schema of a single property
16
+ * @param definitions the root schema's `definitions`, used to resolve `$ref` branches
17
+ * @returns the numeric branch's type and the allowed strings, or null if the
18
+ * property is not such a union
19
+ */
20
+ export declare function getNumberOrEnumInfo(propertySchema: JSONSchema7Definition | undefined, definitions?: Definitions): NumberOrEnumInfo | null;
21
+ export {};
22
+ //# sourceMappingURL=getNumberOrEnumInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNumberOrEnumInfo.d.ts","sourceRoot":"","sources":["../../../src/utils/jsonschema/getNumberOrEnumInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAIhE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,QAAQ,GAAG,SAAS,CAAA;IACjC,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAED,KAAK,WAAW,GAAG,WAAW,CAAC,aAAa,CAAC,CAAA;AA+B7C;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,qBAAqB,GAAG,SAAS,EACjD,WAAW,CAAC,EAAE,WAAW,GACxB,gBAAgB,GAAG,IAAI,CAoCzB"}
@@ -0,0 +1,39 @@
1
+ import { resolveRef as e } from "./collectTopLevelProperties.js";
2
+ import { isSchemaDescribingNullType as t } from "./getOnlyNonNullOneOfOption.js";
3
+ //#region src/utils/jsonschema/getNumberOrEnumInfo.ts
4
+ function n(t, n) {
5
+ if (typeof t == "object") return t.$ref ? e(t.$ref, n) : t;
6
+ }
7
+ function r(e) {
8
+ return e.type === "number" || e.type === "integer" ? e.type : void 0;
9
+ }
10
+ function i(e) {
11
+ if (e.type !== void 0 && e.type !== "string") return;
12
+ let t = e.enum ?? (e.const === void 0 ? [] : [e.const]);
13
+ return t.length > 0 && t.every((e) => typeof e == "string") ? t : void 0;
14
+ }
15
+ function a(e, a) {
16
+ if (typeof e != "object") return null;
17
+ let o = e.anyOf ?? e.oneOf;
18
+ if (!o) return null;
19
+ let s, c = /* @__PURE__ */ new Set(), l = o.map((e) => n(e, a)).filter((e) => !t(e));
20
+ for (let e of l) {
21
+ if (!e) return null;
22
+ let t = r(e);
23
+ if (t && !s) {
24
+ s = t;
25
+ continue;
26
+ }
27
+ let n = i(e);
28
+ if (!n) return null;
29
+ n.forEach((e) => c.add(e));
30
+ }
31
+ return s && c.size > 0 ? {
32
+ numericType: s,
33
+ enumValues: [...c]
34
+ } : null;
35
+ }
36
+ //#endregion
37
+ export { a as getNumberOrEnumInfo };
38
+
39
+ //# sourceMappingURL=getNumberOrEnumInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNumberOrEnumInfo.js","names":[],"sources":["../../../src/utils/jsonschema/getNumberOrEnumInfo.ts"],"sourcesContent":["import { JSONSchema7, JSONSchema7Definition } from 'json-schema'\nimport { resolveRef } from './collectTopLevelProperties'\nimport { isSchemaDescribingNullType } from './getOnlyNonNullOneOfOption'\n\nexport type NumberOrEnumInfo = {\n numericType: 'number' | 'integer'\n enumValues: string[]\n}\n\ntype Definitions = JSONSchema7['definitions']\n\nfunction resolveBranch(\n branch: JSONSchema7Definition,\n definitions: Definitions,\n): JSONSchema7 | undefined {\n if (typeof branch !== 'object') {\n return undefined\n }\n return branch.$ref ? resolveRef(branch.$ref, definitions) : branch\n}\n\nfunction getNumericType(\n branch: JSONSchema7,\n): NumberOrEnumInfo['numericType'] | undefined {\n return branch.type === 'number' || branch.type === 'integer'\n ? branch.type\n : undefined\n}\n\nfunction getStringEnumValues(branch: JSONSchema7): string[] | undefined {\n if (branch.type !== undefined && branch.type !== 'string') {\n return undefined\n }\n const values =\n branch.enum ?? (branch.const !== undefined ? [branch.const] : [])\n return values.length > 0 && values.every(value => typeof value === 'string')\n ? values\n : undefined\n}\n\n/**\n * Detects a property whose values are either a number or one of a closed set of\n * strings, such as a masked age (`43` or \">= 90\") or a measurement that may be\n * \"N/A\". The property must be an `anyOf` (or `oneOf`) with exactly one `number`\n * or `integer` branch and one or more branches that each allow only strings,\n * through an `enum` or a `const`. Branches may appear in any order, may be local\n * `#/definitions/` references, and may be accompanied by `null` branches.\n *\n * @param propertySchema the schema of a single property\n * @param definitions the root schema's `definitions`, used to resolve `$ref` branches\n * @returns the numeric branch's type and the allowed strings, or null if the\n * property is not such a union\n */\nexport function getNumberOrEnumInfo(\n propertySchema: JSONSchema7Definition | undefined,\n definitions?: Definitions,\n): NumberOrEnumInfo | null {\n if (typeof propertySchema !== 'object') {\n return null\n }\n const branches = propertySchema.anyOf ?? propertySchema.oneOf\n if (!branches) {\n return null\n }\n\n let numericType: NumberOrEnumInfo['numericType'] | undefined\n const enumValues = new Set<string>()\n const nonNullBranches = branches\n .map(branch => resolveBranch(branch, definitions))\n .filter(branch => !isSchemaDescribingNullType(branch))\n\n for (const branch of nonNullBranches) {\n if (!branch) {\n return null\n }\n const branchNumericType = getNumericType(branch)\n if (branchNumericType && !numericType) {\n numericType = branchNumericType\n continue\n }\n // Any branch that is neither the numeric branch nor a closed set of strings\n // (including a second numeric branch) makes the union something else\n const branchValues = getStringEnumValues(branch)\n if (!branchValues) {\n return null\n }\n branchValues.forEach(value => enumValues.add(value))\n }\n\n return numericType && enumValues.size > 0\n ? { numericType, enumValues: [...enumValues] }\n : null\n}\n"],"mappings":";;;AAWA,SAAS,EACP,GACA,GACyB;CACrB,WAAO,KAAW,UAGtB,OAAO,EAAO,OAAO,EAAW,EAAO,MAAM,CAAW,IAAI;AAC9D;AAEA,SAAS,EACP,GAC6C;CAC7C,OAAO,EAAO,SAAS,YAAY,EAAO,SAAS,YAC/C,EAAO,OACP,KAAA;AACN;AAEA,SAAS,EAAoB,GAA2C;CACtE,IAAI,EAAO,SAAS,KAAA,KAAa,EAAO,SAAS,UAC/C;CAEF,IAAM,IACJ,EAAO,SAAS,EAAO,UAAU,KAAA,IAA6B,CAAC,IAAlB,CAAC,EAAO,KAAK;CAC5D,OAAO,EAAO,SAAS,KAAK,EAAO,OAAM,MAAS,OAAO,KAAU,QAAQ,IACvE,IACA,KAAA;AACN;AAeA,SAAgB,EACd,GACA,GACyB;CACzB,IAAI,OAAO,KAAmB,UAC5B,OAAO;CAET,IAAM,IAAW,EAAe,SAAS,EAAe;CACxD,IAAI,CAAC,GACH,OAAO;CAGT,IAAI,GACE,oBAAa,IAAI,IAAY,GAC7B,IAAkB,EACrB,KAAI,MAAU,EAAc,GAAQ,CAAW,CAAC,EAChD,QAAO,MAAU,CAAC,EAA2B,CAAM,CAAC;CAEvD,KAAK,IAAM,KAAU,GAAiB;EACpC,IAAI,CAAC,GACH,OAAO;EAET,IAAM,IAAoB,EAAe,CAAM;EAC/C,IAAI,KAAqB,CAAC,GAAa;GACrC,IAAc;GACd;EACF;EAGA,IAAM,IAAe,EAAoB,CAAM;EAC/C,IAAI,CAAC,GACH,OAAO;EAET,EAAa,SAAQ,MAAS,EAAW,IAAI,CAAK,CAAC;CACrD;CAEA,OAAO,KAAe,EAAW,OAAO,IACpC;EAAE;EAAa,YAAY,CAAC,GAAG,CAAU;CAAE,IAC3C;AACN"}
@@ -1,2 +1,3 @@
1
+ export declare function isSchemaDescribingNullType(s: any): boolean;
1
2
  export declare function getOnlyNonNullOneOfOption(jsonSchema: Record<string, unknown>): Record<string, unknown> | undefined;
2
3
  //# sourceMappingURL=getOnlyNonNullOneOfOption.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getOnlyNonNullOneOfOption.d.ts","sourceRoot":"","sources":["../../../src/utils/jsonschema/getOnlyNonNullOneOfOption.ts"],"names":[],"mappings":"AAYA,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAgBrC"}
1
+ {"version":3,"file":"getOnlyNonNullOneOfOption.d.ts","sourceRoot":"","sources":["../../../src/utils/jsonschema/getOnlyNonNullOneOfOption.ts"],"names":[],"mappings":"AAIA,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,GAAG,WAMhD;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAgBrC"}
@@ -12,6 +12,6 @@ function i(e) {
12
12
  }
13
13
  }
14
14
  //#endregion
15
- export { i as getOnlyNonNullOneOfOption };
15
+ export { i as getOnlyNonNullOneOfOption, r as isSchemaDescribingNullType };
16
16
 
17
17
  //# sourceMappingURL=getOnlyNonNullOneOfOption.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getOnlyNonNullOneOfOption.js","names":[],"sources":["../../../src/utils/jsonschema/getOnlyNonNullOneOfOption.ts"],"sourcesContent":["import isArray from 'lodash-es/isArray'\nimport isEqual from 'lodash-es/isEqual'\nimport isObject from 'lodash-es/isObject'\n\nfunction isSchemaDescribingNullType(s: any) {\n return (\n isObject(s) &&\n 'type' in s &&\n (s.type == 'null' || isEqual(s.type, ['null']))\n )\n}\n\nexport function getOnlyNonNullOneOfOption(\n jsonSchema: Record<string, unknown>,\n): Record<string, unknown> | undefined {\n if (jsonSchema?.oneOf && isArray(jsonSchema.oneOf)) {\n // PORTALS-3723\n // Also handle our special 'oneOf' enum case just like in `getEnumeratedValues`\n const oneOfSchemasOmitNulltype = jsonSchema.oneOf.filter(\n s => !isSchemaDescribingNullType(s),\n )\n if (\n oneOfSchemasOmitNulltype.length == 1 &&\n isObject(oneOfSchemasOmitNulltype[0])\n ) {\n return oneOfSchemasOmitNulltype[0] as Record<string, unknown>\n }\n }\n\n return undefined\n}\n"],"mappings":";;;;AAIA,SAAS,EAA2B,GAAQ;CAC1C,OACE,EAAS,CAAC,KACV,UAAU,MACT,EAAE,QAAQ,UAAU,EAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;AAEjD;AAEA,SAAgB,EACd,GACqC;CACrC,IAAI,GAAY,SAAS,EAAQ,EAAW,KAAK,GAAG;EAGlD,IAAM,IAA2B,EAAW,MAAM,QAChD,MAAK,CAAC,EAA2B,CAAC,CACpC;EACA,IACE,EAAyB,UAAU,KACnC,EAAS,EAAyB,EAAE,GAEpC,OAAO,EAAyB;CAEpC;AAGF"}
1
+ {"version":3,"file":"getOnlyNonNullOneOfOption.js","names":[],"sources":["../../../src/utils/jsonschema/getOnlyNonNullOneOfOption.ts"],"sourcesContent":["import isArray from 'lodash-es/isArray'\nimport isEqual from 'lodash-es/isEqual'\nimport isObject from 'lodash-es/isObject'\n\nexport function isSchemaDescribingNullType(s: any) {\n return (\n isObject(s) &&\n 'type' in s &&\n (s.type == 'null' || isEqual(s.type, ['null']))\n )\n}\n\nexport function getOnlyNonNullOneOfOption(\n jsonSchema: Record<string, unknown>,\n): Record<string, unknown> | undefined {\n if (jsonSchema?.oneOf && isArray(jsonSchema.oneOf)) {\n // PORTALS-3723\n // Also handle our special 'oneOf' enum case just like in `getEnumeratedValues`\n const oneOfSchemasOmitNulltype = jsonSchema.oneOf.filter(\n s => !isSchemaDescribingNullType(s),\n )\n if (\n oneOfSchemasOmitNulltype.length == 1 &&\n isObject(oneOfSchemasOmitNulltype[0])\n ) {\n return oneOfSchemasOmitNulltype[0] as Record<string, unknown>\n }\n }\n\n return undefined\n}\n"],"mappings":";;;;AAIA,SAAgB,EAA2B,GAAQ;CACjD,OACE,EAAS,CAAC,KACV,UAAU,MACT,EAAE,QAAQ,UAAU,EAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;AAEjD;AAEA,SAAgB,EACd,GACqC;CACrC,IAAI,GAAY,SAAS,EAAQ,EAAW,KAAK,GAAG;EAGlD,IAAM,IAA2B,EAAW,MAAM,QAChD,MAAK,CAAC,EAA2B,CAAC,CACpC;EACA,IACE,EAAyB,UAAU,KACnC,EAAS,EAAyB,EAAE,GAEpC,OAAO,EAAyB;CAEpC;AAGF"}
@@ -6,6 +6,11 @@ export interface SchemaPropertyInfo {
6
6
  isRequired: boolean;
7
7
  enumeratedValues: EnumeratedValue[] | null;
8
8
  description?: string;
9
+ /**
10
+ * True when the property is either a number of the given `type` or one of the
11
+ * strings in `enumeratedValues`; see {@link getNumberOrEnumInfo}
12
+ */
13
+ isNumberOrEnum?: boolean;
9
14
  }
10
15
  export interface SchemaPropertiesMap {
11
16
  [propertyName: string]: SchemaPropertyInfo;
@@ -1 +1 @@
1
- {"version":3,"file":"getSchemaPropertyInfo.d.ts","sourceRoot":"","sources":["../../../src/utils/jsonschema/getSchemaPropertyInfo.ts"],"names":[],"mappings":"AAAA,OAA4B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAG5E,OAAO,EAAE,YAAY,EAAmB,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,YAAY,GAAG,SAAS,CAAA;IAC9B,UAAU,EAAE,OAAO,CAAA;IACnB,gBAAgB,EAAE,eAAe,EAAE,GAAG,IAAI,CAAA;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,CAAC,YAAY,EAAE,MAAM,GAAG,kBAAkB,CAAA;CAC3C;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,WAAW,GAAG,IAAI,GACzB,mBAAmB,CAqCrB"}
1
+ {"version":3,"file":"getSchemaPropertyInfo.d.ts","sourceRoot":"","sources":["../../../src/utils/jsonschema/getSchemaPropertyInfo.ts"],"names":[],"mappings":"AAAA,OAA4B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAI5E,OAAO,EAAE,YAAY,EAAmB,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,YAAY,GAAG,SAAS,CAAA;IAC9B,UAAU,EAAE,OAAO,CAAA;IACnB,gBAAgB,EAAE,eAAe,EAAE,GAAG,IAAI,CAAA;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,CAAC,YAAY,EAAE,MAAM,GAAG,kBAAkB,CAAA;CAC3C;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,WAAW,GAAG,IAAI,GACzB,mBAAmB,CA0DrB"}
@@ -1,22 +1,37 @@
1
1
  import e from "./getEnumeratedValues.js";
2
- import t from "./getRequiredAttributes.js";
3
- import n from "./getSchemaForProperty.js";
4
- import { getFlatTypeInfo as r } from "./getType.js";
2
+ import { getNumberOrEnumInfo as t } from "./getNumberOrEnumInfo.js";
3
+ import n from "./getRequiredAttributes.js";
4
+ import r from "./getSchemaForProperty.js";
5
+ import { getFlatTypeInfo as i } from "./getType.js";
5
6
  //#region src/utils/jsonschema/getSchemaPropertyInfo.ts
6
- function i(i) {
7
- if (!i) return {};
8
- let a = t(i), o = {};
9
- return i.properties && Object.keys(i.properties).forEach((t) => {
10
- let s = n(i, t), c = r(s), l = e(s).map((e) => e.value);
11
- l.length === 0 && s?.items && (l = e(Array.isArray(s.items) ? s.items[0] : s.items).map((e) => e.value)), o[t] = {
12
- type: c,
13
- isRequired: a.includes(t),
14
- enumeratedValues: l.length > 0 ? l : null,
15
- description: s?.description
7
+ function a(a) {
8
+ if (!a) return {};
9
+ let o = n(a), s = {};
10
+ return a.properties && Object.keys(a.properties).forEach((n) => {
11
+ let c = r(a, n), l = t(c, a.definitions);
12
+ if (l) {
13
+ s[n] = {
14
+ type: {
15
+ ...i(c),
16
+ type: l.numericType
17
+ },
18
+ isRequired: o.includes(n),
19
+ enumeratedValues: l.enumValues,
20
+ description: c?.description,
21
+ isNumberOrEnum: !0
22
+ };
23
+ return;
24
+ }
25
+ let u = i(c), d = e(c).map((e) => e.value);
26
+ d.length === 0 && c?.items && (d = e(Array.isArray(c.items) ? c.items[0] : c.items).map((e) => e.value)), s[n] = {
27
+ type: u,
28
+ isRequired: o.includes(n),
29
+ enumeratedValues: d.length > 0 ? d : null,
30
+ description: c?.description
16
31
  };
17
- }), o;
32
+ }), s;
18
33
  }
19
34
  //#endregion
20
- export { i as getSchemaPropertiesInfo };
35
+ export { a as getSchemaPropertiesInfo };
21
36
 
22
37
  //# sourceMappingURL=getSchemaPropertyInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSchemaPropertyInfo.js","names":[],"sources":["../../../src/utils/jsonschema/getSchemaPropertyInfo.ts"],"sourcesContent":["import getEnumeratedValues, { EnumeratedValue } from './getEnumeratedValues'\nimport getSchemaForProperty from './getSchemaForProperty'\nimport getRequiredAttributes from './getRequiredAttributes'\nimport { FlatTypeInfo, getFlatTypeInfo } from './getType'\nimport { JSONSchema7 } from 'json-schema'\n\nexport interface SchemaPropertyInfo {\n type: FlatTypeInfo | undefined\n isRequired: boolean\n enumeratedValues: EnumeratedValue[] | null\n description?: string\n}\n\nexport interface SchemaPropertiesMap {\n [propertyName: string]: SchemaPropertyInfo\n}\n\n/**\n * Processes a JSON schema once and returns information for all properties\n * @param schema The JSON schema to process\n * @returns A map of property names to their schema information\n */\nexport function getSchemaPropertiesInfo(\n schema: JSONSchema7 | null,\n): SchemaPropertiesMap {\n if (!schema) {\n return {}\n }\n\n const requiredFields = getRequiredAttributes(schema)\n const propertiesMap: SchemaPropertiesMap = {}\n\n // Process each property in the schema\n if (schema.properties) {\n Object.keys(schema.properties).forEach(propertyName => {\n const propertySchema = getSchemaForProperty(schema, propertyName)\n const type = getFlatTypeInfo(propertySchema)\n let enumeratedValues = getEnumeratedValues(propertySchema).map(\n item => item.value,\n )\n\n // Check for nested enums in array items\n if (enumeratedValues.length === 0 && propertySchema?.items) {\n const itemsSchema = Array.isArray(propertySchema.items)\n ? propertySchema.items[0]\n : propertySchema.items\n enumeratedValues = getEnumeratedValues(itemsSchema).map(\n item => item.value,\n )\n }\n\n propertiesMap[propertyName] = {\n type,\n isRequired: requiredFields.includes(propertyName),\n enumeratedValues: enumeratedValues.length > 0 ? enumeratedValues : null,\n description: propertySchema?.description,\n }\n })\n }\n\n return propertiesMap\n}\n"],"mappings":";;;;;AAsBA,SAAgB,EACd,GACqB;CACrB,IAAI,CAAC,GACH,OAAO,CAAC;CAGV,IAAM,IAAiB,EAAsB,CAAM,GAC7C,IAAqC,CAAC;CA8B5C,OA3BI,EAAO,cACT,OAAO,KAAK,EAAO,UAAU,EAAE,SAAQ,MAAgB;EACrD,IAAM,IAAiB,EAAqB,GAAQ,CAAY,GAC1D,IAAO,EAAgB,CAAc,GACvC,IAAmB,EAAoB,CAAc,EAAE,KACzD,MAAQ,EAAK,KACf;EAYA,AATI,EAAiB,WAAW,KAAK,GAAgB,UAInD,IAAmB,EAHC,MAAM,QAAQ,EAAe,KAAK,IAClD,EAAe,MAAM,KACrB,EAAe,KAC+B,EAAE,KAClD,MAAQ,EAAK,KACf,IAGF,EAAc,KAAgB;GAC5B;GACA,YAAY,EAAe,SAAS,CAAY;GAChD,kBAAkB,EAAiB,SAAS,IAAI,IAAmB;GACnE,aAAa,GAAgB;EAC/B;CACF,CAAC,GAGI;AACT"}
1
+ {"version":3,"file":"getSchemaPropertyInfo.js","names":[],"sources":["../../../src/utils/jsonschema/getSchemaPropertyInfo.ts"],"sourcesContent":["import getEnumeratedValues, { EnumeratedValue } from './getEnumeratedValues'\nimport { getNumberOrEnumInfo } from './getNumberOrEnumInfo'\nimport getSchemaForProperty from './getSchemaForProperty'\nimport getRequiredAttributes from './getRequiredAttributes'\nimport { FlatTypeInfo, getFlatTypeInfo } from './getType'\nimport { JSONSchema7 } from 'json-schema'\n\nexport interface SchemaPropertyInfo {\n type: FlatTypeInfo | undefined\n isRequired: boolean\n enumeratedValues: EnumeratedValue[] | null\n description?: string\n /**\n * True when the property is either a number of the given `type` or one of the\n * strings in `enumeratedValues`; see {@link getNumberOrEnumInfo}\n */\n isNumberOrEnum?: boolean\n}\n\nexport interface SchemaPropertiesMap {\n [propertyName: string]: SchemaPropertyInfo\n}\n\n/**\n * Processes a JSON schema once and returns information for all properties\n * @param schema The JSON schema to process\n * @returns A map of property names to their schema information\n */\nexport function getSchemaPropertiesInfo(\n schema: JSONSchema7 | null,\n): SchemaPropertiesMap {\n if (!schema) {\n return {}\n }\n\n const requiredFields = getRequiredAttributes(schema)\n const propertiesMap: SchemaPropertiesMap = {}\n\n // Process each property in the schema\n if (schema.properties) {\n Object.keys(schema.properties).forEach(propertyName => {\n const propertySchema = getSchemaForProperty(schema, propertyName)\n\n const numberOrEnum = getNumberOrEnumInfo(\n propertySchema,\n schema.definitions,\n )\n if (numberOrEnum) {\n // A number-or-enum union describes neither a single type nor an\n // enumeration, so both come from its detected branches.\n propertiesMap[propertyName] = {\n type: {\n ...getFlatTypeInfo(propertySchema),\n type: numberOrEnum.numericType,\n },\n isRequired: requiredFields.includes(propertyName),\n enumeratedValues: numberOrEnum.enumValues,\n description: propertySchema?.description,\n isNumberOrEnum: true,\n }\n return\n }\n\n const type = getFlatTypeInfo(propertySchema)\n let enumeratedValues = getEnumeratedValues(propertySchema).map(\n item => item.value,\n )\n\n // Check for nested enums in array items\n if (enumeratedValues.length === 0 && propertySchema?.items) {\n const itemsSchema = Array.isArray(propertySchema.items)\n ? propertySchema.items[0]\n : propertySchema.items\n enumeratedValues = getEnumeratedValues(itemsSchema).map(\n item => item.value,\n )\n }\n\n propertiesMap[propertyName] = {\n type,\n isRequired: requiredFields.includes(propertyName),\n enumeratedValues: enumeratedValues.length > 0 ? enumeratedValues : null,\n description: propertySchema?.description,\n }\n })\n }\n\n return propertiesMap\n}\n"],"mappings":";;;;;;AA4BA,SAAgB,EACd,GACqB;CACrB,IAAI,CAAC,GACH,OAAO,CAAC;CAGV,IAAM,IAAiB,EAAsB,CAAM,GAC7C,IAAqC,CAAC;CAmD5C,OAhDI,EAAO,cACT,OAAO,KAAK,EAAO,UAAU,EAAE,SAAQ,MAAgB;EACrD,IAAM,IAAiB,EAAqB,GAAQ,CAAY,GAE1D,IAAe,EACnB,GACA,EAAO,WACT;EACA,IAAI,GAAc;GAGhB,EAAc,KAAgB;IAC5B,MAAM;KACJ,GAAG,EAAgB,CAAc;KACjC,MAAM,EAAa;IACrB;IACA,YAAY,EAAe,SAAS,CAAY;IAChD,kBAAkB,EAAa;IAC/B,aAAa,GAAgB;IAC7B,gBAAgB;GAClB;GACA;EACF;EAEA,IAAM,IAAO,EAAgB,CAAc,GACvC,IAAmB,EAAoB,CAAc,EAAE,KACzD,MAAQ,EAAK,KACf;EAYA,AATI,EAAiB,WAAW,KAAK,GAAgB,UAInD,IAAmB,EAHC,MAAM,QAAQ,EAAe,KAAK,IAClD,EAAe,MAAM,KACrB,EAAe,KAC+B,EAAE,KAClD,MAAQ,EAAK,KACf,IAGF,EAAc,KAAgB;GAC5B;GACA,YAAY,EAAe,SAAS,CAAY;GAChD,kBAAkB,EAAiB,SAAS,IAAI,IAAmB;GACnE,aAAa,GAAgB;EAC/B;CACF,CAAC,GAGI;AACT"}
@@ -38,10 +38,10 @@ function i(e) {
38
38
  function a(e) {
39
39
  if (!e.startsWith("/")) return null;
40
40
  let t = e.slice(1);
41
- return !t || t.includes("/") ? null : t.replace(/~1/g, "/").replace(/~0/g, "~");
41
+ return !t || t.includes("/") ? null : t.replaceAll("~1", "/").replaceAll("~0", "~");
42
42
  }
43
43
  function o(e) {
44
- return `/${e.replace(/~/g, "~0").replace(/\//g, "~1")}`;
44
+ return `/${e.replaceAll("~", "~0").replaceAll("/", "~1")}`;
45
45
  }
46
46
  function s(e, t) {
47
47
  let n = a(t);
@@ -1 +1 @@
1
- {"version":3,"file":"submissionContext.js","names":[],"sources":["../../../src/utils/jsonschema/submissionContext.ts"],"sourcesContent":["/**\n * Convention for gating a JSON Schema property to a data access REQUEST or RENEWAL submission.\n *\n * To gate a property to a specific submission context, a client can use conditional logic in\n * the JSON Schema against the 'x-synapse-submissionContext' property.\n *\n * A property that should only appear for a RENEWAL (or only for a REQUEST) is declared inside\n * an `allOf` entry keyed on the reserved `x-synapse-submissionContext` property, e.g.:\n *\n * ```json\n * {\n * \"allOf\": [{\n * \"if\": { \"properties\": { \"x-synapse-submissionContext\": { \"const\": \"RENEWAL\" } } },\n * \"then\": {\n * \"properties\": { \"summaryOfUse\": { \"type\": \"string\" } },\n * \"required\": [\"summaryOfUse\"]\n * }\n * }]\n * }\n * ```\n *\n * The submitted `schemaData` MUST include `x-synapse-submissionContext`; the server validates\n * that it matches the actual submission context. This module resolves the convention client-side\n * so the FormTemplateEditor's field library, step slots, and preview can discover and render such\n * properties, and provides a guided authoring API (`setSchemaProperty`,\n * `setSchemaPropertyContext`, `setSchemaPropertyRequired`, `removeSchemaProperty`,\n * `renameSchemaProperty`) so ACT can author a Request/Renewal-only field from a \"Submission\n * context\" select box, without hand-editing a JSON Schema.\n */\nimport { RJSFSchema } from '@rjsf/utils'\nimport { DataAccessRequestType } from '@sage-bionetworks/synapse-client'\n\nexport const SUBMISSION_CONTEXT_PROPERTY = 'x-synapse-submissionContext'\n\nexport type SchemaPropertyContext = 'ALWAYS' | 'REQUEST_ONLY' | 'RENEWAL_ONLY'\n\nexport type ResolvedSchemaProperty = {\n propertyKey: string\n subSchema: RJSFSchema\n isRequired: boolean\n context: SchemaPropertyContext\n}\n\ntype ConditionalBranch = {\n requestType: DataAccessRequestType\n properties: Record<string, RJSFSchema>\n required: Set<string>\n}\n\nfunction contextForRequestType(\n requestType: DataAccessRequestType,\n): SchemaPropertyContext {\n return requestType === DataAccessRequestType.REQUEST\n ? 'REQUEST_ONLY'\n : 'RENEWAL_ONLY'\n}\n\n/**\n * Parse `schema.allOf` for entries following the `x-synapse-submissionContext` `if`/`then`\n * convention above. Entries that don't match it (an unrelated `if` key, or a missing\n * `then.properties`) are left alone.\n */\nfunction readConditionalBranches(schema: RJSFSchema): ConditionalBranch[] {\n const branches: ConditionalBranch[] = []\n for (const entry of schema.allOf ?? []) {\n if (typeof entry === 'boolean') continue\n const ifClause = (entry as RJSFSchema).if\n const thenClause = (entry as RJSFSchema).then\n if (\n !ifClause ||\n typeof ifClause === 'boolean' ||\n !thenClause ||\n typeof thenClause === 'boolean'\n ) {\n continue\n }\n const contextConst = (\n ifClause.properties?.[SUBMISSION_CONTEXT_PROPERTY] as\n | RJSFSchema\n | undefined\n )?.const as DataAccessRequestType | undefined\n if (\n contextConst !== DataAccessRequestType.REQUEST &&\n contextConst !== DataAccessRequestType.RENEWAL\n ) {\n continue\n }\n branches.push({\n requestType: contextConst,\n properties: (thenClause.properties ?? {}) as Record<string, RJSFSchema>,\n required: new Set(thenClause.required ?? []),\n })\n }\n return branches\n}\n\n/**\n * Enumerate every leaf property the schema declares along with which submission\n * context applies to each. The reserved `x-synapse-submissionContext`\n * property itself is never included; it isn't a bindable field.\n */\nexport function listResolvedSchemaProperties(\n schema: RJSFSchema,\n): ResolvedSchemaProperty[] {\n const required = new Set(schema.required ?? [])\n const result: ResolvedSchemaProperty[] = []\n const seen = new Set<string>([SUBMISSION_CONTEXT_PROPERTY])\n\n for (const [propertyKey, subSchema] of Object.entries(\n (schema.properties ?? {}) as Record<string, RJSFSchema>,\n )) {\n if (seen.has(propertyKey)) continue\n seen.add(propertyKey)\n result.push({\n propertyKey,\n subSchema,\n isRequired: required.has(propertyKey),\n context: 'ALWAYS',\n })\n }\n\n for (const branch of readConditionalBranches(schema)) {\n for (const [propertyKey, subSchema] of Object.entries(branch.properties)) {\n // An unconditional definition of the same key wins; conditional branches only add\n // properties that aren't already declared at the top level.\n if (seen.has(propertyKey)) continue\n seen.add(propertyKey)\n result.push({\n propertyKey,\n subSchema,\n isRequired: branch.required.has(propertyKey),\n context: contextForRequestType(branch.requestType),\n })\n }\n }\n\n return result\n}\n\n/** The property key addressed by a single-segment JSON Pointer (e.g. `/institution` -> `institution`). */\nexport function pointerToPropertyKey(pointer: string): string | null {\n if (!pointer.startsWith('/')) return null\n const segment = pointer.slice(1)\n if (!segment || segment.includes('/')) return null\n return segment.replace(/~1/g, '/').replace(/~0/g, '~')\n}\n\n/** The single-segment JSON Pointer addressing a property key (e.g. `institution` -> `/institution`),\n * the inverse of `pointerToPropertyKey`. */\nexport function propertyKeyToPointer(propertyKey: string): string {\n return `/${propertyKey.replace(/~/g, '~0').replace(/\\//g, '~1')}`\n}\n\n/** Resolve a `FormTemplateField.schemaPath`-style JSON Pointer, applying the same rules as\n * `listResolvedSchemaProperties`. */\nexport function resolveSchemaPropertyAtPointer(\n schema: RJSFSchema,\n pointer: string,\n): ResolvedSchemaProperty | undefined {\n const propertyKey = pointerToPropertyKey(pointer)\n if (!propertyKey) return undefined\n return listResolvedSchemaProperties(schema).find(\n p => p.propertyKey === propertyKey,\n )\n}\n\n/** Whether a property's context applies for the given requestType (`ALWAYS` always applies). */\nexport function contextAppliesForRequestType(\n context: SchemaPropertyContext,\n requestType: DataAccessRequestType,\n): boolean {\n if (context === 'ALWAYS') return true\n return context === contextForRequestType(requestType)\n}\n\n/** Human label for display, e.g. a field library row or step slot badge. */\nexport function submissionContextLabel(context: SchemaPropertyContext): string {\n switch (context) {\n case 'ALWAYS':\n return 'Always'\n case 'REQUEST_ONLY':\n return 'Request only'\n case 'RENEWAL_ONLY':\n return 'Renewal only'\n }\n}\n\nfunction requestTypeForContext(\n context: SchemaPropertyContext,\n): DataAccessRequestType | undefined {\n if (context === 'REQUEST_ONLY') return DataAccessRequestType.REQUEST\n if (context === 'RENEWAL_ONLY') return DataAccessRequestType.RENEWAL\n return undefined\n}\n\n/** Index of the `allOf` entry gating on `requestType` per the convention above, or -1. */\nfunction findBranchIndex(\n allOf: (RJSFSchema | boolean)[],\n requestType: DataAccessRequestType,\n): number {\n return allOf.findIndex(entry => {\n if (typeof entry === 'boolean') return false\n const ifClause = entry.if\n if (!ifClause || typeof ifClause === 'boolean') return false\n const contextConst = (\n ifClause.properties?.[SUBMISSION_CONTEXT_PROPERTY] as\n | RJSFSchema\n | undefined\n )?.const\n return contextConst === requestType\n })\n}\n\n/**\n * Remove `propertyKey` from wherever it's currently defined. Drops now-empty\n * `then.properties`/branches/the `allOf` array itself so relocating or deleting\n * a property never leaves extra schema components behind.\n */\nexport function removeSchemaProperty(\n schema: RJSFSchema,\n propertyKey: string,\n): RJSFSchema {\n const properties = {\n ...((schema.properties ?? {}) as Record<string, RJSFSchema>),\n }\n let changed = propertyKey in properties\n delete properties[propertyKey]\n const required = (schema.required ?? []).filter(k => k !== propertyKey)\n\n const allOf = (schema.allOf ?? [])\n .map(entry => {\n if (typeof entry === 'boolean') return entry\n const thenClause = entry.then\n if (!thenClause || typeof thenClause === 'boolean') return entry\n const thenProps = {\n ...((thenClause.properties ?? {}) as Record<string, RJSFSchema>),\n }\n if (!(propertyKey in thenProps)) return entry\n changed = true\n delete thenProps[propertyKey]\n if (Object.keys(thenProps).length === 0) return null\n return {\n ...entry,\n then: {\n ...thenClause,\n properties: thenProps,\n required: (thenClause.required ?? []).filter(k => k !== propertyKey),\n },\n }\n })\n .filter((entry): entry is RJSFSchema | boolean => entry !== null)\n\n if (!changed) return schema\n\n const next: RJSFSchema = { ...schema, properties, required }\n if (allOf.length > 0) {\n next.allOf = allOf\n } else {\n delete next.allOf\n }\n return next\n}\n\n/**\n * Insert or replace a property's definition at the given submission context, relocating it there\n * from wherever it previously lived.\n *\n * Does not modify the property's requiredness behind at its old location. Callers that need to\n * preserve it (e.g. changing a property's context) should follow up with `setSchemaPropertyRequired`.\n */\nexport function setSchemaProperty(\n schema: RJSFSchema,\n propertyKey: string,\n subSchema: RJSFSchema,\n context: SchemaPropertyContext,\n): RJSFSchema {\n const withoutProperty = removeSchemaProperty(schema, propertyKey)\n const requestType = requestTypeForContext(context)\n\n if (!requestType) {\n return {\n ...withoutProperty,\n properties: {\n ...((withoutProperty.properties ?? {}) as Record<string, RJSFSchema>),\n [propertyKey]: subSchema,\n },\n }\n }\n\n const allOf = [...(withoutProperty.allOf ?? [])]\n const branchIndex = findBranchIndex(allOf, requestType)\n if (branchIndex === -1) {\n allOf.push({\n if: {\n properties: { [SUBMISSION_CONTEXT_PROPERTY]: { const: requestType } },\n },\n then: { properties: { [propertyKey]: subSchema }, required: [] },\n })\n } else {\n const entry = allOf[branchIndex] as RJSFSchema\n const thenClause = entry.then as RJSFSchema\n allOf[branchIndex] = {\n ...entry,\n then: {\n ...thenClause,\n properties: {\n ...((thenClause.properties ?? {}) as Record<string, RJSFSchema>),\n [propertyKey]: subSchema,\n },\n },\n }\n }\n return { ...withoutProperty, allOf }\n}\n\n/** Set whether a property is required within its current context's branch (top-level `required`\n * for `ALWAYS`, or the matching `allOf` branch's `then.required` otherwise). A no-op if the\n * property isn't actually defined at that context. */\nexport function setSchemaPropertyRequired(\n schema: RJSFSchema,\n propertyKey: string,\n context: SchemaPropertyContext,\n isRequired: boolean,\n): RJSFSchema {\n const requestType = requestTypeForContext(context)\n if (!requestType) {\n const properties = (schema.properties ?? {}) as Record<string, RJSFSchema>\n if (!(propertyKey in properties)) return schema\n const required = (schema.required ?? []).filter(k => k !== propertyKey)\n if (isRequired) required.push(propertyKey)\n return { ...schema, required }\n }\n const allOf = [...(schema.allOf ?? [])]\n const branchIndex = findBranchIndex(allOf, requestType)\n if (branchIndex === -1) return schema\n const entry = allOf[branchIndex] as RJSFSchema\n const thenClause = entry.then as RJSFSchema\n const thenProperties = (thenClause.properties ?? {}) as Record<\n string,\n RJSFSchema\n >\n if (!(propertyKey in thenProperties)) return schema\n const required = (thenClause.required ?? []).filter(k => k !== propertyKey)\n if (isRequired) required.push(propertyKey)\n allOf[branchIndex] = { ...entry, then: { ...thenClause, required } }\n return { ...schema, allOf }\n}\n\n/**\n * Move a property to a different submission context, preserving its definition and\n * requiredness. A no-op if the property doesn't resolve, or is already at that context.\n */\nexport function setSchemaPropertyContext(\n schema: RJSFSchema,\n propertyKey: string,\n context: SchemaPropertyContext,\n): RJSFSchema {\n const resolved = resolveSchemaPropertyAtPointer(schema, `/${propertyKey}`)\n if (!resolved || resolved.context === context) return schema\n const next = setSchemaProperty(\n schema,\n propertyKey,\n resolved.subSchema,\n context,\n )\n return resolved.isRequired\n ? setSchemaPropertyRequired(next, propertyKey, context, true)\n : next\n}\n\n/**\n * Replace a property's definition wherever it's defined (top-level or an `allOf` branch),\n * preserving its context and required-ness. A no-op if the property doesn't resolve.\n */\nexport function replaceSchemaPropertyDefinition(\n schema: RJSFSchema,\n propertyKey: string,\n subSchema: RJSFSchema,\n): RJSFSchema {\n const resolved = resolveSchemaPropertyAtPointer(\n schema,\n propertyKeyToPointer(propertyKey),\n )\n if (!resolved) return schema\n const next = setSchemaProperty(\n schema,\n propertyKey,\n subSchema,\n resolved.context,\n )\n return resolved.isRequired\n ? setSchemaPropertyRequired(next, propertyKey, resolved.context, true)\n : next\n}\n\n/**\n * Rename a property's key wherever it's defined (top-level or an `allOf` branch), preserving its\n * definition, context, and required-ness. A no-op if `oldKey` doesn't resolve.\n */\nexport function renameSchemaProperty(\n schema: RJSFSchema,\n oldKey: string,\n newKey: string,\n): RJSFSchema {\n const resolved = resolveSchemaPropertyAtPointer(schema, `/${oldKey}`)\n if (!resolved) return schema\n const withoutOld = removeSchemaProperty(schema, oldKey)\n const withNew = setSchemaProperty(\n withoutOld,\n newKey,\n resolved.subSchema,\n resolved.context,\n )\n return resolved.isRequired\n ? setSchemaPropertyRequired(withNew, newKey, resolved.context, true)\n : withNew\n}\n"],"mappings":";;AAgCA,IAAa,IAA8B;AAiB3C,SAAS,EACP,GACuB;CACvB,OAAO,MAAgB,EAAsB,UACzC,iBACA;AACN;AAOA,SAAS,EAAwB,GAAyC;CACxE,IAAM,IAAgC,CAAC;CACvC,KAAK,IAAM,KAAS,EAAO,SAAS,CAAC,GAAG;EACtC,IAAI,OAAO,KAAU,WAAW;EAChC,IAAM,IAAY,EAAqB,IACjC,IAAc,EAAqB;EACzC,IACE,CAAC,KACD,OAAO,KAAa,aACpB,CAAC,KACD,OAAO,KAAe,WAEtB;EAEF,IAAM,IACJ,EAAS,aAAa,IAGrB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O;CAC/B,IAAM,IAAQ,EAAM,IACd,IAAa,EAAM;CAKzB,IAAI,EAAE,MAJkB,EAAW,cAAc,CAAC,KAIZ,OAAO;CAC7C,IAAM,KAAY,EAAW,YAAY,CAAC,GAAG,QAAO,MAAK,MAAM,CAAW;CAG1E,OAFI,KAAY,EAAS,KAAK,CAAW,GACzC,EAAM,KAAe;EAAE,GAAG;EAAO,MAAM;GAAE,GAAG;GAAY;EAAS;CAAE,GAC5D;EAAE,GAAG;EAAQ;CAAM;AAC5B;AAMA,SAAgB,EACd,GACA,GACA,GACY;CACZ,IAAM,IAAW,EAA+B,GAAQ,IAAI,GAAa;CACzE,IAAI,CAAC,KAAY,EAAS,YAAY,GAAS,OAAO;CACtD,IAAM,IAAO,EACX,GACA,GACA,EAAS,WACT,CACF;CACA,OAAO,EAAS,aACZ,EAA0B,GAAM,GAAa,GAAS,EAAI,IAC1D;AACN;AAMA,SAAgB,EACd,GACA,GACA,GACY;CACZ,IAAM,IAAW,EACf,GACA,EAAqB,CAAW,CAClC;CACA,IAAI,CAAC,GAAU,OAAO;CACtB,IAAM,IAAO,EACX,GACA,GACA,GACA,EAAS,OACX;CACA,OAAO,EAAS,aACZ,EAA0B,GAAM,GAAa,EAAS,SAAS,EAAI,IACnE;AACN;AAMA,SAAgB,EACd,GACA,GACA,GACY;CACZ,IAAM,IAAW,EAA+B,GAAQ,IAAI,GAAQ;CACpE,IAAI,CAAC,GAAU,OAAO;CAEtB,IAAM,IAAU,EADG,EAAqB,GAAQ,CAE9C,GACA,GACA,EAAS,WACT,EAAS,OACX;CACA,OAAO,EAAS,aACZ,EAA0B,GAAS,GAAQ,EAAS,SAAS,EAAI,IACjE;AACN"}
1
+ {"version":3,"file":"submissionContext.js","names":[],"sources":["../../../src/utils/jsonschema/submissionContext.ts"],"sourcesContent":["/**\n * Convention for gating a JSON Schema property to a data access REQUEST or RENEWAL submission.\n *\n * To gate a property to a specific submission context, a client can use conditional logic in\n * the JSON Schema against the 'x-synapse-submissionContext' property.\n *\n * A property that should only appear for a RENEWAL (or only for a REQUEST) is declared inside\n * an `allOf` entry keyed on the reserved `x-synapse-submissionContext` property, e.g.:\n *\n * ```json\n * {\n * \"allOf\": [{\n * \"if\": { \"properties\": { \"x-synapse-submissionContext\": { \"const\": \"RENEWAL\" } } },\n * \"then\": {\n * \"properties\": { \"summaryOfUse\": { \"type\": \"string\" } },\n * \"required\": [\"summaryOfUse\"]\n * }\n * }]\n * }\n * ```\n *\n * The submitted `schemaData` MUST include `x-synapse-submissionContext`; the server validates\n * that it matches the actual submission context. This module resolves the convention client-side\n * so the FormTemplateEditor's field library, step slots, and preview can discover and render such\n * properties, and provides a guided authoring API (`setSchemaProperty`,\n * `setSchemaPropertyContext`, `setSchemaPropertyRequired`, `removeSchemaProperty`,\n * `renameSchemaProperty`) so ACT can author a Request/Renewal-only field from a \"Submission\n * context\" select box, without hand-editing a JSON Schema.\n */\nimport { RJSFSchema } from '@rjsf/utils'\nimport { DataAccessRequestType } from '@sage-bionetworks/synapse-client'\n\nexport const SUBMISSION_CONTEXT_PROPERTY = 'x-synapse-submissionContext'\n\nexport type SchemaPropertyContext = 'ALWAYS' | 'REQUEST_ONLY' | 'RENEWAL_ONLY'\n\nexport type ResolvedSchemaProperty = {\n propertyKey: string\n subSchema: RJSFSchema\n isRequired: boolean\n context: SchemaPropertyContext\n}\n\ntype ConditionalBranch = {\n requestType: DataAccessRequestType\n properties: Record<string, RJSFSchema>\n required: Set<string>\n}\n\nfunction contextForRequestType(\n requestType: DataAccessRequestType,\n): SchemaPropertyContext {\n return requestType === DataAccessRequestType.REQUEST\n ? 'REQUEST_ONLY'\n : 'RENEWAL_ONLY'\n}\n\n/**\n * Parse `schema.allOf` for entries following the `x-synapse-submissionContext` `if`/`then`\n * convention above. Entries that don't match it (an unrelated `if` key, or a missing\n * `then.properties`) are left alone.\n */\nfunction readConditionalBranches(schema: RJSFSchema): ConditionalBranch[] {\n const branches: ConditionalBranch[] = []\n for (const entry of schema.allOf ?? []) {\n if (typeof entry === 'boolean') continue\n const ifClause = (entry as RJSFSchema).if\n const thenClause = (entry as RJSFSchema).then\n if (\n !ifClause ||\n typeof ifClause === 'boolean' ||\n !thenClause ||\n typeof thenClause === 'boolean'\n ) {\n continue\n }\n const contextConst = (\n ifClause.properties?.[SUBMISSION_CONTEXT_PROPERTY] as\n | RJSFSchema\n | undefined\n )?.const as DataAccessRequestType | undefined\n if (\n contextConst !== DataAccessRequestType.REQUEST &&\n contextConst !== DataAccessRequestType.RENEWAL\n ) {\n continue\n }\n branches.push({\n requestType: contextConst,\n properties: (thenClause.properties ?? {}) as Record<string, RJSFSchema>,\n required: new Set(thenClause.required ?? []),\n })\n }\n return branches\n}\n\n/**\n * Enumerate every leaf property the schema declares along with which submission\n * context applies to each. The reserved `x-synapse-submissionContext`\n * property itself is never included; it isn't a bindable field.\n */\nexport function listResolvedSchemaProperties(\n schema: RJSFSchema,\n): ResolvedSchemaProperty[] {\n const required = new Set(schema.required ?? [])\n const result: ResolvedSchemaProperty[] = []\n const seen = new Set<string>([SUBMISSION_CONTEXT_PROPERTY])\n\n for (const [propertyKey, subSchema] of Object.entries(\n (schema.properties ?? {}) as Record<string, RJSFSchema>,\n )) {\n if (seen.has(propertyKey)) continue\n seen.add(propertyKey)\n result.push({\n propertyKey,\n subSchema,\n isRequired: required.has(propertyKey),\n context: 'ALWAYS',\n })\n }\n\n for (const branch of readConditionalBranches(schema)) {\n for (const [propertyKey, subSchema] of Object.entries(branch.properties)) {\n // An unconditional definition of the same key wins; conditional branches only add\n // properties that aren't already declared at the top level.\n if (seen.has(propertyKey)) continue\n seen.add(propertyKey)\n result.push({\n propertyKey,\n subSchema,\n isRequired: branch.required.has(propertyKey),\n context: contextForRequestType(branch.requestType),\n })\n }\n }\n\n return result\n}\n\n/** The property key addressed by a single-segment JSON Pointer (e.g. `/institution` -> `institution`). */\nexport function pointerToPropertyKey(pointer: string): string | null {\n if (!pointer.startsWith('/')) return null\n const segment = pointer.slice(1)\n if (!segment || segment.includes('/')) return null\n return segment.replaceAll('~1', '/').replaceAll('~0', '~')\n}\n\n/** The single-segment JSON Pointer addressing a property key (e.g. `institution` -> `/institution`),\n * the inverse of `pointerToPropertyKey`. */\nexport function propertyKeyToPointer(propertyKey: string): string {\n return `/${propertyKey.replaceAll('~', '~0').replaceAll('/', '~1')}`\n}\n\n/** Resolve a `FormTemplateField.schemaPath`-style JSON Pointer, applying the same rules as\n * `listResolvedSchemaProperties`. */\nexport function resolveSchemaPropertyAtPointer(\n schema: RJSFSchema,\n pointer: string,\n): ResolvedSchemaProperty | undefined {\n const propertyKey = pointerToPropertyKey(pointer)\n if (!propertyKey) return undefined\n return listResolvedSchemaProperties(schema).find(\n p => p.propertyKey === propertyKey,\n )\n}\n\n/** Whether a property's context applies for the given requestType (`ALWAYS` always applies). */\nexport function contextAppliesForRequestType(\n context: SchemaPropertyContext,\n requestType: DataAccessRequestType,\n): boolean {\n if (context === 'ALWAYS') return true\n return context === contextForRequestType(requestType)\n}\n\n/** Human label for display, e.g. a field library row or step slot badge. */\nexport function submissionContextLabel(context: SchemaPropertyContext): string {\n switch (context) {\n case 'ALWAYS':\n return 'Always'\n case 'REQUEST_ONLY':\n return 'Request only'\n case 'RENEWAL_ONLY':\n return 'Renewal only'\n }\n}\n\nfunction requestTypeForContext(\n context: SchemaPropertyContext,\n): DataAccessRequestType | undefined {\n if (context === 'REQUEST_ONLY') return DataAccessRequestType.REQUEST\n if (context === 'RENEWAL_ONLY') return DataAccessRequestType.RENEWAL\n return undefined\n}\n\n/** Index of the `allOf` entry gating on `requestType` per the convention above, or -1. */\nfunction findBranchIndex(\n allOf: (RJSFSchema | boolean)[],\n requestType: DataAccessRequestType,\n): number {\n return allOf.findIndex(entry => {\n if (typeof entry === 'boolean') return false\n const ifClause = entry.if\n if (!ifClause || typeof ifClause === 'boolean') return false\n const contextConst = (\n ifClause.properties?.[SUBMISSION_CONTEXT_PROPERTY] as\n | RJSFSchema\n | undefined\n )?.const\n return contextConst === requestType\n })\n}\n\n/**\n * Remove `propertyKey` from wherever it's currently defined. Drops now-empty\n * `then.properties`/branches/the `allOf` array itself so relocating or deleting\n * a property never leaves extra schema components behind.\n */\nexport function removeSchemaProperty(\n schema: RJSFSchema,\n propertyKey: string,\n): RJSFSchema {\n const properties = {\n ...((schema.properties ?? {}) as Record<string, RJSFSchema>),\n }\n let changed = propertyKey in properties\n delete properties[propertyKey]\n const required = (schema.required ?? []).filter(k => k !== propertyKey)\n\n const allOf = (schema.allOf ?? [])\n .map(entry => {\n if (typeof entry === 'boolean') return entry\n const thenClause = entry.then\n if (!thenClause || typeof thenClause === 'boolean') return entry\n const thenProps = {\n ...((thenClause.properties ?? {}) as Record<string, RJSFSchema>),\n }\n if (!(propertyKey in thenProps)) return entry\n changed = true\n delete thenProps[propertyKey]\n if (Object.keys(thenProps).length === 0) return null\n return {\n ...entry,\n then: {\n ...thenClause,\n properties: thenProps,\n required: (thenClause.required ?? []).filter(k => k !== propertyKey),\n },\n }\n })\n .filter((entry): entry is RJSFSchema | boolean => entry !== null)\n\n if (!changed) return schema\n\n const next: RJSFSchema = { ...schema, properties, required }\n if (allOf.length > 0) {\n next.allOf = allOf\n } else {\n delete next.allOf\n }\n return next\n}\n\n/**\n * Insert or replace a property's definition at the given submission context, relocating it there\n * from wherever it previously lived.\n *\n * Does not modify the property's requiredness behind at its old location. Callers that need to\n * preserve it (e.g. changing a property's context) should follow up with `setSchemaPropertyRequired`.\n */\nexport function setSchemaProperty(\n schema: RJSFSchema,\n propertyKey: string,\n subSchema: RJSFSchema,\n context: SchemaPropertyContext,\n): RJSFSchema {\n const withoutProperty = removeSchemaProperty(schema, propertyKey)\n const requestType = requestTypeForContext(context)\n\n if (!requestType) {\n return {\n ...withoutProperty,\n properties: {\n ...((withoutProperty.properties ?? {}) as Record<string, RJSFSchema>),\n [propertyKey]: subSchema,\n },\n }\n }\n\n const allOf = [...(withoutProperty.allOf ?? [])]\n const branchIndex = findBranchIndex(allOf, requestType)\n if (branchIndex === -1) {\n allOf.push({\n if: {\n properties: { [SUBMISSION_CONTEXT_PROPERTY]: { const: requestType } },\n },\n then: { properties: { [propertyKey]: subSchema }, required: [] },\n })\n } else {\n const entry = allOf[branchIndex] as RJSFSchema\n const thenClause = entry.then as RJSFSchema\n allOf[branchIndex] = {\n ...entry,\n then: {\n ...thenClause,\n properties: {\n ...((thenClause.properties ?? {}) as Record<string, RJSFSchema>),\n [propertyKey]: subSchema,\n },\n },\n }\n }\n return { ...withoutProperty, allOf }\n}\n\n/** Set whether a property is required within its current context's branch (top-level `required`\n * for `ALWAYS`, or the matching `allOf` branch's `then.required` otherwise). A no-op if the\n * property isn't actually defined at that context. */\nexport function setSchemaPropertyRequired(\n schema: RJSFSchema,\n propertyKey: string,\n context: SchemaPropertyContext,\n isRequired: boolean,\n): RJSFSchema {\n const requestType = requestTypeForContext(context)\n if (!requestType) {\n const properties = (schema.properties ?? {}) as Record<string, RJSFSchema>\n if (!(propertyKey in properties)) return schema\n const required = (schema.required ?? []).filter(k => k !== propertyKey)\n if (isRequired) required.push(propertyKey)\n return { ...schema, required }\n }\n const allOf = [...(schema.allOf ?? [])]\n const branchIndex = findBranchIndex(allOf, requestType)\n if (branchIndex === -1) return schema\n const entry = allOf[branchIndex] as RJSFSchema\n const thenClause = entry.then as RJSFSchema\n const thenProperties = (thenClause.properties ?? {}) as Record<\n string,\n RJSFSchema\n >\n if (!(propertyKey in thenProperties)) return schema\n const required = (thenClause.required ?? []).filter(k => k !== propertyKey)\n if (isRequired) required.push(propertyKey)\n allOf[branchIndex] = { ...entry, then: { ...thenClause, required } }\n return { ...schema, allOf }\n}\n\n/**\n * Move a property to a different submission context, preserving its definition and\n * requiredness. A no-op if the property doesn't resolve, or is already at that context.\n */\nexport function setSchemaPropertyContext(\n schema: RJSFSchema,\n propertyKey: string,\n context: SchemaPropertyContext,\n): RJSFSchema {\n const resolved = resolveSchemaPropertyAtPointer(schema, `/${propertyKey}`)\n if (!resolved || resolved.context === context) return schema\n const next = setSchemaProperty(\n schema,\n propertyKey,\n resolved.subSchema,\n context,\n )\n return resolved.isRequired\n ? setSchemaPropertyRequired(next, propertyKey, context, true)\n : next\n}\n\n/**\n * Replace a property's definition wherever it's defined (top-level or an `allOf` branch),\n * preserving its context and required-ness. A no-op if the property doesn't resolve.\n */\nexport function replaceSchemaPropertyDefinition(\n schema: RJSFSchema,\n propertyKey: string,\n subSchema: RJSFSchema,\n): RJSFSchema {\n const resolved = resolveSchemaPropertyAtPointer(\n schema,\n propertyKeyToPointer(propertyKey),\n )\n if (!resolved) return schema\n const next = setSchemaProperty(\n schema,\n propertyKey,\n subSchema,\n resolved.context,\n )\n return resolved.isRequired\n ? setSchemaPropertyRequired(next, propertyKey, resolved.context, true)\n : next\n}\n\n/**\n * Rename a property's key wherever it's defined (top-level or an `allOf` branch), preserving its\n * definition, context, and required-ness. A no-op if `oldKey` doesn't resolve.\n */\nexport function renameSchemaProperty(\n schema: RJSFSchema,\n oldKey: string,\n newKey: string,\n): RJSFSchema {\n const resolved = resolveSchemaPropertyAtPointer(schema, `/${oldKey}`)\n if (!resolved) return schema\n const withoutOld = removeSchemaProperty(schema, oldKey)\n const withNew = setSchemaProperty(\n withoutOld,\n newKey,\n resolved.subSchema,\n resolved.context,\n )\n return resolved.isRequired\n ? setSchemaPropertyRequired(withNew, newKey, resolved.context, true)\n : withNew\n}\n"],"mappings":";;AAgCA,IAAa,IAA8B;AAiB3C,SAAS,EACP,GACuB;CACvB,OAAO,MAAgB,EAAsB,UACzC,iBACA;AACN;AAOA,SAAS,EAAwB,GAAyC;CACxE,IAAM,IAAgC,CAAC;CACvC,KAAK,IAAM,KAAS,EAAO,SAAS,CAAC,GAAG;EACtC,IAAI,OAAO,KAAU,WAAW;EAChC,IAAM,IAAY,EAAqB,IACjC,IAAc,EAAqB;EACzC,IACE,CAAC,KACD,OAAO,KAAa,aACpB,CAAC,KACD,OAAO,KAAe,WAEtB;EAEF,IAAM,IACJ,EAAS,aAAa,IAGrB;EA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B,IAAM,IAAQ,EAAM,IACd,IAAa,EAAM;CAKzB,IAAI,EAAE,MAJkB,EAAW,cAAc,CAAC,KAIZ,OAAO;CAC7C,IAAM,KAAY,EAAW,YAAY,CAAC,GAAG,QAAO,MAAK,MAAM,CAAW;CAG1E,OAFI,KAAY,EAAS,KAAK,CAAW,GACzC,EAAM,KAAe;EAAE,GAAG;EAAO,MAAM;GAAE,GAAG;GAAY;EAAS;CAAE,GAC5D;EAAE,GAAG;EAAQ;CAAM;AAC5B;AAMA,SAAgB,EACd,GACA,GACA,GACY;CACZ,IAAM,IAAW,EAA+B,GAAQ,IAAI,GAAa;CACzE,IAAI,CAAC,KAAY,EAAS,YAAY,GAAS,OAAO;CACtD,IAAM,IAAO,EACX,GACA,GACA,EAAS,WACT,CACF;CACA,OAAO,EAAS,aACZ,EAA0B,GAAM,GAAa,GAAS,EAAI,IAC1D;AACN;AAMA,SAAgB,EACd,GACA,GACA,GACY;CACZ,IAAM,IAAW,EACf,GACA,EAAqB,CAAW,CAClC;CACA,IAAI,CAAC,GAAU,OAAO;CACtB,IAAM,IAAO,EACX,GACA,GACA,GACA,EAAS,OACX;CACA,OAAO,EAAS,aACZ,EAA0B,GAAM,GAAa,EAAS,SAAS,EAAI,IACnE;AACN;AAMA,SAAgB,EACd,GACA,GACA,GACY;CACZ,IAAM,IAAW,EAA+B,GAAQ,IAAI,GAAQ;CACpE,IAAI,CAAC,GAAU,OAAO;CAEtB,IAAM,IAAU,EADG,EAAqB,GAAQ,CAE9C,GACA,GACA,EAAS,WACT,EAAS,OACX;CACA,OAAO,EAAS,aACZ,EAA0B,GAAS,GAAQ,EAAS,SAAS,EAAI,IACjE;AACN"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synapse-react-client",
3
- "version": "4.0.46",
3
+ "version": "4.0.47",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -75,7 +75,7 @@
75
75
  "jsonpath-plus": "^10.4.0",
76
76
  "katex": "^0.18.2",
77
77
  "lodash-es": "^4.18.1",
78
- "markdown-it": "^14.3.2",
78
+ "markdown-it": "^14.3.3",
79
79
  "markdown-it-br": "^1.0.0",
80
80
  "markdown-it-center-text": "^1.0.4",
81
81
  "markdown-it-inline-comments": "^1.0.1",
@@ -125,8 +125,8 @@
125
125
  "@sage-bionetworks/markdown-it-container": "4.0.1",
126
126
  "@sage-bionetworks/react-datasheet-grid": "4.11.5-sage.10",
127
127
  "@sage-bionetworks/synapse-client": "0.0.24",
128
- "@sage-bionetworks/synapse-types": "0.0.12",
129
128
  "markdown-it-synapse": "2.0.0",
129
+ "@sage-bionetworks/synapse-types": "0.0.12",
130
130
  "markdown-it-synapse-table": "1.0.8"
131
131
  },
132
132
  "peerDependencies": {
@@ -209,7 +209,7 @@
209
209
  "react-dom": "^19.2.7",
210
210
  "react-select-event": "^5.5.1",
211
211
  "react-test-renderer": "^19.2.7",
212
- "storybook": "10.6.1",
212
+ "storybook": "10.6.2",
213
213
  "stream-browserify": "^3.0.0",
214
214
  "stream-http": "^3.2.0",
215
215
  "timers-browserify": "^2.0.12",
@@ -223,8 +223,8 @@
223
223
  "vitest-when": "^0.10.0",
224
224
  "weak-napi": "^2.0.2",
225
225
  "whatwg-fetch": "^3.6.20",
226
- "vite-config": "0.0.0",
227
- "@sage-bionetworks/aridhia-client": "0.0.1"
226
+ "@sage-bionetworks/aridhia-client": "0.0.1",
227
+ "vite-config": "0.0.0"
228
228
  },
229
229
  "nx": {
230
230
  "targets": {