synapse-react-client 4.0.40 → 4.0.42
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.d.ts +1 -0
- package/dist/SWC.index.d.ts.map +1 -1
- package/dist/SWC.index.js +2 -1
- package/dist/SWC.index.js.map +1 -1
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.d.ts +1 -0
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.d.ts.map +1 -1
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.js +12 -12
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.d.ts +7 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js +30 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js +138 -244
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.d.ts +13 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.js +60 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts +8 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +179 -63
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts +2 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js +13 -13
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.d.ts +3 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts +3 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.d.ts +12 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.js +50 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +112 -143
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts +4 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js +8 -7
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts +3 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +79 -47
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.d.ts +12 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.js +51 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.d.ts +12 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.js +24 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts +11 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.js +0 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.d.ts +22 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.js +32 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.js.map +1 -0
- package/dist/components/AclEditor/AclEditor.js +20 -20
- package/dist/components/Aridhia/AridhiaAccessStatus.d.ts.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.js +51 -48
- package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
- package/dist/components/Authentication/Constants.d.ts +4 -0
- package/dist/components/Authentication/Constants.d.ts.map +1 -1
- package/dist/components/Authentication/Constants.js +5 -2
- package/dist/components/Authentication/Constants.js.map +1 -1
- package/dist/components/Authentication/RecoveryCodeGrid.d.ts.map +1 -1
- package/dist/components/Authentication/RecoveryCodeGrid.js +8 -1
- package/dist/components/Authentication/RecoveryCodeGrid.js.map +1 -1
- package/dist/components/Authentication/RegenerateBackupCodesWarning.js +4 -1
- package/dist/components/Authentication/RegenerateBackupCodesWarning.js.map +1 -1
- package/dist/components/Authentication/TOTPForm.d.ts.map +1 -1
- package/dist/components/Authentication/TOTPForm.js +20 -18
- package/dist/components/Authentication/TOTPForm.js.map +1 -1
- package/dist/components/Authentication/TwoFactorBackupCodes.d.ts.map +1 -1
- package/dist/components/Authentication/TwoFactorBackupCodes.js +41 -12
- package/dist/components/Authentication/TwoFactorBackupCodes.js.map +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.d.ts.map +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js +90 -77
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +244 -246
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/components/GridLoadingState.d.ts +23 -0
- package/dist/components/DataGrid/components/GridLoadingState.d.ts.map +1 -0
- package/dist/components/DataGrid/components/GridLoadingState.js +64 -0
- package/dist/components/DataGrid/components/GridLoadingState.js.map +1 -0
- package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js +52 -54
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.d.ts +60 -6
- package/dist/components/DataGrid/useDataGridWebsocket.d.ts.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js +71 -60
- package/dist/components/DataGrid/useDataGridWebsocket.js.map +1 -1
- package/dist/components/DataGrid/utils/getNamedColumnIndices.d.ts +11 -0
- package/dist/components/DataGrid/utils/getNamedColumnIndices.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/getNamedColumnIndices.js +8 -0
- package/dist/components/DataGrid/utils/getNamedColumnIndices.js.map +1 -0
- package/dist/components/FilePreview/FileHandleContentRenderer.d.ts +6 -2
- package/dist/components/FilePreview/FileHandleContentRenderer.d.ts.map +1 -1
- package/dist/components/FilePreview/FileHandleContentRenderer.js +27 -14
- package/dist/components/FilePreview/FileHandleContentRenderer.js.map +1 -1
- package/dist/components/FilePreview/PdfPreview.d.ts +1 -1
- package/dist/components/FilePreview/PdfPreview.d.ts.map +1 -1
- package/dist/components/FilePreview/PdfPreview.js +15 -16
- package/dist/components/FilePreview/PdfPreview.js.map +1 -1
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts +11 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js +61 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts +33 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js +190 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.css +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.d.ts +17 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.js +88 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.module.js +5 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.module.scss +12 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.d.ts +19 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.js +115 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.css +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.d.ts +9 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.js +18 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.js +5 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.scss +4 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.d.ts +21 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.js +108 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.js.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.d.ts +10 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.js +31 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.js.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.d.ts +15 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js +234 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.d.ts +14 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js +72 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js.map +1 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.d.ts +13 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.js +33 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.js.map +1 -0
- package/dist/components/FormTemplateEditor/StepCard.d.ts +25 -0
- package/dist/components/FormTemplateEditor/StepCard.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/StepCard.js +203 -0
- package/dist/components/FormTemplateEditor/StepCard.js.map +1 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.d.ts +34 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.js +128 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.js.map +1 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts +19 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.js +78 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.js.map +1 -0
- package/dist/components/FormTemplateEditor/dragHandle.css +1 -0
- package/dist/components/FormTemplateEditor/dragHandle.module.js +8 -0
- package/dist/components/FormTemplateEditor/dragHandle.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/dragHandle.module.scss +22 -0
- package/dist/components/FormTemplateEditor/dropTarget.css +1 -0
- package/dist/components/FormTemplateEditor/dropTarget.module.js +5 -0
- package/dist/components/FormTemplateEditor/dropTarget.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/dropTarget.module.scss +14 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.d.ts +48 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.js +126 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.js.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.d.ts +35 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.js +35 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.js.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.d.ts +32 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.js +75 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.js.map +1 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts +27 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js +84 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js.map +1 -0
- package/dist/components/FormTemplateEditor/sortableIds.d.ts +23 -0
- package/dist/components/FormTemplateEditor/sortableIds.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/sortableIds.js +24 -0
- package/dist/components/FormTemplateEditor/sortableIds.js.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.d.ts +33 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.js +59 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.js.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.d.ts +9 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.js +66 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.js.map +1 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts +28 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js +54 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js.map +1 -0
- package/dist/components/FormTemplateEditor/utils.d.ts +21 -0
- package/dist/components/FormTemplateEditor/utils.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/utils.js +24 -0
- package/dist/components/FormTemplateEditor/utils.js.map +1 -0
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts +1 -1
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.css +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.scss +6 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js +4 -0
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js.map +1 -1
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.d.ts +11 -0
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.js +28 -19
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.css +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts +3 -0
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.js +123 -123
- package/dist/components/QueryBuilder/FilterConditionRow.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.module.js +10 -11
- package/dist/components/QueryBuilder/FilterConditionRow.module.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.module.scss +0 -5
- package/dist/components/QueryBuilder/FilterGroupNode.css +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts +4 -0
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.js +85 -51
- package/dist/components/QueryBuilder/FilterGroupNode.js.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.module.js +10 -9
- package/dist/components/QueryBuilder/FilterGroupNode.module.js.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.module.scss +9 -0
- package/dist/components/QueryBuilder/QBDragHandle.d.ts +10 -0
- package/dist/components/QueryBuilder/QBDragHandle.d.ts.map +1 -0
- package/dist/components/QueryBuilder/QBDragHandle.js +22 -0
- package/dist/components/QueryBuilder/QBDragHandle.js.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.d.ts.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderControls.js +120 -108
- package/dist/components/QueryBuilder/QueryBuilderControls.js.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts +7 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.js.map +1 -1
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts +2 -1
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts.map +1 -1
- package/dist/components/QueryBuilder/qbTreeToReadable.js +25 -21
- package/dist/components/QueryBuilder/qbTreeToReadable.js.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderDnd.d.ts +27 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.js +41 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.css +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.js +8 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.scss +12 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts +16 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderMetadata.js +13 -5
- package/dist/components/QueryBuilder/queryBuilderMetadata.js.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderOperations.d.ts +13 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.d.ts.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderOperations.js +39 -36
- package/dist/components/QueryBuilder/queryBuilderOperations.js.map +1 -1
- package/dist/components/QueryBuilder/useQBValueDisplayName.d.ts +18 -0
- package/dist/components/QueryBuilder/useQBValueDisplayName.d.ts.map +1 -0
- package/dist/components/QueryBuilder/useQBValueDisplayName.js +64 -0
- package/dist/components/QueryBuilder/useQBValueDisplayName.js.map +1 -0
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +46 -47
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +6 -6
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.d.ts +1 -0
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.d.ts.map +1 -1
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.js +13 -11
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.js.map +1 -1
- package/dist/components/SynapseTable/SearchV2.js +4 -4
- package/dist/components/ToastMessage/ToastMessage.d.ts.map +1 -1
- package/dist/components/ToastMessage/ToastMessage.js +25 -22
- package/dist/components/ToastMessage/ToastMessage.js.map +1 -1
- package/dist/components/dataaccess/FormTemplateEditorRoute.d.ts +7 -0
- package/dist/components/dataaccess/FormTemplateEditorRoute.d.ts.map +1 -0
- package/dist/components/dataaccess/FormTemplateEditorRoute.js +26 -0
- package/dist/components/dataaccess/FormTemplateEditorRoute.js.map +1 -0
- package/dist/components/dataaccess/FormTemplateTable.d.ts +10 -0
- package/dist/components/dataaccess/FormTemplateTable.d.ts.map +1 -0
- package/dist/components/dataaccess/FormTemplateTable.js +124 -0
- package/dist/components/dataaccess/FormTemplateTable.js.map +1 -0
- package/dist/components/dataaccess/ReviewerDashboard.d.ts.map +1 -1
- package/dist/components/dataaccess/ReviewerDashboard.js +80 -50
- package/dist/components/dataaccess/ReviewerDashboard.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +2 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts +0 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +35 -36
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
- package/dist/components/styled/LeftRightPanel.d.ts.map +1 -1
- package/dist/components/styled/LeftRightPanel.js +19 -2
- package/dist/components/styled/LeftRightPanel.js.map +1 -1
- package/dist/components/widgets/FileHandleLink.d.ts +12 -2
- package/dist/components/widgets/FileHandleLink.d.ts.map +1 -1
- package/dist/components/widgets/FileHandleLink.js +25 -29
- package/dist/components/widgets/FileHandleLink.js.map +1 -1
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts +4 -2
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockFormTemplates.js +13 -14
- package/dist/mocks/accessRequirement/mockFormTemplates.js.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts +4 -1
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemas.js +24 -17
- package/dist/mocks/accessRequirement/mockJsonSchemas.js.map +1 -1
- package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts +41 -14
- package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/asyncJobHandlers.js +53 -44
- package/dist/mocks/msw/handlers/asyncJobHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/authHandlers.d.ts +1 -0
- package/dist/mocks/msw/handlers/authHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/authHandlers.js +6 -2
- package/dist/mocks/msw/handlers/authHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/chatHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/chatHandlers.js +19 -13
- package/dist/mocks/msw/handlers/chatHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts +2 -0
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js +52 -46
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/fileHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/fileHandlers.js +25 -21
- package/dist/mocks/msw/handlers/fileHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts +2 -1
- package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/formTemplateHandlers.js +18 -18
- package/dist/mocks/msw/handlers/formTemplateHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/schemaHandlers.d.ts +10 -1
- package/dist/mocks/msw/handlers/schemaHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/schemaHandlers.js +30 -7
- package/dist/mocks/msw/handlers/schemaHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/searchQueryHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/searchQueryHandlers.js +24 -18
- package/dist/mocks/msw/handlers/searchQueryHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/tableQueryHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/tableQueryHandlers.js +35 -16
- package/dist/mocks/msw/handlers/tableQueryHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.d.ts +8 -0
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.d.ts.map +1 -0
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.js +19 -0
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.js.map +1 -0
- package/dist/style/abstracts/_cssVariables.scss +13 -0
- package/dist/style/components/_toasts.scss +10 -1
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +9 -3
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +17 -7
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/auth/index.d.ts +1 -0
- package/dist/synapse-queries/auth/index.d.ts.map +1 -1
- package/dist/synapse-queries/auth/index.js +2 -1
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.d.ts +11 -0
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.d.ts.map +1 -0
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js +19 -0
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js.map +1 -0
- package/dist/synapse-queries/dataaccess/index.d.ts +0 -1
- package/dist/synapse-queries/dataaccess/index.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +3 -4
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts +18 -0
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js +33 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
- package/dist/synapse-queries/file/useDirectUploadToS3.js +6 -6
- package/dist/synapse-queries/file/useFileHandle.d.ts +8 -0
- package/dist/synapse-queries/file/useFileHandle.d.ts.map +1 -1
- package/dist/synapse-queries/file/useFileHandle.js +15 -6
- package/dist/synapse-queries/file/useFileHandle.js.map +1 -1
- package/dist/synapse-queries/index.js +260 -257
- package/dist/synapse-queries/jsonschema/index.js +2 -2
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts +9 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts.map +1 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js +22 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js.map +1 -0
- package/dist/synapse-queries/jsonschema/useSchema.d.ts +5 -0
- package/dist/synapse-queries/jsonschema/useSchema.d.ts.map +1 -1
- package/dist/synapse-queries/jsonschema/useSchema.js +9 -1
- package/dist/synapse-queries/jsonschema/useSchema.js.map +1 -1
- package/dist/testutils/vitest.setup.js +18 -9
- package/dist/testutils/vitest.setup.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/APIConstants.d.ts +2 -0
- package/dist/utils/APIConstants.d.ts.map +1 -1
- package/dist/utils/APIConstants.js +2 -2
- package/dist/utils/APIConstants.js.map +1 -1
- package/dist/utils/appendFinalQueryParamKey.d.ts.map +1 -1
- package/dist/utils/appendFinalQueryParamKey.js +4 -1
- package/dist/utils/appendFinalQueryParamKey.js.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts +2 -0
- package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.js +1 -1
- package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
- package/dist/utils/functions/ArrayUtils.d.ts +3 -0
- package/dist/utils/functions/ArrayUtils.d.ts.map +1 -1
- package/dist/utils/functions/ArrayUtils.js +7 -1
- package/dist/utils/functions/ArrayUtils.js.map +1 -1
- package/dist/utils/functions/toPascalCase.d.ts +6 -0
- package/dist/utils/functions/toPascalCase.d.ts.map +1 -0
- package/dist/utils/functions/toPascalCase.js +8 -0
- package/dist/utils/functions/toPascalCase.js.map +1 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.d.ts +26 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.d.ts.map +1 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.js +28 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.js.map +1 -0
- package/dist/utils/jsonschema/submissionContext.d.ts +91 -0
- package/dist/utils/jsonschema/submissionContext.d.ts.map +1 -0
- package/dist/utils/jsonschema/submissionContext.js +178 -0
- package/dist/utils/jsonschema/submissionContext.js.map +1 -0
- package/package.json +13 -10
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.d.ts +0 -6
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.d.ts.map +0 -1
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js +0 -32
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js.map +0 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts +0 -9
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts.map +0 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.js +0 -24
- package/dist/components/entity/page/title_bar/TitleBarProperties.js.map +0 -1
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.d.ts +0 -21
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.d.ts.map +0 -1
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.js +0 -34
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.js.map +0 -1
|
@@ -1,15 +1,42 @@
|
|
|
1
|
-
import { ErrorResponse } from '@sage-bionetworks/synapse-client';
|
|
2
|
-
import { DefaultBodyType } from 'msw';
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { AsynchronousRequestBody, ErrorResponse } from '@sage-bionetworks/synapse-client';
|
|
2
|
+
import { DefaultBodyType, HttpHandler } from 'msw';
|
|
3
|
+
/**
|
|
4
|
+
* Maps a job request's `concreteType` to a function producing that job's response body.
|
|
5
|
+
*/
|
|
6
|
+
export type AsynchronousJobDispatch = Record<string, (request: AsynchronousRequestBody) => DefaultBodyType | ErrorResponse>;
|
|
7
|
+
/**
|
|
8
|
+
* Build a single-entry `AsynchronousJobDispatch` for one `concreteType`, narrowing `handler`'s
|
|
9
|
+
* request parameter to that type's variant of `AsynchronousRequestBody` so callers never have to
|
|
10
|
+
* re-cast the generic request themselves.
|
|
11
|
+
*/
|
|
12
|
+
export declare function dispatchEntry<T extends AsynchronousRequestBody['concreteType']>(concreteType: T, handler: (request: Extract<AsynchronousRequestBody, {
|
|
13
|
+
concreteType: T;
|
|
14
|
+
}>) => DefaultBodyType | ErrorResponse): AsynchronousJobDispatch;
|
|
15
|
+
/**
|
|
16
|
+
* A dedicated async service-specific start/get path pair.
|
|
17
|
+
*/
|
|
18
|
+
type AsyncTypeServicePaths = {
|
|
19
|
+
requestPath: string;
|
|
20
|
+
responsePath: (tokenParam: string) => string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Generates MSW handlers for asynchronous jobs, dispatching by request `concreteType`.
|
|
24
|
+
*
|
|
25
|
+
* By default, registers the generic endpoint pair used by every job type dispatched through
|
|
26
|
+
* `postRepoV1AsynchronousJob`/`getRepoV1AsynchronousJobJobId`
|
|
27
|
+
* (`POST /repo/v1/asynchronous/job` + `GET /repo/v1/asynchronous/job/{jobId}`). Callers that need
|
|
28
|
+
* to support more than one `concreteType` in the same test/story MUST merge their entries into a
|
|
29
|
+
* single `dispatch` map and call this once.
|
|
30
|
+
*
|
|
31
|
+
* @param dispatch maps each supported request `concreteType` to a function producing that job's response body
|
|
32
|
+
* @param options.asyncTypeServicePaths registers a dedicated start/get path pair instead of the generic endpoint; see {@link AsyncTypeServicePaths}
|
|
33
|
+
* @param options.backendOrigin the backend origin to use for the handlers
|
|
34
|
+
* @param options.serviceSpecificEndpointResponseStatus the status code for the dedicated response path (`asyncTypeServicePaths` only); also determines whether both GET endpoints report `COMPLETE` or `FAILED`
|
|
35
|
+
*/
|
|
36
|
+
export declare function generateAsyncJobHandlers(dispatch: AsynchronousJobDispatch, options?: {
|
|
37
|
+
asyncTypeServicePaths?: AsyncTypeServicePaths;
|
|
38
|
+
backendOrigin?: string;
|
|
39
|
+
serviceSpecificEndpointResponseStatus?: number;
|
|
40
|
+
}): HttpHandler[];
|
|
41
|
+
export {};
|
|
15
42
|
//# sourceMappingURL=asyncJobHandlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncJobHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/asyncJobHandlers.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"asyncJobHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/asyncJobHandlers.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,uBAAuB,EACvB,aAAa,EACd,MAAM,kCAAkC,CAAA;AAMzC,OAAO,EAAE,eAAe,EAAQ,WAAW,EAAgB,MAAM,KAAK,CAAA;AAiBtE;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C,MAAM,EACN,CAAC,OAAO,EAAE,uBAAuB,KAAK,eAAe,GAAG,aAAa,CACtE,CAAA;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,CAAC,SAAS,uBAAuB,CAAC,cAAc,CAAC,EAEjD,YAAY,EAAE,CAAC,EACf,OAAO,EAAE,CACP,OAAO,EAAE,OAAO,CAAC,uBAAuB,EAAE;IAAE,YAAY,EAAE,CAAC,CAAA;CAAE,CAAC,KAC3D,eAAe,GAAG,aAAa,GACnC,uBAAuB,CAKzB;AAED;;GAEG;AACH,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAA;CAC7C,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,uBAAuB,EACjC,OAAO,GAAE;IACP,qBAAqB,CAAC,EAAE,qBAAqB,CAAA;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,qCAAqC,CAAC,EAAE,MAAM,CAAA;CAC1C,GACL,WAAW,EAAE,CA0Hf"}
|
|
@@ -1,53 +1,62 @@
|
|
|
1
1
|
import { BackendDestinationEnum as e, getEndpoint as t } from "../../../utils/functions/getEndpoint.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { HttpResponse as
|
|
2
|
+
import { ASYNCHRONOUS_JOB as n, ASYNCHRONOUS_JOB_TOKEN as r } from "../../../utils/APIConstants.js";
|
|
3
|
+
import i from "../util/BasicMockedCrudService.js";
|
|
4
|
+
import { HttpResponse as a, http as o } from "msw";
|
|
5
5
|
//#region src/mocks/msw/handlers/asyncJobHandlers.ts
|
|
6
|
-
var
|
|
6
|
+
var s = new i({
|
|
7
7
|
idField: "id",
|
|
8
8
|
autoGenerateId: !0
|
|
9
9
|
});
|
|
10
|
-
function
|
|
11
|
-
return [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
10
|
+
function c(e, t) {
|
|
11
|
+
return { [e]: (e) => t(e) };
|
|
12
|
+
}
|
|
13
|
+
function l(i, c = {}) {
|
|
14
|
+
let { asyncTypeServicePaths: l, backendOrigin: u = t(e.REPO_ENDPOINT), serviceSpecificEndpointResponseStatus: d = 201 } = c;
|
|
15
|
+
if (l && Object.keys(i).length !== 1) throw Error("generateAsyncJobHandlers: asyncTypeServicePaths requires exactly one dispatch entry, since the dedicated path already disambiguates the job type.");
|
|
16
|
+
let f = d < 400 ? "COMPLETE" : "FAILED";
|
|
17
|
+
function p(e) {
|
|
18
|
+
let t = i[e.concreteType];
|
|
19
|
+
if (!t) throw Error(`generateAsyncJobHandlers: unsupported concreteType "${e.concreteType}"`);
|
|
20
|
+
return t(e);
|
|
21
|
+
}
|
|
22
|
+
let m = l?.requestPath ?? n, h = [o.post(`${u}${m}`, async ({ request: e }) => {
|
|
23
|
+
let t = await e.json(), n = s.create({
|
|
24
|
+
request: t,
|
|
25
|
+
response: p(t)
|
|
26
|
+
}), r = l ? { token: n.id } : {
|
|
27
|
+
jobId: n.id,
|
|
28
|
+
jobState: "PROCESSING"
|
|
29
|
+
};
|
|
30
|
+
return a.json(r, { status: 201 });
|
|
31
|
+
}), o.get(`${u}${r(":id")}`, ({ params: e }) => {
|
|
32
|
+
let t = e.id, n = s.getOneById(t);
|
|
33
|
+
if (!t || !n) return a.json({ message: "The mocked asynchronous job was not found" }, { status: 404 });
|
|
34
|
+
let { request: r, response: i } = n;
|
|
35
|
+
return a.json({
|
|
36
|
+
jobState: f,
|
|
37
|
+
jobCanceling: !1,
|
|
38
|
+
requestBody: r,
|
|
39
|
+
etag: "00000000-0000-0000-0000-000000000000",
|
|
40
|
+
jobId: t,
|
|
41
|
+
responseBody: i,
|
|
42
|
+
startedByUserId: 0,
|
|
43
|
+
startedOn: "",
|
|
44
|
+
changedOn: "",
|
|
45
|
+
progressMessage: "",
|
|
46
|
+
progressCurrent: 100,
|
|
47
|
+
progressTotal: 100,
|
|
48
|
+
exception: "",
|
|
49
|
+
errorMessage: "",
|
|
50
|
+
errorDetails: "",
|
|
51
|
+
runtimeMS: 100
|
|
52
|
+
}, { status: 200 });
|
|
53
|
+
})];
|
|
54
|
+
return l && h.push(o.get(`${u}${l.responsePath(":asyncJobToken")}`, ({ params: e }) => {
|
|
55
|
+
let t = e.asyncJobToken, n = s.getOneById(t);
|
|
56
|
+
return !t || !n ? a.json({ message: "The mocked asynchronous job was not found" }, { status: 404 }) : a.json(n.response, { status: d });
|
|
57
|
+
})), h;
|
|
49
58
|
}
|
|
50
59
|
//#endregion
|
|
51
|
-
export {
|
|
60
|
+
export { c as dispatchEntry, l as generateAsyncJobHandlers };
|
|
52
61
|
|
|
53
62
|
//# sourceMappingURL=asyncJobHandlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncJobHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/asyncJobHandlers.ts"],"sourcesContent":["import { ASYNCHRONOUS_JOB_TOKEN } from '@/utils/APIConstants'\nimport {\n BackendDestinationEnum,\n getEndpoint,\n} from '@/utils/functions/getEndpoint'\nimport {
|
|
1
|
+
{"version":3,"file":"asyncJobHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/asyncJobHandlers.ts"],"sourcesContent":["import { ASYNCHRONOUS_JOB, ASYNCHRONOUS_JOB_TOKEN } from '@/utils/APIConstants'\nimport {\n BackendDestinationEnum,\n getEndpoint,\n} from '@/utils/functions/getEndpoint'\nimport {\n AsynchronousRequestBody,\n ErrorResponse,\n} from '@sage-bionetworks/synapse-client'\nimport {\n AsynchJobState,\n AsynchronousJobStatus,\n AsyncJobId,\n} from '@sage-bionetworks/synapse-types'\nimport { DefaultBodyType, http, HttpHandler, HttpResponse } from 'msw'\nimport BasicMockedCrudService from '../util/BasicMockedCrudService'\n\ntype AsyncJobDetails = {\n id: string\n request: AsynchronousRequestBody\n response: DefaultBodyType | ErrorResponse\n}\n\nconst mockAsynchronousJobService = new BasicMockedCrudService<\n AsyncJobDetails,\n 'id'\n>({\n idField: 'id',\n autoGenerateId: true,\n})\n\n/**\n * Maps a job request's `concreteType` to a function producing that job's response body.\n */\nexport type AsynchronousJobDispatch = Record<\n string,\n (request: AsynchronousRequestBody) => DefaultBodyType | ErrorResponse\n>\n\n/**\n * Build a single-entry `AsynchronousJobDispatch` for one `concreteType`, narrowing `handler`'s\n * request parameter to that type's variant of `AsynchronousRequestBody` so callers never have to\n * re-cast the generic request themselves.\n */\nexport function dispatchEntry<\n T extends AsynchronousRequestBody['concreteType'],\n>(\n concreteType: T,\n handler: (\n request: Extract<AsynchronousRequestBody, { concreteType: T }>,\n ) => DefaultBodyType | ErrorResponse,\n): AsynchronousJobDispatch {\n return {\n [concreteType]: request =>\n handler(request as Extract<AsynchronousRequestBody, { concreteType: T }>),\n }\n}\n\n/**\n * A dedicated async service-specific start/get path pair.\n */\ntype AsyncTypeServicePaths = {\n requestPath: string\n responsePath: (tokenParam: string) => string\n}\n\n/**\n * Generates MSW handlers for asynchronous jobs, dispatching by request `concreteType`.\n *\n * By default, registers the generic endpoint pair used by every job type dispatched through\n * `postRepoV1AsynchronousJob`/`getRepoV1AsynchronousJobJobId`\n * (`POST /repo/v1/asynchronous/job` + `GET /repo/v1/asynchronous/job/{jobId}`). Callers that need\n * to support more than one `concreteType` in the same test/story MUST merge their entries into a\n * single `dispatch` map and call this once.\n *\n * @param dispatch maps each supported request `concreteType` to a function producing that job's response body\n * @param options.asyncTypeServicePaths registers a dedicated start/get path pair instead of the generic endpoint; see {@link AsyncTypeServicePaths}\n * @param options.backendOrigin the backend origin to use for the handlers\n * @param options.serviceSpecificEndpointResponseStatus the status code for the dedicated response path (`asyncTypeServicePaths` only); also determines whether both GET endpoints report `COMPLETE` or `FAILED`\n */\nexport function generateAsyncJobHandlers(\n dispatch: AsynchronousJobDispatch,\n options: {\n asyncTypeServicePaths?: AsyncTypeServicePaths\n backendOrigin?: string\n serviceSpecificEndpointResponseStatus?: number\n } = {},\n): HttpHandler[] {\n const {\n asyncTypeServicePaths,\n backendOrigin = getEndpoint(BackendDestinationEnum.REPO_ENDPOINT),\n serviceSpecificEndpointResponseStatus = 201,\n } = options\n\n if (asyncTypeServicePaths && Object.keys(dispatch).length !== 1) {\n throw new Error(\n 'generateAsyncJobHandlers: asyncTypeServicePaths requires exactly one dispatch entry, since the dedicated path already disambiguates the job type.',\n )\n }\n\n const jobState: AsynchJobState =\n serviceSpecificEndpointResponseStatus < 400 ? 'COMPLETE' : 'FAILED'\n\n function resolveResponse(\n body: AsynchronousRequestBody,\n ): DefaultBodyType | ErrorResponse {\n const handler = dispatch[body.concreteType]\n if (!handler) {\n throw new Error(\n `generateAsyncJobHandlers: unsupported concreteType \"${body.concreteType}\"`,\n )\n }\n return handler(body)\n }\n\n const requestPath = asyncTypeServicePaths?.requestPath ?? ASYNCHRONOUS_JOB\n\n const handlers: HttpHandler[] = [\n // Handler for the asynchronous job request endpoint.\n http.post(`${backendOrigin}${requestPath}`, async ({ request }) => {\n const body = (await request.json()) as AsynchronousRequestBody\n const createdJob = mockAsynchronousJobService.create({\n request: body,\n response: resolveResponse(body),\n })\n\n // The generic endpoint's response is a full AsynchronousJobStatus (read via `.jobId`).\n // The per-service endpoints respond with an AsyncJobId (read via `.token`).\n const responseBody:\n | AsyncJobId\n | Partial<\n AsynchronousJobStatus<AsynchronousRequestBody, DefaultBodyType>\n > = asyncTypeServicePaths\n ? { token: createdJob.id }\n : { jobId: createdJob.id, jobState: 'PROCESSING' }\n\n return HttpResponse.json(responseBody, { status: 201 })\n }),\n\n // Generic async job response handler. Since this implementation is the same for all services and references the global map, it's fine if this is overridden.\n http.get(\n `${backendOrigin}${ASYNCHRONOUS_JOB_TOKEN(':id')}`,\n ({ params }) => {\n const id = params.id as string\n const asyncJobDetails = mockAsynchronousJobService.getOneById(id)\n if (!id || !asyncJobDetails) {\n return HttpResponse.json(\n { message: 'The mocked asynchronous job was not found' },\n { status: 404 },\n )\n }\n const { request, response } = asyncJobDetails\n\n return HttpResponse.json<\n AsynchronousJobStatus<AsynchronousRequestBody, DefaultBodyType>\n >(\n {\n jobState,\n jobCanceling: false,\n requestBody: request,\n etag: '00000000-0000-0000-0000-000000000000',\n jobId: id,\n responseBody: response as DefaultBodyType,\n startedByUserId: 0,\n startedOn: '',\n changedOn: '',\n progressMessage: '',\n progressCurrent: 100,\n progressTotal: 100,\n exception: '',\n errorMessage: '',\n errorDetails: '',\n runtimeMS: 100,\n },\n {\n // This endpoint returns a successful status code regardless of the job status\n status: 200,\n },\n )\n },\n ),\n ]\n\n if (asyncTypeServicePaths) {\n // Dedicated service-specific response endpoint, polled directly by type-specific services instead of\n // the generic async job response handler above.\n handlers.push(\n http.get<{ asyncJobToken: string }>(\n `${backendOrigin}${asyncTypeServicePaths.responsePath(':asyncJobToken')}`,\n ({ params }) => {\n const asyncJobToken = params.asyncJobToken\n const asyncJobDetails =\n mockAsynchronousJobService.getOneById(asyncJobToken)\n if (!asyncJobToken || !asyncJobDetails) {\n return HttpResponse.json(\n { message: 'The mocked asynchronous job was not found' },\n { status: 404 },\n )\n }\n\n return HttpResponse.json(asyncJobDetails.response, {\n status: serviceSpecificEndpointResponseStatus,\n })\n },\n ),\n )\n }\n\n return handlers\n}\n"],"mappings":";;;;;AAuBA,IAAM,IAA6B,IAAI,EAGrC;CACA,SAAS;CACT,gBAAgB;AAClB,CAAC;AAeD,SAAgB,EAGd,GACA,GAGyB;CACzB,OAAO,GACJ,KAAe,MACd,EAAQ,CAAgE,EAC5E;AACF;AAwBA,SAAgB,EACd,GACA,IAII,CAAC,GACU;CACf,IAAM,EACJ,0BACA,mBAAgB,EAAY,EAAuB,aAAa,GAChE,2CAAwC,QACtC;CAEJ,IAAI,KAAyB,OAAO,KAAK,CAAQ,EAAE,WAAW,GAC5D,MAAU,MACR,mJACF;CAGF,IAAM,IACJ,IAAwC,MAAM,aAAa;CAE7D,SAAS,EACP,GACiC;EACjC,IAAM,IAAU,EAAS,EAAK;EAC9B,IAAI,CAAC,GACH,MAAU,MACR,uDAAuD,EAAK,aAAa,EAC3E;EAEF,OAAO,EAAQ,CAAI;CACrB;CAEA,IAAM,IAAc,GAAuB,eAAe,GAEpD,IAA0B,CAE9B,EAAK,KAAK,GAAG,IAAgB,KAAe,OAAO,EAAE,iBAAc;EACjE,IAAM,IAAQ,MAAM,EAAQ,KAAK,GAC3B,IAAa,EAA2B,OAAO;GACnD,SAAS;GACT,UAAU,EAAgB,CAAI;EAChC,CAAC,GAIK,IAIE,IACJ,EAAE,OAAO,EAAW,GAAG,IACvB;GAAE,OAAO,EAAW;GAAI,UAAU;EAAa;EAEnD,OAAO,EAAa,KAAK,GAAc,EAAE,QAAQ,IAAI,CAAC;CACxD,CAAC,GAGD,EAAK,IACH,GAAG,IAAgB,EAAuB,KAAK,MAC9C,EAAE,gBAAa;EACd,IAAM,IAAK,EAAO,IACZ,IAAkB,EAA2B,WAAW,CAAE;EAChE,IAAI,CAAC,KAAM,CAAC,GACV,OAAO,EAAa,KAClB,EAAE,SAAS,4CAA4C,GACvD,EAAE,QAAQ,IAAI,CAChB;EAEF,IAAM,EAAE,YAAS,gBAAa;EAE9B,OAAO,EAAa,KAGlB;GACE;GACA,cAAc;GACd,aAAa;GACb,MAAM;GACN,OAAO;GACP,cAAc;GACd,iBAAiB;GACjB,WAAW;GACX,WAAW;GACX,iBAAiB;GACjB,iBAAiB;GACjB,eAAe;GACf,WAAW;GACX,cAAc;GACd,cAAc;GACd,WAAW;EACb,GACA,EAEE,QAAQ,IACV,CACF;CACF,CACF,CACF;CA2BA,OAzBI,KAGF,EAAS,KACP,EAAK,IACH,GAAG,IAAgB,EAAsB,aAAa,gBAAgB,MACrE,EAAE,gBAAa;EACd,IAAM,IAAgB,EAAO,eACvB,IACJ,EAA2B,WAAW,CAAa;EAQrD,OAPI,CAAC,KAAiB,CAAC,IACd,EAAa,KAClB,EAAE,SAAS,4CAA4C,GACvD,EAAE,QAAQ,IAAI,CAChB,IAGK,EAAa,KAAK,EAAgB,UAAU,EACjD,QAAQ,EACV,CAAC;CACH,CACF,CACF,GAGK;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/authHandlers.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,+
|
|
1
|
+
{"version":3,"file":"authHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/authHandlers.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,+BAqBpD;AAED,wBAAgB,qCAAqC,CAAC,aAAa,EAAE,MAAM,6BAI1E"}
|
|
@@ -4,10 +4,14 @@ function n(n) {
|
|
|
4
4
|
return [
|
|
5
5
|
t.get(`${n}/auth/v1/authenticatedOn`, () => e.json({ authenticatedOn: (/* @__PURE__ */ new Date()).toISOString() }, { status: 200 })),
|
|
6
6
|
t.get(`${n}/auth/v1/anonymousToken`, () => e.json({ accessToken: "mock-anonymous-token" }, { status: 200 })),
|
|
7
|
-
t.post(`${n}/auth/v1/oauth2/introspect`, () => e.json({ active: !0 }, { status: 200 }))
|
|
7
|
+
t.post(`${n}/auth/v1/oauth2/introspect`, () => e.json({ active: !0 }, { status: 200 })),
|
|
8
|
+
r(n)
|
|
8
9
|
];
|
|
9
10
|
}
|
|
11
|
+
function r(n) {
|
|
12
|
+
return t.delete(`${n}/auth/v1/oauth2/identity`, () => new e(null, { status: 200 }));
|
|
13
|
+
}
|
|
10
14
|
//#endregion
|
|
11
|
-
export { n as getAuthHandlers };
|
|
15
|
+
export { n as getAuthHandlers, r as getUnbindOAuthProviderIdentityHandler };
|
|
12
16
|
|
|
13
17
|
//# sourceMappingURL=authHandlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/authHandlers.ts"],"sourcesContent":["import { http, HttpResponse } from 'msw'\n\nexport function getAuthHandlers(backendOrigin: string) {\n return [\n http.get(`${backendOrigin}/auth/v1/authenticatedOn`, () => {\n return HttpResponse.json(\n { authenticatedOn: new Date().toISOString() },\n { status: 200 },\n )\n }),\n http.get(`${backendOrigin}/auth/v1/anonymousToken`, () => {\n return HttpResponse.json(\n { accessToken: 'mock-anonymous-token' },\n { status: 200 },\n )\n }),\n\n http.post(`${backendOrigin}/auth/v1/oauth2/introspect`, () => {\n return HttpResponse.json({ active: true }, { status: 200 })\n }),\n ]\n}\n"],"mappings":";;AAEA,SAAgB,EAAgB,GAAuB;CACrD,OAAO;EACL,EAAK,IAAI,GAAG,EAAc,iCACjB,EAAa,KAClB,EAAE,kCAAiB,IAAI,KAAK,GAAE,YAAY,EAAE,GAC5C,EAAE,QAAQ,IAAI,CAChB,CACD;EACD,EAAK,IAAI,GAAG,EAAc,gCACjB,EAAa,KAClB,EAAE,aAAa,uBAAuB,GACtC,EAAE,QAAQ,IAAI,CAChB,CACD;EAED,EAAK,KAAK,GAAG,EAAc,mCAClB,EAAa,KAAK,EAAE,QAAQ,GAAK,GAAG,EAAE,QAAQ,IAAI,CAAC,CAC3D;
|
|
1
|
+
{"version":3,"file":"authHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/authHandlers.ts"],"sourcesContent":["import { http, HttpResponse } from 'msw'\n\nexport function getAuthHandlers(backendOrigin: string) {\n return [\n http.get(`${backendOrigin}/auth/v1/authenticatedOn`, () => {\n return HttpResponse.json(\n { authenticatedOn: new Date().toISOString() },\n { status: 200 },\n )\n }),\n http.get(`${backendOrigin}/auth/v1/anonymousToken`, () => {\n return HttpResponse.json(\n { accessToken: 'mock-anonymous-token' },\n { status: 200 },\n )\n }),\n\n http.post(`${backendOrigin}/auth/v1/oauth2/introspect`, () => {\n return HttpResponse.json({ active: true }, { status: 200 })\n }),\n\n getUnbindOAuthProviderIdentityHandler(backendOrigin),\n ]\n}\n\nexport function getUnbindOAuthProviderIdentityHandler(backendOrigin: string) {\n return http.delete(`${backendOrigin}/auth/v1/oauth2/identity`, () => {\n return new HttpResponse(null, { status: 200 })\n })\n}\n"],"mappings":";;AAEA,SAAgB,EAAgB,GAAuB;CACrD,OAAO;EACL,EAAK,IAAI,GAAG,EAAc,iCACjB,EAAa,KAClB,EAAE,kCAAiB,IAAI,KAAK,GAAE,YAAY,EAAE,GAC5C,EAAE,QAAQ,IAAI,CAChB,CACD;EACD,EAAK,IAAI,GAAG,EAAc,gCACjB,EAAa,KAClB,EAAE,aAAa,uBAAuB,GACtC,EAAE,QAAQ,IAAI,CAChB,CACD;EAED,EAAK,KAAK,GAAG,EAAc,mCAClB,EAAa,KAAK,EAAE,QAAQ,GAAK,GAAG,EAAE,QAAQ,IAAI,CAAC,CAC3D;EAED,EAAsC,CAAa;CACrD;AACF;AAEA,SAAgB,EAAsC,GAAuB;CAC3E,OAAO,EAAK,OAAO,GAAG,EAAc,iCAC3B,IAAI,EAAa,MAAM,EAAE,QAAQ,IAAI,CAAC,CAC9C;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/chatHandlers.ts"],"names":[],"mappings":"AAkDA,eAAO,MAAM,kBAAkB,GAC7B,sBAAiE,
|
|
1
|
+
{"version":3,"file":"chatHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/chatHandlers.ts"],"names":[],"mappings":"AAkDA,eAAO,MAAM,kBAAkB,GAC7B,sBAAiE,gCA+ClE,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BackendDestinationEnum as e, getEndpoint as t } from "../../../utils/functions/getEndpoint.js";
|
|
2
2
|
import { AGENT_CHAT_TRACE as n, AGENT_SESSION as r, AGENT_SESSION_HISTORY as i, GET_CHAT_ASYNC as a, LIST_AGENT_SESSIONS as o, START_CHAT_ASYNC as s } from "../../../utils/APIConstants.js";
|
|
3
3
|
import "../../../utils/functions/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import { mockAgentChatResponse as
|
|
6
|
-
import { HttpResponse as
|
|
4
|
+
import { dispatchEntry as c, generateAsyncJobHandlers as l } from "./asyncJobHandlers.js";
|
|
5
|
+
import { mockAgentChatResponse as u, mockAgentSession as d, mockChatSessionId as f, mockEmptyTraceEventsResponse as p, mockListAgentSessionsResponse as m, mockSessionHistoryResponse as h, mockTraceEventsResponse1 as g, mockTraceEventsResponse2 as _, mockTraceEventsResponse3 as v } from "../../chat/mockChat.js";
|
|
6
|
+
import { HttpResponse as y, http as b } from "msw";
|
|
7
7
|
//#region src/mocks/msw/handlers/chatHandlers.ts
|
|
8
|
-
function
|
|
9
|
-
return !e.attachments || e.attachments.length === 0 ?
|
|
10
|
-
...
|
|
8
|
+
function x(e) {
|
|
9
|
+
return !e.attachments || e.attachments.length === 0 ? u : {
|
|
10
|
+
...u,
|
|
11
11
|
attachmentStatuses: e.attachments.map((e, t) => t === 0 ? {
|
|
12
12
|
fileHandleId: e.fileHandleId,
|
|
13
13
|
status: "FAILED",
|
|
@@ -19,14 +19,20 @@ function b(e) {
|
|
|
19
19
|
})
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
...c(
|
|
27
|
-
|
|
22
|
+
var S = 0, C = (u = t(e.REPO_ENDPOINT)) => [
|
|
23
|
+
b.post(`${u}${r}`, () => y.json(d, { status: 201 })),
|
|
24
|
+
b.post(`${u}${o}`, () => y.json(m, { status: 201 })),
|
|
25
|
+
b.post(`${u}${i(f)}`, () => y.json(h, { status: 201 })),
|
|
26
|
+
...l(c("org.sagebionetworks.repo.model.agent.AgentChatRequest", x), {
|
|
27
|
+
asyncTypeServicePaths: {
|
|
28
|
+
requestPath: s,
|
|
29
|
+
responsePath: (e) => a(e)
|
|
30
|
+
},
|
|
31
|
+
backendOrigin: u
|
|
32
|
+
}),
|
|
33
|
+
b.post(`${u}${n(":id")}`, () => (S++, S == 1 ? y.json(g, { status: 201 }) : S == 5 ? y.json(_, { status: 201 }) : S == 8 ? y.json(v, { status: 201 }) : y.json(p, { status: 201 })))
|
|
28
34
|
];
|
|
29
35
|
//#endregion
|
|
30
|
-
export {
|
|
36
|
+
export { C as getChatbotHandlers };
|
|
31
37
|
|
|
32
38
|
//# sourceMappingURL=chatHandlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/chatHandlers.ts"],"sourcesContent":["import {\n mockAgentChatResponse,\n mockAgentSession,\n mockChatSessionId,\n mockEmptyTraceEventsResponse,\n mockListAgentSessionsResponse,\n mockSessionHistoryResponse,\n mockTraceEventsResponse1,\n mockTraceEventsResponse2,\n mockTraceEventsResponse3,\n} from '@/mocks/chat/mockChat'\nimport {\n AGENT_CHAT_TRACE,\n AGENT_SESSION,\n AGENT_SESSION_HISTORY,\n GET_CHAT_ASYNC,\n LIST_AGENT_SESSIONS,\n START_CHAT_ASYNC,\n} from '@/utils/APIConstants'\nimport { BackendDestinationEnum, getEndpoint } from '@/utils/functions'\nimport {\n AgentChatRequest,\n AgentChatResponse,\n} from '@sage-bionetworks/synapse-client'\nimport { http, HttpResponse } from 'msw'\nimport { generateAsyncJobHandlers } from './asyncJobHandlers'\n\nfunction buildMockChatResponse(request: AgentChatRequest): AgentChatResponse {\n if (!request.attachments || request.attachments.length === 0) {\n return mockAgentChatResponse\n }\n return {\n ...mockAgentChatResponse,\n attachmentStatuses: request.attachments.map((attachment, index) =>\n index === 0\n ? {\n fileHandleId: attachment.fileHandleId,\n status: 'FAILED',\n failureCode: 'UNSUPPORTED_TYPE',\n failureMessage: 'This file type is not supported.',\n }\n : {\n fileHandleId: attachment.fileHandleId,\n status: 'STAGED',\n },\n ),\n }\n}\n\nlet traceCallCount = 0\nexport const getChatbotHandlers = (\n backendOrigin = getEndpoint(BackendDestinationEnum.REPO_ENDPOINT),\n) => [\n http.post(`${backendOrigin}${AGENT_SESSION}`, () => {\n return HttpResponse.json(mockAgentSession, { status: 201 })\n }),\n\n //list chat sessions\n http.post(`${backendOrigin}${LIST_AGENT_SESSIONS}`, () => {\n // const request: ListAgentSessionsRequest = await request.json()\n return HttpResponse.json(mockListAgentSessionsResponse, { status: 201 })\n }),\n\n //session history\n http.post(\n `${backendOrigin}${AGENT_SESSION_HISTORY(mockChatSessionId)}`,\n () => {\n return HttpResponse.json(mockSessionHistoryResponse, { status: 201 })\n },\n ),\n //Async job to send chat message to the agent\n ...generateAsyncJobHandlers
|
|
1
|
+
{"version":3,"file":"chatHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/chatHandlers.ts"],"sourcesContent":["import {\n mockAgentChatResponse,\n mockAgentSession,\n mockChatSessionId,\n mockEmptyTraceEventsResponse,\n mockListAgentSessionsResponse,\n mockSessionHistoryResponse,\n mockTraceEventsResponse1,\n mockTraceEventsResponse2,\n mockTraceEventsResponse3,\n} from '@/mocks/chat/mockChat'\nimport {\n AGENT_CHAT_TRACE,\n AGENT_SESSION,\n AGENT_SESSION_HISTORY,\n GET_CHAT_ASYNC,\n LIST_AGENT_SESSIONS,\n START_CHAT_ASYNC,\n} from '@/utils/APIConstants'\nimport { BackendDestinationEnum, getEndpoint } from '@/utils/functions'\nimport {\n AgentChatRequest,\n AgentChatResponse,\n} from '@sage-bionetworks/synapse-client'\nimport { http, HttpResponse } from 'msw'\nimport { dispatchEntry, generateAsyncJobHandlers } from './asyncJobHandlers'\n\nfunction buildMockChatResponse(request: AgentChatRequest): AgentChatResponse {\n if (!request.attachments || request.attachments.length === 0) {\n return mockAgentChatResponse\n }\n return {\n ...mockAgentChatResponse,\n attachmentStatuses: request.attachments.map((attachment, index) =>\n index === 0\n ? {\n fileHandleId: attachment.fileHandleId,\n status: 'FAILED',\n failureCode: 'UNSUPPORTED_TYPE',\n failureMessage: 'This file type is not supported.',\n }\n : {\n fileHandleId: attachment.fileHandleId,\n status: 'STAGED',\n },\n ),\n }\n}\n\nlet traceCallCount = 0\nexport const getChatbotHandlers = (\n backendOrigin = getEndpoint(BackendDestinationEnum.REPO_ENDPOINT),\n) => [\n http.post(`${backendOrigin}${AGENT_SESSION}`, () => {\n return HttpResponse.json(mockAgentSession, { status: 201 })\n }),\n\n //list chat sessions\n http.post(`${backendOrigin}${LIST_AGENT_SESSIONS}`, () => {\n // const request: ListAgentSessionsRequest = await request.json()\n return HttpResponse.json(mockListAgentSessionsResponse, { status: 201 })\n }),\n\n //session history\n http.post(\n `${backendOrigin}${AGENT_SESSION_HISTORY(mockChatSessionId)}`,\n () => {\n return HttpResponse.json(mockSessionHistoryResponse, { status: 201 })\n },\n ),\n //Async job to send chat message to the agent\n ...generateAsyncJobHandlers(\n dispatchEntry(\n 'org.sagebionetworks.repo.model.agent.AgentChatRequest',\n buildMockChatResponse,\n ),\n {\n asyncTypeServicePaths: {\n requestPath: START_CHAT_ASYNC,\n responsePath: tokenParam => GET_CHAT_ASYNC(tokenParam),\n },\n backendOrigin,\n },\n ),\n\n //trace events\n http.post(`${backendOrigin}${AGENT_CHAT_TRACE(':id')}`, () => {\n //mock showing progress (increasing number of items)\n traceCallCount++\n if (traceCallCount == 1) {\n return HttpResponse.json(mockTraceEventsResponse1, { status: 201 })\n } else if (traceCallCount == 5) {\n return HttpResponse.json(mockTraceEventsResponse2, { status: 201 })\n } else if (traceCallCount == 8) {\n return HttpResponse.json(mockTraceEventsResponse3, { status: 201 })\n } else\n return HttpResponse.json(mockEmptyTraceEventsResponse, { status: 201 })\n }),\n]\n"],"mappings":";;;;;;;AA2BA,SAAS,EAAsB,GAA8C;CAI3E,OAHI,CAAC,EAAQ,eAAe,EAAQ,YAAY,WAAW,IAClD,IAEF;EACL,GAAG;EACH,oBAAoB,EAAQ,YAAY,KAAK,GAAY,MACvD,MAAU,IACN;GACE,cAAc,EAAW;GACzB,QAAQ;GACR,aAAa;GACb,gBAAgB;EAClB,IACA;GACE,cAAc,EAAW;GACzB,QAAQ;EACV,CACN;CACF;AACF;AAEA,IAAI,IAAiB,GACR,KACX,IAAgB,EAAY,EAAuB,aAAa,MAC7D;CACH,EAAK,KAAK,GAAG,IAAgB,WACpB,EAAa,KAAK,GAAkB,EAAE,QAAQ,IAAI,CAAC,CAC3D;CAGD,EAAK,KAAK,GAAG,IAAgB,WAEpB,EAAa,KAAK,GAA+B,EAAE,QAAQ,IAAI,CAAC,CACxE;CAGD,EAAK,KACH,GAAG,IAAgB,EAAsB,CAAiB,WAEjD,EAAa,KAAK,GAA4B,EAAE,QAAQ,IAAI,CAAC,CAExE;CAEA,GAAG,EACD,EACE,yDACA,CACF,GACA;EACE,uBAAuB;GACrB,aAAa;GACb,eAAc,MAAc,EAAe,CAAU;EACvD;EACA;CACF,CACF;CAGA,EAAK,KAAK,GAAG,IAAgB,EAAiB,KAAK,YAEjD,KACI,KAAkB,IACb,EAAa,KAAK,GAA0B,EAAE,QAAQ,IAAI,CAAC,IACzD,KAAkB,IACpB,EAAa,KAAK,GAA0B,EAAE,QAAQ,IAAI,CAAC,IACzD,KAAkB,IACpB,EAAa,KAAK,GAA0B,EAAE,QAAQ,IAAI,CAAC,IAE3D,EAAa,KAAK,GAA8B,EAAE,QAAQ,IAAI,CAAC,EACzE;AACH"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { EDucSignatureStatus } from '@sage-bionetworks/synapse-client';
|
|
2
|
+
export declare const MOCK_EDUC_SIGNATURE_STATUS: EDucSignatureStatus;
|
|
1
3
|
export declare function getDataAccessRequestHandlers(backendOrigin: string): import("msw").HttpHandler[];
|
|
2
4
|
//# sourceMappingURL=dataAccessRequestHandlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataAccessRequestHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/dataAccessRequestHandlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataAccessRequestHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/dataAccessRequestHandlers.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AA2BtE,eAAO,MAAM,0BAA0B,EAAE,mBAQxC,CAAA;AAED,wBAAgB,4BAA4B,CAAC,aAAa,EAAE,MAAM,+BAyGjE"}
|
|
@@ -1,67 +1,73 @@
|
|
|
1
|
-
import { ACCESS_REQUIREMENT_DATA_ACCESS_REQUEST_FOR_UPDATE as e, DATA_ACCESS_REQUEST as t, DATA_ACCESS_REQUEST_SIGNATURE as n, DATA_ACCESS_REQUEST_SIGNATURE_FILEHANDLE_ID as r,
|
|
2
|
-
import { MOCK_ACCESS_REQUIREMENT_WITHOUT_ACL_ID as
|
|
3
|
-
import
|
|
4
|
-
import { MOCK_DATA_ACCESS_RENEWAL as
|
|
5
|
-
import { HttpResponse as
|
|
1
|
+
import { ACCESS_REQUIREMENT_DATA_ACCESS_REQUEST_FOR_UPDATE as e, DATA_ACCESS_REQUEST as t, DATA_ACCESS_REQUEST_SIGNATURE as n, DATA_ACCESS_REQUEST_SIGNATURE_FILEHANDLE_ID as r, DATA_ACCESS_REQUEST_SIGNATURE_PRECHECK as i, DATA_ACCESS_REQUEST_SIGNATURE_QUOTA as a, DATA_ACCESS_REQUEST_SIGNATURE_STATUS as o, DATA_ACCESS_REQUEST_SUBMISSION as s } from "../../../utils/APIConstants.js";
|
|
2
|
+
import { MOCK_ACCESS_REQUIREMENT_WITHOUT_ACL_ID as c, mockManagedACTAccessRequirement as l } from "../../accessRequirement/mockAccessRequirements.js";
|
|
3
|
+
import u from "../util/BasicMockedCrudService.js";
|
|
4
|
+
import { MOCK_DATA_ACCESS_RENEWAL as d, MOCK_DATA_ACCESS_REQUEST as f } from "../../dataaccess/MockDataAccessRequest.js";
|
|
5
|
+
import { HttpResponse as p, http as m } from "msw";
|
|
6
6
|
//#region src/mocks/msw/handlers/dataAccessRequestHandlers.ts
|
|
7
|
-
var
|
|
7
|
+
var h = new u({
|
|
8
8
|
idField: "id",
|
|
9
9
|
autoGenerateId: !0,
|
|
10
|
-
initialData: [
|
|
11
|
-
}),
|
|
12
|
-
accessRequirementId: String(
|
|
13
|
-
requestId:
|
|
10
|
+
initialData: [f, d]
|
|
11
|
+
}), g = new u({ initialData: [{
|
|
12
|
+
accessRequirementId: String(l.id),
|
|
13
|
+
requestId: f.id
|
|
14
14
|
}, {
|
|
15
|
-
accessRequirementId: String(
|
|
16
|
-
requestId:
|
|
17
|
-
}] })
|
|
18
|
-
|
|
15
|
+
accessRequirementId: String(c),
|
|
16
|
+
requestId: d.id
|
|
17
|
+
}] }), _ = {
|
|
18
|
+
ducStatus: "sent",
|
|
19
|
+
includesRequestChanges: !0,
|
|
20
|
+
signerStatus: [
|
|
21
|
+
{
|
|
22
|
+
name: "Alice Accessor",
|
|
23
|
+
userId: "3388888",
|
|
24
|
+
status: "done"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "Bob Collaborator",
|
|
28
|
+
userId: "3388889",
|
|
29
|
+
status: "pending"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "Cara Officer",
|
|
33
|
+
status: "pending"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
function v(c) {
|
|
19
38
|
return [
|
|
20
|
-
|
|
21
|
-
let t =
|
|
39
|
+
m.get(`${c}${e(":id")}`, ({ params: e }) => {
|
|
40
|
+
let t = g.getOneByField("accessRequirementId", e.id);
|
|
22
41
|
if (t?.requestId) {
|
|
23
|
-
let e =
|
|
24
|
-
if (e) return
|
|
42
|
+
let e = h.getOneById(t.requestId);
|
|
43
|
+
if (e) return p.json(e, { status: 200 });
|
|
25
44
|
}
|
|
26
|
-
return
|
|
45
|
+
return p.json({ message: `MSW: Request or Renewal not found for access requirement ID: ${e.id}` }, { status: 404 });
|
|
27
46
|
}),
|
|
28
|
-
|
|
29
|
-
let t = await e.json(), n = t.id ?
|
|
30
|
-
return r = n ?
|
|
47
|
+
m.post(`${c}${t}`, async ({ request: e }) => {
|
|
48
|
+
let t = await e.json(), n = t.id ? h.getOneById(t.id) : null, r;
|
|
49
|
+
return r = n ? h.update(t.id, t) : h.create(t), p.json(r, { status: 201 });
|
|
31
50
|
}),
|
|
32
|
-
|
|
33
|
-
|
|
51
|
+
m.post(`${c}${s(":id")}`, () => p.json({}, { status: 201 })),
|
|
52
|
+
m.post(`${c}${n(":id")}`, () => p.json({
|
|
34
53
|
quota: 5,
|
|
35
54
|
remaining: 4
|
|
36
55
|
}, { status: 200 })),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
includesRequestChanges: !0
|
|
40
|
-
signerStatus: [
|
|
41
|
-
{
|
|
42
|
-
name: "Alice Accessor",
|
|
43
|
-
userId: "3388888",
|
|
44
|
-
status: "done"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: "Bob Collaborator",
|
|
48
|
-
userId: "3388889",
|
|
49
|
-
status: "pending"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: "Cara Officer",
|
|
53
|
-
status: "pending"
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
+
m.put(`${c}${n(":id")}`, () => p.json({
|
|
57
|
+
..._,
|
|
58
|
+
includesRequestChanges: !0
|
|
56
59
|
}, { status: 200 })),
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
m.delete(`${c}${n(":id")}`, () => new p(null, { status: 204 })),
|
|
61
|
+
m.get(`${c}${i(":id")}`, () => p.json({ result: !0 }, { status: 200 })),
|
|
62
|
+
m.get(`${c}${o(":id")}`, () => p.json(_, { status: 200 })),
|
|
63
|
+
m.get(`${c}${r(":id")}`, () => p.json({ fileHandleId: "mock-signed-duc-file-handle" }, { status: 200 })),
|
|
64
|
+
m.get(`${c}${a(":id")}`, () => p.json({
|
|
59
65
|
quota: 5,
|
|
60
66
|
remaining: 4
|
|
61
67
|
}, { status: 200 }))
|
|
62
68
|
];
|
|
63
69
|
}
|
|
64
70
|
//#endregion
|
|
65
|
-
export {
|
|
71
|
+
export { _ as MOCK_EDUC_SIGNATURE_STATUS, v as getDataAccessRequestHandlers };
|
|
66
72
|
|
|
67
73
|
//# sourceMappingURL=dataAccessRequestHandlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataAccessRequestHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/dataAccessRequestHandlers.ts"],"sourcesContent":["import {\n ACCESS_REQUIREMENT_DATA_ACCESS_REQUEST_FOR_UPDATE,\n DATA_ACCESS_REQUEST,\n DATA_ACCESS_REQUEST_SIGNATURE,\n DATA_ACCESS_REQUEST_SIGNATURE_FILEHANDLE_ID,\n DATA_ACCESS_REQUEST_SIGNATURE_QUOTA,\n DATA_ACCESS_REQUEST_SIGNATURE_STATUS,\n DATA_ACCESS_REQUEST_SUBMISSION,\n} from '@/utils/APIConstants'\nimport { Renewal, Request } from '@sage-bionetworks/synapse-types'\nimport { http, HttpResponse } from 'msw'\nimport {\n MOCK_ACCESS_REQUIREMENT_WITHOUT_ACL_ID,\n mockManagedACTAccessRequirement,\n} from '../../accessRequirement/mockAccessRequirements'\nimport {\n MOCK_DATA_ACCESS_RENEWAL,\n MOCK_DATA_ACCESS_REQUEST,\n} from '../../dataaccess/MockDataAccessRequest'\nimport BasicMockedCrudService from '../util/BasicMockedCrudService'\nimport { EDucSignatureStatus } from '@sage-bionetworks/synapse-client'\n\nconst mockDataAccessRequestService = new BasicMockedCrudService<\n Request | Renewal,\n 'id'\n>({\n idField: 'id',\n autoGenerateId: true,\n initialData: [MOCK_DATA_ACCESS_REQUEST, MOCK_DATA_ACCESS_RENEWAL],\n})\n\nconst mockMapARToDataAccessRequestService = new BasicMockedCrudService<{\n accessRequirementId: string\n requestId: string\n}>({\n initialData: [\n {\n accessRequirementId: String(mockManagedACTAccessRequirement.id),\n requestId: MOCK_DATA_ACCESS_REQUEST.id,\n },\n {\n accessRequirementId: String(MOCK_ACCESS_REQUIREMENT_WITHOUT_ACL_ID),\n requestId: MOCK_DATA_ACCESS_RENEWAL.id,\n },\n ],\n})\n\nexport function getDataAccessRequestHandlers(backendOrigin: string) {\n return [\n http.get(\n `${backendOrigin}${ACCESS_REQUIREMENT_DATA_ACCESS_REQUEST_FOR_UPDATE(\n ':id',\n )}`,\n ({ params }) => {\n const response = mockMapARToDataAccessRequestService.getOneByField(\n 'accessRequirementId',\n params.id as string,\n )\n if (response?.requestId) {\n const dataAccessRequest = mockDataAccessRequestService.getOneById(\n response.requestId,\n )\n if (dataAccessRequest) {\n return HttpResponse.json(dataAccessRequest, { status: 200 })\n }\n }\n return HttpResponse.json(\n {\n message: `MSW: Request or Renewal not found for access requirement ID: ${params.id}`,\n },\n { status: 404 },\n )\n },\n ),\n http.post<never, Request | Renewal>(\n `${backendOrigin}${DATA_ACCESS_REQUEST}`,\n async ({ request }) => {\n const resp = await request.json()\n const existingRequest = resp.id\n ? mockDataAccessRequestService.getOneById(resp.id)\n : null\n\n let updated\n if (existingRequest) {\n updated = mockDataAccessRequestService.update(resp.id, resp)\n } else {\n updated = mockDataAccessRequestService.create(resp)\n }\n\n return HttpResponse.json(updated, { status: 201 })\n },\n ),\n\n http.post(\n `${backendOrigin}${DATA_ACCESS_REQUEST_SUBMISSION(':id')}`,\n () => {\n return HttpResponse.json({}, { status: 201 })\n },\n ),\n\n http.post(`${backendOrigin}${DATA_ACCESS_REQUEST_SIGNATURE(':id')}`, () => {\n return HttpResponse.json({ quota: 5, remaining: 4 }, { status: 200 })\n }),\n\n http.
|
|
1
|
+
{"version":3,"file":"dataAccessRequestHandlers.js","names":[],"sources":["../../../../src/mocks/msw/handlers/dataAccessRequestHandlers.ts"],"sourcesContent":["import {\n ACCESS_REQUIREMENT_DATA_ACCESS_REQUEST_FOR_UPDATE,\n DATA_ACCESS_REQUEST,\n DATA_ACCESS_REQUEST_SIGNATURE,\n DATA_ACCESS_REQUEST_SIGNATURE_FILEHANDLE_ID,\n DATA_ACCESS_REQUEST_SIGNATURE_PRECHECK,\n DATA_ACCESS_REQUEST_SIGNATURE_QUOTA,\n DATA_ACCESS_REQUEST_SIGNATURE_STATUS,\n DATA_ACCESS_REQUEST_SUBMISSION,\n} from '@/utils/APIConstants'\nimport { Renewal, Request } from '@sage-bionetworks/synapse-types'\nimport { http, HttpResponse } from 'msw'\nimport {\n MOCK_ACCESS_REQUIREMENT_WITHOUT_ACL_ID,\n mockManagedACTAccessRequirement,\n} from '../../accessRequirement/mockAccessRequirements'\nimport {\n MOCK_DATA_ACCESS_RENEWAL,\n MOCK_DATA_ACCESS_REQUEST,\n} from '../../dataaccess/MockDataAccessRequest'\nimport BasicMockedCrudService from '../util/BasicMockedCrudService'\nimport { EDucSignatureStatus } from '@sage-bionetworks/synapse-client'\n\nconst mockDataAccessRequestService = new BasicMockedCrudService<\n Request | Renewal,\n 'id'\n>({\n idField: 'id',\n autoGenerateId: true,\n initialData: [MOCK_DATA_ACCESS_REQUEST, MOCK_DATA_ACCESS_RENEWAL],\n})\n\nconst mockMapARToDataAccessRequestService = new BasicMockedCrudService<{\n accessRequirementId: string\n requestId: string\n}>({\n initialData: [\n {\n accessRequirementId: String(mockManagedACTAccessRequirement.id),\n requestId: MOCK_DATA_ACCESS_REQUEST.id,\n },\n {\n accessRequirementId: String(MOCK_ACCESS_REQUIREMENT_WITHOUT_ACL_ID),\n requestId: MOCK_DATA_ACCESS_RENEWAL.id,\n },\n ],\n})\n\nexport const MOCK_EDUC_SIGNATURE_STATUS: EDucSignatureStatus = {\n ducStatus: 'sent',\n includesRequestChanges: true,\n signerStatus: [\n { name: 'Alice Accessor', userId: '3388888', status: 'done' },\n { name: 'Bob Collaborator', userId: '3388889', status: 'pending' },\n { name: 'Cara Officer', status: 'pending' },\n ],\n}\n\nexport function getDataAccessRequestHandlers(backendOrigin: string) {\n return [\n http.get(\n `${backendOrigin}${ACCESS_REQUIREMENT_DATA_ACCESS_REQUEST_FOR_UPDATE(\n ':id',\n )}`,\n ({ params }) => {\n const response = mockMapARToDataAccessRequestService.getOneByField(\n 'accessRequirementId',\n params.id as string,\n )\n if (response?.requestId) {\n const dataAccessRequest = mockDataAccessRequestService.getOneById(\n response.requestId,\n )\n if (dataAccessRequest) {\n return HttpResponse.json(dataAccessRequest, { status: 200 })\n }\n }\n return HttpResponse.json(\n {\n message: `MSW: Request or Renewal not found for access requirement ID: ${params.id}`,\n },\n { status: 404 },\n )\n },\n ),\n http.post<never, Request | Renewal>(\n `${backendOrigin}${DATA_ACCESS_REQUEST}`,\n async ({ request }) => {\n const resp = await request.json()\n const existingRequest = resp.id\n ? mockDataAccessRequestService.getOneById(resp.id)\n : null\n\n let updated\n if (existingRequest) {\n updated = mockDataAccessRequestService.update(resp.id, resp)\n } else {\n updated = mockDataAccessRequestService.create(resp)\n }\n\n return HttpResponse.json(updated, { status: 201 })\n },\n ),\n\n http.post(\n `${backendOrigin}${DATA_ACCESS_REQUEST_SUBMISSION(':id')}`,\n () => {\n return HttpResponse.json({}, { status: 201 })\n },\n ),\n\n http.post(`${backendOrigin}${DATA_ACCESS_REQUEST_SIGNATURE(':id')}`, () => {\n return HttpResponse.json({ quota: 5, remaining: 4 }, { status: 200 })\n }),\n\n // A successful update always leaves the envelope in sync with the request, whatever the\n // status handler below is overridden to report beforehand.\n http.put(`${backendOrigin}${DATA_ACCESS_REQUEST_SIGNATURE(':id')}`, () => {\n return HttpResponse.json<EDucSignatureStatus>(\n { ...MOCK_EDUC_SIGNATURE_STATUS, includesRequestChanges: true },\n { status: 200 },\n )\n }),\n\n http.delete(\n `${backendOrigin}${DATA_ACCESS_REQUEST_SIGNATURE(':id')}`,\n () => new HttpResponse(null, { status: 204 }),\n ),\n\n // The service wraps the answer in `{ result }`, though the OpenAPI spec declares a bare\n // boolean. Mirror the deployed shape so mocked flows match what callers really parse.\n http.get(\n `${backendOrigin}${DATA_ACCESS_REQUEST_SIGNATURE_PRECHECK(':id')}`,\n () => HttpResponse.json({ result: true }, { status: 200 }),\n ),\n\n http.get(\n `${backendOrigin}${DATA_ACCESS_REQUEST_SIGNATURE_STATUS(':id')}`,\n () => {\n return HttpResponse.json<EDucSignatureStatus>(\n MOCK_EDUC_SIGNATURE_STATUS,\n { status: 200 },\n )\n },\n ),\n\n http.get(\n `${backendOrigin}${DATA_ACCESS_REQUEST_SIGNATURE_FILEHANDLE_ID(':id')}`,\n () => {\n return HttpResponse.json(\n { fileHandleId: 'mock-signed-duc-file-handle' },\n { status: 200 },\n )\n },\n ),\n\n http.get(\n `${backendOrigin}${DATA_ACCESS_REQUEST_SIGNATURE_QUOTA(':id')}`,\n () => {\n return HttpResponse.json({ quota: 5, remaining: 4 }, { status: 200 })\n },\n ),\n ]\n}\n"],"mappings":";;;;;;AAuBA,IAAM,IAA+B,IAAI,EAGvC;CACA,SAAS;CACT,gBAAgB;CAChB,aAAa,CAAC,GAA0B,CAAwB;AAClE,CAAC,GAEK,IAAsC,IAAI,EAG7C,EACD,aAAa,CACX;CACE,qBAAqB,OAAO,EAAgC,EAAE;CAC9D,WAAW,EAAyB;AACtC,GACA;CACE,qBAAqB,OAAO,CAAsC;CAClE,WAAW,EAAyB;AACtC,CACF,EACF,CAAC,GAEY,IAAkD;CAC7D,WAAW;CACX,wBAAwB;CACxB,cAAc;EACZ;GAAE,MAAM;GAAkB,QAAQ;GAAW,QAAQ;EAAO;EAC5D;GAAE,MAAM;GAAoB,QAAQ;GAAW,QAAQ;EAAU;EACjE;GAAE,MAAM;GAAgB,QAAQ;EAAU;CAC5C;AACF;AAEA,SAAgB,EAA6B,GAAuB;CAClE,OAAO;EACL,EAAK,IACH,GAAG,IAAgB,EACjB,KACF,MACC,EAAE,gBAAa;GACd,IAAM,IAAW,EAAoC,cACnD,uBACA,EAAO,EACT;GACA,IAAI,GAAU,WAAW;IACvB,IAAM,IAAoB,EAA6B,WACrD,EAAS,SACX;IACA,IAAI,GACF,OAAO,EAAa,KAAK,GAAmB,EAAE,QAAQ,IAAI,CAAC;GAE/D;GACA,OAAO,EAAa,KAClB,EACE,SAAS,gEAAgE,EAAO,KAClF,GACA,EAAE,QAAQ,IAAI,CAChB;EACF,CACF;EACA,EAAK,KACH,GAAG,IAAgB,KACnB,OAAO,EAAE,iBAAc;GACrB,IAAM,IAAO,MAAM,EAAQ,KAAK,GAC1B,IAAkB,EAAK,KACzB,EAA6B,WAAW,EAAK,EAAE,IAC/C,MAEA;GAOJ,OANA,AAGE,IAHE,IACQ,EAA6B,OAAO,EAAK,IAAI,CAAI,IAEjD,EAA6B,OAAO,CAAI,GAG7C,EAAa,KAAK,GAAS,EAAE,QAAQ,IAAI,CAAC;EACnD,CACF;EAEA,EAAK,KACH,GAAG,IAAgB,EAA+B,KAAK,WAE9C,EAAa,KAAK,CAAC,GAAG,EAAE,QAAQ,IAAI,CAAC,CAEhD;EAEA,EAAK,KAAK,GAAG,IAAgB,EAA8B,KAAK,WACvD,EAAa,KAAK;GAAE,OAAO;GAAG,WAAW;EAAE,GAAG,EAAE,QAAQ,IAAI,CAAC,CACrE;EAID,EAAK,IAAI,GAAG,IAAgB,EAA8B,KAAK,WACtD,EAAa,KAClB;GAAE,GAAG;GAA4B,wBAAwB;EAAK,GAC9D,EAAE,QAAQ,IAAI,CAChB,CACD;EAED,EAAK,OACH,GAAG,IAAgB,EAA8B,KAAK,WAChD,IAAI,EAAa,MAAM,EAAE,QAAQ,IAAI,CAAC,CAC9C;EAIA,EAAK,IACH,GAAG,IAAgB,EAAuC,KAAK,WACzD,EAAa,KAAK,EAAE,QAAQ,GAAK,GAAG,EAAE,QAAQ,IAAI,CAAC,CAC3D;EAEA,EAAK,IACH,GAAG,IAAgB,EAAqC,KAAK,WAEpD,EAAa,KAClB,GACA,EAAE,QAAQ,IAAI,CAChB,CAEJ;EAEA,EAAK,IACH,GAAG,IAAgB,EAA4C,KAAK,WAE3D,EAAa,KAClB,EAAE,cAAc,8BAA8B,GAC9C,EAAE,QAAQ,IAAI,CAChB,CAEJ;EAEA,EAAK,IACH,GAAG,IAAgB,EAAoC,KAAK,WAEnD,EAAa,KAAK;GAAE,OAAO;GAAG,WAAW;EAAE,GAAG,EAAE,QAAQ,IAAI,CAAC,CAExE;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/fileHandlers.ts"],"names":[],"mappings":"AAaA,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,+
|
|
1
|
+
{"version":3,"file":"fileHandlers.d.ts","sourceRoot":"","sources":["../../../../src/mocks/msw/handlers/fileHandlers.ts"],"names":[],"mappings":"AAaA,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,+BA2FpD"}
|
|
@@ -1,59 +1,63 @@
|
|
|
1
|
-
import { FILE as e,
|
|
1
|
+
import { FILE as e, FILE_HANDLE as t, FILE_HANDLE_BATCH as n } from "../../../utils/APIConstants.js";
|
|
2
2
|
import "../../user/mock_user_profile.js";
|
|
3
|
-
import { mockFileHandles as
|
|
4
|
-
import { uniqueId as
|
|
5
|
-
import { HttpResponse as
|
|
3
|
+
import { mockFileHandles as r } from "../../mock_file_handle.js";
|
|
4
|
+
import { uniqueId as i } from "lodash-es";
|
|
5
|
+
import { HttpResponse as a, http as o } from "msw";
|
|
6
6
|
//#region src/mocks/msw/handlers/fileHandlers.ts
|
|
7
|
-
function
|
|
7
|
+
function s(s) {
|
|
8
8
|
return [
|
|
9
|
-
|
|
10
|
-
let t = await e.json(),
|
|
9
|
+
o.post(`${s}${n}`, async ({ request: e }) => {
|
|
10
|
+
let t = await e.json(), n = { requestedFiles: [] };
|
|
11
11
|
return t.requestedFiles.forEach((e) => {
|
|
12
|
-
let t =
|
|
13
|
-
t &&
|
|
12
|
+
let t = r.find((t) => t.id === e.fileHandleId);
|
|
13
|
+
t && n.requestedFiles.push({
|
|
14
14
|
fileHandleId: t.id,
|
|
15
15
|
fileHandle: t
|
|
16
16
|
});
|
|
17
|
-
}),
|
|
17
|
+
}), a.json(n, { status: 201 });
|
|
18
18
|
}),
|
|
19
|
-
|
|
19
|
+
o.get(`${s}${t}/:id`, ({ params: e }) => {
|
|
20
|
+
let t = r.find((t) => t.id === e.id);
|
|
21
|
+
return t ? a.json(t) : a.json({ reason: `FileHandle not found: ${e.id}` }, { status: 404 });
|
|
22
|
+
}),
|
|
23
|
+
o.post(`${s}${e}/file/multipart`, () => {
|
|
20
24
|
let e = {
|
|
21
25
|
state: "COMPLETED",
|
|
22
|
-
resultFileHandleId:
|
|
23
|
-
uploadId:
|
|
26
|
+
resultFileHandleId: i("mockFileHandleId"),
|
|
27
|
+
uploadId: i("mockUploadId"),
|
|
24
28
|
startedBy: "999",
|
|
25
29
|
startedOn: (/* @__PURE__ */ new Date()).toISOString(),
|
|
26
30
|
updatedOn: (/* @__PURE__ */ new Date()).toISOString(),
|
|
27
31
|
partsState: "1"
|
|
28
32
|
};
|
|
29
|
-
return
|
|
33
|
+
return a.json(e, { status: 201 });
|
|
30
34
|
}),
|
|
31
|
-
|
|
35
|
+
o.put(`${s}${e}/file/multipart/:id/complete`, ({ params: e }) => {
|
|
32
36
|
let t = {
|
|
33
37
|
state: "COMPLETED",
|
|
34
|
-
resultFileHandleId:
|
|
38
|
+
resultFileHandleId: i("mockFileHandleId"),
|
|
35
39
|
uploadId: String(e.id),
|
|
36
40
|
startedBy: "999",
|
|
37
41
|
startedOn: (/* @__PURE__ */ new Date()).toISOString(),
|
|
38
42
|
updatedOn: (/* @__PURE__ */ new Date()).toISOString(),
|
|
39
43
|
partsState: "1"
|
|
40
44
|
};
|
|
41
|
-
return
|
|
45
|
+
return a.json(t, { status: 201 });
|
|
42
46
|
}),
|
|
43
|
-
|
|
47
|
+
o.post(`${s}${e}/externalFileHandle`, async ({ request: e }) => {
|
|
44
48
|
let t = {
|
|
45
49
|
...await e.json(),
|
|
46
|
-
id:
|
|
50
|
+
id: i(),
|
|
47
51
|
etag: "fake-etag",
|
|
48
52
|
createdBy: "999",
|
|
49
53
|
createdOn: (/* @__PURE__ */ new Date()).toISOString(),
|
|
50
54
|
modifiedOn: (/* @__PURE__ */ new Date()).toISOString()
|
|
51
55
|
};
|
|
52
|
-
return
|
|
56
|
+
return a.json(t, { status: 201 });
|
|
53
57
|
})
|
|
54
58
|
];
|
|
55
59
|
}
|
|
56
60
|
//#endregion
|
|
57
|
-
export {
|
|
61
|
+
export { s as getFileHandlers };
|
|
58
62
|
|
|
59
63
|
//# sourceMappingURL=fileHandlers.js.map
|