@zeniai/client-epic-state 5.1.4-beta7ND → 5.1.4-betaML1
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/lib/entity/company/companyPayload.d.ts +0 -4
- package/lib/entity/company/companyPayload.js +0 -6
- package/lib/entity/company/companyStateTypes.d.ts +0 -7
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +0 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.js +0 -9
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +25 -38
- package/lib/entity/tenant/tenantReducer.js +5 -65
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +2 -0
- package/lib/epic.d.ts +1 -6
- package/lib/epic.js +1 -7
- package/lib/esm/entity/company/companyPayload.js +0 -6
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +0 -8
- package/lib/esm/entity/tenant/tenantReducer.js +3 -63
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +1 -0
- package/lib/esm/epic.js +1 -7
- package/lib/esm/index.js +7 -11
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +1 -0
- package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
- package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +18 -24
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +17 -29
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +51 -223
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +12 -24
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +6 -37
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +52 -106
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/index.d.ts +10 -14
- package/lib/index.js +35 -64
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +1 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -0
- package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
- package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +18 -24
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.d.ts +2 -2
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +15 -27
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +0 -3
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +5 -44
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +52 -225
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -6
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +12 -27
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +8 -52
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +7 -39
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -28
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +53 -107
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -7
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -19
- package/package.json +1 -1
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +0 -21
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -59
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -55
- package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -40
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -29
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -40
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -58
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -77
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -14
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -207
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -41
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -44
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +0 -8
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -33
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +0 -9
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -44
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +0 -28
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -62
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +0 -9
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -81
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +0 -24
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -17
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +0 -29
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -215
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +0 -154
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -46
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared types for the KYC / KYB document autofill flow that lives inside the
|
|
3
|
-
* commonSetup feature (Setup pages + Onboarding both consume it via the same
|
|
4
|
-
* selector view; there is no separate state slice).
|
|
5
|
-
*
|
|
6
|
-
* Backed by document-communication-agent `POST /1.0/documents/process/sync`,
|
|
7
|
-
* which proxies document-service ExtendAI parsers and returns one of the
|
|
8
|
-
* parser payloads below — each value shaped as `{value, confidence}` per field.
|
|
9
|
-
*/
|
|
10
|
-
import { ID } from '../../../../commonStateTypes/common';
|
|
11
|
-
import { AllowedDocumentType } from '../../../../entity/file/fileState';
|
|
12
|
-
/**
|
|
13
|
-
* Form-side identity document types as picked in `SelectDocumentField`.
|
|
14
|
-
* These are camelCase per the web-components convention.
|
|
15
|
-
*/
|
|
16
|
-
export type KycSelectDocumentType = 'driverLicense' | 'passport' | 'ssnCard' | 'stateId';
|
|
17
|
-
/**
|
|
18
|
-
* KYC document types accepted by the document-service parsers (snake_case).
|
|
19
|
-
* Subset of {@link KycKybProvidedDocumentType}. `stateId` from the form maps
|
|
20
|
-
* to no parser today and is skipped at dispatch time.
|
|
21
|
-
*/
|
|
22
|
-
export type KycProvidedDocumentType = 'passport' | 'driving_license' | 'social_security_card';
|
|
23
|
-
/** KYB document types accepted by the document-service parsers. */
|
|
24
|
-
export type KybProvidedDocumentType = 'certificate_of_incorporation' | 'tax_ein';
|
|
25
|
-
/** All KYC / KYB document types accepted by document-communication-agent. */
|
|
26
|
-
export type KycKybProvidedDocumentType = KycProvidedDocumentType | KybProvidedDocumentType;
|
|
27
|
-
/** Field value with model confidence (0..1) as returned by ExtendAI parsers. */
|
|
28
|
-
export interface FieldWithConfidence<T = string | null> {
|
|
29
|
-
confidence: number;
|
|
30
|
-
value: T | null;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Parser payloads — keep in sync with document-service
|
|
34
|
-
* `processors/parsers/extend_*_parser.py`.
|
|
35
|
-
*/
|
|
36
|
-
export interface ExtendPassportParsed {
|
|
37
|
-
date_of_birth?: FieldWithConfidence;
|
|
38
|
-
date_of_expiry?: FieldWithConfidence;
|
|
39
|
-
date_of_issue?: FieldWithConfidence;
|
|
40
|
-
first_name?: FieldWithConfidence;
|
|
41
|
-
gender?: FieldWithConfidence;
|
|
42
|
-
issuing_authority?: FieldWithConfidence;
|
|
43
|
-
last_name?: FieldWithConfidence;
|
|
44
|
-
mrz_line_1?: FieldWithConfidence;
|
|
45
|
-
mrz_line_2?: FieldWithConfidence;
|
|
46
|
-
nationality?: FieldWithConfidence;
|
|
47
|
-
passport_number?: FieldWithConfidence;
|
|
48
|
-
place_of_birth?: FieldWithConfidence;
|
|
49
|
-
}
|
|
50
|
-
export interface ExtendDrivingLicenseParsed {
|
|
51
|
-
address_city?: FieldWithConfidence;
|
|
52
|
-
address_state?: FieldWithConfidence;
|
|
53
|
-
address_street?: FieldWithConfidence;
|
|
54
|
-
address_zip?: FieldWithConfidence;
|
|
55
|
-
date_of_birth?: FieldWithConfidence;
|
|
56
|
-
date_of_expiry?: FieldWithConfidence;
|
|
57
|
-
date_of_issue?: FieldWithConfidence;
|
|
58
|
-
first_name?: FieldWithConfidence;
|
|
59
|
-
issuing_state?: FieldWithConfidence;
|
|
60
|
-
last_name?: FieldWithConfidence;
|
|
61
|
-
license_number?: FieldWithConfidence;
|
|
62
|
-
middle_name?: FieldWithConfidence;
|
|
63
|
-
}
|
|
64
|
-
export interface ExtendSsnCardParsed {
|
|
65
|
-
full_name?: FieldWithConfidence;
|
|
66
|
-
}
|
|
67
|
-
export interface ExtendCertificateOfIncorporationParsed {
|
|
68
|
-
company_address?: FieldWithConfidence;
|
|
69
|
-
company_legal_name?: FieldWithConfidence;
|
|
70
|
-
countries_of_operations?: FieldWithConfidence<string[]>;
|
|
71
|
-
date_of_incorporation?: FieldWithConfidence;
|
|
72
|
-
ein?: FieldWithConfidence;
|
|
73
|
-
industry?: FieldWithConfidence;
|
|
74
|
-
phone_number?: FieldWithConfidence;
|
|
75
|
-
product_description?: FieldWithConfidence;
|
|
76
|
-
purpose_of_account?: FieldWithConfidence;
|
|
77
|
-
registered_address?: FieldWithConfidence;
|
|
78
|
-
regulated_status?: FieldWithConfidence;
|
|
79
|
-
source_of_funds?: FieldWithConfidence;
|
|
80
|
-
state_of_incorporation?: FieldWithConfidence;
|
|
81
|
-
sub_industry?: FieldWithConfidence;
|
|
82
|
-
sub_us_nexus?: FieldWithConfidence;
|
|
83
|
-
transaction_volume_expectations?: FieldWithConfidence;
|
|
84
|
-
type_of_incorporation?: FieldWithConfidence;
|
|
85
|
-
us_nexus?: FieldWithConfidence;
|
|
86
|
-
website?: FieldWithConfidence;
|
|
87
|
-
}
|
|
88
|
-
export interface ExtendTaxEinParsed {
|
|
89
|
-
ein?: FieldWithConfidence;
|
|
90
|
-
irs_address?: FieldWithConfidence;
|
|
91
|
-
legal_business_name?: FieldWithConfidence;
|
|
92
|
-
trade_name?: FieldWithConfidence;
|
|
93
|
-
}
|
|
94
|
-
/** POST /1.0/documents/process/sync request body. */
|
|
95
|
-
export interface SyncDocumentsProcessRequest {
|
|
96
|
-
files: Array<{
|
|
97
|
-
file_id: ID;
|
|
98
|
-
}>;
|
|
99
|
-
provided_document_type: KycKybProvidedDocumentType;
|
|
100
|
-
metadata?: {
|
|
101
|
-
source?: string;
|
|
102
|
-
} & Record<string, unknown>;
|
|
103
|
-
processing_priority?: number;
|
|
104
|
-
}
|
|
105
|
-
/** Parser payload union — `data.files[0].extracted_data` for any document type. */
|
|
106
|
-
export type ExtendExtractedData = ExtendPassportParsed | ExtendDrivingLicenseParsed | ExtendSsnCardParsed | ExtendCertificateOfIncorporationParsed | ExtendTaxEinParsed;
|
|
107
|
-
/** Per-file row inside the batch response. */
|
|
108
|
-
export interface SyncDocumentsProcessFileResult {
|
|
109
|
-
extracted_data: ExtendExtractedData | null;
|
|
110
|
-
file_id: ID;
|
|
111
|
-
status: string;
|
|
112
|
-
filename?: string | null;
|
|
113
|
-
processing_metadata?: Record<string, unknown>;
|
|
114
|
-
}
|
|
115
|
-
/** POST /1.0/documents/process/sync response body. */
|
|
116
|
-
export interface SyncDocumentsProcessResponse {
|
|
117
|
-
data: {
|
|
118
|
-
files: SyncDocumentsProcessFileResult[];
|
|
119
|
-
provided_document_type: KycKybProvidedDocumentType;
|
|
120
|
-
request_id: string;
|
|
121
|
-
status: string;
|
|
122
|
-
tenant_id: string;
|
|
123
|
-
metadata?: Record<string, unknown>;
|
|
124
|
-
} | null;
|
|
125
|
-
status: {
|
|
126
|
-
code: number;
|
|
127
|
-
message: string;
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Discriminator for which Redux slice to apply the autofill to — setup pages
|
|
132
|
-
* (`spendManagement/commonSetup`) and onboarding (`onboardingView/customerView`)
|
|
133
|
-
* share the same field shapes but live in separate slices.
|
|
134
|
-
*/
|
|
135
|
-
export type KycKybAutofillTarget = 'setup' | 'onboarding';
|
|
136
|
-
/** Confidence floor below which we drop an autofill candidate. */
|
|
137
|
-
export declare const KYC_KYB_AUTOFILL_MIN_CONFIDENCE = 0.5;
|
|
138
|
-
/**
|
|
139
|
-
* Maps the form-side {@link KycSelectDocumentType} (camelCase) to the
|
|
140
|
-
* parser-side {@link KycProvidedDocumentType} (snake_case). Returns `null` for
|
|
141
|
-
* `stateId`, which has no parser today.
|
|
142
|
-
*/
|
|
143
|
-
export declare const toKycProvidedDocumentType: (selectType: KycSelectDocumentType) => KycProvidedDocumentType | null;
|
|
144
|
-
/**
|
|
145
|
-
* Maps a persisted {@link AllowedDocumentType} (snake_case — the value stored on
|
|
146
|
-
* an officer's `documentTypeSelectedForVerification`) to the parser-side
|
|
147
|
-
* {@link KycProvidedDocumentType}. Returns `null` for document types with no KYC
|
|
148
|
-
* parser today (e.g. `id_document` / state ID, and any non-identity doc).
|
|
149
|
-
*
|
|
150
|
-
* The officer's stored selection is an `AllowedDocumentType`, not a
|
|
151
|
-
* {@link KycSelectDocumentType}; use this — not {@link toKycProvidedDocumentType}
|
|
152
|
-
* — when triggering autofill off that field.
|
|
153
|
-
*/
|
|
154
|
-
export declare const toKycProvidedDocumentTypeFromAllowed: (allowedType: AllowedDocumentType) => KycProvidedDocumentType | null;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toKycProvidedDocumentTypeFromAllowed = exports.toKycProvidedDocumentType = exports.KYC_KYB_AUTOFILL_MIN_CONFIDENCE = void 0;
|
|
4
|
-
/** Confidence floor below which we drop an autofill candidate. */
|
|
5
|
-
exports.KYC_KYB_AUTOFILL_MIN_CONFIDENCE = 0.5;
|
|
6
|
-
/**
|
|
7
|
-
* Maps the form-side {@link KycSelectDocumentType} (camelCase) to the
|
|
8
|
-
* parser-side {@link KycProvidedDocumentType} (snake_case). Returns `null` for
|
|
9
|
-
* `stateId`, which has no parser today.
|
|
10
|
-
*/
|
|
11
|
-
const toKycProvidedDocumentType = (selectType) => {
|
|
12
|
-
switch (selectType) {
|
|
13
|
-
case 'driverLicense':
|
|
14
|
-
return 'driving_license';
|
|
15
|
-
case 'passport':
|
|
16
|
-
return 'passport';
|
|
17
|
-
case 'ssnCard':
|
|
18
|
-
return 'social_security_card';
|
|
19
|
-
case 'stateId':
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
exports.toKycProvidedDocumentType = toKycProvidedDocumentType;
|
|
24
|
-
/**
|
|
25
|
-
* Maps a persisted {@link AllowedDocumentType} (snake_case — the value stored on
|
|
26
|
-
* an officer's `documentTypeSelectedForVerification`) to the parser-side
|
|
27
|
-
* {@link KycProvidedDocumentType}. Returns `null` for document types with no KYC
|
|
28
|
-
* parser today (e.g. `id_document` / state ID, and any non-identity doc).
|
|
29
|
-
*
|
|
30
|
-
* The officer's stored selection is an `AllowedDocumentType`, not a
|
|
31
|
-
* {@link KycSelectDocumentType}; use this — not {@link toKycProvidedDocumentType}
|
|
32
|
-
* — when triggering autofill off that field.
|
|
33
|
-
*/
|
|
34
|
-
const toKycProvidedDocumentTypeFromAllowed = (allowedType) => {
|
|
35
|
-
switch (allowedType) {
|
|
36
|
-
case 'passport':
|
|
37
|
-
return 'passport';
|
|
38
|
-
case 'driving_license':
|
|
39
|
-
return 'driving_license';
|
|
40
|
-
case 'social_security_card':
|
|
41
|
-
return 'social_security_card';
|
|
42
|
-
default:
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
exports.toKycProvidedDocumentTypeFromAllowed = toKycProvidedDocumentTypeFromAllowed;
|