@taxbit/react-sdk 1.0.0-beta.4 → 1.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/README.md +14 -5
  2. package/dist/src/components/ErrorBoundary/ErrorBoundary.d.ts +16 -0
  3. package/dist/src/components/ErrorBoundary/index.d.ts +1 -0
  4. package/dist/src/components/index.d.ts +1 -0
  5. package/dist/src/contexts/TaxDocumentation/useTaxDocumentation.d.ts +5 -6
  6. package/dist/src/contexts/TaxDocumentation/useTaxDocumentationContext.d.ts +12 -14
  7. package/dist/src/entry/index.d.ts +1 -1
  8. package/dist/src/hooks/index.d.ts +1 -0
  9. package/dist/src/hooks/useHandleError.d.ts +3 -0
  10. package/dist/src/hooks/useTaxbit/index.d.ts +1 -0
  11. package/dist/src/hooks/useTaxbit/useTaxbit.d.ts +10 -3
  12. package/dist/src/hooks/useTaxbit/useTaxbitStatus.d.ts +9 -2
  13. package/dist/src/types/InputStep.d.ts +2 -2
  14. package/dist/src/utils/bearerTokenIsRequiredError.d.ts +1 -0
  15. package/dist/src/utils/getFormStatus.d.ts +2 -0
  16. package/dist/src/utils/getHeaders.d.ts +3 -0
  17. package/dist/src/utils/handleFetch.d.ts +7 -0
  18. package/dist/src/utils/index.d.ts +4 -0
  19. package/dist/src/widgets/TaxbitQuestionnairePersist/__tests__/TaxbitQuestionnairePersist.missingBearerToken.test.d.ts +0 -0
  20. package/dist/src/widgets/TaxbitQuestionnairePersist/useTaxbitPersist.d.ts +7 -11
  21. package/dist/src/wizard/TaxbitQuestionnaireUI/steps.d.ts +0 -1
  22. package/dist/taxbit-react-sdk.js +1827 -1768
  23. package/dist/taxbit-react-sdk.umd.cjs +10 -10
  24. package/package.json +3 -3
  25. package/dist/src/hooks/useTaxbit/useTaxbitConnect.d.ts +0 -8
  26. package/dist/src/wizard/TaxbitQuestionnaireUI/Confirmation/Confirmation.d.ts +0 -2
  27. package/dist/src/wizard/TaxbitQuestionnaireUI/Confirmation/index.d.ts +0 -1
package/README.md CHANGED
@@ -126,13 +126,13 @@ const {
126
126
  statusData,
127
127
  serverData,
128
128
  canGetDocumentUrl,
129
- getNewDocumentUrl,
130
- isGettingDocumentUrl,
129
+ generateDocumentUrl,
130
+ isGeneratingDocumentUrl,
131
131
  documentUrl,
132
- } = useTaxbit(bearerToken, questionnaire);
132
+ } = useTaxbit({ bearerToken, questionnaire, onError });
133
133
  ```
134
134
 
135
- It can also be used to get the document URL for the user's tax documentation. The `getNewDocumentUrl` function will trigger a temporary URL generation. The `documentUrl` will be the URL of the document if it is available. `isGettingDocumentUrl` will be true while the URL is being generated. `canGetDocumentUrl` will be true if the user has submitted the questionnaire and a PDF tax document is available to this user. Note, `DPS` data does not generate a PDF document.
135
+ It can also be used to get the document URL for the user's tax documentation. The `generateDocumentUrl` function will trigger a temporary URL generation. The `documentUrl` will be the URL of the document if it is available. `isGeneratingDocumentUrl` will be true while the URL is being generated. `canGetDocumentUrl` will be true if the user has submitted the questionnaire and a PDF tax document is available to this user. Note, `DPS` data does not generate a PDF document.
136
136
 
137
137
  ### Server Data
138
138
 
@@ -215,9 +215,13 @@ The Taxbit React SDK provides callbacks for the following events on the `TaxbitQ
215
215
  - `onSettled` - called after `onError` or `onSuccess` is called.
216
216
  - `onProgress` - called when the user loads and navigates within the Taxbit UI. The function passed here will be passed a Progress object (see below for the type definition):
217
217
 
218
+ #### Error Boundary
219
+
220
+ A basic React Error Boundary is in place and when an error is thrown, the TaxbitQuestionnaire component will display errors on screen and throw an error in console. The exceptions that are possible are related to fetching data from the server, such as authentication (401 Unauthorized) or network problems (Failed to fetch). An error is also thrown if the bearer token is missing (Bearer Token is required). If the `onError` callback is provided to the component or the hook, these errors will be caught not and the error boundary will not be displayed.
221
+
218
222
  The DPS sequence, for example, can have a total of 3, 4, or 5 steps, each with a localized `stepTitle` and `stepId`. The `stepNumber` is the current step (1 based), and `percentComplete` is the percentage of the steps that have been completed.
219
223
 
220
- ### Types
224
+ ## Types
221
225
 
222
226
  The Taxbit React SDK provides a type for the status of the most recent tax documentation submitted by the user, referred to as `ClientTaxDocumentationStatus`. The data passed to the component and returned to the callback is typed as `ClientTaxDocumentation`.
223
227
 
@@ -290,6 +294,11 @@ type QuestionnaireType = 'DPS' | 'W-FORM';
290
294
 
291
295
  ## Changelog
292
296
 
297
+ ### Version 1.0.0-beta.5
298
+
299
+ 1. Document Generation modifications. Renamed from "getDocumentUrl" to "generateDocumentUrl".
300
+ 2. `onError` callback is now exposed in both the TaxbitQuestionnaire component and the useTaxbit hook.
301
+
293
302
  ### Version 1.0.0-beta.4
294
303
 
295
304
  1. More explicit typing for TaxbitQuestionnaire component props
@@ -0,0 +1,16 @@
1
+ import React, { Component, ReactNode } from 'react';
2
+ interface Props {
3
+ children?: ReactNode;
4
+ }
5
+ interface State {
6
+ hasError: boolean;
7
+ errorMessage?: string;
8
+ }
9
+ export declare class ErrorBoundary extends Component<Props, State> {
10
+ state: State;
11
+ static getDerivedStateFromError(error: Error): State;
12
+ componentDidCatch(error: Error): void;
13
+ componentDidUpdate(): void;
14
+ render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
15
+ }
16
+ export {};
@@ -0,0 +1 @@
1
+ export * from './ErrorBoundary';
@@ -1,4 +1,5 @@
1
1
  export * from './Address';
2
+ export * from './ErrorBoundary';
2
3
  export * from './ErrorMessage';
3
4
  export * from './Form';
4
5
  export * from './InputStatus';
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { ClientTaxDocumentation } from '@taxbit/utilities';
3
3
  import type { InputStep, Locale, Progress, Questionnaire, TaxDocumentation } from 'types';
4
- import { ExternalValidations } from 'types/client';
5
4
  import type { StepId } from 'types/StepId';
5
+ import { ExternalValidations } from 'types/client';
6
6
  type InterviewConfig = {
7
7
  minimumAge: number;
8
8
  };
@@ -10,7 +10,7 @@ export type UseTaxDocumentationProps = {
10
10
  data?: ClientTaxDocumentation;
11
11
  language?: Locale;
12
12
  externalValidations?: ExternalValidations;
13
- onSubmit?: (data?: ClientTaxDocumentation) => void | Promise<void>;
13
+ onSubmit?: (data: ClientTaxDocumentation) => void | Promise<void>;
14
14
  onProgress?: (progress: Progress) => void | Promise<void>;
15
15
  step?: InputStep;
16
16
  questionnaire: Questionnaire;
@@ -20,8 +20,7 @@ export declare const useTaxDocumentation: ({ data: startingData, language: initi
20
20
  isBuildingW9: boolean;
21
21
  isBuildingW8: boolean;
22
22
  onPersistCollectedData: (newData: TaxDocumentation) => void;
23
- onSubmitTaxDocumentation: (data: TaxDocumentation) => void;
24
- error: string | undefined;
23
+ onSubmitTaxDocumentation: (data: TaxDocumentation) => Promise<void>;
25
24
  editTo: (form: InputStep) => void;
26
25
  onCancel: (() => void) | undefined;
27
26
  getStepId: (key: InputStep) => StepId;
@@ -29,10 +28,10 @@ export declare const useTaxDocumentation: ({ data: startingData, language: initi
29
28
  goBack: (() => void) | undefined;
30
29
  goToNext: (data: TaxDocumentation) => void;
31
30
  progress: Progress | undefined;
32
- stepName: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
31
+ stepName: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
33
32
  data: TaxDocumentation;
34
33
  originalClientData: TaxDocumentation;
35
- initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
34
+ initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
36
35
  setLanguage: import("react").Dispatch<import("react").SetStateAction<"bg" | "cs" | "da" | "de" | "de-at" | "el" | "el-cy" | "en" | "en-gb" | "en-nz" | "en-us" | "es" | "et" | "fi" | "fr" | "fr-ca" | "fr-lu" | "ga" | "hr" | "hu" | "it" | "lt" | "lv" | "mt" | "nl" | "nl-be" | "no" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv">>;
37
36
  language: "bg" | "cs" | "da" | "de" | "de-at" | "el" | "el-cy" | "en" | "en-gb" | "en-nz" | "en-us" | "es" | "et" | "fi" | "fr" | "fr-ca" | "fr-lu" | "ga" | "hr" | "hu" | "it" | "lt" | "lv" | "mt" | "nl" | "nl-be" | "no" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv";
38
37
  questionnaire: Questionnaire;
@@ -3,19 +3,18 @@ export declare const useTaxDocumentationContext: () => {
3
3
  isBuildingW9: boolean;
4
4
  isBuildingW8: boolean;
5
5
  onPersistCollectedData: (newData: import("../../types").TaxDocumentation) => void;
6
- onSubmitTaxDocumentation: (data: import("../../types").TaxDocumentation) => void;
7
- error: string | undefined;
8
- editTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
6
+ onSubmitTaxDocumentation: (data: import("../../types").TaxDocumentation) => Promise<void>;
7
+ editTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
9
8
  onCancel: (() => void) | undefined;
10
- getStepId: (key: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => import("../../types/StepId").StepId;
11
- goTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
9
+ getStepId: (key: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => import("../../types/StepId").StepId;
10
+ goTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
12
11
  goBack: (() => void) | undefined;
13
12
  goToNext: (data: import("../../types").TaxDocumentation) => void;
14
13
  progress: import("../../types").Progress | undefined;
15
- stepName: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
14
+ stepName: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
16
15
  data: import("../../types").TaxDocumentation;
17
16
  originalClientData: import("../../types").TaxDocumentation;
18
- initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
17
+ initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
19
18
  setLanguage: import("react").Dispatch<import("react").SetStateAction<"bg" | "cs" | "da" | "de" | "de-at" | "el" | "el-cy" | "en" | "en-gb" | "en-nz" | "en-us" | "es" | "et" | "fi" | "fr" | "fr-ca" | "fr-lu" | "ga" | "hr" | "hu" | "it" | "lt" | "lv" | "mt" | "nl" | "nl-be" | "no" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv">>;
20
19
  language: "bg" | "cs" | "da" | "de" | "de-at" | "el" | "el-cy" | "en" | "en-gb" | "en-nz" | "en-us" | "es" | "et" | "fi" | "fr" | "fr-ca" | "fr-lu" | "ga" | "hr" | "hu" | "it" | "lt" | "lv" | "mt" | "nl" | "nl-be" | "no" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv";
21
20
  questionnaire: import("../../types").Questionnaire;
@@ -28,19 +27,18 @@ export declare const useTaxDocumentationContext: () => {
28
27
  isBuildingW9: boolean;
29
28
  isBuildingW8: boolean;
30
29
  onPersistCollectedData: (newData: import("../../types").TaxDocumentation) => void;
31
- onSubmitTaxDocumentation: (data: import("../../types").TaxDocumentation) => void;
32
- error: string | undefined;
33
- editTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
30
+ onSubmitTaxDocumentation: (data: import("../../types").TaxDocumentation) => Promise<void>;
31
+ editTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
34
32
  onCancel: (() => void) | undefined;
35
- getStepId: (key: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => import("../../types/StepId").StepId;
36
- goTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
33
+ getStepId: (key: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => import("../../types/StepId").StepId;
34
+ goTo: (form: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary") => void;
37
35
  goBack: (() => void) | undefined;
38
36
  goToNext: (data: import("../../types").TaxDocumentation) => void;
39
37
  progress: import("../../types").Progress | undefined;
40
- stepName: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
38
+ stepName: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
41
39
  data: import("../../types").TaxDocumentation;
42
40
  originalClientData: import("../../types").TaxDocumentation;
43
- initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
41
+ initialStep: "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
44
42
  setLanguage: import("react").Dispatch<import("react").SetStateAction<"bg" | "cs" | "da" | "de" | "de-at" | "el" | "el-cy" | "en" | "en-gb" | "en-nz" | "en-us" | "es" | "et" | "fi" | "fr" | "fr-ca" | "fr-lu" | "ga" | "hr" | "hu" | "it" | "lt" | "lv" | "mt" | "nl" | "nl-be" | "no" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv">>;
45
43
  language: "bg" | "cs" | "da" | "de" | "de-at" | "el" | "el-cy" | "en" | "en-gb" | "en-nz" | "en-us" | "es" | "et" | "fi" | "fr" | "fr-ca" | "fr-lu" | "ga" | "hr" | "hu" | "it" | "lt" | "lv" | "mt" | "nl" | "nl-be" | "no" | "pl" | "pt" | "ro" | "sk" | "sl" | "sv";
46
44
  questionnaire: import("../../types").Questionnaire;
@@ -1,5 +1,5 @@
1
1
  import { ClientTaxDocumentation } from '@taxbit/utilities';
2
- export * from '../hooks/useTaxbit';
2
+ export * from '../hooks/useTaxbit/useTaxbit';
3
3
  export * from '../types/Locale';
4
4
  export * from '../types/Progress';
5
5
  export * from '../types/Questionnaire';
@@ -1 +1,2 @@
1
+ export * from './useHandleError';
1
2
  export * from './useTaxbit';
@@ -0,0 +1,3 @@
1
+ export declare const useHandleError: (onError?: ((error: Error) => void | Promise<void>) | undefined) => {
2
+ handleError: (error: Error) => void;
3
+ };
@@ -1 +1,2 @@
1
1
  export * from './useTaxbit';
2
+ export * from './useTaxbitStatus';
@@ -1,9 +1,16 @@
1
1
  import { Questionnaire } from 'types';
2
- export declare const useTaxbit: (bearerToken: string, questionnaire: Questionnaire, staging?: boolean) => {
2
+ type UseTaxbitProps = {
3
+ bearerToken: string;
4
+ questionnaire: Questionnaire;
5
+ staging?: boolean;
6
+ onError?: (error: Error) => void | Promise<void>;
7
+ };
8
+ export declare const useTaxbit: ({ bearerToken, questionnaire, staging, onError, }: UseTaxbitProps) => {
3
9
  serverData: import("@taxbit/utilities").SignedClientTaxDocumentation | undefined;
4
10
  statusData: import("../../entry").ClientTaxDocumentationStatus | undefined;
5
11
  canGetDocumentUrl: boolean;
6
- getNewDocumentUrl: () => void;
7
- isGettingDocumentUrl: boolean;
12
+ generateDocumentUrl: () => void;
13
+ isGeneratingDocumentUrl: boolean;
8
14
  documentUrl: string | undefined;
9
15
  };
16
+ export {};
@@ -1,8 +1,15 @@
1
1
  import type { SignedClientTaxDocumentation } from '@taxbit/utilities';
2
2
  import { Questionnaire } from '../../types';
3
3
  import type { ClientTaxDocumentationStatus } from '../../types/client';
4
- export declare const useTaxbitStatus: (bearerToken: string, questionnaire: Questionnaire, staging?: boolean) => {
5
- formStatus: "COMPLETE" | "INCOMPLETE" | undefined;
4
+ type UseTaxbitStatusProps = {
5
+ bearerToken?: string;
6
+ onError?: (error: Error) => void | Promise<void>;
7
+ questionnaire: Questionnaire;
8
+ staging?: boolean;
9
+ };
10
+ export declare const useTaxbitStatus: ({ bearerToken, questionnaire, staging, onError, }: UseTaxbitStatusProps) => {
6
11
  serverData: SignedClientTaxDocumentation | undefined;
7
12
  statusData: ClientTaxDocumentationStatus | undefined;
13
+ isLoading: boolean;
8
14
  };
15
+ export {};
@@ -1,5 +1,5 @@
1
- declare const inputSteps: readonly ["AccountHolderClassification", "AccountHolderContact", "AccountHolderTax", "AccountHolderTaxClarification", "Confirmation", "Exemptions", "RegardedOwnerContact", "RegardedOwnerTax", "Summary"];
1
+ declare const inputSteps: readonly ["AccountHolderClassification", "AccountHolderContact", "AccountHolderTax", "AccountHolderTaxClarification", "Exemptions", "RegardedOwnerContact", "RegardedOwnerTax", "Summary"];
2
2
  export type InputStep = (typeof inputSteps)[number];
3
- export declare const isInputStep: (step: string) => step is "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Confirmation" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
3
+ export declare const isInputStep: (step: string) => step is "AccountHolderClassification" | "AccountHolderContact" | "AccountHolderTax" | "AccountHolderTaxClarification" | "Exemptions" | "RegardedOwnerContact" | "RegardedOwnerTax" | "Summary";
4
4
  export declare const confirmInputStep: (step: string) => InputStep;
5
5
  export {};
@@ -0,0 +1 @@
1
+ export declare const bearerTokenIsRequiredError: Error;
@@ -0,0 +1,2 @@
1
+ import { ClientTaxDocumentationStatus } from '../types/client';
2
+ export declare const getFormStatus: (statusData: ClientTaxDocumentationStatus | undefined, questionnaire: string) => "COMPLETE" | "INCOMPLETE" | undefined;
@@ -0,0 +1,3 @@
1
+ export declare const getHeaders: ({ bearerToken }: {
2
+ bearerToken: string;
3
+ }) => Headers;
@@ -0,0 +1,7 @@
1
+ type HandleFetchProps<T> = {
2
+ fetcher: Promise<Response>;
3
+ onSuccess?: (data: T) => void;
4
+ onError: (error: Error) => void;
5
+ };
6
+ export declare const handleFetch: <T>({ fetcher, onSuccess, onError, }: HandleFetchProps<T>) => Promise<void>;
7
+ export {};
@@ -1,10 +1,14 @@
1
+ export * from './bearerTokenIsRequiredError';
1
2
  export * from './camelCaseKeys';
2
3
  export * from './cx';
3
4
  export * from './formatUsTin';
4
5
  export * from './getFieldsState';
6
+ export * from './getFormStatus';
7
+ export * from './getHeaders';
5
8
  export * from './getMaskedContent';
6
9
  export * from './getMonthlyDayCount';
7
10
  export * from './getPromptKeyMap';
11
+ export * from './handleFetch';
8
12
  export * from './isBlank';
9
13
  export * from './kebabCase';
10
14
  export * from './mergeClientTaxDocumentationData';
@@ -1,22 +1,18 @@
1
- import { ClientTaxDocumentation } from '@taxbit/utilities';
1
+ import { ClientTaxDocumentation, SignedClientTaxDocumentation } from '@taxbit/utilities';
2
2
  import { Questionnaire } from 'types';
3
3
  import { ExternalValidations } from 'types/client';
4
- export type TaxbitResponseError = {
5
- message: string;
6
- response: Response;
7
- };
8
4
  export type UseTaxbitPersistProps = {
9
5
  data?: ClientTaxDocumentation;
10
6
  staging?: boolean;
11
7
  bearerToken: string;
12
- questionnaire?: Questionnaire;
13
- onSuccess?: (data?: ClientTaxDocumentation) => void | Promise<void>;
14
- onSettled?: (data?: ClientTaxDocumentation) => void | Promise<void>;
15
- onError?: (error?: TaxbitResponseError) => void | Promise<void>;
16
- onSubmit?: (data?: ClientTaxDocumentation) => void | Promise<void>;
8
+ questionnaire: Questionnaire;
9
+ onSuccess?: (data: ClientTaxDocumentation) => void | Promise<void>;
10
+ onSettled?: (data: ClientTaxDocumentation) => void | Promise<void>;
11
+ onError?: (error: Error) => void | Promise<void>;
12
+ onSubmit?: (data: ClientTaxDocumentation) => void | Promise<void>;
17
13
  };
18
14
  export declare const useTaxbitPersist: ({ bearerToken, data, onSubmit, onSuccess, onSettled, onError, staging, questionnaire, }: UseTaxbitPersistProps) => {
19
- handleOnSubmit: (data?: ClientTaxDocumentation) => Promise<void>;
15
+ handleOnSubmit: (data: SignedClientTaxDocumentation) => Promise<void>;
20
16
  externalValidations: ExternalValidations;
21
17
  formData: ClientTaxDocumentation;
22
18
  isComplete: boolean;
@@ -2,7 +2,6 @@ export * from './AccountHolderClassification';
2
2
  export * from './AccountHolderContact';
3
3
  export * from './AccountHolderTax';
4
4
  export * from './AccountHolderTaxClarification';
5
- export * from './Confirmation';
6
5
  export * from './Exemptions';
7
6
  export * from './RegardedOwnerContact';
8
7
  export * from './RegardedOwnerTax';