@taxbit/react-sdk 0.2.1 → 0.2.2

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.
@@ -2,3 +2,5 @@ export type Requiredish<T> = {
2
2
  [K in keyof Required<T>]: T[K];
3
3
  };
4
4
  export type Extends<T, U extends T> = U;
5
+ export type IsExact<T, U> = [T] extends [U] ? [U] extends [T] ? true : false : false;
6
+ export declare function assertExactType<T extends true>(_expectTrue: T): void;
@@ -0,0 +1,79 @@
1
+ export type Address = {
2
+ city?: string;
3
+ country?: string;
4
+ stateOrProvince?: string;
5
+ firstLine?: string;
6
+ secondLine?: string;
7
+ postalCode?: string;
8
+ };
9
+ export type AccountHolderTaxDocumentation = {
10
+ address?: Address;
11
+ countryOfCitizenship?: string;
12
+ dateOfBirth?: string;
13
+ dbaName?: string;
14
+ mailingAddress?: Address;
15
+ mailingAddressIsDifferent?: boolean;
16
+ name?: string;
17
+ cityOfBirth?: string;
18
+ countryOfBirth?: string;
19
+ financialAccountIdentifier?: string;
20
+ financialAccountName?: string;
21
+ ftin?: string;
22
+ ftinNotLegallyRequired?: boolean;
23
+ taxResidences?: Array<{
24
+ country?: string;
25
+ tin?: string;
26
+ tinNotRequired?: boolean;
27
+ }>;
28
+ tin?: string;
29
+ vatin?: string;
30
+ vatinCountry?: string;
31
+ vatinNotRequired?: boolean;
32
+ exemptFatcaCode?: string;
33
+ exemptPayeeCode?: string;
34
+ isIndividual?: boolean;
35
+ isEuResident?: boolean;
36
+ isUsPerson?: boolean;
37
+ usAccountType?: string;
38
+ usSmllcElection?: boolean;
39
+ usLlcClassification?: string;
40
+ usOtherClassification?: string;
41
+ usTrustEstateEin?: boolean;
42
+ foreignAccountType?: string;
43
+ foreignTrustClassification?: string;
44
+ foreignOtherClassification?: string;
45
+ };
46
+ export type RegardedOwnerTaxDocumentation = {
47
+ address?: Address;
48
+ countryOfCitizenship?: string;
49
+ dateOfBirth?: string;
50
+ dbaName?: string;
51
+ mailingAddress?: Address;
52
+ mailingAddressIsDifferent?: boolean;
53
+ name?: string;
54
+ ftin?: string;
55
+ ftinNotLegallyRequired?: boolean;
56
+ tin?: string;
57
+ exemptFatcaCode?: string;
58
+ exemptPayeeCode?: string;
59
+ isUsPerson?: boolean;
60
+ usAccountType?: string;
61
+ usLlcClassification?: string;
62
+ usOtherClassification?: string;
63
+ usTrustEstateEin?: boolean;
64
+ foreignAccountType?: string;
65
+ foreignTrustClassification?: string;
66
+ foreignOtherClassification?: string;
67
+ };
68
+ export type ClientTaxDocumentation = {
69
+ accountHolder?: AccountHolderTaxDocumentation;
70
+ } & {
71
+ regardedOwner?: RegardedOwnerTaxDocumentation;
72
+ } & {
73
+ hasCertified?: boolean;
74
+ isNotSubjectBackupWithholding?: boolean;
75
+ signature?: string;
76
+ documentType?: 'COMPREHENSIVE';
77
+ source?: string;
78
+ signatureTimestamp?: string;
79
+ };
@@ -0,0 +1,9 @@
1
+ import { ComprehensiveFormStatusEnum, ComprehensiveStatusEnum } from '../server';
2
+ export type ClientTaxDocumentationStatus = {
3
+ status: ComprehensiveStatusEnum.Undocumented | ComprehensiveStatusEnum.Undetermined;
4
+ submissionStatus: ComprehensiveStatusEnum.Submitted | ComprehensiveStatusEnum.NotSubmitted;
5
+ DAC7Interview?: {
6
+ dataCollectionStatus: ComprehensiveFormStatusEnum.Complete | ComprehensiveFormStatusEnum.Incomplete;
7
+ expirationDate: string;
8
+ };
9
+ };
@@ -1,4 +1,2 @@
1
- import type { CamelCaseKeys } from 'types';
2
- import type { SignedComprehensiveTaxDocumentation, TaxDocumentationStatus } from '../server';
3
- export type ClientTaxDocumentation = CamelCaseKeys<SignedComprehensiveTaxDocumentation>;
4
- export type ClientTaxDocumentationStatus = CamelCaseKeys<TaxDocumentationStatus>;
1
+ export type { ClientTaxDocumentation } from './ClientTaxDocumentation';
2
+ export type { ClientTaxDocumentationStatus } from './ClientTaxDocumentationStatus';
@@ -76,3 +76,6 @@ export type SignedComprehensiveTaxDocumentation = {
76
76
  document_type?: 'COMPREHENSIVE';
77
77
  source?: string;
78
78
  };
79
+ export type SignedDatedComprehensiveTaxDocumentation = SignedComprehensiveTaxDocumentation & {
80
+ signature_timestamp?: string;
81
+ };
@@ -3,8 +3,8 @@ import { HintKey } from "i18n/types";
3
3
  export declare const getHintKeyMap: () => {
4
4
  signature?: "dateOfBirth" | undefined;
5
5
  source?: "dateOfBirth" | undefined;
6
- exemptPayeeCode?: "dateOfBirth" | undefined;
7
6
  exemptFatcaCode?: "dateOfBirth" | undefined;
7
+ exemptPayeeCode?: "dateOfBirth" | undefined;
8
8
  iAcknowlegeESignIsOk?: "dateOfBirth" | undefined;
9
9
  iAmACitizenOfTheUs?: "dateOfBirth" | undefined;
10
10
  iAmExemptFromFatcaReporting?: "dateOfBirth" | undefined;
@@ -3,8 +3,8 @@ import { TaxDocumentation, TaxDocumentationKey } from 'types/TaxDocumentation';
3
3
  export declare const getPromptKeyMap: (data: TaxDocumentation) => {
4
4
  signature?: PromptKey | undefined;
5
5
  source?: PromptKey | undefined;
6
- exemptPayeeCode?: PromptKey | undefined;
7
6
  exemptFatcaCode?: PromptKey | undefined;
7
+ exemptPayeeCode?: PromptKey | undefined;
8
8
  iAcknowlegeESignIsOk?: PromptKey | undefined;
9
9
  iAmACitizenOfTheUs?: PromptKey | undefined;
10
10
  iAmExemptFromFatcaReporting?: PromptKey | undefined;
@@ -7,5 +7,7 @@ export * from './getMonthlyDayCount';
7
7
  export * from './getPromptKeyMap';
8
8
  export * from './isBlank';
9
9
  export * from './kebabCase';
10
+ export * from './snakeCaseKeys';
11
+ export * from './transformForClient';
10
12
  export * from './transformInbound';
11
13
  export * from './transformOutbound';
@@ -0,0 +1 @@
1
+ export declare const snakeCaseKeys: (item: unknown) => unknown;
@@ -0,0 +1 @@
1
+ export * from './transformForClient.ts';
@@ -0,0 +1,3 @@
1
+ import { TaxDocumentation } from '../../types';
2
+ import { ClientTaxDocumentation } from '../../types/client';
3
+ export declare const transformForClient: (data: TaxDocumentation) => ClientTaxDocumentation;
@@ -1,3 +1,3 @@
1
1
  import { TaxDocumentation } from '../../types';
2
- import { SignedComprehensiveTaxDocumentation } from '../../types/server';
3
- export declare const transformOutbound: (data: TaxDocumentation) => SignedComprehensiveTaxDocumentation;
2
+ import { SignedDatedComprehensiveTaxDocumentation } from '../../types/server';
3
+ export declare const transformOutbound: (data: TaxDocumentation) => SignedDatedComprehensiveTaxDocumentation;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Locale, TaxDocumentation, TaxForm } from 'types';
2
+ import { Locale, TaxForm } from 'types';
3
3
  import { ClientTaxDocumentation } from 'types/client';
4
4
  export type TaxBitFormProps = {
5
5
  data?: ClientTaxDocumentation;
@@ -7,7 +7,7 @@ export type TaxBitFormProps = {
7
7
  bearerToken: string;
8
8
  language?: Locale;
9
9
  taxForms?: TaxForm[];
10
- onSubmit?: (data?: TaxDocumentation) => void;
11
- onSuccess?: (data?: TaxDocumentation) => void;
10
+ onSubmit?: (data?: ClientTaxDocumentation) => void;
11
+ onSuccess?: (data?: ClientTaxDocumentation) => void;
12
12
  };
13
13
  export declare const TaxBitForm: ({ staging, data, bearerToken, language, taxForms, onSubmit, onSuccess, }: TaxBitFormProps) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { TaxBitFormUIProps } from './TaxBitFormUI';
3
3
  export type TaxDocumentationDAC7PathProps = Omit<TaxBitFormUIProps, 'taxForms'>;
4
- export declare const TaxBitDAC7FormUI: ({ data, onSubmit, language, }: TaxDocumentationDAC7PathProps) => React.JSX.Element;
4
+ export declare const TaxBitDAC7FormUI: ({ data, onSubmit, language, complete, }: TaxDocumentationDAC7PathProps) => React.JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import type { Locale, TaxDocumentation, TaxForm } from '../../types';
2
+ import type { Locale, TaxForm } from '../../types';
3
3
  import { ClientTaxDocumentation } from '../../types/client';
4
4
  export type TaxBitFormUIProps = {
5
5
  data?: ClientTaxDocumentation;
6
- onSubmit: (data: TaxDocumentation) => void;
6
+ onSubmit: (data: ClientTaxDocumentation) => void;
7
7
  language?: Locale;
8
8
  taxForms?: TaxForm[];
9
9
  complete?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taxbit/react-sdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "TaxBit Tax Documentation",
5
5
  "author": "TaxBit",
6
6
  "type": "module",