@zeniai/client-epic-state 5.1.0 → 5.1.1-beta0ND

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 (106) hide show
  1. package/lib/commonStateTypes/animations.d.ts +1 -1
  2. package/lib/commonStateTypes/animations.js +1 -0
  3. package/lib/entity/company/companyPayload.d.ts +4 -0
  4. package/lib/entity/company/companyPayload.js +4 -0
  5. package/lib/entity/company/companyStateTypes.d.ts +4 -0
  6. package/lib/entity/jeSchedules/jeSchedulesPayload.js +18 -6
  7. package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +1 -0
  8. package/lib/entity/paymentAccount/paymentAccountSelector.js +9 -0
  9. package/lib/entity/tenant/clearAllEpic.d.ts +2 -2
  10. package/lib/entity/tenant/clearAllEpic.js +2 -2
  11. package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
  12. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +21 -0
  13. package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +54 -0
  14. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
  15. package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
  16. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
  17. package/lib/entity/tenant/tenantPayload.d.ts +1 -0
  18. package/lib/entity/tenant/tenantReducer.d.ts +38 -25
  19. package/lib/entity/tenant/tenantReducer.js +70 -10
  20. package/lib/entity/tenant/tenantState.d.ts +1 -0
  21. package/lib/entity/transaction/payloadTypes/transactionPayload.js +4 -2
  22. package/lib/epic.d.ts +8 -3
  23. package/lib/epic.js +9 -3
  24. package/lib/esm/commonStateTypes/animations.js +1 -0
  25. package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +1 -1
  26. package/lib/esm/entity/company/companyPayload.js +4 -0
  27. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +18 -6
  28. package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +8 -0
  29. package/lib/esm/entity/tenant/clearAllEpic.js +2 -2
  30. package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +50 -0
  31. package/lib/esm/entity/tenant/tenantReducer.js +68 -8
  32. package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +4 -2
  33. package/lib/esm/epic.js +9 -3
  34. package/lib/esm/index.js +12 -9
  35. package/lib/esm/reducer.js +3 -3
  36. package/lib/esm/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +3 -3
  37. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -1
  38. package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
  39. package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
  40. package/lib/esm/view/fileView/epic/updateFileNameEpic.js +2 -2
  41. package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +40 -0
  42. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +29 -0
  43. package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +40 -0
  44. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +218 -50
  45. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +12 -2
  46. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +12 -0
  47. package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +1 -1
  48. package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +1 -1
  49. package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +1 -3
  50. package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +1 -2
  51. package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +1 -1
  52. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +58 -0
  53. package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +77 -0
  54. package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +14 -0
  55. package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +207 -0
  56. package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +106 -52
  57. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +6 -1
  58. package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +41 -0
  59. package/lib/index.d.ts +15 -11
  60. package/lib/index.js +64 -44
  61. package/lib/reducer.d.ts +3 -3
  62. package/lib/reducer.js +3 -3
  63. package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.d.ts +1 -1
  64. package/lib/view/companyView/epic/companyPassport/updateCapitalizationAccountThresholdEpic.js +2 -2
  65. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +1 -1
  66. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -1
  67. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -1
  68. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -1
  69. package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
  70. package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
  71. package/lib/view/fileView/epic/updateFileNameEpic.js +1 -1
  72. package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +7 -0
  73. package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +44 -0
  74. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +8 -0
  75. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +33 -0
  76. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +9 -0
  77. package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +44 -0
  78. package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +3 -0
  79. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +41 -4
  80. package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +220 -51
  81. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +5 -1
  82. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +15 -2
  83. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +40 -0
  84. package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +13 -1
  85. package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +1 -1
  86. package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +1 -1
  87. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +1 -1
  88. package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +1 -3
  89. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +1 -1
  90. package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +1 -2
  91. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +28 -0
  92. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +62 -0
  93. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +9 -0
  94. package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +81 -0
  95. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +24 -0
  96. package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +17 -0
  97. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +29 -0
  98. package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +215 -0
  99. package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +28 -2
  100. package/lib/view/spendManagement/commonSetup/setupViewReducer.js +107 -53
  101. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +7 -2
  102. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +6 -1
  103. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +19 -0
  104. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +154 -0
  105. package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +46 -0
  106. package/package.json +1 -1
@@ -92,15 +92,17 @@ function getBusinessVerificationDetails(state, companyId) {
92
92
  const { setupViewState, countryListState } = state;
93
93
  const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, updateStatus, } = setupViewState;
94
94
  const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
95
- const { companyDetailsLocalData, companyOfficerLocalData } = (0, exports.getCompanyAndIdentityDetails)(state, companyId, {
95
+ const { companyDetailsLocalData, companyOfficerLocalData, parsingDocumentFileIds, } = (0, exports.getCompanyAndIdentityDetails)(state, companyId, {
96
96
  companyDetails,
97
97
  companyOfficerUpdateStatus,
98
98
  primaryContactDetails,
99
+ parsingDocumentFileIds: setupViewState.parsingDocumentFileIds,
99
100
  });
100
101
  const allNationalityCountries = countryListState.byCountryListCode.nationalityCountryList.countries;
101
102
  return {
102
103
  companyDetailsLocalData,
103
104
  companyOfficerLocalData,
105
+ parsingDocumentFileIds,
104
106
  companyView,
105
107
  updateStatus,
106
108
  allNationalityCountries,
@@ -124,6 +126,7 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
124
126
  const companyAddress = addressViewState.newAddressState?.company_address;
125
127
  const registeredCompanyAddress = addressViewState.newAddressState?.company_registered_address;
126
128
  companyDetailsLocalData = {
129
+ autoFilledFields: companyDetails.autoFilledFields,
127
130
  companyId,
128
131
  companyDescription,
129
132
  companyLegalName,
@@ -196,6 +199,7 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
196
199
  const companyOfficerAddress = addressViewState.newAddressState?.[addressType];
197
200
  companyOfficerLocalData[officerType] = {
198
201
  ...companyOfficer.localData,
202
+ autoFilledFields: companyOfficer.autoFilledFields,
199
203
  userFiles: (0, fileSelector_1.getFilesByFileIds)(fileState, fileIds),
200
204
  additionalFiles: (0, fileSelector_1.getFilesByFileIds)(fileState, additionalSubmittedDocumentsForVerificationFileIds),
201
205
  deleteFileStatusById,
@@ -209,6 +213,7 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
209
213
  return {
210
214
  companyDetailsLocalData,
211
215
  companyOfficerLocalData,
216
+ parsingDocumentFileIds: companyAndIdentityDetails.parsingDocumentFileIds,
212
217
  };
213
218
  };
214
219
  exports.getCompanyAndIdentityDetails = getCompanyAndIdentityDetails;
@@ -81,9 +81,21 @@ export interface SetupViewLocalData {
81
81
  */
82
82
  export interface CompanyAndIdentityDetails {
83
83
  companyDetails: {
84
+ /**
85
+ * Field names from {@link CompanyDetailsLocalData} that were populated by AI
86
+ * autofill from an uploaded KYB document. Drives the ✦ sparkle in the form.
87
+ * Always present (empty when no autofill has run yet).
88
+ */
89
+ autoFilledFields: string[];
84
90
  localData?: CompanyDetailsLocalData;
85
91
  };
86
92
  companyOfficerUpdateStatus: Record<CompanyOfficerType, {
93
+ /**
94
+ * Field names from {@link CompanyOfficerLocalData} populated by AI autofill
95
+ * from an uploaded KYC identity document. Drives the ✦ sparkle in the form.
96
+ * Always present (empty when no autofill has run yet).
97
+ */
98
+ autoFilledFields: string[];
87
99
  otpverificationStatus: FetchStateAndError;
88
100
  sendOtpStatus: FetchStateAndError;
89
101
  localData?: CompanyOfficerLocalData;
@@ -93,6 +105,13 @@ export interface CompanyAndIdentityDetails {
93
105
  };
94
106
  }
95
107
  export interface SetupViewState extends CompanyAndIdentityDetails {
108
+ /**
109
+ * File IDs currently being parsed by the AI autofill epic. Populated when
110
+ * `parseUploadedKyc/KybDocument` dispatches and cleared when the
111
+ * corresponding apply / failure action fires. Drives the "AI is reading
112
+ * your document" overlay on the document upload field.
113
+ */
114
+ parsingDocumentFileIds: ID[];
96
115
  updateStatus: FetchStateAndError;
97
116
  }
98
117
  export {};
@@ -0,0 +1,154 @@
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;
@@ -0,0 +1,46 @@
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.0",
3
+ "version": "5.1.1-beta0ND",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",