synapse-react-client 4.0.45 → 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.
- package/dist/SWC.index.js +1 -1
- package/dist/aridhia-queries/AridhiaKeyFactory.d.ts +1 -0
- package/dist/aridhia-queries/AridhiaKeyFactory.d.ts.map +1 -1
- package/dist/aridhia-queries/AridhiaKeyFactory.js +3 -0
- package/dist/aridhia-queries/AridhiaKeyFactory.js.map +1 -1
- package/dist/aridhia-queries/aridhiaTokenExchange.js +6 -6
- package/dist/aridhia-queries/index.d.ts +1 -0
- package/dist/aridhia-queries/index.d.ts.map +1 -1
- package/dist/aridhia-queries/index.js +11 -10
- package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.d.ts +19 -0
- package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.d.ts.map +1 -0
- package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.js +14 -0
- package/dist/aridhia-queries/useGetAridhiaVocabularyTerm.js.map +1 -0
- package/dist/aridhia-queries/useSubmitAridhiaDar.js +2 -2
- package/dist/aridhia-queries/useSubmitAridhiaDar.js.map +1 -1
- package/dist/components/AccessRequirementList/AccessApprovalCheckMark.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessApprovalCheckMark.js +6 -4
- package/dist/components/AccessRequirementList/AccessApprovalCheckMark.js.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewCollaboratorsAndSigningOfficialAccordion.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +11 -8
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
- package/dist/components/AccessTokenPage/AccessTokenPage.js +1 -1
- package/dist/components/AccessTokenPage/AccessTokenPage.js.map +1 -1
- package/dist/components/AccessTokenPage/CreateAccessTokenModal.js +1 -1
- package/dist/components/AccessTokenPage/CreateAccessTokenModal.js.map +1 -1
- package/dist/components/AccountLevelBadges/AccountLevelBadges.js +1 -1
- package/dist/components/AccountLevelBadges/AccountLevelBadges.js.map +1 -1
- package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js +1 -1
- package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js.map +1 -1
- package/dist/components/AclEditor/AclEditor.test-utils.js +3 -5
- package/dist/components/AclEditor/AclEditor.test-utils.js.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.d.ts.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.js +43 -30
- package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
- package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts +6 -2
- package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts.map +1 -1
- package/dist/components/Aridhia/AridhiaDarStatusPopover.js +101 -31
- package/dist/components/Aridhia/AridhiaDarStatusPopover.js.map +1 -1
- package/dist/components/Aridhia/DarWizard/DarSectionForm.d.ts.map +1 -1
- package/dist/components/Aridhia/DarWizard/DarSectionForm.js +17 -13
- package/dist/components/Aridhia/DarWizard/DarSectionForm.js.map +1 -1
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts +3 -3
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.d.ts.map +1 -1
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js +33 -34
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js.map +1 -1
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.d.ts +11 -9
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.d.ts.map +1 -1
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.js +24 -13
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.js.map +1 -1
- package/dist/components/Aridhia/fairFormToRjsf.js +1 -1
- package/dist/components/Aridhia/fairFormToRjsf.js.map +1 -1
- package/dist/components/Authentication/LastLoginInfo.js +3 -3
- package/dist/components/Authentication/LastLoginInfo.js.map +1 -1
- package/dist/components/Authentication/RecoveryCodeForm.js +1 -1
- package/dist/components/Authentication/RecoveryCodeForm.js.map +1 -1
- package/dist/components/Authentication/RecoveryCodeGrid.js.map +1 -1
- package/dist/components/Authentication/TOTPForm.d.ts.map +1 -1
- package/dist/components/Authentication/TOTPForm.js +3 -3
- package/dist/components/Authentication/TOTPForm.js.map +1 -1
- package/dist/components/Authentication/index.d.ts +6 -6
- package/dist/components/Authentication/index.d.ts.map +1 -1
- package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js +1 -1
- package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js.map +1 -1
- package/dist/components/CardContainer/CardContainer.js +7 -7
- package/dist/components/CardContainer/CardContainer.js.map +1 -1
- package/dist/components/CertificationQuiz/CertificationQuiz.js +1 -1
- package/dist/components/CertificationQuiz/CertificationQuiz.js.map +1 -1
- package/dist/components/ChallengeRequirementsModal/ChallengeRequirementsModal.js +1 -1
- package/dist/components/ChallengeRequirementsModal/ChallengeRequirementsModal.js.map +1 -1
- package/dist/components/ChallengeSubmission/AvailableEvaluationQueueList.js +1 -1
- package/dist/components/ChallengeSubmission/AvailableEvaluationQueueList.js.map +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmission.d.ts.map +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmission.js +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmission.js.map +1 -1
- package/dist/components/ChallengeSubmission/EvaluationQueueCurrentRoundInfo.js +1 -1
- package/dist/components/ChallengeSubmission/EvaluationQueueCurrentRoundInfo.js.map +1 -1
- package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js +6 -6
- package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
- package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.d.ts.map +1 -1
- package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.js +4 -4
- package/dist/components/ChallengeTeamWizard/ChallengeTeamTable.js.map +1 -1
- package/dist/components/ChallengeTeamWizard/SelectChallengeTeam.js +4 -4
- package/dist/components/ChallengeTeamWizard/SelectChallengeTeam.js.map +1 -1
- package/dist/components/CitationPopover/CitationPopoverContent.js +4 -4
- package/dist/components/CitationPopover/CitationPopoverContent.js.map +1 -1
- package/dist/components/CitationPopover/CitationPopoverUtils.js +2 -2
- package/dist/components/CitationPopover/CitationPopoverUtils.js.map +1 -1
- package/dist/components/CohortBuilder/CohortBuilder.css +1 -0
- package/dist/components/CohortBuilder/CohortBuilder.d.ts +35 -0
- package/dist/components/CohortBuilder/CohortBuilder.d.ts.map +1 -0
- package/dist/components/CohortBuilder/CohortBuilder.js +108 -0
- package/dist/components/CohortBuilder/CohortBuilder.js.map +1 -0
- package/dist/components/CohortBuilder/CohortBuilder.module.js +10 -0
- package/dist/components/CohortBuilder/CohortBuilder.module.js.map +1 -0
- package/dist/components/CohortBuilder/CohortBuilder.module.scss +20 -0
- package/dist/components/CohortBuilder/CohortFilesPanel.d.ts +16 -0
- package/dist/components/CohortBuilder/CohortFilesPanel.d.ts.map +1 -0
- package/dist/components/CohortBuilder/CohortFilesPanel.js +124 -0
- package/dist/components/CohortBuilder/CohortFilesPanel.js.map +1 -0
- package/dist/components/CohortBuilder/cohortHandOff.d.ts +25 -0
- package/dist/components/CohortBuilder/cohortHandOff.d.ts.map +1 -0
- package/dist/components/CohortBuilder/cohortHandOff.js +26 -0
- package/dist/components/CohortBuilder/cohortHandOff.js.map +1 -0
- package/dist/components/ColumnFilter/ColumnFilter.d.ts.map +1 -1
- package/dist/components/ColumnFilter/ColumnFilter.js +14 -13
- package/dist/components/ColumnFilter/ColumnFilter.js.map +1 -1
- package/dist/components/ComponentCollapse.d.ts.map +1 -1
- package/dist/components/ComponentCollapse.js +2 -1
- package/dist/components/ComponentCollapse.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.d.ts.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +231 -219
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/SyncGridWithSourceButton.d.ts.map +1 -1
- package/dist/components/DataGrid/SyncGridWithSourceButton.js +5 -4
- package/dist/components/DataGrid/SyncGridWithSourceButton.js.map +1 -1
- package/dist/components/DataGrid/columns/AutocompleteColumn.d.ts +11 -2
- package/dist/components/DataGrid/columns/AutocompleteColumn.d.ts.map +1 -1
- package/dist/components/DataGrid/columns/AutocompleteColumn.js +115 -109
- package/dist/components/DataGrid/columns/AutocompleteColumn.js.map +1 -1
- package/dist/components/DataGrid/columns/NumberColumn.js +1 -1
- package/dist/components/DataGrid/columns/NumberColumn.js.map +1 -1
- package/dist/components/DataGrid/columns/NumberOrEnumColumn.d.ts +20 -0
- package/dist/components/DataGrid/columns/NumberOrEnumColumn.d.ts.map +1 -0
- package/dist/components/DataGrid/columns/NumberOrEnumColumn.js +18 -0
- package/dist/components/DataGrid/columns/NumberOrEnumColumn.js.map +1 -0
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js +7 -5
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js.map +1 -1
- package/dist/components/DataGrid/components/ExportCsvFromGridButton.js +4 -4
- package/dist/components/DataGrid/components/ExportCsvFromGridButton.js.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsButton.js +4 -4
- package/dist/components/DataGrid/components/ReorderColumnsButton.js.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js +12 -8
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
- package/dist/components/DataGrid/components/UploadCsvToGridButton.js +1 -1
- package/dist/components/DataGrid/components/UploadCsvToGridButton.js.map +1 -1
- package/dist/components/DataGrid/components/contextMenu.js +3 -3
- package/dist/components/DataGrid/components/contextMenu.js.map +1 -1
- package/dist/components/DataGrid/hooks/useGridUndoRedo.d.ts.map +1 -1
- package/dist/components/DataGrid/hooks/useGridUndoRedo.js +14 -12
- package/dist/components/DataGrid/hooks/useGridUndoRedo.js.map +1 -1
- package/dist/components/DataGrid/hooks/useStack.d.ts +1 -1
- package/dist/components/DataGrid/hooks/useStack.js +2 -2
- package/dist/components/DataGrid/hooks/useStack.js.map +1 -1
- package/dist/components/DataGrid/utils/applyModelChange.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/applyModelChange.js +14 -14
- package/dist/components/DataGrid/utils/applyModelChange.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +47 -42
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DataGrid/utils/extractColumnValidationMessages.js +7 -7
- package/dist/components/DataGrid/utils/extractColumnValidationMessages.js.map +1 -1
- package/dist/components/DataGrid/utils/json-rx/JsonRx.js +2 -2
- package/dist/components/DataGrid/utils/json-rx/JsonRx.js.map +1 -1
- package/dist/components/DataGrid/utils/splitPatch.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/splitPatch.js +22 -13
- package/dist/components/DataGrid/utils/splitPatch.js.map +1 -1
- package/dist/components/DownloadCart/DownloadCartPage.js +1 -1
- package/dist/components/DownloadCart/DownloadCartPage.js.map +1 -1
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.d.ts.map +1 -1
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js +3 -2
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js.map +1 -1
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.js.map +1 -1
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.scss +1 -3
- package/dist/components/DownloadCart/MeetAccessRequirementCard.js +1 -1
- package/dist/components/DownloadCart/MeetAccessRequirementCard.js.map +1 -1
- package/dist/components/EntityBadgeIcons/EntityBadgeIcons.d.ts.map +1 -1
- package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js +16 -10
- package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js.map +1 -1
- package/dist/components/EntityDownloadButton/EntityDownloadButton.js +1 -1
- package/dist/components/EntityDownloadButton/EntityDownloadButton.js.map +1 -1
- package/dist/components/EntityDownloadConfirmation/EntityDownloadConfirmation.js +5 -5
- package/dist/components/EntityDownloadConfirmation/EntityDownloadConfirmation.js.map +1 -1
- package/dist/components/EntityFinder/EntityFinder.js +4 -4
- package/dist/components/EntityFinder/EntityIdTextField.js +1 -1
- package/dist/components/EntityFinder/EntityIdTextField.js.map +1 -1
- package/dist/components/EntityFinder/details/view/DetailsView.d.ts.map +1 -1
- package/dist/components/EntityFinder/details/view/DetailsView.js +4 -4
- package/dist/components/EntityFinder/details/view/DetailsView.js.map +1 -1
- package/dist/components/EntityFinder/tree/VirtualizedTree.d.ts.map +1 -1
- package/dist/components/EntityFinder/tree/VirtualizedTree.js +5 -4
- package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
- package/dist/components/EntityHeaderTable/EntityHeaderTable.js +4 -4
- package/dist/components/EntityHeaderTable/EntityHeaderTable.js.map +1 -1
- package/dist/components/EntityHeaderTable/Filter.d.ts.map +1 -1
- package/dist/components/EntityHeaderTable/Filter.js +1 -1
- package/dist/components/EntityHeaderTable/Filter.js.map +1 -1
- package/dist/components/EntityTreeTable/components/EntityNameCell.d.ts.map +1 -1
- package/dist/components/EntityTreeTable/components/EntityNameCell.js +2 -1
- package/dist/components/EntityTreeTable/components/EntityNameCell.js.map +1 -1
- package/dist/components/EntityUpload/FileUploadProgress.d.ts.map +1 -1
- package/dist/components/EntityUpload/FileUploadProgress.js +11 -7
- package/dist/components/EntityUpload/FileUploadProgress.js.map +1 -1
- package/dist/components/Evaluation/EvaluationRoundEditor.js.map +1 -1
- package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.d.ts.map +1 -1
- package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.js +4 -3
- package/dist/components/Evaluation/round_limits/EvaluationRoundLimitOptionsList.js.map +1 -1
- package/dist/components/ExperimentalMode/ExperimentalMode.js +1 -1
- package/dist/components/ExperimentalMode/ExperimentalMode.js.map +1 -1
- package/dist/components/ExternalFileHandleLink/ExternalFileHandleLink.js +1 -1
- package/dist/components/ExternalFileHandleLink/ExternalFileHandleLink.js.map +1 -1
- package/dist/components/FeaturedDataTabs/FacetPlotsCard.d.ts.map +1 -1
- package/dist/components/FeaturedDataTabs/FacetPlotsCard.js +80 -84
- package/dist/components/FeaturedDataTabs/FacetPlotsCard.js.map +1 -1
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js +2 -1
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js.map +1 -1
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js +2 -1
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js.map +1 -1
- package/dist/components/FormTemplateEditor/FieldLibrary.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/FieldLibrary.js +2 -1
- package/dist/components/FormTemplateEditor/FieldLibrary.js.map +1 -1
- package/dist/components/FormTemplateEditor/FieldLibraryRow.js +4 -4
- package/dist/components/FormTemplateEditor/FieldLibraryRow.js.map +1 -1
- package/dist/components/FormTemplateEditor/FormStructurePanel.js +7 -7
- package/dist/components/FormTemplateEditor/FormStructurePanel.js.map +1 -1
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js +1 -1
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js.map +1 -1
- package/dist/components/FormTemplateEditor/StepCard.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/StepCard.js +15 -10
- package/dist/components/FormTemplateEditor/StepCard.js.map +1 -1
- package/dist/components/FormTemplateEditor/StepFieldRow.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/StepFieldRow.js +11 -6
- package/dist/components/FormTemplateEditor/StepFieldRow.js.map +1 -1
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.js +2 -1
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.js.map +1 -1
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js +2 -2
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js.map +1 -1
- package/dist/components/FullTextSearch/FullTextSearch.js +8 -8
- package/dist/components/GenericCard/CardUtils.js.map +1 -1
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +46 -46
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js.map +1 -1
- package/dist/components/GenericCard/DuoTermTags/duoTerms.js +1 -1
- package/dist/components/GenericCard/DuoTermTags/duoTerms.js.map +1 -1
- package/dist/components/GenericCard/PortalDOI/PortalDOI.js +5 -5
- package/dist/components/GenericCard/PortalDOI/PortalDOI.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +38 -38
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/GoalsV3/GoalsV3.js +1 -1
- package/dist/components/GoalsV3/GoalsV3.js.map +1 -1
- package/dist/components/HelpPopover/HelpPopover.js +1 -1
- package/dist/components/HelpPopover/HelpPopover.js.map +1 -1
- package/dist/components/HexGrid/HexGrid.d.ts +3 -1
- package/dist/components/HexGrid/HexGrid.d.ts.map +1 -1
- package/dist/components/HexGrid/HexGrid.js +14 -13
- package/dist/components/HexGrid/HexGrid.js.map +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
- package/dist/components/IconSvg/IconSvg.js +154 -47
- package/dist/components/IconSvg/IconSvg.js.map +1 -1
- package/dist/components/IconSvg/index.d.ts +1 -1
- package/dist/components/IconSvg/index.d.ts.map +1 -1
- package/dist/components/IconSvg/index.js.map +1 -1
- package/dist/components/JsonSchemaForm/templates/BaseInputTemplate.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/BaseInputTemplate.js +3 -3
- package/dist/components/JsonSchemaForm/templates/BaseInputTemplate.js.map +1 -1
- package/dist/components/JsonSchemaForm/templates/ButtonTemplate.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/ButtonTemplate.js +19 -16
- package/dist/components/JsonSchemaForm/templates/ButtonTemplate.js.map +1 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js +2 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js.map +1 -1
- package/dist/components/JsonSchemaForm/widgets/PhoneWidget.d.ts +9 -0
- package/dist/components/JsonSchemaForm/widgets/PhoneWidget.d.ts.map +1 -0
- package/dist/components/JsonSchemaForm/widgets/PhoneWidget.js +21 -0
- package/dist/components/JsonSchemaForm/widgets/PhoneWidget.js.map +1 -0
- package/dist/components/Markdown/MarkdownCollapse.d.ts.map +1 -1
- package/dist/components/Markdown/MarkdownCollapse.js +3 -1
- package/dist/components/Markdown/MarkdownCollapse.js.map +1 -1
- package/dist/components/Markdown/MarkdownEditor.js +1 -1
- package/dist/components/Markdown/MarkdownEditor.js.map +1 -1
- package/dist/components/Markdown/widget/index.d.ts +1 -1
- package/dist/components/Markdown/widget/index.d.ts.map +1 -1
- package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js +1 -1
- package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js.map +1 -1
- package/dist/components/ModalDownload/ModalDownload.d.ts.map +1 -1
- package/dist/components/ModalDownload/ModalDownload.js +2 -1
- package/dist/components/ModalDownload/ModalDownload.js.map +1 -1
- package/dist/components/OAuthClientManagement/OAuthManagement.js +14 -13
- package/dist/components/OAuthClientManagement/OAuthManagement.js.map +1 -1
- package/dist/components/Plot/BarPlot.js +1 -1
- package/dist/components/Plot/BarPlot.js.map +1 -1
- package/dist/components/Plot/PlotPanelHeader.d.ts +3 -2
- package/dist/components/Plot/PlotPanelHeader.d.ts.map +1 -1
- package/dist/components/Plot/PlotPanelHeader.js.map +1 -1
- package/dist/components/PortalList/PortalCard.d.ts.map +1 -1
- package/dist/components/PortalList/PortalCard.js +6 -5
- package/dist/components/PortalList/PortalCard.js.map +1 -1
- package/dist/components/PortalList/PortalList.js +4 -4
- package/dist/components/PortalList/PortalList.js.map +1 -1
- package/dist/components/ProgrammaticTableDownload/ProgrammaticTableDownload.js +1 -1
- package/dist/components/ProgrammaticTableDownload/ProgrammaticTableDownload.js.map +1 -1
- package/dist/components/ProjectVisibilityChip/ProjectVisibilityChip.js +6 -6
- package/dist/components/ProvenanceGraph/ProvenanceExternalIcon.js +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceExternalIcon.js.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js +3 -3
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.js +31 -30
- package/dist/components/QueryBuilder/FilterConditionRow.js.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.js +91 -75
- package/dist/components/QueryBuilder/FilterGroupNode.js.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderControls.css +1 -1
- package/dist/components/QueryBuilder/QueryBuilderControls.d.ts.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderControls.js +91 -79
- package/dist/components/QueryBuilder/QueryBuilderControls.js.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderControls.module.js +11 -11
- package/dist/components/QueryBuilder/QueryBuilderControls.module.js.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderControls.module.scss +2 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts +2 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.js.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderLimits.d.ts +18 -0
- package/dist/components/QueryBuilder/queryBuilderLimits.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderLimits.js +38 -0
- package/dist/components/QueryBuilder/queryBuilderLimits.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts +0 -8
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderMetadata.js +6 -9
- package/dist/components/QueryBuilder/queryBuilderMetadata.js.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts +5 -4
- package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderTranslation.js +58 -33
- package/dist/components/QueryBuilder/queryBuilderTranslation.js.map +1 -1
- package/dist/components/QueryBuilder/useQBCombinedSql.d.ts.map +1 -1
- package/dist/components/QueryBuilder/useQBCombinedSql.js +4 -4
- package/dist/components/QueryBuilder/useQBCombinedSql.js.map +1 -1
- package/dist/components/QueryBuilder/useQBValueDisplayName.d.ts.map +1 -1
- package/dist/components/QueryBuilder/useQBValueDisplayName.js +5 -5
- package/dist/components/QueryBuilder/useQBValueDisplayName.js.map +1 -1
- package/dist/components/QueryCountButton/QueryCountButton.js +5 -5
- package/dist/components/QueryCountButton/QueryCountButton.js.map +1 -1
- package/dist/components/QuerySortSelector.js +5 -5
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js +21 -21
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js.map +1 -1
- package/dist/components/QueryWrapper/AggregateQueryErrorNotice.d.ts +20 -0
- package/dist/components/QueryWrapper/AggregateQueryErrorNotice.d.ts.map +1 -0
- package/dist/components/QueryWrapper/AggregateQueryErrorNotice.js +50 -0
- package/dist/components/QueryWrapper/AggregateQueryErrorNotice.js.map +1 -0
- package/dist/components/QueryWrapper/TableQueryUseQueryOptions.d.ts +5 -3
- package/dist/components/QueryWrapper/TableQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/QueryWrapper/TableQueryUseQueryOptions.js +7 -3
- package/dist/components/QueryWrapper/TableQueryUseQueryOptions.js.map +1 -1
- package/dist/components/QueryWrapper/downloadListFiles.d.ts +25 -0
- package/dist/components/QueryWrapper/downloadListFiles.d.ts.map +1 -0
- package/dist/components/QueryWrapper/downloadListFiles.js +39 -0
- package/dist/components/QueryWrapper/downloadListFiles.js.map +1 -0
- package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.d.ts +16 -0
- package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.d.ts.map +1 -0
- package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.js +50 -0
- package/dist/components/QueryWrapper/useAddSelectedRowsToDownloadList.js.map +1 -0
- package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.d.ts +4 -1
- package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.d.ts.map +1 -1
- package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.js +15 -28
- package/dist/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery.js.map +1 -1
- package/dist/components/QueryWrapper/useOnQueryDataChange.d.ts.map +1 -1
- package/dist/components/QueryWrapper/useOnQueryDataChange.js +7 -6
- package/dist/components/QueryWrapper/useOnQueryDataChange.js.map +1 -1
- package/dist/components/QueryWrapperErrorBoundary.d.ts +3 -1
- package/dist/components/QueryWrapperErrorBoundary.d.ts.map +1 -1
- package/dist/components/QueryWrapperErrorBoundary.js +26 -21
- package/dist/components/QueryWrapperErrorBoundary.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/LastUpdatedOn.js +7 -7
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +2 -2
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +34 -32
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js +7 -7
- package/dist/components/QueryWrapperPlotNav/UseRowSet.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/UseRowSet.js +12 -12
- package/dist/components/QueryWrapperPlotNav/UseRowSet.js.map +1 -1
- package/dist/components/ReleaseCard/ReleaseCardLarge.js +5 -5
- package/dist/components/ReleaseCard/ReleaseCardLarge.js.map +1 -1
- package/dist/components/RowDataTable/CategorizedRowDataTable.css +1 -0
- package/dist/components/RowDataTable/CategorizedRowDataTable.d.ts +33 -0
- package/dist/components/RowDataTable/CategorizedRowDataTable.d.ts.map +1 -0
- package/dist/components/RowDataTable/CategorizedRowDataTable.js +64 -0
- package/dist/components/RowDataTable/CategorizedRowDataTable.js.map +1 -0
- package/dist/components/RowDataTable/CategorizedRowDataTable.module.js +8 -0
- package/dist/components/RowDataTable/CategorizedRowDataTable.module.js.map +1 -0
- package/dist/components/RowDataTable/CategorizedRowDataTable.module.scss +18 -0
- package/dist/components/RowDataTable/RowDataTable.d.ts +13 -0
- package/dist/components/RowDataTable/RowDataTable.d.ts.map +1 -1
- package/dist/components/RowDataTable/RowDataTable.js +25 -8
- package/dist/components/RowDataTable/RowDataTable.js.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.js +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.js.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.d.ts.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.js +2 -2
- package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.js.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/template/ObjectFieldTemplate.js +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/template/ObjectFieldTemplate.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts +17 -9
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +39 -30
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js +24 -24
- package/dist/components/SetAccessRequirementCommonFields/SetAccessRequirementCommonFields.js.map +1 -1
- package/dist/components/ShareThisPage/ShareThisPage.js +4 -4
- package/dist/components/ShareThisPage/ShareThisPage.js.map +1 -1
- package/dist/components/StandaloneQueryWrapper/StandaloneQueryWrapper.js +8 -8
- package/dist/components/SustainabilityScorecard/DialLayout.js +1 -1
- package/dist/components/SustainabilityScorecard/DialLayout.js.map +1 -1
- package/dist/components/SustainabilityScorecard/SustainabilityScorecard.js +1 -1
- package/dist/components/SustainabilityScorecard/SustainabilityScorecard.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.js +1 -1
- package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.js +2 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChatMessage.js +1 -1
- package/dist/components/SynapseChat/SynapseChatMessage.js.map +1 -1
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js +1 -1
- package/dist/components/SynapseChat/components/ChatInputArea/ChatInputArea.js.map +1 -1
- package/dist/components/SynapseFooter/SynapseFooter.js +1 -1
- package/dist/components/SynapseFooter/SynapseFooter.js.map +1 -1
- package/dist/components/SynapseForm/NavButtons.js.map +1 -1
- package/dist/components/SynapseForm/StepsSideNav.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseFeaturedDatasetItem.js +1 -1
- package/dist/components/SynapseHomepageV2/SynapseFeaturedDatasetItem.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.d.ts.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.js +2 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseInActionItem.js +4 -4
- package/dist/components/SynapseHomepageV2/SynapseInActionItem.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseTrendingProjectsItem.js +1 -1
- package/dist/components/SynapseHomepageV2/SynapseTrendingProjectsItem.js.map +1 -1
- package/dist/components/SynapseNavDrawer/SynapseNavDrawer.d.ts.map +1 -1
- package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js +4 -1
- package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js.map +1 -1
- package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js +1 -1
- package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js.map +1 -1
- package/dist/components/SynapseSearchPageResults/HighlightedTypography.js +1 -1
- package/dist/components/SynapseSearchPageResults/HighlightedTypography.js.map +1 -1
- package/dist/components/SynapseSearchPageResults/SearchFacetPanel/SearchFacetPanelUtils.d.ts.map +1 -1
- package/dist/components/SynapseSearchPageResults/SearchFacetPanel/SearchFacetPanelUtils.js +3 -3
- package/dist/components/SynapseSearchPageResults/SearchFacetPanel/SearchFacetPanelUtils.js.map +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchPageResults.js +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchPageResults.js.map +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.d.ts.map +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js +12 -9
- package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js.map +1 -1
- package/dist/components/SynapseTable/RowSelection/RowSelectionControls.d.ts.map +1 -1
- package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +38 -44
- package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js.map +1 -1
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.js +4 -4
- package/dist/components/SynapseTable/SqlEditor.js +7 -7
- package/dist/components/SynapseTable/SynapseTable.js +8 -8
- package/dist/components/SynapseTable/SynapseTable.js.map +1 -1
- package/dist/components/SynapseTable/SynapseTableRenderers.d.ts.map +1 -1
- package/dist/components/SynapseTable/SynapseTableRenderers.js +73 -72
- package/dist/components/SynapseTable/SynapseTableRenderers.js.map +1 -1
- package/dist/components/SynapseTable/SynapseTableUtils.js +1 -1
- package/dist/components/SynapseTable/SynapseTableUtils.js.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js +44 -45
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js.map +1 -1
- package/dist/components/SynapseTable/datasets/DatasetEditorVersionCell.js +1 -1
- package/dist/components/SynapseTable/datasets/DatasetEditorVersionCell.js.map +1 -1
- package/dist/components/SynapseTable/datasets/DatasetItemsEditor.d.ts.map +1 -1
- package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js +6 -6
- package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
- package/dist/components/SynapseTable/export/ExportToAnalysisPlatformDialog.js +4 -4
- package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.js +12 -12
- package/dist/components/SynapseTable/export/ExternalPlatformActionsRequiredPrecheck.js.map +1 -1
- package/dist/components/SynapseTable/table-top/ColumnSelection.js +6 -6
- package/dist/components/SynapseTable/table-top/DownloadOptions.d.ts +0 -1
- package/dist/components/SynapseTable/table-top/DownloadOptions.d.ts.map +1 -1
- package/dist/components/SynapseTable/table-top/DownloadOptions.js +64 -57
- package/dist/components/SynapseTable/table-top/DownloadOptions.js.map +1 -1
- package/dist/components/SynapseTable/usePrefetchTableData.d.ts.map +1 -1
- package/dist/components/SynapseTable/usePrefetchTableData.js +3 -3
- package/dist/components/SynapseTable/usePrefetchTableData.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js +2 -2
- package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js +1 -1
- package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorTestUtils.js +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorTestUtils.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js +2 -2
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditorUtils.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js +59 -59
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.d.ts.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.js +6 -4
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaFormActions.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/DatetimeSchema.js +1 -1
- package/dist/components/TableColumnSchemaEditor/Validators/DatetimeSchema.js.map +1 -1
- package/dist/components/TanStackTable/ColumnHeader.js +1 -1
- package/dist/components/TanStackTable/ColumnHeader.js.map +1 -1
- package/dist/components/TanStackTable/ColumnHeaderEnumFilter.js +1 -1
- package/dist/components/TanStackTable/ColumnHeaderEnumFilter.js.map +1 -1
- package/dist/components/TanStackTable/StyledTanStackTable.d.ts.map +1 -1
- package/dist/components/TanStackTable/StyledTanStackTable.js +1 -4
- package/dist/components/TanStackTable/StyledTanStackTable.js.map +1 -1
- package/dist/components/TeamSubjectsSelector/TeamBadgeOrError.js +1 -1
- package/dist/components/TeamSubjectsSelector/TeamBadgeOrError.js.map +1 -1
- package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.d.ts.map +1 -1
- package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.js +4 -3
- package/dist/components/TeamSubjectsSelector/TeamSubjectsSelector.js.map +1 -1
- package/dist/components/TermsAndConditions/TermsAndConditions.js.map +1 -1
- package/dist/components/TotalQueryResults.js +14 -14
- package/dist/components/Webhook/WebhookDashboard.d.ts.map +1 -1
- package/dist/components/Webhook/WebhookDashboard.js +3 -3
- package/dist/components/Webhook/WebhookDashboard.js.map +1 -1
- package/dist/components/dataaccess/AccessRequirementDashboard.js +4 -4
- package/dist/components/dataaccess/AccessRequirementDashboard.js.map +1 -1
- package/dist/components/dataaccess/AccessRequirementTable.js +1 -1
- package/dist/components/dataaccess/AccessRequirementTable.js.map +1 -1
- package/dist/components/dataaccess/EDucTemplateTable.d.ts.map +1 -1
- package/dist/components/dataaccess/EDucTemplateTable.js +13 -11
- package/dist/components/dataaccess/EDucTemplateTable.js.map +1 -1
- package/dist/components/dataaccess/FormTemplateTable.js +6 -6
- package/dist/components/dataaccess/FormTemplateTable.js.map +1 -1
- package/dist/components/dataaccess/ReviewerDashboard.js +17 -17
- package/dist/components/dataaccess/ReviewerDashboard.js.map +1 -1
- package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js +4 -4
- package/dist/components/doi/CreateOrUpdateDoiModal.js +1 -1
- package/dist/components/doi/CreateOrUpdateDoiModal.js.map +1 -1
- package/dist/components/download_list/DownloadConfirmationUtils.d.ts +5 -1
- package/dist/components/download_list/DownloadConfirmationUtils.d.ts.map +1 -1
- package/dist/components/download_list/DownloadConfirmationUtils.js +2 -2
- package/dist/components/download_list/DownloadConfirmationUtils.js.map +1 -1
- package/dist/components/download_list/DownloadDetails.d.ts.map +1 -1
- package/dist/components/download_list/DownloadDetails.js +12 -10
- package/dist/components/download_list/DownloadDetails.js.map +1 -1
- package/dist/components/entity/metadata/AnnotationsTable.js +1 -1
- package/dist/components/entity/metadata/AnnotationsTable.js.map +1 -1
- package/dist/components/entity/page/CreatedByModifiedBy.js +1 -1
- package/dist/components/entity/page/CreatedByModifiedBy.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
- package/dist/components/error/ErrorBanner.d.ts.map +1 -1
- package/dist/components/error/ErrorBanner.js +49 -46
- package/dist/components/error/ErrorBanner.js.map +1 -1
- package/dist/components/error/ErrorChip.d.ts.map +1 -1
- package/dist/components/error/ErrorChip.js +2 -1
- package/dist/components/error/ErrorChip.js.map +1 -1
- package/dist/components/file/upload/MultiFileUploadProgress.js +5 -5
- package/dist/components/row_renderers/Dataset.d.ts.map +1 -1
- package/dist/components/row_renderers/Dataset.js +6 -6
- package/dist/components/row_renderers/Dataset.js.map +1 -1
- package/dist/components/row_renderers/Funder.js +1 -1
- package/dist/components/row_renderers/Funder.js.map +1 -1
- package/dist/components/table/CsvPreview/CreateTableFromCsvDialog.js +14 -14
- package/dist/components/table/CsvPreview/CsvPreviewWithOptions.js +4 -4
- package/dist/components/table/CsvPreview/CsvPreviewWithOptions.js.map +1 -1
- package/dist/components/widgets/ElementWithTooltip.d.ts +6 -1
- package/dist/components/widgets/ElementWithTooltip.d.ts.map +1 -1
- package/dist/components/widgets/ElementWithTooltip.js +22 -14
- package/dist/components/widgets/ElementWithTooltip.js.map +1 -1
- package/dist/components/widgets/RangeSlider/RangeSlider.d.ts.map +1 -1
- package/dist/components/widgets/RangeSlider/RangeSlider.js +1 -1
- package/dist/components/widgets/RangeSlider/RangeSlider.js.map +1 -1
- package/dist/components/widgets/SynapseImage.js +1 -1
- package/dist/components/widgets/SynapseImage.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts +16 -5
- package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js +115 -102
- package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetPlotLegendList.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/FacetPlotLegendList.js +4 -2
- package/dist/components/widgets/facet-nav/FacetPlotLegendList.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetPlotLegendTable.js +1 -1
- package/dist/components/widgets/facet-nav/FacetPlotLegendTable.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetPlotLegendUtils.d.ts +2 -0
- package/dist/components/widgets/facet-nav/FacetPlotLegendUtils.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/FacetPlotLegendUtils.js.map +1 -1
- package/dist/components/widgets/facet-nav/PlotsContainer.d.ts +7 -0
- package/dist/components/widgets/facet-nav/PlotsContainer.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/PlotsContainer.js +47 -45
- package/dist/components/widgets/facet-nav/PlotsContainer.js.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js +4 -4
- package/dist/components/widgets/facet-nav/useFacetPlots.d.ts +3 -2
- package/dist/components/widgets/facet-nav/useFacetPlots.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/useFacetPlots.js +16 -15
- package/dist/components/widgets/facet-nav/useFacetPlots.js.map +1 -1
- package/dist/components/widgets/query-filter/CombinedRangeFacetFilter.js +4 -4
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts +2 -2
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js +62 -60
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts +2 -0
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js +10 -10
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts +1 -0
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js +2 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUtils.d.ts +3 -2
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUtils.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUtils.js.map +1 -1
- package/dist/components/widgets/query-filter/FacetFilterControls.d.ts +3 -2
- package/dist/components/widgets/query-filter/FacetFilterControls.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/FacetFilterControls.js +63 -62
- package/dist/components/widgets/query-filter/FacetFilterControls.js.map +1 -1
- package/dist/components/widgets/query-filter/JsonColumnFacetFilters.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/JsonColumnFacetFilters.js +30 -29
- package/dist/components/widgets/query-filter/JsonColumnFacetFilters.js.map +1 -1
- package/dist/components/widgets/query-filter/RangeFacetFilter.js +5 -5
- package/dist/features/curator/dashboard/components/NextStepButton.d.ts.map +1 -1
- package/dist/features/curator/dashboard/components/NextStepButton.js +7 -6
- package/dist/features/curator/dashboard/components/NextStepButton.js.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +8 -8
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js +4 -4
- package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksPage.js +4 -4
- package/dist/features/entity/metadata-task/components/MetadataTasksPage.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js.map +1 -1
- package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js +4 -4
- package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js.map +1 -1
- package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js +1 -1
- package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js.map +1 -1
- package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js +1 -1
- package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js.map +1 -1
- package/dist/features/entity/metadata-task/create-task/curationTaskFlowRoutes.js +10 -10
- package/dist/features/entity/metadata-task/create-task/curationTaskFlowRoutes.js.map +1 -1
- package/dist/features/team/invitation/components/OpenInvitationsToUserCard.js +1 -1
- package/dist/features/team/invitation/components/OpenInvitationsToUserCard.js.map +1 -1
- package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.d.ts +53 -0
- package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.d.ts.map +1 -0
- package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.js +391 -0
- package/dist/mocks/cohortBuilder/cohortBuilderMockProfiles.js.map +1 -0
- package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.d.ts +41 -0
- package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.d.ts.map +1 -0
- package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.js +379 -0
- package/dist/mocks/cohortBuilder/cohortBuilderMockQueryEngine.js.map +1 -0
- package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.d.ts +26 -0
- package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.d.ts.map +1 -0
- package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.js +112 -0
- package/dist/mocks/cohortBuilder/cohortBuilderSyntheticData.js.map +1 -0
- package/dist/mocks/mockAnnotationColumns.d.ts.map +1 -1
- package/dist/mocks/mockAnnotationColumns.js +1 -1
- package/dist/mocks/mockAnnotationColumns.js.map +1 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +17 -0
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.js +62 -42
- package/dist/mocks/msw/handlers/aridhiaHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts +21 -2
- package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/asyncJobHandlers.js +30 -22
- package/dist/mocks/msw/handlers/asyncJobHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/cohortBuilderHandlers.d.ts +27 -0
- package/dist/mocks/msw/handlers/cohortBuilderHandlers.d.ts.map +1 -0
- package/dist/mocks/msw/handlers/cohortBuilderHandlers.js +158 -0
- package/dist/mocks/msw/handlers/cohortBuilderHandlers.js.map +1 -0
- package/dist/mocks/msw/handlers/entityHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/entityHandlers.js +70 -67
- package/dist/mocks/msw/handlers/entityHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/gridHandlers.js +2 -2
- package/dist/mocks/msw/handlers/gridHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/subscriptionHandlers.js +1 -1
- package/dist/mocks/msw/handlers/subscriptionHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/userProfileHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/userProfileHandlers.js +2 -2
- package/dist/mocks/msw/handlers/userProfileHandlers.js.map +1 -1
- package/dist/mocks/msw/server.d.ts.map +1 -1
- package/dist/mocks/msw/server.js +4 -2
- package/dist/mocks/msw/server.js.map +1 -1
- package/dist/mocks/query/mockColumnCategoryTable.d.ts +19 -0
- package/dist/mocks/query/mockColumnCategoryTable.d.ts.map +1 -0
- package/dist/mocks/query/mockColumnCategoryTable.js +188 -0
- package/dist/mocks/query/mockColumnCategoryTable.js.map +1 -0
- package/dist/stories/ColorPaletteInspector.d.ts.map +1 -1
- package/dist/stories/ColorPaletteInspector.js +2 -2
- package/dist/stories/ColorPaletteInspector.js.map +1 -1
- package/dist/style/components/facet_nav/_facet-nav-panel.scss +8 -0
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/auth/useOIDC.js +2 -2
- package/dist/synapse-queries/auth/useOIDC.js.map +1 -1
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js +2 -2
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js.map +1 -1
- package/dist/synapse-queries/challenge/useChallenge.js +2 -2
- package/dist/synapse-queries/challenge/useChallenge.js.map +1 -1
- package/dist/synapse-queries/chat/useChat.js +8 -8
- package/dist/synapse-queries/chat/useChat.js.map +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.js +10 -10
- package/dist/synapse-queries/curation/task/useCurationTask.js.map +1 -1
- package/dist/synapse-queries/dataaccess/useAccessRequirements.js +24 -24
- package/dist/synapse-queries/dataaccess/useAccessRequirements.js.map +1 -1
- package/dist/synapse-queries/dataaccess/useDataAccessSubmission.js +4 -4
- package/dist/synapse-queries/dataaccess/useDataAccessSubmission.js.map +1 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js +6 -6
- package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
- package/dist/synapse-queries/dataaccess/useFormTemplate.js +4 -4
- package/dist/synapse-queries/dataaccess/useFormTemplate.js.map +1 -1
- package/dist/synapse-queries/download/index.js +2 -2
- package/dist/synapse-queries/download/useDownloadList.d.ts +5 -0
- package/dist/synapse-queries/download/useDownloadList.d.ts.map +1 -1
- package/dist/synapse-queries/download/useDownloadList.js +14 -13
- package/dist/synapse-queries/download/useDownloadList.js.map +1 -1
- package/dist/synapse-queries/entity/useEntity.d.ts.map +1 -1
- package/dist/synapse-queries/entity/useEntity.js +20 -20
- package/dist/synapse-queries/entity/useEntity.js.map +1 -1
- package/dist/synapse-queries/entity/useExportToADWorkbench.d.ts.map +1 -1
- package/dist/synapse-queries/entity/useExportToADWorkbench.js +2 -1
- package/dist/synapse-queries/entity/useExportToADWorkbench.js.map +1 -1
- package/dist/synapse-queries/entity/useExportToCavatica.d.ts.map +1 -1
- package/dist/synapse-queries/entity/useExportToCavatica.js +3 -2
- package/dist/synapse-queries/entity/useExportToCavatica.js.map +1 -1
- package/dist/synapse-queries/entity/useExportToPluto.d.ts.map +1 -1
- package/dist/synapse-queries/entity/useExportToPluto.js +2 -1
- package/dist/synapse-queries/entity/useExportToPluto.js.map +1 -1
- package/dist/synapse-queries/entity/useGetQueryResultBundle.d.ts.map +1 -1
- package/dist/synapse-queries/entity/useGetQueryResultBundle.js +4 -7
- package/dist/synapse-queries/entity/useGetQueryResultBundle.js.map +1 -1
- package/dist/synapse-queries/forum/useReply.js +6 -6
- package/dist/synapse-queries/forum/useReply.js.map +1 -1
- package/dist/synapse-queries/forum/useThread.js +14 -14
- package/dist/synapse-queries/forum/useThread.js.map +1 -1
- package/dist/synapse-queries/grid/useEstablishWebsocketConnection.js +1 -1
- package/dist/synapse-queries/grid/useEstablishWebsocketConnection.js.map +1 -1
- package/dist/synapse-queries/grid/useGridSession.js +4 -4
- package/dist/synapse-queries/grid/useGridSession.js.map +1 -1
- package/dist/synapse-queries/index.js +177 -176
- package/dist/synapse-queries/oauth/useOAuthClient.js +9 -9
- package/dist/synapse-queries/oauth/useOAuthClient.js.map +1 -1
- package/dist/synapse-queries/portal/usePortal.js +7 -7
- package/dist/synapse-queries/portal/usePortal.js.map +1 -1
- package/dist/synapse-queries/subscription/useSubscription.js +4 -4
- package/dist/synapse-queries/subscription/useSubscription.js.map +1 -1
- package/dist/synapse-queries/table/useTableUpdateTransaction.js +2 -2
- package/dist/synapse-queries/table/useTableUpdateTransaction.js.map +1 -1
- package/dist/synapse-queries/team/useTeam.js +2 -2
- package/dist/synapse-queries/team/useTeam.js.map +1 -1
- package/dist/synapse-queries/team/useTeamList.d.ts.map +1 -1
- package/dist/synapse-queries/team/useTeamList.js +3 -3
- package/dist/synapse-queries/team/useTeamList.js.map +1 -1
- package/dist/synapse-queries/team/useTeamMembers.js +8 -8
- package/dist/synapse-queries/team/useTeamMembers.js.map +1 -1
- package/dist/synapse-queries/termsOfService/useTermsOfService.js +2 -2
- package/dist/synapse-queries/termsOfService/useTermsOfService.js.map +1 -1
- package/dist/synapse-queries/trash/useTrashCan.js +4 -4
- package/dist/synapse-queries/trash/useTrashCan.js.map +1 -1
- package/dist/synapse-queries/user/useCertificationQuiz.js +2 -2
- package/dist/synapse-queries/user/useCertificationQuiz.js.map +1 -1
- package/dist/synapse-queries/user/useFavorites.js +4 -4
- package/dist/synapse-queries/user/useFavorites.js.map +1 -1
- package/dist/synapse-queries/user/useGetUserChallenges.d.ts.map +1 -1
- package/dist/synapse-queries/user/useGetUserChallenges.js.map +1 -1
- package/dist/synapse-queries/user/useRevokeCertification.js +2 -2
- package/dist/synapse-queries/user/useRevokeCertification.js.map +1 -1
- package/dist/synapse-queries/wiki/useWiki.js +10 -10
- package/dist/synapse-queries/wiki/useWiki.js.map +1 -1
- package/dist/theme/DefaultTheme.d.ts.map +1 -1
- package/dist/theme/DefaultTheme.js +4 -1
- package/dist/theme/DefaultTheme.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/APIConstants.d.ts.map +1 -1
- package/dist/utils/APIConstants.js.map +1 -1
- package/dist/utils/AppUtils/AppUtils.js +1 -1
- package/dist/utils/AppUtils/AppUtils.js.map +1 -1
- package/dist/utils/ContentTypeUtils.js +4 -4
- package/dist/utils/ContentTypeUtils.js.map +1 -1
- package/dist/utils/PermissionLevelToAccessType.js +1 -1
- package/dist/utils/PermissionLevelToAccessType.js.map +1 -1
- package/dist/utils/analytics/useGoogleAnalytics.js +1 -1
- package/dist/utils/analytics/useGoogleAnalytics.js.map +1 -1
- package/dist/utils/context/DocumentMetadataContext.js +1 -1
- package/dist/utils/context/DocumentMetadataContext.js.map +1 -1
- package/dist/utils/functions/AccessControlListUtils.d.ts.map +1 -1
- package/dist/utils/functions/AccessControlListUtils.js +3 -3
- package/dist/utils/functions/AccessControlListUtils.js.map +1 -1
- package/dist/utils/functions/ArrayUtils.js +2 -2
- package/dist/utils/functions/ArrayUtils.js.map +1 -1
- package/dist/utils/functions/EntityTypeUtils.d.ts.map +1 -1
- package/dist/utils/functions/EntityTypeUtils.js.map +1 -1
- package/dist/utils/functions/FileHandleUtils.js +1 -1
- package/dist/utils/functions/FileHandleUtils.js.map +1 -1
- package/dist/utils/functions/RegularExpressions.js +1 -1
- package/dist/utils/functions/RegularExpressions.js.map +1 -1
- package/dist/utils/functions/StringUtils.d.ts.map +1 -1
- package/dist/utils/functions/StringUtils.js +1 -2
- package/dist/utils/functions/StringUtils.js.map +1 -1
- package/dist/utils/functions/deepLinkingUtils.js +2 -2
- package/dist/utils/functions/deepLinkingUtils.js.map +1 -1
- package/dist/utils/functions/enumerationFacet.d.ts +26 -0
- package/dist/utils/functions/enumerationFacet.d.ts.map +1 -0
- package/dist/utils/functions/enumerationFacet.js +27 -0
- package/dist/utils/functions/enumerationFacet.js.map +1 -0
- package/dist/utils/functions/facetCountUtils.d.ts +12 -0
- package/dist/utils/functions/facetCountUtils.d.ts.map +1 -0
- package/dist/utils/functions/facetCountUtils.js +9 -0
- package/dist/utils/functions/facetCountUtils.js.map +1 -0
- package/dist/utils/functions/getEndpoint.js.map +1 -1
- package/dist/utils/functions/getUserData.js +1 -1
- package/dist/utils/functions/getUserData.js.map +1 -1
- package/dist/utils/functions/queryUtils.d.ts +1 -1
- package/dist/utils/functions/queryUtils.d.ts.map +1 -1
- package/dist/utils/functions/queryUtils.js +26 -22
- package/dist/utils/functions/queryUtils.js.map +1 -1
- package/dist/utils/functions/testDownloadSpeed.d.ts.map +1 -1
- package/dist/utils/functions/testDownloadSpeed.js +17 -26
- package/dist/utils/functions/testDownloadSpeed.js.map +1 -1
- package/dist/utils/functions/unCamelCase.js +1 -1
- package/dist/utils/functions/unCamelCase.js.map +1 -1
- package/dist/utils/hooks/useGetInfoFromIds.js +5 -5
- package/dist/utils/hooks/useGetInfoFromIds.js.map +1 -1
- package/dist/utils/hooks/useImmutableTableQuery/TableQueryReducerActions.js +1 -1
- package/dist/utils/hooks/useImmutableTableQuery/TableQueryReducerActions.js.map +1 -1
- package/dist/utils/hooks/useLogin.d.ts.map +1 -1
- package/dist/utils/hooks/useLogin.js +5 -5
- package/dist/utils/hooks/useLogin.js.map +1 -1
- package/dist/utils/hooks/useUploadFileEntity/useCreateFolderPath.js.map +1 -1
- package/dist/utils/jsonschema/collectTopLevelProperties.d.ts +6 -0
- package/dist/utils/jsonschema/collectTopLevelProperties.d.ts.map +1 -1
- package/dist/utils/jsonschema/collectTopLevelProperties.js +1 -1
- package/dist/utils/jsonschema/collectTopLevelProperties.js.map +1 -1
- package/dist/utils/jsonschema/getNumberOrEnumInfo.d.ts +22 -0
- package/dist/utils/jsonschema/getNumberOrEnumInfo.d.ts.map +1 -0
- package/dist/utils/jsonschema/getNumberOrEnumInfo.js +39 -0
- package/dist/utils/jsonschema/getNumberOrEnumInfo.js.map +1 -0
- package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.d.ts +1 -0
- package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.d.ts.map +1 -1
- package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.js +1 -1
- package/dist/utils/jsonschema/getOnlyNonNullOneOfOption.js.map +1 -1
- package/dist/utils/jsonschema/getSchemaPropertyInfo.d.ts +5 -0
- package/dist/utils/jsonschema/getSchemaPropertyInfo.d.ts.map +1 -1
- package/dist/utils/jsonschema/getSchemaPropertyInfo.js +30 -15
- package/dist/utils/jsonschema/getSchemaPropertyInfo.js.map +1 -1
- package/dist/utils/jsonschema/submissionContext.js +2 -2
- package/dist/utils/jsonschema/submissionContext.js.map +1 -1
- package/package.json +7 -6
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import "../../../utils/SynapseConstants.js";
|
|
2
|
+
import { BackendDestinationEnum as e, MOCK_REPO_ORIGIN as t, getEndpoint as n } from "../../../utils/functions/getEndpoint.js";
|
|
3
|
+
import { ENTITY_HEADERS as r, ENTITY_ID as i, TABLE_QUERY_ASYNC_GET as a, TABLE_QUERY_ASYNC_START as o } from "../../../utils/APIConstants.js";
|
|
4
|
+
import { AsyncJobFailure as s, dispatchEntry as c, generateAsyncJobHandlers as l } from "./asyncJobHandlers.js";
|
|
5
|
+
import { getEntityHandlers as u } from "./entityHandlers.js";
|
|
6
|
+
import { DATA_REFERENCE_COLUMN_NAME as d, ELITE_MOCK_PROFILE as f, PARTICIPANT_ID_COLUMN_NAME as p, REFERENCE_TYPE_COLUMN_NAME as m, STUDY_COLUMN_NAME as h } from "../../cohortBuilder/cohortBuilderMockProfiles.js";
|
|
7
|
+
import { createCohortBuilderSyntheticData as g } from "../../cohortBuilder/cohortBuilderSyntheticData.js";
|
|
8
|
+
import { getCohortBuilderColumnModels as _, runCohortBuilderMockQuery as v } from "../../cohortBuilder/cohortBuilderMockQueryEngine.js";
|
|
9
|
+
import { ColumnSingleValueFilterOperator as y } from "@sage-bionetworks/synapse-types";
|
|
10
|
+
import { HttpResponse as b, http as x } from "msw";
|
|
11
|
+
//#region src/mocks/msw/handlers/cohortBuilderHandlers.ts
|
|
12
|
+
var S = "syn_MATERIAL", C = "/repo/v1/download/list/add/async/start", w = (e) => `/repo/v1/download/list/add/async/get/${e}`, T = "/repo/v1/download/list/add/stats/async/start", E = (e) => `/repo/v1/download/list/add/stats/async/get/${e}`, D = "/repo/v1/download/list/add", O = 10 * 1024 * 1024, k = "90000003", A = /* @__PURE__ */ new Map();
|
|
13
|
+
function j(e) {
|
|
14
|
+
let t = A.get(e);
|
|
15
|
+
return t || (t = g(e), A.set(e, t)), t;
|
|
16
|
+
}
|
|
17
|
+
function M(e) {
|
|
18
|
+
let { profile: t, dataAttributeNames: n } = e, r = _(e), i = [
|
|
19
|
+
p,
|
|
20
|
+
h,
|
|
21
|
+
...t.participantAttributes.map((e) => e.name)
|
|
22
|
+
].join(", "), a = n.map((e) => `CAST(CONCAT('[', GROUP_CONCAT(DISTINCT CONCAT('"', ${e}, '"')), ']') AS <STRING_LIST column>) AS ${e}`).join(", "), o = [
|
|
23
|
+
m,
|
|
24
|
+
h,
|
|
25
|
+
...n
|
|
26
|
+
].join(", "), s = (e, t, n, r) => ({
|
|
27
|
+
id: e,
|
|
28
|
+
name: t,
|
|
29
|
+
concreteType: "org.sagebionetworks.repo.model.table.VirtualTable",
|
|
30
|
+
parentId: "syn90000000",
|
|
31
|
+
etag: "00000000-0000-0000-0000-000000000000",
|
|
32
|
+
createdOn: "2026-10-01T00:00:00.000Z",
|
|
33
|
+
modifiedOn: "2026-10-01T00:00:00.000Z",
|
|
34
|
+
createdBy: "0",
|
|
35
|
+
modifiedBy: "0",
|
|
36
|
+
versionNumber: 1,
|
|
37
|
+
versionLabel: "in progress",
|
|
38
|
+
isLatestVersion: !0,
|
|
39
|
+
isSearchEnabled: !1,
|
|
40
|
+
definingSQL: n,
|
|
41
|
+
columnIds: r
|
|
42
|
+
});
|
|
43
|
+
return [s(t.participantsVirtualTableId, `${t.portalName} Cohort Builder Participants (synthetic)`, `SELECT ${i}, ${a} FROM ${S} GROUP BY ${i}`, r.participants.map((e) => e.id)), s(t.dataVirtualTableId, `${t.portalName} Cohort Builder Files and Datasets (synthetic)`, `SELECT ${d} AS id, name, ${o} FROM ${S} GROUP BY ${d}, name, ${o}`, r.dataReferences.map((e) => e.id))];
|
|
44
|
+
}
|
|
45
|
+
function N(t = {}) {
|
|
46
|
+
let { profile: u = f, access: d = "AGGREGATE_ONLY", maxCohortValues: p, backendOrigin: h = n(e.REPO_ENDPOINT) } = t, g = j(u), _ = M(g).map((e) => x.get(`${h}${i(e.id)}`, () => b.json(e))), S = x.post(`${h}${r}`, async ({ request: e }) => {
|
|
47
|
+
let { references: t } = await e.clone().json(), n = t.flatMap((e) => {
|
|
48
|
+
let t = g.references.get(e.targetId);
|
|
49
|
+
return t ? [{
|
|
50
|
+
id: t.id,
|
|
51
|
+
name: t.name,
|
|
52
|
+
type: t.referenceType === "FILE" ? "org.sagebionetworks.repo.model.FileEntity" : "org.sagebionetworks.repo.model.table.Dataset",
|
|
53
|
+
versionNumber: 1,
|
|
54
|
+
isLatestVersion: !0,
|
|
55
|
+
benefactorId: 9e7,
|
|
56
|
+
createdOn: "2026-10-01T00:00:00.000Z",
|
|
57
|
+
modifiedOn: "2026-10-01T00:00:00.000Z",
|
|
58
|
+
createdBy: "0",
|
|
59
|
+
modifiedBy: "0"
|
|
60
|
+
}] : [];
|
|
61
|
+
});
|
|
62
|
+
return n.length > 0 ? b.json({ results: n }) : void 0;
|
|
63
|
+
}), A = [u.participantsVirtualTableId, u.dataVirtualTableId].flatMap((e) => l(c("org.sagebionetworks.repo.model.table.QueryBundleRequest", (e) => {
|
|
64
|
+
let t = v(g, e, d, { maxCohortValues: p });
|
|
65
|
+
return t.status === 200 ? t.body : new s(t.status, t.body);
|
|
66
|
+
}), {
|
|
67
|
+
asyncTypeServicePaths: {
|
|
68
|
+
requestPath: o(e),
|
|
69
|
+
responsePath: (t) => a(e, t)
|
|
70
|
+
},
|
|
71
|
+
backendOrigin: h
|
|
72
|
+
}));
|
|
73
|
+
function N(e, t) {
|
|
74
|
+
let n = e, r = {
|
|
75
|
+
concreteType: "org.sagebionetworks.repo.model.table.ColumnSingleValueQueryFilter",
|
|
76
|
+
columnName: m,
|
|
77
|
+
operator: y.EQUAL,
|
|
78
|
+
values: ["FILE"]
|
|
79
|
+
}, i = v(g, {
|
|
80
|
+
concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest",
|
|
81
|
+
entityId: u.dataVirtualTableId,
|
|
82
|
+
partMask: 2,
|
|
83
|
+
query: t ? {
|
|
84
|
+
...n,
|
|
85
|
+
additionalFilters: [...n.additionalFilters ?? [], r]
|
|
86
|
+
} : n
|
|
87
|
+
}, d, { maxCohortValues: p });
|
|
88
|
+
return "queryCount" in i.body ? i.body.queryCount ?? 0 : new s(i.status, i.body);
|
|
89
|
+
}
|
|
90
|
+
let P = [
|
|
91
|
+
...l(c("org.sagebionetworks.repo.model.download.AddToDownloadListStatsRequest", (e) => {
|
|
92
|
+
let t = N(e.request?.query, !1), n = N(e.request?.query, !0);
|
|
93
|
+
return t instanceof s ? t : n instanceof s ? n : {
|
|
94
|
+
concreteType: "org.sagebionetworks.repo.model.download.AddToDownloadListStatsResponse",
|
|
95
|
+
fileCount: t,
|
|
96
|
+
fileSize: n * O,
|
|
97
|
+
isFileCountAndSizeEstimate: !1
|
|
98
|
+
};
|
|
99
|
+
}), {
|
|
100
|
+
asyncTypeServicePaths: {
|
|
101
|
+
requestPath: T,
|
|
102
|
+
responsePath: E
|
|
103
|
+
},
|
|
104
|
+
backendOrigin: h
|
|
105
|
+
}),
|
|
106
|
+
...l(c("org.sagebionetworks.repo.model.download.AddToDownloadListRequest", (e) => {
|
|
107
|
+
if (e.useVersionNumber !== !1 && e.query?.selectFileVersionColumn === void 0) return new s(400, {
|
|
108
|
+
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
109
|
+
reason: `'${u.dataVirtualTableId}' is not a file view or a dataset, the query.selectFileVersionColumn must be specified`
|
|
110
|
+
});
|
|
111
|
+
let t = N(e.query, !0);
|
|
112
|
+
return t instanceof s ? t : {
|
|
113
|
+
concreteType: "org.sagebionetworks.repo.model.download.AddToDownloadListResponse",
|
|
114
|
+
numberOfFilesAdded: t
|
|
115
|
+
};
|
|
116
|
+
}), {
|
|
117
|
+
asyncTypeServicePaths: {
|
|
118
|
+
requestPath: C,
|
|
119
|
+
responsePath: w
|
|
120
|
+
},
|
|
121
|
+
backendOrigin: h
|
|
122
|
+
}),
|
|
123
|
+
x.post(`${h}${D}`, async ({ request: e }) => {
|
|
124
|
+
let { batchToAdd: t } = await e.json(), n = t.filter((e) => g.references.get(e.fileEntityId)?.referenceType === "FILE").length;
|
|
125
|
+
return b.json({ numberOfFilesAdded: n });
|
|
126
|
+
})
|
|
127
|
+
], F = l(c("org.sagebionetworks.repo.model.table.DownloadFromTableRequest", (e) => {
|
|
128
|
+
let t = N(e, !1);
|
|
129
|
+
return t instanceof s ? t : {
|
|
130
|
+
concreteType: "org.sagebionetworks.repo.model.table.DownloadFromTableResult",
|
|
131
|
+
resultsFileHandleId: k,
|
|
132
|
+
tableId: u.dataVirtualTableId
|
|
133
|
+
};
|
|
134
|
+
}), {
|
|
135
|
+
asyncTypeServicePaths: {
|
|
136
|
+
requestPath: `/repo/v1/entity/${u.dataVirtualTableId}/table/download/csv/async/start`,
|
|
137
|
+
responsePath: (e) => `/repo/v1/entity/${u.dataVirtualTableId}/table/download/csv/async/get/${e}`
|
|
138
|
+
},
|
|
139
|
+
backendOrigin: h
|
|
140
|
+
});
|
|
141
|
+
return [
|
|
142
|
+
..._,
|
|
143
|
+
S,
|
|
144
|
+
...A,
|
|
145
|
+
...P,
|
|
146
|
+
...F
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
function P(e = {}) {
|
|
150
|
+
return { entity: [...N({
|
|
151
|
+
...e,
|
|
152
|
+
backendOrigin: t
|
|
153
|
+
}), ...u(t)] };
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
export { k as MOCK_COHORT_CSV_FILE_HANDLE_ID, O as MOCK_COHORT_FILE_SIZE_BYTES, N as getCohortBuilderHandlers, P as getCohortBuilderStorybookHandlers, j as getCohortBuilderSyntheticData };
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=cohortBuilderHandlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohortBuilderHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/cohortBuilderHandlers.ts"],"sourcesContent":["import {\n CohortBuilderMockProfile,\n DATA_REFERENCE_COLUMN_NAME,\n ELITE_MOCK_PROFILE,\n PARTICIPANT_ID_COLUMN_NAME,\n REFERENCE_TYPE_COLUMN_NAME,\n STUDY_COLUMN_NAME,\n} from '@/mocks/cohortBuilder/cohortBuilderMockProfiles'\nimport {\n CohortBuilderAccess,\n CohortBuilderMockQueryOptions,\n getCohortBuilderColumnModels,\n runCohortBuilderMockQuery,\n} from '@/mocks/cohortBuilder/cohortBuilderMockQueryEngine'\nimport {\n CohortBuilderSyntheticData,\n createCohortBuilderSyntheticData,\n} from '@/mocks/cohortBuilder/cohortBuilderSyntheticData'\nimport {\n ENTITY_HEADERS,\n ENTITY_ID,\n TABLE_QUERY_ASYNC_GET,\n TABLE_QUERY_ASYNC_START,\n} from '@/utils/APIConstants'\nimport { BUNDLE_MASK_QUERY_COUNT } from '@/utils/SynapseConstants'\nimport {\n BackendDestinationEnum,\n getEndpoint,\n MOCK_REPO_ORIGIN,\n} from '@/utils/functions/getEndpoint'\nimport {\n AddBatchOfFilesToDownloadListRequest,\n ColumnSingleValueFilterOperator,\n ColumnSingleValueQueryFilter,\n EntityHeader,\n Query,\n QueryBundleRequest,\n Reference,\n VirtualTable,\n} from '@sage-bionetworks/synapse-types'\nimport { http, HttpHandler, HttpResponse } from 'msw'\nimport {\n AsyncJobFailure,\n dispatchEntry,\n generateAsyncJobHandlers,\n} from './asyncJobHandlers'\nimport { getEntityHandlers } from './entityHandlers'\n\nconst MOCK_MATERIAL_VIEW_ID = 'syn_MATERIAL'\n\nconst DOWNLOAD_LIST_ADD_ASYNC_START = '/repo/v1/download/list/add/async/start'\nconst DOWNLOAD_LIST_ADD_ASYNC_GET = (token: string) =>\n `/repo/v1/download/list/add/async/get/${token}`\nconst DOWNLOAD_LIST_ADD_STATS_ASYNC_START =\n '/repo/v1/download/list/add/stats/async/start'\nconst DOWNLOAD_LIST_ADD_STATS_ASYNC_GET = (token: string) =>\n `/repo/v1/download/list/add/stats/async/get/${token}`\nconst DOWNLOAD_LIST_ADD_BATCH = '/repo/v1/download/list/add'\n\n/** Synthetic files have no file handles; each is reported at this size in Download List statistics. */\nexport const MOCK_COHORT_FILE_SIZE_BYTES = 10 * 1024 * 1024\n/** The file handle of every mock Files/Datasets CSV export. */\nexport const MOCK_COHORT_CSV_FILE_HANDLE_ID = '90000003'\n\nconst syntheticDataByProfile = new Map<\n CohortBuilderMockProfile,\n CohortBuilderSyntheticData\n>()\n\n/** Synthetic data for a profile, generated once per profile and reused across handlers. */\nexport function getCohortBuilderSyntheticData(\n profile: CohortBuilderMockProfile,\n): CohortBuilderSyntheticData {\n let data = syntheticDataByProfile.get(profile)\n if (!data) {\n data = createCohortBuilderSyntheticData(profile)\n syntheticDataByProfile.set(profile, data)\n }\n return data\n}\n\nfunction getVirtualTableEntities(\n data: CohortBuilderSyntheticData,\n): VirtualTable[] {\n const { profile, dataAttributeNames } = data\n const columnModels = getCohortBuilderColumnModels(data)\n const participantColumns = [\n PARTICIPANT_ID_COLUMN_NAME,\n STUDY_COLUMN_NAME,\n ...profile.participantAttributes.map(attribute => attribute.name),\n ].join(', ')\n const dataAttributeLists = dataAttributeNames\n .map(\n name =>\n `CAST(CONCAT('[', GROUP_CONCAT(DISTINCT CONCAT('\"', ${name}, '\"')), ']') AS <STRING_LIST column>) AS ${name}`,\n )\n .join(', ')\n const dataColumns = [\n REFERENCE_TYPE_COLUMN_NAME,\n STUDY_COLUMN_NAME,\n ...dataAttributeNames,\n ].join(', ')\n const virtualTable = (\n id: string,\n name: string,\n definingSQL: string,\n columnIds: string[],\n ): VirtualTable => ({\n id,\n name,\n concreteType: 'org.sagebionetworks.repo.model.table.VirtualTable',\n parentId: 'syn90000000',\n etag: '00000000-0000-0000-0000-000000000000',\n createdOn: '2026-10-01T00:00:00.000Z',\n modifiedOn: '2026-10-01T00:00:00.000Z',\n createdBy: '0',\n modifiedBy: '0',\n versionNumber: 1,\n versionLabel: 'in progress',\n isLatestVersion: true,\n isSearchEnabled: false,\n definingSQL,\n columnIds,\n })\n return [\n virtualTable(\n profile.participantsVirtualTableId,\n `${profile.portalName} Cohort Builder Participants (synthetic)`,\n `SELECT ${participantColumns}, ${dataAttributeLists} FROM ${MOCK_MATERIAL_VIEW_ID} GROUP BY ${participantColumns}`,\n columnModels.participants.map(column => column.id!),\n ),\n virtualTable(\n profile.dataVirtualTableId,\n `${profile.portalName} Cohort Builder Files and Datasets (synthetic)`,\n `SELECT ${DATA_REFERENCE_COLUMN_NAME} AS id, name, ${dataColumns} FROM ${MOCK_MATERIAL_VIEW_ID} GROUP BY ${DATA_REFERENCE_COLUMN_NAME}, name, ${dataColumns}`,\n columnModels.dataReferences.map(column => column.id!),\n ),\n ]\n}\n\nexport type CohortBuilderHandlersOptions = CohortBuilderMockQueryOptions & {\n profile?: CohortBuilderMockProfile\n access?: CohortBuilderAccess\n backendOrigin?: string\n}\n\n/**\n * MSW handlers that emulate the Cohort Builder 2.0 VirtualTables (participant\n * and file/dataset perspectives) over synthetic data, including the\n * AGGREGATE_DATA behavior an unapproved caller sees.\n */\nexport function getCohortBuilderHandlers(\n options: CohortBuilderHandlersOptions = {},\n): HttpHandler[] {\n const {\n profile = ELITE_MOCK_PROFILE,\n access = 'AGGREGATE_ONLY',\n maxCohortValues,\n backendOrigin = getEndpoint(BackendDestinationEnum.REPO_ENDPOINT),\n } = options\n const data = getCohortBuilderSyntheticData(profile)\n\n const entityHandlers = getVirtualTableEntities(data).map(entity =>\n http.get(`${backendOrigin}${ENTITY_ID(entity.id!)}`, () =>\n HttpResponse.json(entity),\n ),\n )\n\n // Headers for the synthetic files and datasets; other references fall through to the next handler.\n const entityHeaderHandler = http.post(\n `${backendOrigin}${ENTITY_HEADERS}`,\n async ({ request }) => {\n const { references } = (await request.clone().json()) as {\n references: Reference[]\n }\n const results = references.flatMap((reference): EntityHeader[] => {\n const syntheticReference = data.references.get(reference.targetId)\n return syntheticReference\n ? [\n {\n id: syntheticReference.id,\n name: syntheticReference.name,\n type:\n syntheticReference.referenceType === 'FILE'\n ? 'org.sagebionetworks.repo.model.FileEntity'\n : 'org.sagebionetworks.repo.model.table.Dataset',\n versionNumber: 1,\n isLatestVersion: true,\n benefactorId: 90000000,\n createdOn: '2026-10-01T00:00:00.000Z',\n modifiedOn: '2026-10-01T00:00:00.000Z',\n createdBy: '0',\n modifiedBy: '0',\n },\n ]\n : []\n })\n return results.length > 0 ? HttpResponse.json({ results }) : undefined\n },\n )\n\n const queryHandlers = [\n profile.participantsVirtualTableId,\n profile.dataVirtualTableId,\n ].flatMap(entityId =>\n generateAsyncJobHandlers(\n dispatchEntry(\n 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n request => {\n const result = runCohortBuilderMockQuery(\n data,\n // The async-job mocks type request bodies with the generated client models; the engine uses the legacy\n // QueryBundleRequest, whose shape matches what the client sends.\n request as unknown as QueryBundleRequest,\n access,\n { maxCohortValues },\n )\n return result.status === 200\n ? result.body\n : new AsyncJobFailure(result.status, result.body)\n },\n ),\n {\n asyncTypeServicePaths: {\n requestPath: TABLE_QUERY_ASYNC_START(entityId),\n responsePath: tokenParam =>\n TABLE_QUERY_ASYNC_GET(entityId, tokenParam),\n },\n backendOrigin,\n },\n ),\n )\n\n // Counts a Files/Datasets query's rows as this caller sees them, optionally only the file rows.\n function countDataRows(\n requestQuery: unknown,\n onlyFiles: boolean,\n ): number | AsyncJobFailure {\n // The async-job mocks type request bodies with the generated client models; the engine uses the legacy Query,\n // whose shape (including cohorts) matches what the client sends.\n const query = requestQuery as Query\n const fileFilter: ColumnSingleValueQueryFilter = {\n concreteType:\n 'org.sagebionetworks.repo.model.table.ColumnSingleValueQueryFilter',\n columnName: REFERENCE_TYPE_COLUMN_NAME,\n operator: ColumnSingleValueFilterOperator.EQUAL,\n values: ['FILE'],\n }\n const result = runCohortBuilderMockQuery(\n data,\n {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n entityId: profile.dataVirtualTableId,\n partMask: BUNDLE_MASK_QUERY_COUNT,\n query: onlyFiles\n ? {\n ...query,\n additionalFilters: [\n ...(query.additionalFilters ?? []),\n fileFilter,\n ],\n }\n : query,\n },\n access,\n { maxCohortValues },\n )\n // A count-only request returns a bundle with queryCount; anything else is an error body.\n return 'queryCount' in result.body\n ? (result.body.queryCount ?? 0)\n : new AsyncJobFailure(result.status, result.body)\n }\n\n // As on the server: the statistics count every row of the query, but only files are added. Datasets are skipped\n // until the server adds a dataset's files instead (PLFM-9997). Adding a VirtualTable query needs a version column,\n // which these tables don't have, unless the current versions are requested.\n const downloadListHandlers = [\n ...generateAsyncJobHandlers(\n dispatchEntry(\n 'org.sagebionetworks.repo.model.download.AddToDownloadListStatsRequest',\n request => {\n const fileCount = countDataRows(request.request?.query, false)\n const filesOnly = countDataRows(request.request?.query, true)\n if (fileCount instanceof AsyncJobFailure) return fileCount\n if (filesOnly instanceof AsyncJobFailure) return filesOnly\n return {\n concreteType:\n 'org.sagebionetworks.repo.model.download.AddToDownloadListStatsResponse',\n fileCount,\n fileSize: filesOnly * MOCK_COHORT_FILE_SIZE_BYTES,\n isFileCountAndSizeEstimate: false,\n }\n },\n ),\n {\n asyncTypeServicePaths: {\n requestPath: DOWNLOAD_LIST_ADD_STATS_ASYNC_START,\n responsePath: DOWNLOAD_LIST_ADD_STATS_ASYNC_GET,\n },\n backendOrigin,\n },\n ),\n ...generateAsyncJobHandlers(\n dispatchEntry(\n 'org.sagebionetworks.repo.model.download.AddToDownloadListRequest',\n request => {\n if (\n request.useVersionNumber !== false &&\n request.query?.selectFileVersionColumn === undefined\n ) {\n return new AsyncJobFailure(400, {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `'${profile.dataVirtualTableId}' is not a file view or a dataset, the query.selectFileVersionColumn must be specified`,\n })\n }\n const numberOfFilesAdded = countDataRows(request.query, true)\n return numberOfFilesAdded instanceof AsyncJobFailure\n ? numberOfFilesAdded\n : {\n concreteType:\n 'org.sagebionetworks.repo.model.download.AddToDownloadListResponse',\n numberOfFilesAdded,\n }\n },\n ),\n {\n asyncTypeServicePaths: {\n requestPath: DOWNLOAD_LIST_ADD_ASYNC_START,\n responsePath: DOWNLOAD_LIST_ADD_ASYNC_GET,\n },\n backendOrigin,\n },\n ),\n http.post(\n `${backendOrigin}${DOWNLOAD_LIST_ADD_BATCH}`,\n async ({ request }) => {\n const { batchToAdd } =\n (await request.json()) as AddBatchOfFilesToDownloadListRequest\n const numberOfFilesAdded = batchToAdd.filter(\n item =>\n data.references.get(item.fileEntityId)?.referenceType === 'FILE',\n ).length\n return HttpResponse.json({ numberOfFilesAdded })\n },\n ),\n ]\n\n // The CSV export resolves the request's cohorts like a query, so a cohort reference without its definition fails.\n const csvExportHandlers = generateAsyncJobHandlers(\n dispatchEntry(\n 'org.sagebionetworks.repo.model.table.DownloadFromTableRequest',\n request => {\n const rowCount = countDataRows(request, false)\n return rowCount instanceof AsyncJobFailure\n ? rowCount\n : {\n concreteType:\n 'org.sagebionetworks.repo.model.table.DownloadFromTableResult',\n resultsFileHandleId: MOCK_COHORT_CSV_FILE_HANDLE_ID,\n tableId: profile.dataVirtualTableId,\n }\n },\n ),\n {\n asyncTypeServicePaths: {\n requestPath: `/repo/v1/entity/${profile.dataVirtualTableId}/table/download/csv/async/start`,\n responsePath: token =>\n `/repo/v1/entity/${profile.dataVirtualTableId}/table/download/csv/async/get/${token}`,\n },\n backendOrigin,\n },\n )\n\n return [\n ...entityHandlers,\n entityHeaderHandler,\n ...queryHandlers,\n ...downloadListHandlers,\n ...csvExportHandlers,\n ]\n}\n\n/**\n * Storybook MSW handler groups that serve the Cohort Builder mocks on the mock stack. They replace the `entity` group so\n * they run before the stock entity handlers, which answer 404 for unknown entity IDs.\n */\nexport function getCohortBuilderStorybookHandlers(\n options: Omit<CohortBuilderHandlersOptions, 'backendOrigin'> = {},\n): Record<string, HttpHandler[]> {\n return {\n entity: [\n ...getCohortBuilderHandlers({\n ...options,\n backendOrigin: MOCK_REPO_ORIGIN,\n }),\n ...getEntityHandlers(MOCK_REPO_ORIGIN),\n ],\n }\n}\n"],"mappings":";;;;;;;;;;;AAgDA,IAAM,IAAwB,gBAExB,IAAgC,0CAChC,KAA+B,MACnC,wCAAwC,KACpC,IACJ,gDACI,KAAqC,MACzC,8CAA8C,KAC1C,IAA0B,8BAGnB,IAA8B,KAAK,OAAO,MAE1C,IAAiC,YAExC,oBAAyB,IAAI,IAGjC;AAGF,SAAgB,EACd,GAC4B;CAC5B,IAAI,IAAO,EAAuB,IAAI,CAAO;CAK7C,OAJK,MACH,IAAO,EAAiC,CAAO,GAC/C,EAAuB,IAAI,GAAS,CAAI,IAEnC;AACT;AAEA,SAAS,EACP,GACgB;CAChB,IAAM,EAAE,YAAS,0BAAuB,GAClC,IAAe,EAA6B,CAAI,GAChD,IAAqB;EACzB;EACA;EACA,GAAG,EAAQ,sBAAsB,KAAI,MAAa,EAAU,IAAI;CAClE,EAAE,KAAK,IAAI,GACL,IAAqB,EACxB,KACC,MACE,sDAAsD,EAAK,4CAA4C,G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,EACD,EACE,qEACA,MAAW;GACT,IACE,EAAQ,qBAAqB,MAC7B,EAAQ,OAAO,4BAA4B,KAAA,GAE3C,OAAO,IAAI,EAAgB,KAAK;IAC9B,cAAc;IACd,QAAQ,IAAI,EAAQ,mBAAmB;GACzC,CAAC;GAEH,IAAM,IAAqB,EAAc,EAAQ,OAAO,EAAI;GAC5D,OAAO,aAA8B,IACjC,IACA;IACE,cACE;IACF;GACF;EACN,CACF,GACA;GACE,uBAAuB;IACrB,aAAa;IACb,cAAc;GAChB;GACA;EACF,CACF;EACA,EAAK,KACH,GAAG,IAAgB,KACnB,OAAO,EAAE,iBAAc;GACrB,IAAM,EAAE,kBACL,MAAM,EAAQ,KAAK,GAChB,IAAqB,EAAW,QACpC,MACE,EAAK,WAAW,IAAI,EAAK,YAAY,GAAG,kBAAkB,MAC9D,EAAE;GACF,OAAO,EAAa,KAAK,EAAE,sBAAmB,CAAC;EACjD,CACF;CACF,GAGM,IAAoB,EACxB,EACE,kEACA,MAAW;EACT,IAAM,IAAW,EAAc,GAAS,EAAK;EAC7C,OAAO,aAAoB,IACvB,IACA;GACE,cACE;GACF,qBAAqB;GACrB,SAAS,EAAQ;EACnB;CACN,CACF,GACA;EACE,uBAAuB;GACrB,aAAa,mBAAmB,EAAQ,mBAAmB;GAC3D,eAAc,MACZ,mBAAmB,EAAQ,mBAAmB,gCAAgC;EAClF;EACA;CACF,CACF;CAEA,OAAO;EACL,GAAG;EACH;EACA,GAAG;EACH,GAAG;EACH,GAAG;CACL;AACF;AAMA,SAAgB,EACd,IAA+D,CAAC,GACjC;CAC/B,OAAO,EACL,QAAQ,CACN,GAAG,EAAyB;EAC1B,GAAG;EACH,eAAe;CACjB,CAAC,GACD,GAAG,EAAkB,CAAgB,CACvC,EACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/entityHandlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entityHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/entityHandlers.ts"],"names":[],"mappings":"AAgBA,OAAO,EAGL,YAAY,EAEZ,UAAU,EAOX,MAAM,iCAAiC,CAAA;AA+BxC,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,EACrB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,6BAuB/B;AAED,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,6BAUjC;AAED,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,MAAM,EACrB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,6BAiC/B;AAED,eAAO,MAAM,iBAAiB,GAAI,eAAe,MAAM,gCA0StD,CAAA"}
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import { ENTITY as e, ENTITY_BUNDLE_V2 as t, ENTITY_HEADERS as n, ENTITY_ID as r, ENTITY_ID_VERSION as i, ENTITY_ID_VERSIONS as a, ENTITY_JSON as o, ENTITY_SCHEMA_BINDING as s } from "../../../utils/APIConstants.js";
|
|
2
|
-
import { normalizeSynPrefix as
|
|
1
|
+
import { ENTITY as e, ENTITY_BUNDLE_V2 as t, ENTITY_HEADERS as n, ENTITY_ID as r, ENTITY_ID_VERSION as i, ENTITY_ID_VERSIONS as a, ENTITY_JSON as o, ENTITY_SCHEMA_BINDING as s, ENTITY_SCHEMA_VALIDATION as c } from "../../../utils/APIConstants.js";
|
|
2
|
+
import { normalizeSynPrefix as l } from "../../../utils/functions/EntityTypeUtils.js";
|
|
3
3
|
import "../../entity/mockEntity.js";
|
|
4
|
-
import { mockSchemaBinding as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { mockSchemaBinding as u, mockSchemaValidationResults as d } from "../../mockSchema.js";
|
|
5
|
+
import f, { mockProjectsEntityData as p } from "../../entity/index.js";
|
|
6
|
+
import { mockOpenRestrictionInformation as m } from "../../mock_has_access_data.js";
|
|
7
|
+
import { mockSynapseStorageUploadDestination as h, mockUploadDestinations as g } from "../../mock_upload_destination.js";
|
|
8
|
+
import { uniqueId as _ } from "lodash-es";
|
|
9
|
+
import { HttpResponse as v, http as y } from "msw";
|
|
9
10
|
//#region src/mocks/msw/handlers/entityHandlers.ts
|
|
10
|
-
function
|
|
11
|
-
let t = e.map(
|
|
12
|
-
return
|
|
11
|
+
function b(e) {
|
|
12
|
+
let t = e.map(l);
|
|
13
|
+
return f.filter((e) => t.includes(l(e.id)));
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
let t =
|
|
15
|
+
function x(e) {
|
|
16
|
+
let t = b([e]);
|
|
16
17
|
if (t.length != 0) return t[0];
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
19
|
+
function S(e, n) {
|
|
20
|
+
return y.post(`${e}${t(":entityId")}`, ({ params: e }) => {
|
|
20
21
|
let t = 404, r = {
|
|
21
22
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
22
23
|
reason: `Mock Service worker could not find a mock entity bundle with ID ${e.entityId}`
|
|
23
24
|
};
|
|
24
25
|
if (n) r = n, t = 200;
|
|
25
26
|
else {
|
|
26
|
-
let n =
|
|
27
|
+
let n = x(e.entityId);
|
|
27
28
|
n?.bundle && (r = n.bundle, t = 200);
|
|
28
29
|
}
|
|
29
|
-
return
|
|
30
|
+
return v.json(r, { status: t });
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
33
|
+
function C(e, t) {
|
|
34
|
+
return y.get(`${e}${o(":entityId")}`, () => {
|
|
34
35
|
let e = t;
|
|
35
|
-
return
|
|
36
|
+
return v.json(e, { status: 200 });
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
39
|
+
function w(e, n) {
|
|
40
|
+
return y.post(`${e}${t(":entityId", ":versionNumber")}`, ({ params: e }) => {
|
|
40
41
|
let t = e.entityId, r = parseInt(e.versionNumber), i = 404, a = {
|
|
41
42
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
42
43
|
reason: `Mock Service worker could not find a mock entity bundle with ID ${t}`
|
|
43
44
|
};
|
|
44
45
|
if (n) a = n, i = 200;
|
|
45
46
|
else {
|
|
46
|
-
let e =
|
|
47
|
+
let e = x(t);
|
|
47
48
|
if (e) {
|
|
48
49
|
let t = e.bundle;
|
|
49
50
|
a = e.versions?.[r] ? {
|
|
@@ -52,127 +53,129 @@ function x(e, n) {
|
|
|
52
53
|
} : t, i = 200;
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
return
|
|
56
|
+
return v.json(a, { status: i });
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
|
-
var
|
|
59
|
-
|
|
59
|
+
var T = (t) => [
|
|
60
|
+
y.post(`${t}${e}`, async ({ request: t }) => {
|
|
60
61
|
let n = 200, r = await t.json(), i = {
|
|
61
62
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
62
63
|
reason: "..."
|
|
63
64
|
};
|
|
64
65
|
return r ? r.name === "A $@*#$% terribly named Project" ? (i.reason = "Invalid project name", n = 403) : i = {
|
|
65
|
-
id:
|
|
66
|
+
id: _("syn"),
|
|
66
67
|
...r
|
|
67
68
|
} : (n = 400, i = {
|
|
68
69
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
69
70
|
reason: `Mock service worker received the following malformed body for PUT ${e} : ${JSON.stringify(r)}`
|
|
70
|
-
}),
|
|
71
|
+
}), v.json(i, { status: n });
|
|
71
72
|
}),
|
|
72
|
-
|
|
73
|
+
y.get(`${t}${r(":entityId")}`, ({ params: e }) => {
|
|
73
74
|
let t = 404, n = {
|
|
74
75
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
75
76
|
reason: `Mock Service worker could not find a mock entity with ID ${e.entityId}`
|
|
76
|
-
}, r =
|
|
77
|
-
return r && (n = r.entity, t = 200),
|
|
77
|
+
}, r = x(e.entityId);
|
|
78
|
+
return r && (n = r.entity, t = 200), v.json(n, { status: t });
|
|
78
79
|
}),
|
|
79
|
-
|
|
80
|
+
y.get(`${t}${a(":entityId")}`, ({ params: e }) => {
|
|
80
81
|
let t = 404, n = {
|
|
81
82
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
82
83
|
reason: `Mock Service worker could not find mock entity versions for ID ${e.entityId}`
|
|
83
|
-
}, r =
|
|
84
|
-
return r?.versionInfo && (n = { results: r.versionInfo }, t = 200),
|
|
84
|
+
}, r = x(e.entityId);
|
|
85
|
+
return r?.versionInfo && (n = { results: r.versionInfo }, t = 200), v.json(n, { status: t });
|
|
85
86
|
}),
|
|
86
|
-
|
|
87
|
+
y.get(`${t}${i(":entityId", ":versionNumber")}`, ({ params: e }) => {
|
|
87
88
|
let t = 404, n = e.entityId, r = e.versionNumber.toString(), i = parseInt(r), a = {
|
|
88
89
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
89
90
|
reason: `Mock Service worker could not find a mock versioned entity with ID ${n}.${r}`
|
|
90
|
-
}, o =
|
|
91
|
-
return o?.versions?.[i] && (a = o.versions[i], t = 200),
|
|
91
|
+
}, o = x(e.entityId);
|
|
92
|
+
return o?.versions?.[i] && (a = o.versions[i], t = 200), v.json(a, { status: t });
|
|
92
93
|
}),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
S(t),
|
|
95
|
+
w(t),
|
|
96
|
+
y.get(`${t}${s(":entityId")}`, () => v.json(u, { status: 200 })),
|
|
97
|
+
y.get(`${t}${c(":entityId")}`, () => v.json(d, { status: 200 })),
|
|
98
|
+
y.post(`${t}/repo/v1/restrictionInformation`, () => v.json(m, { status: 200 })),
|
|
99
|
+
y.get(`${t}${o(":entityId")}`, ({ params: e }) => {
|
|
97
100
|
let t = 404, n = {
|
|
98
101
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
99
102
|
reason: `Mock Service worker could not find a mock entity bundle with ID ${e.entityId}`
|
|
100
|
-
}, r =
|
|
101
|
-
return r?.json && (n = r.json, t = 200),
|
|
103
|
+
}, r = x(e.entityId);
|
|
104
|
+
return r?.json && (n = r.json, t = 200), v.json(n, { status: t });
|
|
102
105
|
}),
|
|
103
|
-
|
|
106
|
+
y.post(`${t}${n}`, async ({ params: e, request: t }) => {
|
|
104
107
|
let n = 404, r = {
|
|
105
108
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
106
109
|
reason: `Mock Service worker could not find a mock entity bundle with ID ${e.entityId}`
|
|
107
110
|
}, i = (await t.json()).references.map((e) => {
|
|
108
|
-
let t =
|
|
111
|
+
let t = x(e.targetId)?.entityHeader;
|
|
109
112
|
if (t) return {
|
|
110
113
|
...t,
|
|
111
114
|
id: e.targetId
|
|
112
115
|
};
|
|
113
116
|
}).filter((e) => !!e);
|
|
114
|
-
return i && (r = { results: i }, n = 200),
|
|
117
|
+
return i && (r = { results: i }, n = 200), v.json(r, { status: n });
|
|
115
118
|
}),
|
|
116
|
-
|
|
119
|
+
y.get(`${t}${r(":entityId")}/path`, ({ params: e }) => {
|
|
117
120
|
let t = 404, n = {
|
|
118
121
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
119
122
|
reason: `Mock Service worker could not find a mock entity path using ID ${e.entityId}`
|
|
120
|
-
}, r =
|
|
121
|
-
return r?.path && (n = r.path, t = 200),
|
|
123
|
+
}, r = x(e.entityId);
|
|
124
|
+
return r?.path && (n = r.path, t = 200), v.json(n, { status: t });
|
|
122
125
|
}),
|
|
123
|
-
|
|
124
|
-
let e =
|
|
125
|
-
return
|
|
126
|
+
y.get(`${t}/file/v1/entity/:id/uploadDestination`, () => {
|
|
127
|
+
let e = h;
|
|
128
|
+
return v.json(e, { status: 200 });
|
|
126
129
|
}),
|
|
127
|
-
|
|
130
|
+
y.get(`${t}/file/v1/entity/:id/uploadDestination/:storageLocationId`, ({ params: e }) => {
|
|
128
131
|
let t = 404, n = {
|
|
129
132
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
130
133
|
reason: `Mock Service worker could not find an uploadDestination using storageLocationId ${e.storageLocationId}`
|
|
131
|
-
}, r =
|
|
132
|
-
return r && (n = r, t = 200),
|
|
134
|
+
}, r = g.find((t) => Number(e.storageLocationId) === t.storageLocationId);
|
|
135
|
+
return r && (n = r, t = 200), v.json(n, { status: t });
|
|
133
136
|
}),
|
|
134
|
-
|
|
135
|
-
let e = { results:
|
|
137
|
+
y.get(`${t}/repo/v1/projects`, () => {
|
|
138
|
+
let e = { results: p.map((e) => ({
|
|
136
139
|
name: e.name,
|
|
137
140
|
id: e.id,
|
|
138
141
|
lastActivity: "2024-01-04T21:11:59.000Z",
|
|
139
142
|
modifiedBy: parseInt(e.entity.modifiedBy),
|
|
140
143
|
modifiedOn: e.entity.modifiedOn
|
|
141
144
|
})) };
|
|
142
|
-
return
|
|
145
|
+
return v.json(e, { status: 200 });
|
|
143
146
|
}),
|
|
144
|
-
|
|
145
|
-
let n =
|
|
147
|
+
y.post(`${t}${r(":entityId")}/acl`, async ({ params: e, request: t }) => {
|
|
148
|
+
let n = x(e.entityId), r, i;
|
|
146
149
|
return n ? n.bundle?.accessControlList ? (r = 403, i = {
|
|
147
150
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
148
151
|
reason: "Resource already has an ACL."
|
|
149
152
|
}) : (i = await t.json(), r = 201) : (r = 404, i = {
|
|
150
153
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
151
154
|
reason: `Mock Service worker could not find a mock entity bundle with ID ${e.entityId}`
|
|
152
|
-
}),
|
|
155
|
+
}), v.json(i, { status: r });
|
|
153
156
|
}),
|
|
154
|
-
|
|
155
|
-
let n =
|
|
157
|
+
y.put(`${t}${r(":entityId")}/acl`, async ({ params: e, request: t }) => {
|
|
158
|
+
let n = x(e.entityId), r, i;
|
|
156
159
|
return n ? n?.bundle?.accessControlList ? (i = await t.json(), r = 200) : (i = {
|
|
157
160
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
158
161
|
reason: "Cannot update ACL for a resource which inherits its permissions."
|
|
159
162
|
}, r = 403) : (r = 404, i = {
|
|
160
163
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
161
164
|
reason: `Mock Service worker could not find a mock entity bundle with ID ${e.entityId}`
|
|
162
|
-
}),
|
|
165
|
+
}), v.json(i, { status: r });
|
|
163
166
|
}),
|
|
164
|
-
|
|
165
|
-
let t =
|
|
167
|
+
y.delete(`${t}${r(":entityId")}/acl`, ({ params: e }) => {
|
|
168
|
+
let t = x(e.entityId), n, r;
|
|
166
169
|
return t ? t?.bundle?.accessControlList ? (r = "", n = 200) : (r = {
|
|
167
170
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
168
171
|
reason: "Cannot delete ACL for a resource which inherits its permissions."
|
|
169
172
|
}, n = 403) : (n = 404, r = {
|
|
170
173
|
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
|
|
171
174
|
reason: `Mock Service worker could not find a mock entity bundle with ID ${e.entityId}`
|
|
172
|
-
}),
|
|
175
|
+
}), v.json(r, { status: n });
|
|
173
176
|
})
|
|
174
177
|
];
|
|
175
178
|
//#endregion
|
|
176
|
-
export {
|
|
179
|
+
export { S as getEntityBundleHandler, T as getEntityHandlers, C as getEntityJsonHandler, w as getVersionedEntityBundleHandler };
|
|
177
180
|
|
|
178
181
|
//# sourceMappingURL=entityHandlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/entityHandlers.ts"],"sourcesContent":["import {\n ENTITY,\n ENTITY_BUNDLE_V2,\n ENTITY_HEADERS,\n ENTITY_ID,\n ENTITY_ID_VERSION,\n ENTITY_ID_VERSIONS,\n ENTITY_JSON,\n ENTITY_SCHEMA_BINDING,\n} from '@/utils/APIConstants'\nimport { normalizeSynPrefix } from '@/utils/functions/EntityTypeUtils'\nimport {\n ErrorResponse,\n UploadDestination,\n} from '@sage-bionetworks/synapse-client'\nimport {\n AccessControlList,\n Entity,\n EntityBundle,\n EntityHeader,\n EntityJson,\n EntityPath,\n PaginatedResults,\n ProjectHeaderList,\n Reference,\n VersionableEntity,\n VersionInfo,\n} from '@sage-bionetworks/synapse-types'\nimport { uniqueId } from 'lodash-es'\nimport { http, HttpResponse } from 'msw'\nimport mockEntities, { mockProjectsEntityData } from '../../entity'\nimport { MOCK_INVALID_PROJECT_NAME } from '../../entity/mockEntity'\nimport { MockEntityData } from '../../entity/MockEntityData'\nimport {\n mockSynapseStorageUploadDestination,\n mockUploadDestinations,\n} from '../../mock_upload_destination'\nimport { mockSchemaBinding } from '../../mockSchema'\nimport { SynapseApiResponse } from '../handlers'\n\nfunction getMatchingMockEntities(entityIds: string[]): MockEntityData[] {\n const normalizedPassedIds = entityIds.map(normalizeSynPrefix)\n return mockEntities.filter(entity =>\n normalizedPassedIds.includes(normalizeSynPrefix(entity.id)),\n )\n}\nfunction getMatchingMockEntity(entityId: string): MockEntityData | undefined {\n const matches = getMatchingMockEntities([entityId])\n if (matches.length == 0) {\n return undefined\n }\n return matches[0]\n}\n\nexport function getEntityBundleHandler(\n backendOrigin: string,\n bundle?: Partial<EntityBundle>,\n) {\n return http.post(\n `${backendOrigin}${ENTITY_BUNDLE_V2(':entityId')}`,\n ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<EntityBundle> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n if (bundle) {\n response = bundle as EntityBundle\n status = 200\n } else {\n const entityData = getMatchingMockEntity(params.entityId as string)\n if (entityData?.bundle) {\n response = entityData.bundle\n status = 200\n }\n }\n return HttpResponse.json(response, { status })\n },\n )\n}\n\nexport function getEntityJsonHandler(\n backendOrigin: string,\n entityJson?: Partial<EntityJson>,\n) {\n return http.get(\n `${backendOrigin}${ENTITY_JSON(':entityId')}`,\n\n () => {\n const response = entityJson\n return HttpResponse.json(response, { status: 200 })\n },\n )\n}\n\nexport function getVersionedEntityBundleHandler(\n backendOrigin: string,\n bundle?: Partial<EntityBundle>,\n) {\n return http.post(\n `${backendOrigin}${ENTITY_BUNDLE_V2(':entityId', ':versionNumber')}`,\n ({ params }) => {\n const entityId = params.entityId as string\n const versionNumber = parseInt(params.versionNumber as string)\n let status = 404\n let response: SynapseApiResponse<EntityBundle> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${entityId}`,\n }\n if (bundle) {\n response = bundle as EntityBundle\n status = 200\n } else {\n const entityData = getMatchingMockEntity(entityId)\n if (entityData) {\n const bundle = entityData.bundle\n if (entityData.versions?.[versionNumber]) {\n response = {\n ...bundle,\n entity: entityData.versions[versionNumber],\n } as EntityBundle\n } else {\n response = bundle as EntityBundle\n }\n status = 200\n }\n }\n return HttpResponse.json(response, { status })\n },\n )\n}\n\nexport const getEntityHandlers = (backendOrigin: string) => [\n /**\n * Create a new entity\n */\n http.post<never, Entity>(`${backendOrigin}${ENTITY}`, async ({ request }) => {\n let status = 200\n const requestBody = await request.json()\n let response: SynapseApiResponse<Entity> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: '...',\n }\n if (!requestBody) {\n status = 400\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock service worker received the following malformed body for PUT ${ENTITY} : ${JSON.stringify(\n requestBody,\n )}`,\n }\n } else {\n if (requestBody.name === MOCK_INVALID_PROJECT_NAME) {\n ;(response as ErrorResponse).reason = 'Invalid project name'\n status = 403\n } else {\n response = { id: uniqueId('syn'), ...requestBody }\n }\n }\n\n return HttpResponse.json(response, { status })\n }),\n\n /**\n * Get entity by ID\n */\n http.get(`${backendOrigin}${ENTITY_ID(':entityId')}`, ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<Entity> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity with ID ${params.entityId}`,\n }\n\n const entityData = getMatchingMockEntity(params.entityId as string)\n if (entityData) {\n response = entityData.entity\n status = 200\n }\n return HttpResponse.json(response, { status })\n }),\n\n http.get(\n `${backendOrigin}${ENTITY_ID_VERSIONS(':entityId')}`,\n ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<PaginatedResults<VersionInfo>> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find mock entity versions for ID ${params.entityId}`,\n }\n\n const entityData = getMatchingMockEntity(params.entityId as string)\n if (entityData?.versionInfo) {\n response = { results: entityData.versionInfo }\n status = 200\n }\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.get<{ entityId: string; versionNumber: string }>(\n `${backendOrigin}${ENTITY_ID_VERSION(':entityId', ':versionNumber')}`,\n ({ params }) => {\n let status = 404\n const entityId = params.entityId\n const versionNumber = params.versionNumber.toString()\n const requestedVersionNumber = parseInt(versionNumber)\n\n let response: SynapseApiResponse<VersionableEntity> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock versioned entity with ID ${entityId}.${versionNumber}`,\n }\n\n const entityData = getMatchingMockEntity(params.entityId)\n if (entityData?.versions?.[requestedVersionNumber]) {\n response = entityData.versions[\n requestedVersionNumber\n ] as VersionableEntity\n status = 200\n }\n return HttpResponse.json(response, { status })\n },\n ),\n\n getEntityBundleHandler(backendOrigin),\n getVersionedEntityBundleHandler(backendOrigin),\n\n http.get(`${backendOrigin}${ENTITY_SCHEMA_BINDING(':entityId')}`, () => {\n return HttpResponse.json(mockSchemaBinding, { status: 200 })\n }),\n http.get(\n `${backendOrigin}${ENTITY_JSON(':entityId')}`,\n\n ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<EntityJson> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n const entityData = getMatchingMockEntity(params.entityId as string)\n if (entityData?.json) {\n response = entityData.json\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.post<{ entityId: string }, { references: Reference[] }>(\n `${backendOrigin}${ENTITY_HEADERS}`,\n\n async ({ params, request }) => {\n let status = 404\n let response: SynapseApiResponse<PaginatedResults<EntityHeader>> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n\n const referenceList = await request.json()\n const entityData: EntityHeader[] = referenceList.references\n .map(ref => {\n const entityHeader = getMatchingMockEntity(ref.targetId)?.entityHeader\n if (entityHeader) {\n return {\n ...entityHeader,\n // ID should match what is passed in (i.e. may or may not have syn prefix)\n id: ref.targetId,\n }\n }\n return undefined\n })\n .filter((header): header is EntityHeader => !!header)\n\n if (entityData) {\n response = { results: entityData }\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.get(\n `${backendOrigin}${ENTITY_ID(':entityId')}/path`,\n\n ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<EntityPath> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity path using ID ${params.entityId}`,\n }\n const entityData = getMatchingMockEntity(params.entityId as string)\n\n if (entityData?.path) {\n response = entityData.path\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.get(`${backendOrigin}/file/v1/entity/:id/uploadDestination`, () => {\n const response: UploadDestination = mockSynapseStorageUploadDestination\n return HttpResponse.json(response, { status: 200 })\n }),\n\n http.get(\n `${backendOrigin}/file/v1/entity/:id/uploadDestination/:storageLocationId`,\n ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<UploadDestination> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find an uploadDestination using storageLocationId ${params.storageLocationId}`,\n }\n const uploadDestination = mockUploadDestinations.find(\n e => Number(params.storageLocationId) === e.storageLocationId,\n )\n\n if (uploadDestination) {\n response = uploadDestination\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.get(`${backendOrigin}/repo/v1/projects`, () => {\n const response: ProjectHeaderList = {\n results: mockProjectsEntityData.map(p => ({\n name: p.name,\n id: p.id,\n lastActivity: '2024-01-04T21:11:59.000Z',\n modifiedBy: parseInt(p.entity.modifiedBy!),\n modifiedOn: p.entity.modifiedOn!,\n })),\n }\n return HttpResponse.json(response, { status: 200 })\n }),\n\n http.post<{ entityId: string }, AccessControlList>(\n `${backendOrigin}${ENTITY_ID(':entityId')}/acl`,\n async ({ params, request }) => {\n const entityData = getMatchingMockEntity(params.entityId)\n let status: number\n let response: SynapseApiResponse<AccessControlList>\n if (!entityData) {\n status = 404\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n } else if (entityData.bundle?.accessControlList) {\n status = 403\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: 'Resource already has an ACL.',\n }\n } else {\n response = await request.json()\n status = 201\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.put<{ entityId: string }, AccessControlList>(\n `${backendOrigin}${ENTITY_ID(':entityId')}/acl`,\n async ({ params, request }) => {\n const entityData = getMatchingMockEntity(params.entityId)\n\n let status: number\n let response: SynapseApiResponse<AccessControlList>\n\n if (!entityData) {\n status = 404\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n } else if (!entityData?.bundle?.accessControlList) {\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason:\n 'Cannot update ACL for a resource which inherits its permissions.',\n }\n status = 403\n } else {\n response = await request.json()\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.delete(`${backendOrigin}${ENTITY_ID(':entityId')}/acl`, ({ params }) => {\n const entityData = getMatchingMockEntity(params.entityId as string)\n\n let status: number\n let response: SynapseApiResponse<''>\n\n if (!entityData) {\n status = 404\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n } else if (!entityData?.bundle?.accessControlList) {\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason:\n 'Cannot delete ACL for a resource which inherits its permissions.',\n }\n status = 403\n } else {\n response = ''\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n }),\n]\n"],"mappings":";;;;;;;;;AAwCA,SAAS,EAAwB,GAAuC;CACtE,IAAM,IAAsB,EAAU,IAAI,CAAkB;CAC5D,OAAO,EAAa,QAAO,MACzB,EAAoB,SAAS,EAAmB,EAAO,EAAE,CAAC,CAC5D;AACF;AACA,SAAS,EAAsB,GAA8C;CAC3E,IAAM,IAAU,EAAwB,CAAC,CAAQ,CAAC;CAC9C,MAAQ,UAAU,GAGtB,OAAO,EAAQ;AACjB;AAEA,SAAgB,EACd,GACA,GACA;CACA,OAAO,EAAK,KACV,GAAG,IAAgB,EAAiB,WAAW,MAC9C,EAAE,gBAAa;EACd,IAAI,IAAS,KACT,IAA6C;GAC/C,cAAc;GACd,QAAQ,mEAAmE,EAAO;EACpF;EACA,IAAI,GAEF,AADA,IAAW,GACX,IAAS;OACJ;GACL,IAAM,IAAa,EAAsB,EAAO,QAAkB;GAClE,AAAI,GAAY,WACd,IAAW,EAAW,QACtB,IAAS;EAEb;EACA,OAAO,EAAa,KAAK,GAAU,EAAE,UAAO,CAAC;CAC/C,CACF;AACF;AAEA,SAAgB,EACd,GACA,GACA;CACA,OAAO,EAAK,IACV,GAAG,IAAgB,EAAY,WAAW,WAEpC;EACJ,IAAM,IAAW;EACjB,OAAO,EAA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andlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/entityHandlers.ts"],"sourcesContent":["import {\n ENTITY,\n ENTITY_BUNDLE_V2,\n ENTITY_HEADERS,\n ENTITY_ID,\n ENTITY_ID_VERSION,\n ENTITY_ID_VERSIONS,\n ENTITY_JSON,\n ENTITY_SCHEMA_BINDING,\n ENTITY_SCHEMA_VALIDATION,\n} from '@/utils/APIConstants'\nimport { normalizeSynPrefix } from '@/utils/functions/EntityTypeUtils'\nimport {\n ErrorResponse,\n UploadDestination,\n} from '@sage-bionetworks/synapse-client'\nimport {\n AccessControlList,\n Entity,\n EntityBundle,\n EntityHeader,\n EntityJson,\n EntityPath,\n PaginatedResults,\n ProjectHeaderList,\n Reference,\n VersionableEntity,\n VersionInfo,\n} from '@sage-bionetworks/synapse-types'\nimport { uniqueId } from 'lodash-es'\nimport { http, HttpResponse } from 'msw'\nimport mockEntities, { mockProjectsEntityData } from '../../entity'\nimport { MOCK_INVALID_PROJECT_NAME } from '../../entity/mockEntity'\nimport { MockEntityData } from '../../entity/MockEntityData'\nimport {\n mockSynapseStorageUploadDestination,\n mockUploadDestinations,\n} from '../../mock_upload_destination'\nimport { mockOpenRestrictionInformation } from '../../mock_has_access_data'\nimport {\n mockSchemaBinding,\n mockSchemaValidationResults,\n} from '../../mockSchema'\nimport { SynapseApiResponse } from '../handlers'\n\nfunction getMatchingMockEntities(entityIds: string[]): MockEntityData[] {\n const normalizedPassedIds = entityIds.map(normalizeSynPrefix)\n return mockEntities.filter(entity =>\n normalizedPassedIds.includes(normalizeSynPrefix(entity.id)),\n )\n}\nfunction getMatchingMockEntity(entityId: string): MockEntityData | undefined {\n const matches = getMatchingMockEntities([entityId])\n if (matches.length == 0) {\n return undefined\n }\n return matches[0]\n}\n\nexport function getEntityBundleHandler(\n backendOrigin: string,\n bundle?: Partial<EntityBundle>,\n) {\n return http.post(\n `${backendOrigin}${ENTITY_BUNDLE_V2(':entityId')}`,\n ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<EntityBundle> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n if (bundle) {\n response = bundle as EntityBundle\n status = 200\n } else {\n const entityData = getMatchingMockEntity(params.entityId as string)\n if (entityData?.bundle) {\n response = entityData.bundle\n status = 200\n }\n }\n return HttpResponse.json(response, { status })\n },\n )\n}\n\nexport function getEntityJsonHandler(\n backendOrigin: string,\n entityJson?: Partial<EntityJson>,\n) {\n return http.get(\n `${backendOrigin}${ENTITY_JSON(':entityId')}`,\n\n () => {\n const response = entityJson\n return HttpResponse.json(response, { status: 200 })\n },\n )\n}\n\nexport function getVersionedEntityBundleHandler(\n backendOrigin: string,\n bundle?: Partial<EntityBundle>,\n) {\n return http.post(\n `${backendOrigin}${ENTITY_BUNDLE_V2(':entityId', ':versionNumber')}`,\n ({ params }) => {\n const entityId = params.entityId as string\n const versionNumber = parseInt(params.versionNumber as string)\n let status = 404\n let response: SynapseApiResponse<EntityBundle> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${entityId}`,\n }\n if (bundle) {\n response = bundle as EntityBundle\n status = 200\n } else {\n const entityData = getMatchingMockEntity(entityId)\n if (entityData) {\n const bundle = entityData.bundle\n if (entityData.versions?.[versionNumber]) {\n response = {\n ...bundle,\n entity: entityData.versions[versionNumber],\n } as EntityBundle\n } else {\n response = bundle as EntityBundle\n }\n status = 200\n }\n }\n return HttpResponse.json(response, { status })\n },\n )\n}\n\nexport const getEntityHandlers = (backendOrigin: string) => [\n /**\n * Create a new entity\n */\n http.post<never, Entity>(`${backendOrigin}${ENTITY}`, async ({ request }) => {\n let status = 200\n const requestBody = await request.json()\n let response: SynapseApiResponse<Entity> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: '...',\n }\n if (!requestBody) {\n status = 400\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock service worker received the following malformed body for PUT ${ENTITY} : ${JSON.stringify(\n requestBody,\n )}`,\n }\n } else {\n if (requestBody.name === MOCK_INVALID_PROJECT_NAME) {\n ;(response as ErrorResponse).reason = 'Invalid project name'\n status = 403\n } else {\n response = { id: uniqueId('syn'), ...requestBody }\n }\n }\n\n return HttpResponse.json(response, { status })\n }),\n\n /**\n * Get entity by ID\n */\n http.get(`${backendOrigin}${ENTITY_ID(':entityId')}`, ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<Entity> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity with ID ${params.entityId}`,\n }\n\n const entityData = getMatchingMockEntity(params.entityId as string)\n if (entityData) {\n response = entityData.entity\n status = 200\n }\n return HttpResponse.json(response, { status })\n }),\n\n http.get(\n `${backendOrigin}${ENTITY_ID_VERSIONS(':entityId')}`,\n ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<PaginatedResults<VersionInfo>> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find mock entity versions for ID ${params.entityId}`,\n }\n\n const entityData = getMatchingMockEntity(params.entityId as string)\n if (entityData?.versionInfo) {\n response = { results: entityData.versionInfo }\n status = 200\n }\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.get<{ entityId: string; versionNumber: string }>(\n `${backendOrigin}${ENTITY_ID_VERSION(':entityId', ':versionNumber')}`,\n ({ params }) => {\n let status = 404\n const entityId = params.entityId\n const versionNumber = params.versionNumber.toString()\n const requestedVersionNumber = parseInt(versionNumber)\n\n let response: SynapseApiResponse<VersionableEntity> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock versioned entity with ID ${entityId}.${versionNumber}`,\n }\n\n const entityData = getMatchingMockEntity(params.entityId)\n if (entityData?.versions?.[requestedVersionNumber]) {\n response = entityData.versions[\n requestedVersionNumber\n ] as VersionableEntity\n status = 200\n }\n return HttpResponse.json(response, { status })\n },\n ),\n\n getEntityBundleHandler(backendOrigin),\n getVersionedEntityBundleHandler(backendOrigin),\n\n http.get(`${backendOrigin}${ENTITY_SCHEMA_BINDING(':entityId')}`, () => {\n return HttpResponse.json(mockSchemaBinding, { status: 200 })\n }),\n http.get(`${backendOrigin}${ENTITY_SCHEMA_VALIDATION(':entityId')}`, () => {\n return HttpResponse.json(mockSchemaValidationResults, { status: 200 })\n }),\n http.post(`${backendOrigin}/repo/v1/restrictionInformation`, () => {\n return HttpResponse.json(mockOpenRestrictionInformation, { status: 200 })\n }),\n http.get(\n `${backendOrigin}${ENTITY_JSON(':entityId')}`,\n\n ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<EntityJson> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n const entityData = getMatchingMockEntity(params.entityId as string)\n if (entityData?.json) {\n response = entityData.json\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.post<{ entityId: string }, { references: Reference[] }>(\n `${backendOrigin}${ENTITY_HEADERS}`,\n\n async ({ params, request }) => {\n let status = 404\n let response: SynapseApiResponse<PaginatedResults<EntityHeader>> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n\n const referenceList = await request.json()\n const entityData: EntityHeader[] = referenceList.references\n .map(ref => {\n const entityHeader = getMatchingMockEntity(ref.targetId)?.entityHeader\n if (entityHeader) {\n return {\n ...entityHeader,\n // ID should match what is passed in (i.e. may or may not have syn prefix)\n id: ref.targetId,\n }\n }\n return undefined\n })\n .filter((header): header is EntityHeader => !!header)\n\n if (entityData) {\n response = { results: entityData }\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.get(\n `${backendOrigin}${ENTITY_ID(':entityId')}/path`,\n\n ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<EntityPath> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity path using ID ${params.entityId}`,\n }\n const entityData = getMatchingMockEntity(params.entityId as string)\n\n if (entityData?.path) {\n response = entityData.path\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.get(`${backendOrigin}/file/v1/entity/:id/uploadDestination`, () => {\n const response: UploadDestination = mockSynapseStorageUploadDestination\n return HttpResponse.json(response, { status: 200 })\n }),\n\n http.get(\n `${backendOrigin}/file/v1/entity/:id/uploadDestination/:storageLocationId`,\n ({ params }) => {\n let status = 404\n let response: SynapseApiResponse<UploadDestination> = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find an uploadDestination using storageLocationId ${params.storageLocationId}`,\n }\n const uploadDestination = mockUploadDestinations.find(\n e => Number(params.storageLocationId) === e.storageLocationId,\n )\n\n if (uploadDestination) {\n response = uploadDestination\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.get(`${backendOrigin}/repo/v1/projects`, () => {\n const response: ProjectHeaderList = {\n results: mockProjectsEntityData.map(p => ({\n name: p.name,\n id: p.id,\n lastActivity: '2024-01-04T21:11:59.000Z',\n modifiedBy: parseInt(p.entity.modifiedBy!),\n modifiedOn: p.entity.modifiedOn!,\n })),\n }\n return HttpResponse.json(response, { status: 200 })\n }),\n\n http.post<{ entityId: string }, AccessControlList>(\n `${backendOrigin}${ENTITY_ID(':entityId')}/acl`,\n async ({ params, request }) => {\n const entityData = getMatchingMockEntity(params.entityId)\n let status: number\n let response: SynapseApiResponse<AccessControlList>\n if (!entityData) {\n status = 404\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n } else if (entityData.bundle?.accessControlList) {\n status = 403\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: 'Resource already has an ACL.',\n }\n } else {\n response = await request.json()\n status = 201\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.put<{ entityId: string }, AccessControlList>(\n `${backendOrigin}${ENTITY_ID(':entityId')}/acl`,\n async ({ params, request }) => {\n const entityData = getMatchingMockEntity(params.entityId)\n\n let status: number\n let response: SynapseApiResponse<AccessControlList>\n\n if (!entityData) {\n status = 404\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n } else if (!entityData?.bundle?.accessControlList) {\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason:\n 'Cannot update ACL for a resource which inherits its permissions.',\n }\n status = 403\n } else {\n response = await request.json()\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n },\n ),\n\n http.delete(`${backendOrigin}${ENTITY_ID(':entityId')}/acl`, ({ params }) => {\n const entityData = getMatchingMockEntity(params.entityId as string)\n\n let status: number\n let response: SynapseApiResponse<''>\n\n if (!entityData) {\n status = 404\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason: `Mock Service worker could not find a mock entity bundle with ID ${params.entityId}`,\n }\n } else if (!entityData?.bundle?.accessControlList) {\n response = {\n concreteType: 'org.sagebionetworks.repo.model.ErrorResponse',\n reason:\n 'Cannot delete ACL for a resource which inherits its permissions.',\n }\n status = 403\n } else {\n response = ''\n status = 200\n }\n\n return HttpResponse.json(response, { status })\n }),\n]\n"],"mappings":";;;;;;;;;;AA6CA,SAAS,EAAwB,GAAuC;CACtE,IAAM,IAAsB,EAAU,IAAI,CAAkB;CAC5D,OAAO,EAAa,QAAO,MACzB,EAAoB,SAAS,EAAmB,EAAO,EAAE,CAAC,CAC5D;AACF;AACA,SAAS,EAAsB,GAA8C;CAC3E,IAAM,IAAU,EAAwB,CAAC,CAAQ,CAAC;CAC9C,MAAQ,UAAU,GAGtB,OAAO,EAAQ;AACjB;AAEA,SAAgB,EACd,GACA,GACA;CACA,OAAO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oBJ,OAlBK,IAMO,GAAY,QAAQ,qBAQ9B,IAAW,MAAM,EAAQ,KAAK,GAC9B,IAAS,QART,IAAW;GACT,cAAc;GACd,QACE;EACJ,GACA,IAAS,QAXT,IAAS,KACT,IAAW;GACT,cAAc;GACd,QAAQ,mEAAmE,EAAO;EACpF,IAaK,EAAa,KAAK,GAAU,EAAE,UAAO,CAAC;CAC/C,CACF;CAEA,EAAK,OAAO,GAAG,IAAgB,EAAU,WAAW,EAAE,QAAQ,EAAE,gBAAa;EAC3E,IAAM,IAAa,EAAsB,EAAO,QAAkB,GAE9D,GACA;EAoBJ,OAlBK,IAMO,GAAY,QAAQ,qBAQ9B,IAAW,IACX,IAAS,QART,IAAW;GACT,cAAc;GACd,QACE;EACJ,GACA,IAAS,QAXT,IAAS,KACT,IAAW;GACT,cAAc;GACd,QAAQ,mEAAmE,EAAO;EACpF,IAaK,EAAa,KAAK,GAAU,EAAE,UAAO,CAAC;CAC/C,CAAC;AACH"}
|
|
@@ -29,7 +29,7 @@ function a(a) {
|
|
|
29
29
|
}
|
|
30
30
|
}, { status: 200 })) : e.text("Job not found", { status: 404 });
|
|
31
31
|
}),
|
|
32
|
-
t.post(`${a}/repo/v1/grid/:sessionId/replica`, async ({ request: t }) => {
|
|
32
|
+
t.post(`${a}/repo/v1/grid/session/:sessionId/replica`, async ({ request: t }) => {
|
|
33
33
|
let { gridSessionId: r } = await t.json();
|
|
34
34
|
if (!Array.from(i.values()).find((e) => e.sessionId === r)) return e.text("Grid session not found", { status: 404 });
|
|
35
35
|
let a = {
|
|
@@ -44,7 +44,7 @@ function a(a) {
|
|
|
44
44
|
};
|
|
45
45
|
return e.json(a, { status: 201 });
|
|
46
46
|
}),
|
|
47
|
-
t.
|
|
47
|
+
t.post(`${a}/repo/v1/grid/session/:sessionId/presigned/url`, ({ params: t }) => {
|
|
48
48
|
let { sessionId: n } = t;
|
|
49
49
|
if (!Array.from(i.values()).find((e) => e.sessionId === n)) return e.text("Grid session not found", { status: 404 });
|
|
50
50
|
let r = `https://mock-s3-bucket/${n}/data.csv?presigned=true`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/gridHandlers.ts"],"sourcesContent":["import { CreateReplicaRequest } from '@sage-bionetworks/synapse-client'\nimport { http, HttpResponse } from 'msw'\n\nfunction getRandomInt() {\n return crypto.getRandomValues(new Uint32Array(1))[0]\n}\n\n// Generate unique session IDs for grid sessions\nconst generateSessionId = () => {\n const randomId: number = getRandomInt()\n return `grid-session-${randomId * 100000}`\n}\n\ninterface GridJob {\n status: string\n startTime: number\n sessionId: string\n}\n\n// In-memory storage to track async jobs\nconst pendingJobs = new Map<string, GridJob>()\n\nexport function getGridHandlers(backendOrigin: string) {\n return [\n // Handler for starting a grid session\n http.post(\n `${backendOrigin}/repo/v1/grid/session/async/start`,\n async ({ request }) => {\n // Generate a unique job token\n const jobToken = `job-${Date.now()}-${Math.random()\n .toString(36)\n .substring(2, 9)}`\n const requestBody = await request.json()\n\n // Store job details for later reference\n pendingJobs.set(jobToken, {\n status: 'PROCESSING',\n startTime: Date.now(),\n sessionId: generateSessionId(),\n })\n\n return HttpResponse.json(requestBody, { status: 201 })\n },\n ),\n\n // Handler for retrieving async job results\n http.get<{ token: string }>(\n `${backendOrigin}/repo/v1/grid/session/async/get/:token`,\n ({ params }) => {\n // Retrieve job data\n const jobData = pendingJobs.get(params.token)\n\n if (!jobData) {\n return HttpResponse.text('Job not found', { status: 404 })\n }\n\n // Job is complete, return result\n jobData.status = 'COMPLETE'\n return HttpResponse.json(\n {\n concreteType: 'org.sagebionetworks.repo.model.grid.GridSession',\n gridSession: {\n sessionId: jobData.sessionId,\n startedBy: 'mockUser',\n startedOn: new Date().toISOString(),\n etag: `etag-${Date.now()}`,\n modifiedOn: new Date().toISOString(),\n lastReplicaIdClient: 1,\n lastReplicaIdService: 1,\n },\n },\n { status: 200 },\n )\n },\n ),\n\n // Handler for GridSessionReplica\n http.post<{ sessionId: string }, CreateReplicaRequest>(\n `${backendOrigin}/repo/v1/grid/:sessionId/replica`,\n async ({ request }) => {\n const { gridSessionId } = await request.json()\n\n // Check if the session ID exists in pending jobs\n const jobData = Array.from(pendingJobs.values()).find(\n job => job.sessionId === gridSessionId,\n )\n\n if (!jobData) {\n return HttpResponse.text('Grid session not found', { status: 404 })\n }\n\n // Create a replica for the session\n const replicaId = getRandomInt() % 1000\n const replicaResponse = {\n concreteType: 'org.sagebionetworks.repo.model.grid.GridReplica',\n replica: {\n gridSessionId,\n replicaId,\n createdBy: 'mockUser',\n isAgentReplica: false,\n createdOn: new Date().toISOString(),\n },\n }\n return HttpResponse.json(replicaResponse, { status: 201 })\n },\n ),\n\n // Handler for Grid presigned URL\n http.
|
|
1
|
+
{"version":3,"file":"gridHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/gridHandlers.ts"],"sourcesContent":["import { CreateReplicaRequest } from '@sage-bionetworks/synapse-client'\nimport { http, HttpResponse } from 'msw'\n\nfunction getRandomInt() {\n return crypto.getRandomValues(new Uint32Array(1))[0]\n}\n\n// Generate unique session IDs for grid sessions\nconst generateSessionId = () => {\n const randomId: number = getRandomInt()\n return `grid-session-${randomId * 100000}`\n}\n\ninterface GridJob {\n status: string\n startTime: number\n sessionId: string\n}\n\n// In-memory storage to track async jobs\nconst pendingJobs = new Map<string, GridJob>()\n\nexport function getGridHandlers(backendOrigin: string) {\n return [\n // Handler for starting a grid session\n http.post(\n `${backendOrigin}/repo/v1/grid/session/async/start`,\n async ({ request }) => {\n // Generate a unique job token\n const jobToken = `job-${Date.now()}-${Math.random()\n .toString(36)\n .substring(2, 9)}`\n const requestBody = await request.json()\n\n // Store job details for later reference\n pendingJobs.set(jobToken, {\n status: 'PROCESSING',\n startTime: Date.now(),\n sessionId: generateSessionId(),\n })\n\n return HttpResponse.json(requestBody, { status: 201 })\n },\n ),\n\n // Handler for retrieving async job results\n http.get<{ token: string }>(\n `${backendOrigin}/repo/v1/grid/session/async/get/:token`,\n ({ params }) => {\n // Retrieve job data\n const jobData = pendingJobs.get(params.token)\n\n if (!jobData) {\n return HttpResponse.text('Job not found', { status: 404 })\n }\n\n // Job is complete, return result\n jobData.status = 'COMPLETE'\n return HttpResponse.json(\n {\n concreteType: 'org.sagebionetworks.repo.model.grid.GridSession',\n gridSession: {\n sessionId: jobData.sessionId,\n startedBy: 'mockUser',\n startedOn: new Date().toISOString(),\n etag: `etag-${Date.now()}`,\n modifiedOn: new Date().toISOString(),\n lastReplicaIdClient: 1,\n lastReplicaIdService: 1,\n },\n },\n { status: 200 },\n )\n },\n ),\n\n // Handler for GridSessionReplica\n http.post<{ sessionId: string }, CreateReplicaRequest>(\n `${backendOrigin}/repo/v1/grid/session/:sessionId/replica`,\n async ({ request }) => {\n const { gridSessionId } = await request.json()\n\n // Check if the session ID exists in pending jobs\n const jobData = Array.from(pendingJobs.values()).find(\n job => job.sessionId === gridSessionId,\n )\n\n if (!jobData) {\n return HttpResponse.text('Grid session not found', { status: 404 })\n }\n\n // Create a replica for the session\n const replicaId = getRandomInt() % 1000\n const replicaResponse = {\n concreteType: 'org.sagebionetworks.repo.model.grid.GridReplica',\n replica: {\n gridSessionId,\n replicaId,\n createdBy: 'mockUser',\n isAgentReplica: false,\n createdOn: new Date().toISOString(),\n },\n }\n return HttpResponse.json(replicaResponse, { status: 201 })\n },\n ),\n\n // Handler for Grid presigned URL\n http.post<{ sessionId: string }>(\n `${backendOrigin}/repo/v1/grid/session/:sessionId/presigned/url`,\n ({ params }) => {\n const { sessionId } = params\n\n const jobData = Array.from(pendingJobs.values()).find(\n job => job.sessionId === sessionId,\n )\n if (!jobData) {\n return HttpResponse.text('Grid session not found', { status: 404 })\n }\n // Generate a mock presigned URL\n const presignedUrl = `https://mock-s3-bucket/${sessionId}/data.csv?presigned=true`\n return HttpResponse.json({ presignedUrl }, { status: 200 })\n },\n ),\n ]\n}\n"],"mappings":";;AAGA,SAAS,IAAe;CACtB,OAAO,OAAO,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AAa,IAAI;KAM/B,WAAW;KACX,gBAAgB;KAChB,4BAAW,IAAI,KAAK,GAAE,YAAY;IACpC;GACF;GACA,OAAO,EAAa,KAAK,GAAiB,EAAE,QAAQ,IAAI,CAAC;EAC3D,CACF;EAGA,EAAK,KACH,GAAG,EAAc,kDAChB,EAAE,gBAAa;GACd,IAAM,EAAE,iBAAc;GAKtB,IAAI,CAHY,MAAM,KAAK,EAAY,OAAO,CAAC,EAAE,MAC/C,MAAO,EAAI,cAAc,CAEtB,GACH,OAAO,EAAa,KAAK,0BAA0B,EAAE,QAAQ,IAAI,CAAC;GAGpE,IAAM,IAAe,0BAA0B,EAAU;GACzD,OAAO,EAAa,KAAK,EAAE,gBAAa,GAAG,EAAE,QAAQ,IAAI,CAAC;EAC5D,CACF;CACF;AACF"}
|
|
@@ -9,7 +9,7 @@ var a = new n({
|
|
|
9
9
|
autoGenerateId: !0
|
|
10
10
|
});
|
|
11
11
|
function o(e, t = "ASC", n = 0, r = 10, i) {
|
|
12
|
-
let o = a.getAll().filter((t) => e ? t.objectType === e : !0).filter((e) => i ? i.includes(e.objectId) : !0).
|
|
12
|
+
let o = a.getAll().filter((t) => e ? t.objectType === e : !0).filter((e) => i ? i.includes(e.objectId) : !0).toSorted((e, n) => {
|
|
13
13
|
let r = new Date(n.createdOn).getTime() - new Date(e.createdOn).getTime();
|
|
14
14
|
return t === "ASC" ? r : -1 * r;
|
|
15
15
|
}), s = o.length;
|