@terreno/ui 57.19.2 → 57.21.0
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/.ai/guidelines/core.md +1 -1
- package/CHANGELOG.md +443 -0
- package/dist/Accordion.d.ts.map +1 -1
- package/dist/Accordion.js +3 -3
- package/dist/Accordion.js.map +1 -1
- package/dist/Avatar.d.ts.map +1 -1
- package/dist/Avatar.js +3 -1
- package/dist/Avatar.js.map +1 -1
- package/dist/Box.d.ts.map +1 -1
- package/dist/Box.js +38 -2
- package/dist/Box.js.map +1 -1
- package/dist/Card.js +2 -2
- package/dist/Card.js.map +1 -1
- package/dist/Common.d.ts +175 -34
- package/dist/Common.d.ts.map +1 -1
- package/dist/Common.js.map +1 -1
- package/dist/ConsentFormScreen.d.ts +1 -1
- package/dist/ConsentFormScreen.d.ts.map +1 -1
- package/dist/ConsentFormScreen.js +13 -4
- package/dist/ConsentFormScreen.js.map +1 -1
- package/dist/DateTimeField.d.ts.map +1 -1
- package/dist/DateTimeField.js +11 -9
- package/dist/DateTimeField.js.map +1 -1
- package/dist/Field.d.ts.map +1 -1
- package/dist/Field.js +2 -0
- package/dist/Field.js.map +1 -1
- package/dist/FormContainer.d.ts +68 -0
- package/dist/FormContainer.d.ts.map +1 -0
- package/dist/FormContainer.js +79 -0
- package/dist/FormContainer.js.map +1 -0
- package/dist/GPTChat.d.ts.map +1 -1
- package/dist/GPTChat.js +2 -1
- package/dist/GPTChat.js.map +1 -1
- package/dist/Heading.d.ts +1 -1
- package/dist/Heading.d.ts.map +1 -1
- package/dist/Heading.js +5 -2
- package/dist/Heading.js.map +1 -1
- package/dist/HeightField.js +8 -8
- package/dist/HeightField.js.map +1 -1
- package/dist/Icon.d.ts +4 -0
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Icon.js +43 -2
- package/dist/Icon.js.map +1 -1
- package/dist/LabeledCheckBox.d.ts +22 -0
- package/dist/LabeledCheckBox.d.ts.map +1 -0
- package/dist/LabeledCheckBox.js +30 -0
- package/dist/LabeledCheckBox.js.map +1 -0
- package/dist/ListDetailLayout.d.ts +36 -0
- package/dist/ListDetailLayout.d.ts.map +1 -0
- package/dist/ListDetailLayout.js +153 -0
- package/dist/ListDetailLayout.js.map +1 -0
- package/dist/MarkdownEditor.d.ts.map +1 -1
- package/dist/MarkdownEditor.js +2 -1
- package/dist/MarkdownEditor.js.map +1 -1
- package/dist/MediaQuery.d.ts +1 -1
- package/dist/MediaQuery.d.ts.map +1 -1
- package/dist/MediaQuery.js +1 -1
- package/dist/MediaQuery.js.map +1 -1
- package/dist/OtpField.d.ts +60 -0
- package/dist/OtpField.d.ts.map +1 -0
- package/dist/OtpField.js +154 -0
- package/dist/OtpField.js.map +1 -0
- package/dist/PickerSelect.js +9 -9
- package/dist/PickerSelect.js.map +1 -1
- package/dist/ProvisionalConsentSigner.d.ts +21 -0
- package/dist/ProvisionalConsentSigner.d.ts.map +1 -0
- package/dist/ProvisionalConsentSigner.js +199 -0
- package/dist/ProvisionalConsentSigner.js.map +1 -0
- package/dist/ResponsiveBreakpoint.d.ts +5 -0
- package/dist/ResponsiveBreakpoint.d.ts.map +1 -1
- package/dist/ResponsiveBreakpoint.js +7 -0
- package/dist/ResponsiveBreakpoint.js.map +1 -1
- package/dist/SocialLoginButton.d.ts +10 -0
- package/dist/SocialLoginButton.d.ts.map +1 -1
- package/dist/SocialLoginButton.js +26 -8
- package/dist/SocialLoginButton.js.map +1 -1
- package/dist/SplitPage.d.ts +11 -0
- package/dist/SplitPage.d.ts.map +1 -1
- package/dist/SplitPage.js +11 -5
- package/dist/SplitPage.js.map +1 -1
- package/dist/SplitPage.native.d.ts.map +1 -1
- package/dist/SplitPage.native.js +3 -1
- package/dist/SplitPage.native.js.map +1 -1
- package/dist/SyncStatusBanner.d.ts +7 -1
- package/dist/SyncStatusBanner.d.ts.map +1 -1
- package/dist/SyncStatusBanner.js +20 -4
- package/dist/SyncStatusBanner.js.map +1 -1
- package/dist/TapToEdit.d.ts +1 -1
- package/dist/TapToEdit.d.ts.map +1 -1
- package/dist/TapToEdit.js.map +1 -1
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +48 -14
- package/dist/TextField.js.map +1 -1
- package/dist/Theme.d.ts.map +1 -1
- package/dist/Theme.js +16 -0
- package/dist/Theme.js.map +1 -1
- package/dist/fieldElements/FieldError.d.ts.map +1 -1
- package/dist/fieldElements/FieldError.js +1 -1
- package/dist/fieldElements/FieldError.js.map +1 -1
- package/dist/index.d.ts +19 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/lazyBoundaries/heavyOptionalExports.d.ts +3 -0
- package/dist/lazyBoundaries/heavyOptionalExports.d.ts.map +1 -1
- package/dist/lazyBoundaries/heavyOptionalExports.js +2 -0
- package/dist/lazyBoundaries/heavyOptionalExports.js.map +1 -1
- package/dist/login/LastUsedBadge.d.ts +14 -0
- package/dist/login/LastUsedBadge.d.ts.map +1 -0
- package/dist/login/LastUsedBadge.js +23 -0
- package/dist/login/LastUsedBadge.js.map +1 -0
- package/dist/login/LoginAccountCard.d.ts +38 -0
- package/dist/login/LoginAccountCard.d.ts.map +1 -0
- package/dist/login/LoginAccountCard.js +72 -0
- package/dist/login/LoginAccountCard.js.map +1 -0
- package/dist/login/LoginAccountList.d.ts +33 -0
- package/dist/login/LoginAccountList.d.ts.map +1 -0
- package/dist/login/LoginAccountList.js +30 -0
- package/dist/login/LoginAccountList.js.map +1 -0
- package/dist/login/LoginScreen.d.ts +4 -4
- package/dist/login/LoginScreen.d.ts.map +1 -1
- package/dist/login/LoginScreen.js +294 -13
- package/dist/login/LoginScreen.js.map +1 -1
- package/dist/login/OutlinePill.d.ts +28 -0
- package/dist/login/OutlinePill.d.ts.map +1 -0
- package/dist/login/OutlinePill.js +48 -0
- package/dist/login/OutlinePill.js.map +1 -0
- package/dist/login/TwoFactorChallengeScreen.d.ts +26 -0
- package/dist/login/TwoFactorChallengeScreen.d.ts.map +1 -0
- package/dist/login/TwoFactorChallengeScreen.js +139 -0
- package/dist/login/TwoFactorChallengeScreen.js.map +1 -0
- package/dist/login/loginMethods.d.ts +27 -0
- package/dist/login/loginMethods.d.ts.map +1 -0
- package/dist/login/loginMethods.js +37 -0
- package/dist/login/loginMethods.js.map +1 -0
- package/dist/login/loginTypes.d.ts +202 -5
- package/dist/login/loginTypes.d.ts.map +1 -1
- package/dist/pdfHtmlTemplate.d.ts +17 -0
- package/dist/pdfHtmlTemplate.d.ts.map +1 -1
- package/dist/pdfHtmlTemplate.js +78 -0
- package/dist/pdfHtmlTemplate.js.map +1 -1
- package/dist/security/AccountSecurityScreen.d.ts +10 -0
- package/dist/security/AccountSecurityScreen.d.ts.map +1 -0
- package/dist/security/AccountSecurityScreen.js +50 -0
- package/dist/security/AccountSecurityScreen.js.map +1 -0
- package/dist/security/LinkedAccountsCard.d.ts +32 -0
- package/dist/security/LinkedAccountsCard.d.ts.map +1 -0
- package/dist/security/LinkedAccountsCard.js +145 -0
- package/dist/security/LinkedAccountsCard.js.map +1 -0
- package/dist/security/PasskeysCard.d.ts +39 -0
- package/dist/security/PasskeysCard.d.ts.map +1 -0
- package/dist/security/PasskeysCard.js +168 -0
- package/dist/security/PasskeysCard.js.map +1 -0
- package/dist/security/PasswordCard.d.ts +32 -0
- package/dist/security/PasswordCard.d.ts.map +1 -0
- package/dist/security/PasswordCard.js +198 -0
- package/dist/security/PasswordCard.js.map +1 -0
- package/dist/security/SessionsCard.d.ts +39 -0
- package/dist/security/SessionsCard.d.ts.map +1 -0
- package/dist/security/SessionsCard.js +168 -0
- package/dist/security/SessionsCard.js.map +1 -0
- package/dist/security/TwoFactorSettingsCard.d.ts +55 -0
- package/dist/security/TwoFactorSettingsCard.d.ts.map +1 -0
- package/dist/security/TwoFactorSettingsCard.js +458 -0
- package/dist/security/TwoFactorSettingsCard.js.map +1 -0
- package/dist/security/securityMethods.d.ts +40 -0
- package/dist/security/securityMethods.d.ts.map +1 -0
- package/dist/security/securityMethods.js +66 -0
- package/dist/security/securityMethods.js.map +1 -0
- package/dist/security/securityTypes.d.ts +467 -0
- package/dist/security/securityTypes.d.ts.map +1 -0
- package/dist/security/securityTypes.js +2 -0
- package/dist/security/securityTypes.js.map +1 -0
- package/dist/security/userAgent.d.ts +26 -0
- package/dist/security/userAgent.d.ts.map +1 -0
- package/dist/security/userAgent.js +80 -0
- package/dist/security/userAgent.js.map +1 -0
- package/dist/signUp/OAuthButtons.d.ts +28 -5
- package/dist/signUp/OAuthButtons.d.ts.map +1 -1
- package/dist/signUp/OAuthButtons.js +44 -5
- package/dist/signUp/OAuthButtons.js.map +1 -1
- package/dist/signUp/SignUpScreen.d.ts.map +1 -1
- package/dist/signUp/SignUpScreen.js +50 -5
- package/dist/signUp/SignUpScreen.js.map +1 -1
- package/dist/signUp/signUpTypes.d.ts +21 -1
- package/dist/signUp/signUpTypes.d.ts.map +1 -1
- package/dist/useConsentForms.d.ts +9 -0
- package/dist/useConsentForms.d.ts.map +1 -1
- package/dist/useConsentForms.js +18 -0
- package/dist/useConsentForms.js.map +1 -1
- package/dist/useProvisionalConsent.d.ts +124 -0
- package/dist/useProvisionalConsent.d.ts.map +1 -0
- package/dist/useProvisionalConsent.js +79 -0
- package/dist/useProvisionalConsent.js.map +1 -0
- package/package.json +5 -2
- package/src/Accordion.test.tsx +5 -0
- package/src/Accordion.tsx +3 -8
- package/src/ActionSheet.test.tsx +13 -13
- package/src/AddressField.test.tsx +9 -3
- package/src/AnnouncementNavigator.test.tsx +4 -4
- package/src/AreaChart.test.tsx +15 -0
- package/src/Avatar.test.tsx +8 -0
- package/src/Avatar.tsx +2 -0
- package/src/Badge.test.tsx +1 -1
- package/src/Banner.test.tsx +0 -1
- package/src/BarChart.test.tsx +15 -0
- package/src/Box.test.tsx +143 -75
- package/src/Box.tsx +44 -2
- package/src/Button.test.tsx +11 -6
- package/src/Card.test.tsx +2 -2
- package/src/Card.tsx +2 -2
- package/src/Common.ts +194 -36
- package/src/ConflictSheet.test.tsx +5 -5
- package/src/ConsentFormScreen.test.tsx +87 -1
- package/src/ConsentFormScreen.tsx +28 -4
- package/src/ConsentNavigator.test.tsx +1 -2
- package/src/CustomSelectField.test.tsx +16 -4
- package/src/DataTable.test.tsx +4 -4
- package/src/DataTableVirtualizationRegression.test.tsx +1 -0
- package/src/DateTimeActionSheet.test.tsx +2 -0
- package/src/DateTimeField.test.tsx +3 -12
- package/src/DateTimeField.tsx +11 -9
- package/src/DismissButton.test.tsx +22 -4
- package/src/DonutChart.test.tsx +15 -0
- package/src/EmailField.test.tsx +13 -22
- package/src/EmojiSelector.test.tsx +2 -2
- package/src/ErrorBoundary.test.tsx +5 -3
- package/src/Field.test.tsx +20 -44
- package/src/Field.tsx +2 -0
- package/src/FilePickerButton.test.tsx +35 -0
- package/src/FormContainer.test.tsx +242 -0
- package/src/FormContainer.tsx +177 -0
- package/src/GPTChat.test.tsx +40 -16
- package/src/GPTChat.tsx +8 -2
- package/src/Heading.test.tsx +15 -1
- package/src/Heading.tsx +6 -1
- package/src/HeightField.tsx +8 -8
- package/src/Icon.test.tsx +54 -3
- package/src/Icon.tsx +92 -3
- package/src/IconButton.test.tsx +85 -0
- package/src/Image.test.tsx +1 -1
- package/src/LabeledCheckBox.test.tsx +45 -0
- package/src/LabeledCheckBox.tsx +89 -0
- package/src/Link.test.tsx +11 -4
- package/src/ListDetailLayout.tsx +247 -0
- package/src/MarkdownEditor.tsx +2 -1
- package/src/MarkdownView.test.tsx +1 -1
- package/src/MediaQuery.ts +1 -0
- package/src/MobileAddressAutoComplete.test.tsx +2 -1
- package/src/Modal.test.tsx +7 -2
- package/src/ModalSheet.test.tsx +5 -4
- package/src/MultiselectField.test.tsx +17 -3
- package/src/NumberField.test.tsx +14 -14
- package/src/NumberPickerActionSheet.test.tsx +1 -1
- package/src/OpenAPIContext.test.tsx +4 -4
- package/src/OpenAPIRenderRegression.test.tsx +1 -1
- package/src/OtpField.test.tsx +280 -0
- package/src/OtpField.tsx +307 -0
- package/src/P0RenderRegression.test.tsx +7 -1
- package/src/P1RenderRegression.test.tsx +1 -0
- package/src/P2ButtonRenderRegression.test.tsx +1 -0
- package/src/Page.test.tsx +1 -1
- package/src/PhoneNumberField.test.tsx +14 -38
- package/src/PickerSelect.tsx +9 -9
- package/src/Popover.test.tsx +2 -2
- package/src/ProvisionalConsentSigner.test.tsx +625 -0
- package/src/ProvisionalConsentSigner.tsx +423 -0
- package/src/RadioField.test.tsx +7 -2
- package/src/ResponsiveBreakpoint.test.tsx +7 -0
- package/src/ResponsiveBreakpoint.tsx +14 -0
- package/src/RootImportRegression.test.tsx +3 -0
- package/src/SegmentedControl.test.tsx +21 -12
- package/src/SidebarNavigation.test.tsx +18 -6
- package/src/Signature.test.tsx +20 -23
- package/src/Slider.test.tsx +1 -1
- package/src/SocialLoginButton.test.tsx +14 -0
- package/src/SocialLoginButton.tsx +51 -7
- package/src/SplitPage.native.tsx +3 -1
- package/src/SplitPage.test.tsx +15 -5
- package/src/SplitPage.tsx +11 -5
- package/src/SyncStatusBanner.test.tsx +61 -4
- package/src/SyncStatusBanner.tsx +29 -3
- package/src/TapToEdit.test.tsx +38 -15
- package/src/TapToEdit.tsx +1 -1
- package/src/TerrenoFontProvider.test.tsx +1 -1
- package/src/Text.test.tsx +4 -4
- package/src/TextField.test.tsx +232 -9
- package/src/TextField.tsx +70 -12
- package/src/Theme.test.tsx +49 -0
- package/src/Theme.tsx +16 -0
- package/src/Toast.test.tsx +5 -5
- package/src/ToastNotifications.test.tsx +73 -70
- package/src/ToastNotifications.webModal.test.tsx +2 -2
- package/src/Tooltip.test.tsx +3 -3
- package/src/UnifiedAddressAutoComplete.test.tsx +1 -1
- package/src/UserInactivity.test.tsx +4 -2
- package/src/WebAddressAutocomplete.test.tsx +12 -12
- package/src/WebDropdownMenu.test.tsx +16 -15
- package/src/__snapshots__/AddressField.test.tsx.snap +12 -0
- package/src/__snapshots__/AiSuggestionBox.test.tsx.snap +15 -0
- package/src/__snapshots__/Avatar.test.tsx.snap +1 -0
- package/src/__snapshots__/Card.test.tsx.snap +1 -1
- package/src/__snapshots__/CustomSelectField.test.tsx.snap +3 -0
- package/src/__snapshots__/DismissButton.test.tsx.snap +3 -3
- package/src/__snapshots__/EmailField.test.tsx.snap +6 -0
- package/src/__snapshots__/Field.test.tsx.snap +41 -2
- package/src/__snapshots__/Heading.test.tsx.snap +1 -1
- package/src/__snapshots__/HeightField.test.tsx.snap +2 -0
- package/src/__snapshots__/Image.test.tsx.snap +1 -1
- package/src/__snapshots__/MobileAddressAutoComplete.test.tsx.snap +3 -0
- package/src/__snapshots__/NumberField.test.tsx.snap +3 -0
- package/src/__snapshots__/Page.test.tsx.snap +2 -2
- package/src/__snapshots__/PhoneNumberField.test.tsx.snap +12 -0
- package/src/__snapshots__/Slider.test.tsx.snap +1 -0
- package/src/__snapshots__/SocialLoginButton.test.tsx.snap +43 -22
- package/src/__snapshots__/TapToEdit.test.tsx.snap +3 -0
- package/src/__snapshots__/Text.test.tsx.snap +1 -1
- package/src/__snapshots__/TextArea.test.tsx.snap +17 -1
- package/src/__snapshots__/TextField.test.tsx.snap +19 -2
- package/src/__snapshots__/TypedSignatureField.test.tsx.snap +3 -0
- package/src/__snapshots__/UnifiedAddressAutoComplete.test.tsx.snap +18 -0
- package/src/__snapshots__/WebAddressAutocomplete.test.tsx.snap +12 -0
- package/src/asks/AskCard.test.tsx +16 -13
- package/src/asks/AskFiles.test.tsx +5 -1
- package/src/asks/askFileRefs.test.ts +1 -1
- package/src/asks/askSummary.test.ts +2 -2
- package/src/benchmarks/importTiming.ts +1 -1
- package/src/blocks/BlocksView.test.tsx +20 -11
- package/src/bunSetup.ts +14 -2
- package/src/dataTableFilters.test.tsx +1 -1
- package/src/fieldElements/FieldError.tsx +1 -0
- package/src/fieldElements/__snapshots__/FieldError.test.tsx.snap +2 -0
- package/src/index.tsx +42 -1
- package/src/isolated/ListDetailLayout.isolated.tsx +632 -0
- package/src/lazyBoundaries/heavyOptionalExports.tsx +7 -0
- package/src/login/LastUsedBadge.tsx +40 -0
- package/src/login/LoginAccountCard.tsx +205 -0
- package/src/login/LoginAccountList.tsx +115 -0
- package/src/login/LoginScreen.test.tsx +839 -3
- package/src/login/LoginScreen.tsx +674 -91
- package/src/login/OutlinePill.tsx +110 -0
- package/src/login/TwoFactorChallengeScreen.test.tsx +376 -0
- package/src/login/TwoFactorChallengeScreen.tsx +307 -0
- package/src/login/__snapshots__/LoginScreen.test.tsx.snap +1454 -334
- package/src/login/loginMethods.test.ts +53 -0
- package/src/login/loginMethods.ts +60 -0
- package/src/login/loginTypes.ts +208 -5
- package/src/pdfHtmlTemplate.test.ts +243 -4
- package/src/pdfHtmlTemplate.ts +93 -0
- package/src/security/AccountSecurityScreen.test.tsx +262 -0
- package/src/security/AccountSecurityScreen.tsx +156 -0
- package/src/security/LinkedAccountsCard.test.tsx +371 -0
- package/src/security/LinkedAccountsCard.tsx +297 -0
- package/src/security/PasskeysCard.test.tsx +378 -0
- package/src/security/PasskeysCard.tsx +371 -0
- package/src/security/PasswordCard.test.tsx +445 -0
- package/src/security/PasswordCard.tsx +342 -0
- package/src/security/SessionsCard.test.tsx +349 -0
- package/src/security/SessionsCard.tsx +362 -0
- package/src/security/TwoFactorSettingsCard.test.tsx +700 -0
- package/src/security/TwoFactorSettingsCard.tsx +872 -0
- package/src/security/securityMethods.test.ts +101 -0
- package/src/security/securityMethods.ts +104 -0
- package/src/security/securityTypes.ts +480 -0
- package/src/security/userAgent.test.ts +119 -0
- package/src/security/userAgent.ts +102 -0
- package/src/signUp/OAuthButtons.test.tsx +27 -0
- package/src/signUp/OAuthButtons.tsx +153 -19
- package/src/signUp/SignUpScreen.test.tsx +171 -2
- package/src/signUp/SignUpScreen.tsx +87 -25
- package/src/signUp/__snapshots__/SignUpScreen.test.tsx.snap +22 -11
- package/src/signUp/signUpTypes.ts +23 -1
- package/src/table/tableContext.test.tsx +5 -5
- package/src/test-utils.tsx +56 -1
- package/src/testing/reactDomServer.d.ts +7 -0
- package/src/useConsentForms.test.ts +38 -2
- package/src/useConsentForms.ts +25 -0
- package/src/useProvisionalConsent.test.ts +256 -0
- package/src/useProvisionalConsent.ts +218 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import {describe, expect, it, mock} from "bun:test";
|
|
2
|
+
import {act, renderHook} from "@testing-library/react-native";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
type ProvisionalConsentApi,
|
|
6
|
+
type ProvisionalConsentStatusRow,
|
|
7
|
+
provisionalSignerName,
|
|
8
|
+
useProvisionalConsent,
|
|
9
|
+
} from "./useProvisionalConsent";
|
|
10
|
+
|
|
11
|
+
interface CapturedQuery {
|
|
12
|
+
providesTags: string[];
|
|
13
|
+
query: (userId: string) => string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface CapturedMutation {
|
|
17
|
+
invalidatesTags: string[];
|
|
18
|
+
query: (args: Record<string, unknown>) => {body: unknown; method: string; url: string};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const row: ProvisionalConsentStatusRow = {
|
|
22
|
+
form: {
|
|
23
|
+
active: true,
|
|
24
|
+
agreeButtonText: "I agree",
|
|
25
|
+
allowDecline: true,
|
|
26
|
+
captureSignature: false,
|
|
27
|
+
checkboxes: [],
|
|
28
|
+
content: {en: "# Telehealth"},
|
|
29
|
+
declineButtonText: "Decline",
|
|
30
|
+
defaultLocale: "en",
|
|
31
|
+
id: "form-1",
|
|
32
|
+
order: 1,
|
|
33
|
+
required: true,
|
|
34
|
+
requireScrollToBottom: false,
|
|
35
|
+
slug: "telehealth",
|
|
36
|
+
title: "Telehealth",
|
|
37
|
+
type: "agreement",
|
|
38
|
+
version: 1,
|
|
39
|
+
},
|
|
40
|
+
isConsented: false,
|
|
41
|
+
status: "pending",
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const buildApi = (
|
|
45
|
+
state: {data?: unknown; error?: unknown; isLoading?: boolean} = {},
|
|
46
|
+
signResult: () => Promise<unknown> = () => Promise.resolve({}),
|
|
47
|
+
voidResult: () => Promise<unknown> = () => Promise.resolve({})
|
|
48
|
+
): {
|
|
49
|
+
voidedArgs: unknown[];
|
|
50
|
+
api: ProvisionalConsentApi;
|
|
51
|
+
captured: CapturedQuery[];
|
|
52
|
+
capturedMutations: CapturedMutation[];
|
|
53
|
+
addTagTypes: string[][];
|
|
54
|
+
queriedUserIds: string[];
|
|
55
|
+
signedBodies: unknown[];
|
|
56
|
+
} => {
|
|
57
|
+
const captured: CapturedQuery[] = [];
|
|
58
|
+
const capturedMutations: CapturedMutation[] = [];
|
|
59
|
+
const addTagTypes: string[][] = [];
|
|
60
|
+
const queriedUserIds: string[] = [];
|
|
61
|
+
const signedBodies: unknown[] = [];
|
|
62
|
+
const voidedArgs: unknown[] = [];
|
|
63
|
+
const api = {
|
|
64
|
+
enhanceEndpoints: mock((options: {addTagTypes: string[]}) => {
|
|
65
|
+
addTagTypes.push(options.addTagTypes);
|
|
66
|
+
return {
|
|
67
|
+
injectEndpoints: mock(
|
|
68
|
+
(options: {
|
|
69
|
+
endpoints: (build: {
|
|
70
|
+
mutation: (def: CapturedMutation) => unknown;
|
|
71
|
+
query: (def: CapturedQuery) => unknown;
|
|
72
|
+
}) => unknown;
|
|
73
|
+
}) => {
|
|
74
|
+
options.endpoints({
|
|
75
|
+
mutation: (def: CapturedMutation) => {
|
|
76
|
+
capturedMutations.push(def);
|
|
77
|
+
return def;
|
|
78
|
+
},
|
|
79
|
+
query: (def: CapturedQuery) => {
|
|
80
|
+
captured.push(def);
|
|
81
|
+
return def;
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
return {
|
|
85
|
+
useGetConsentStatusQuery: (userId: string) => {
|
|
86
|
+
queriedUserIds.push(userId);
|
|
87
|
+
return {
|
|
88
|
+
data: state.data,
|
|
89
|
+
error: state.error,
|
|
90
|
+
isLoading: state.isLoading ?? false,
|
|
91
|
+
refetch: () => {},
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
useSignConsentProvisionallyMutation: () => [
|
|
95
|
+
(body: unknown) => {
|
|
96
|
+
signedBodies.push(body);
|
|
97
|
+
return {unwrap: signResult};
|
|
98
|
+
},
|
|
99
|
+
{isLoading: false},
|
|
100
|
+
],
|
|
101
|
+
useVoidProvisionalConsentMutation: () => [
|
|
102
|
+
(args: unknown) => {
|
|
103
|
+
voidedArgs.push(args);
|
|
104
|
+
return {unwrap: voidResult};
|
|
105
|
+
},
|
|
106
|
+
{isLoading: false},
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
};
|
|
112
|
+
}),
|
|
113
|
+
} as unknown as ProvisionalConsentApi;
|
|
114
|
+
return {addTagTypes, api, captured, capturedMutations, queriedUserIds, signedBodies, voidedArgs};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
describe("useProvisionalConsent", () => {
|
|
118
|
+
it("queries the status endpoint for the user under the base URL", () => {
|
|
119
|
+
const {api, captured, addTagTypes, queriedUserIds} = buildApi({data: {data: [row]}});
|
|
120
|
+
|
|
121
|
+
const {result} = renderHook(() =>
|
|
122
|
+
useProvisionalConsent({api, baseUrl: "/api", userId: "user 1"})
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
expect(captured).toHaveLength(1);
|
|
126
|
+
expect(captured[0].query("user 1")).toBe("/api/consent-responses/status?userId=user%201");
|
|
127
|
+
expect(captured[0].providesTags).toEqual(["ConsentStatus"]);
|
|
128
|
+
expect(addTagTypes[0]).toEqual(["ConsentStatus", "PendingConsents"]);
|
|
129
|
+
expect(queriedUserIds).toContain("user 1");
|
|
130
|
+
expect(result.current.statuses).toEqual([row]);
|
|
131
|
+
expect(result.current.isLoading).toBe(false);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it("injects the endpoint once per api and base URL", () => {
|
|
135
|
+
const {api, captured} = buildApi({data: {data: []}});
|
|
136
|
+
|
|
137
|
+
renderHook(() => useProvisionalConsent({api, userId: "a"}));
|
|
138
|
+
renderHook(() => useProvisionalConsent({api, userId: "b"}));
|
|
139
|
+
renderHook(() => useProvisionalConsent({api, baseUrl: "/v2", userId: "a"}));
|
|
140
|
+
|
|
141
|
+
expect(captured).toHaveLength(2);
|
|
142
|
+
expect(captured[0].query("a")).toBe("/consent-responses/status?userId=a");
|
|
143
|
+
expect(captured[1].query("a")).toBe("/v2/consent-responses/status?userId=a");
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("defines the provisional sign mutation and invalidates statuses and pending consents", () => {
|
|
147
|
+
const {api, capturedMutations} = buildApi({data: []});
|
|
148
|
+
renderHook(() => useProvisionalConsent({api, baseUrl: "/api", userId: "a"}));
|
|
149
|
+
|
|
150
|
+
expect(capturedMutations).toHaveLength(2);
|
|
151
|
+
expect(capturedMutations[0].invalidatesTags).toEqual(["ConsentStatus", "PendingConsents"]);
|
|
152
|
+
const body = {consentFormId: "form-1", note: "Phone", userId: "a"};
|
|
153
|
+
expect(capturedMutations[0].query(body)).toEqual({
|
|
154
|
+
body,
|
|
155
|
+
method: "POST",
|
|
156
|
+
url: "/api/consent-responses/provisional",
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it("signs for the hook's user and unwraps the response envelope", async () => {
|
|
161
|
+
const response = {_id: "response-1", agreedAt: "2026-10-20T15:30:00.000Z"};
|
|
162
|
+
const {api, signedBodies} = buildApi({data: []}, () => Promise.resolve({data: response}));
|
|
163
|
+
const {result} = renderHook(() => useProvisionalConsent({api, userId: "member-1"}));
|
|
164
|
+
|
|
165
|
+
let signed: unknown;
|
|
166
|
+
await act(async () => {
|
|
167
|
+
signed = await result.current.sign({consentFormId: "form-1", locale: "en", note: "Phone"});
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
expect(signedBodies).toEqual([
|
|
171
|
+
{consentFormId: "form-1", locale: "en", note: "Phone", userId: "member-1"},
|
|
172
|
+
]);
|
|
173
|
+
expect(signed).toEqual(response);
|
|
174
|
+
expect(result.current.isSigning).toBe(false);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it("returns an already-unwrapped sign response as is", async () => {
|
|
178
|
+
const response = {_id: "response-2", agreedAt: "2026-10-20T15:30:00.000Z"};
|
|
179
|
+
const {api} = buildApi({data: []}, () => Promise.resolve(response));
|
|
180
|
+
const {result} = renderHook(() => useProvisionalConsent({api, userId: "member-1"}));
|
|
181
|
+
|
|
182
|
+
let signed: unknown;
|
|
183
|
+
await act(async () => {
|
|
184
|
+
signed = await result.current.sign({consentFormId: "form-1", note: "Phone"});
|
|
185
|
+
});
|
|
186
|
+
expect(signed).toEqual(response);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it("rejects with the server error when signing fails", async () => {
|
|
190
|
+
const error = {data: {title: "Consent form is not active"}, status: 400};
|
|
191
|
+
const {api} = buildApi({data: []}, () => Promise.reject(error));
|
|
192
|
+
const {result} = renderHook(() => useProvisionalConsent({api, userId: "member-1"}));
|
|
193
|
+
|
|
194
|
+
await expect(result.current.sign({consentFormId: "form-1", note: "Phone"})).rejects.toBe(error);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it("defines the void mutation for a response id", () => {
|
|
198
|
+
const {api, capturedMutations} = buildApi({data: []});
|
|
199
|
+
renderHook(() => useProvisionalConsent({api, baseUrl: "/api", userId: "a"}));
|
|
200
|
+
|
|
201
|
+
expect(capturedMutations[1].invalidatesTags).toEqual(["ConsentStatus", "PendingConsents"]);
|
|
202
|
+
expect(capturedMutations[1].query({reason: "Wrong member", responseId: "resp 1"})).toEqual({
|
|
203
|
+
body: {reason: "Wrong member"},
|
|
204
|
+
method: "POST",
|
|
205
|
+
url: "/api/consent-responses/resp%201/void",
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it("voids a signature and unwraps the response", async () => {
|
|
210
|
+
const response = {_id: "response-1", voidedAt: "2026-10-21T09:00:00.000Z"};
|
|
211
|
+
const {api, voidedArgs} = buildApi({data: []}, undefined, () =>
|
|
212
|
+
Promise.resolve({data: response})
|
|
213
|
+
);
|
|
214
|
+
const {result} = renderHook(() => useProvisionalConsent({api, userId: "member-1"}));
|
|
215
|
+
|
|
216
|
+
let voided: unknown;
|
|
217
|
+
await act(async () => {
|
|
218
|
+
voided = await result.current.voidSignature({reason: "Wrong member", responseId: "r1"});
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
expect(voidedArgs).toEqual([{reason: "Wrong member", responseId: "r1"}]);
|
|
222
|
+
expect(voided).toEqual(response);
|
|
223
|
+
expect(result.current.isVoiding).toBe(false);
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
it("accepts an unwrapped array response", () => {
|
|
227
|
+
const {api} = buildApi({data: [row]});
|
|
228
|
+
const {result} = renderHook(() => useProvisionalConsent({api, userId: "a"}));
|
|
229
|
+
expect(result.current.statuses).toEqual([row]);
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
it("returns no statuses while loading and passes the error through", () => {
|
|
233
|
+
const error = {status: 405};
|
|
234
|
+
const {api} = buildApi({error, isLoading: true});
|
|
235
|
+
const {result} = renderHook(() => useProvisionalConsent({api, userId: "a"}));
|
|
236
|
+
expect(result.current.statuses).toEqual([]);
|
|
237
|
+
expect(result.current.isLoading).toBe(true);
|
|
238
|
+
expect(result.current.error).toBe(error);
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
describe("provisionalSignerName", () => {
|
|
243
|
+
it("prefers the signer's name, then their email", () => {
|
|
244
|
+
expect(provisionalSignerName({email: "dana@example.com", name: "Dana Rivera"})).toBe(
|
|
245
|
+
"Dana Rivera"
|
|
246
|
+
);
|
|
247
|
+
expect(provisionalSignerName({email: "dana@example.com"})).toBe("dana@example.com");
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it("falls back to Staff when the signer is unknown or not populated", () => {
|
|
251
|
+
expect(provisionalSignerName({})).toBe("Staff");
|
|
252
|
+
expect(provisionalSignerName(null)).toBe("Staff");
|
|
253
|
+
expect(provisionalSignerName(undefined)).toBe("Staff");
|
|
254
|
+
expect(provisionalSignerName("64b7f0c2a1b2c3d4e5f60718")).toBe("Staff");
|
|
255
|
+
});
|
|
256
|
+
});
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import {useCallback} from "react";
|
|
2
|
+
|
|
3
|
+
import type {ConsentFormPublic} from "./useConsentForms";
|
|
4
|
+
|
|
5
|
+
export type ProvisionalConsentStatus = "pending" | "provisional" | "signed" | "declined";
|
|
6
|
+
|
|
7
|
+
export interface ProvisionalConsentSignedBy {
|
|
8
|
+
id: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Label for whoever signed provisionally: their name, then their email, then "Staff". */
|
|
14
|
+
export const provisionalSignerName = (
|
|
15
|
+
signer?: {name?: string; email?: string} | string | null
|
|
16
|
+
): string => {
|
|
17
|
+
if (!signer || typeof signer !== "object") {
|
|
18
|
+
return "Staff";
|
|
19
|
+
}
|
|
20
|
+
return signer.name || signer.email || "Staff";
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** One row of `GET /consent-responses/status`: a form and where the user stands on it. */
|
|
24
|
+
export interface ProvisionalConsentStatusRow {
|
|
25
|
+
form: ConsentFormPublic & {_id?: string};
|
|
26
|
+
status: ProvisionalConsentStatus;
|
|
27
|
+
/** True for `signed` and `provisional`. */
|
|
28
|
+
isConsented: boolean;
|
|
29
|
+
respondedAt?: string;
|
|
30
|
+
provisional?: {
|
|
31
|
+
responseId: string;
|
|
32
|
+
signedAt: string;
|
|
33
|
+
signedBy: ProvisionalConsentSignedBy | null;
|
|
34
|
+
note?: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface ConsentStatusResponse {
|
|
39
|
+
data?: ProvisionalConsentStatusRow[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface SignConsentProvisionallyBody {
|
|
43
|
+
userId: string;
|
|
44
|
+
consentFormId: string;
|
|
45
|
+
note: string;
|
|
46
|
+
locale?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The `ConsentResponse` the server returns for a provisional signature. */
|
|
50
|
+
export interface ProvisionalConsentResponse {
|
|
51
|
+
_id: string;
|
|
52
|
+
agreedAt: string;
|
|
53
|
+
consentFormId: string;
|
|
54
|
+
userId: string;
|
|
55
|
+
provisional: boolean;
|
|
56
|
+
provisionalNote?: string;
|
|
57
|
+
provisionalSignedBy?: {_id: string; name?: string; email?: string} | string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type MutationTrigger<TBody> = (body: TBody) => {unwrap: () => Promise<unknown>};
|
|
61
|
+
|
|
62
|
+
type MutationHook<TBody> = () => [MutationTrigger<TBody>, {isLoading: boolean; error?: unknown}];
|
|
63
|
+
|
|
64
|
+
export interface VoidProvisionalConsentArgs {
|
|
65
|
+
responseId: string;
|
|
66
|
+
reason: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface ProvisionalConsentQueryBuilder {
|
|
70
|
+
query: (options: {providesTags: string[]; query: (userId: string) => string}) => unknown;
|
|
71
|
+
mutation: <TArgs>(options: {
|
|
72
|
+
invalidatesTags: string[];
|
|
73
|
+
query: (args: TArgs) => {body: unknown; method: "POST"; url: string};
|
|
74
|
+
}) => unknown;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface ProvisionalConsentQueryState {
|
|
78
|
+
data?: ProvisionalConsentStatusRow[] | ConsentStatusResponse;
|
|
79
|
+
error: unknown;
|
|
80
|
+
isLoading: boolean;
|
|
81
|
+
refetch: () => void | Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
interface ProvisionalConsentEnhancedApi {
|
|
85
|
+
useGetConsentStatusQuery: (userId: string) => ProvisionalConsentQueryState;
|
|
86
|
+
useSignConsentProvisionallyMutation: MutationHook<SignConsentProvisionallyBody>;
|
|
87
|
+
useVoidProvisionalConsentMutation: MutationHook<VoidProvisionalConsentArgs>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface ProvisionalConsentApiWithTags {
|
|
91
|
+
injectEndpoints: (options: {
|
|
92
|
+
endpoints: (build: ProvisionalConsentQueryBuilder) => {
|
|
93
|
+
getConsentStatus: unknown;
|
|
94
|
+
signConsentProvisionally: unknown;
|
|
95
|
+
voidProvisionalConsent: unknown;
|
|
96
|
+
};
|
|
97
|
+
overrideExisting: boolean;
|
|
98
|
+
}) => ProvisionalConsentEnhancedApi;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** The consumer's RTK Query api, as passed to `ConsentNavigator`. */
|
|
102
|
+
export interface ProvisionalConsentApi {
|
|
103
|
+
enhanceEndpoints: (options: {addTagTypes: string[]}) => ProvisionalConsentApiWithTags;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface UseProvisionalConsentResult {
|
|
107
|
+
statuses: ProvisionalConsentStatusRow[];
|
|
108
|
+
isLoading: boolean;
|
|
109
|
+
error: unknown;
|
|
110
|
+
refetch: () => void | Promise<void>;
|
|
111
|
+
/** Sign a form provisionally for the user. Rejects with the RTK error on failure. */
|
|
112
|
+
sign: (body: Omit<SignConsentProvisionallyBody, "userId">) => Promise<ProvisionalConsentResponse>;
|
|
113
|
+
isSigning: boolean;
|
|
114
|
+
/** Void a provisional signature made in error. Rejects with the RTK error on failure. */
|
|
115
|
+
voidSignature: (args: VoidProvisionalConsentArgs) => Promise<ProvisionalConsentResponse>;
|
|
116
|
+
isVoiding: boolean;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Mutations may arrive as `{data}` envelopes or already unwrapped by the base query. */
|
|
120
|
+
const unwrapData = <T>(result: unknown): T => {
|
|
121
|
+
if (result && typeof result === "object" && "data" in result) {
|
|
122
|
+
return (result as {data: T}).data;
|
|
123
|
+
}
|
|
124
|
+
return result as T;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Cache the enhanced api per (api, baseUrl) so `injectEndpoints` runs once, as in
|
|
129
|
+
* `useConsentForms`: re-injecting the same endpoint name logs a development error.
|
|
130
|
+
*/
|
|
131
|
+
const enhancedApiCache = new WeakMap<
|
|
132
|
+
ProvisionalConsentApi,
|
|
133
|
+
Map<string, ProvisionalConsentEnhancedApi>
|
|
134
|
+
>();
|
|
135
|
+
|
|
136
|
+
const getEnhancedApi = (
|
|
137
|
+
api: ProvisionalConsentApi,
|
|
138
|
+
base: string
|
|
139
|
+
): ProvisionalConsentEnhancedApi => {
|
|
140
|
+
let byBase = enhancedApiCache.get(api);
|
|
141
|
+
if (!byBase) {
|
|
142
|
+
byBase = new Map();
|
|
143
|
+
enhancedApiCache.set(api, byBase);
|
|
144
|
+
}
|
|
145
|
+
const cached = byBase.get(base);
|
|
146
|
+
if (cached) {
|
|
147
|
+
return cached;
|
|
148
|
+
}
|
|
149
|
+
const apiWithTags = api.enhanceEndpoints({addTagTypes: ["ConsentStatus", "PendingConsents"]});
|
|
150
|
+
const enhanced = apiWithTags.injectEndpoints({
|
|
151
|
+
endpoints: (build) => ({
|
|
152
|
+
getConsentStatus: build.query({
|
|
153
|
+
providesTags: ["ConsentStatus"],
|
|
154
|
+
query: (userId: string) =>
|
|
155
|
+
`${base}/consent-responses/status?userId=${encodeURIComponent(userId)}`,
|
|
156
|
+
}),
|
|
157
|
+
// A provisional signature changes the target's statuses and their pending notice.
|
|
158
|
+
signConsentProvisionally: build.mutation<SignConsentProvisionallyBody>({
|
|
159
|
+
invalidatesTags: ["ConsentStatus", "PendingConsents"],
|
|
160
|
+
query: (body) => ({
|
|
161
|
+
body,
|
|
162
|
+
method: "POST",
|
|
163
|
+
url: `${base}/consent-responses/provisional`,
|
|
164
|
+
}),
|
|
165
|
+
}),
|
|
166
|
+
// A void brings the form back to pending and removes the user's notice.
|
|
167
|
+
voidProvisionalConsent: build.mutation<VoidProvisionalConsentArgs>({
|
|
168
|
+
invalidatesTags: ["ConsentStatus", "PendingConsents"],
|
|
169
|
+
query: ({reason, responseId}) => ({
|
|
170
|
+
body: {reason},
|
|
171
|
+
method: "POST",
|
|
172
|
+
url: `${base}/consent-responses/${encodeURIComponent(responseId)}/void`,
|
|
173
|
+
}),
|
|
174
|
+
}),
|
|
175
|
+
}),
|
|
176
|
+
overrideExisting: false,
|
|
177
|
+
});
|
|
178
|
+
byBase.set(base, enhanced);
|
|
179
|
+
return enhanced;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
/** Consent status of each form for `userId`, for staff who sign consent on the user's behalf. */
|
|
183
|
+
export const useProvisionalConsent = ({
|
|
184
|
+
api,
|
|
185
|
+
baseUrl,
|
|
186
|
+
userId,
|
|
187
|
+
}: {
|
|
188
|
+
/** The consumer's RTK Query api. Typed loosely, like `ConsentNavigator`, so any app api fits. */
|
|
189
|
+
api: unknown;
|
|
190
|
+
baseUrl?: string;
|
|
191
|
+
userId: string;
|
|
192
|
+
}): UseProvisionalConsentResult => {
|
|
193
|
+
const enhancedApi = getEnhancedApi(api as ProvisionalConsentApi, baseUrl || "");
|
|
194
|
+
const {data, error, isLoading, refetch} = enhancedApi.useGetConsentStatusQuery(userId);
|
|
195
|
+
const [signMutation, {isLoading: isSigning}] = enhancedApi.useSignConsentProvisionallyMutation();
|
|
196
|
+
const statuses = Array.isArray(data) ? data : (data?.data ?? []);
|
|
197
|
+
|
|
198
|
+
const sign = useCallback(
|
|
199
|
+
async (
|
|
200
|
+
body: Omit<SignConsentProvisionallyBody, "userId">
|
|
201
|
+
): Promise<ProvisionalConsentResponse> => {
|
|
202
|
+
const result = await signMutation({...body, userId}).unwrap();
|
|
203
|
+
return unwrapData<ProvisionalConsentResponse>(result);
|
|
204
|
+
},
|
|
205
|
+
[signMutation, userId]
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
const [voidMutation, {isLoading: isVoiding}] = enhancedApi.useVoidProvisionalConsentMutation();
|
|
209
|
+
const voidSignature = useCallback(
|
|
210
|
+
async (args: VoidProvisionalConsentArgs): Promise<ProvisionalConsentResponse> => {
|
|
211
|
+
const result = await voidMutation(args).unwrap();
|
|
212
|
+
return unwrapData<ProvisionalConsentResponse>(result);
|
|
213
|
+
},
|
|
214
|
+
[voidMutation]
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
return {error, isLoading, isSigning, isVoiding, refetch, sign, statuses, voidSignature};
|
|
218
|
+
};
|