Files
self/common/index.ts
turnoffthiscomputer 2df4dc4619 SELF-725: add iOS qrcode opener and aadhaar screen (#1038)
* add iOS qrcode opener and aadhaar screen

* format

* fix test

* add Image-picker android (#1077)

* add image-picker android

* fix validation

* feat: implement Aadhaar upload success and error screens, enhance AadhaarNavBar with dynamic progress indication

- Added AadhaarUploadedSuccessScreen and AadhaarUploadErrorScreen components for handling upload outcomes.
- Updated AadhaarNavBar to reflect current upload step with dynamic progress bar.
- Integrated new screens into navigation flow for Aadhaar upload process.
- Introduced blue check and warning SVG icons for visual feedback on success and error states.

* feat: generate mock aadhar (#1083)

* feat: generate mock aadhar

* add yarn.lock

* update yarn.lock

* update protocolStore, update types, start modifying provingMachine

* Register mock aadhar (#1093)

* Register mock aadhar

* fix ofac

* temp: generate name

* fix dob

* Add Aadhaar support to ID card component and screens

- Integrated Aadhaar icon and conditional rendering in IdCardLayout.
- Updated AadhaarUploadScreen to process QR codes and store Aadhaar data.
- Modified navigation and button text in AadhaarUploadedSuccessScreen.
- Added mock data generation for Aadhaar in the mobile SDK.
- Updated ManageDocumentsScreen to include Aadhaar document type.
- Enhanced error handling and validation for Aadhaar QR code processing.
- Added utility functions for Aadhaar data extraction and commitment processing.

* aadhaar disclose - wip (#1094)

* fix: timestamp cal of extractQRDataFields

* Feat/aadhar fixes (#1099)

* Fix - android aadhar qr scanner

* fixes

* update text

* yarn nice

* run prettier

* Add mock Aadhaar certificates for development

- Introduced hardcoded Aadhaar test certificates for development purposes.
- Moved Aadhaar mock private and public keys to a dedicated file for better organization.
- Updated the mock ID document generation utility to utilize the new Aadhaar mock certificates.

* prettier write

* add 'add-aadhaar' button (#1100)

* Update .gitleaks.toml to include path for mock certificates in the common/dist directory

* yarn nice

* Enhance Aadhaar error handling with specific error types

- Updated the AadhaarUploadErrorScreen to display different messages based on the error type (general or expired).
- Modified the AadhaarUploadScreen to pass the appropriate error type when navigating to the error screen.
- Set initial parameters for the home screen to include a default error type.

* Update passport handling in proving machine to support Aadhaar document category

- Modified the handling of country code in the useProvingStore to return 'IND' for Aadhaar documents.
- Ensured that the country code is only fetched from passport metadata for non-Aadhaar documents.

* tweak layout, text, change email to support, hide help button

* fix ci, remove aadhaar logging, add aadhaar events

* remove unused aadhaar tracking events

* update globs

* fix gitguardian config

* don't track id

---------

Co-authored-by: Justin Hernandez <justin.hernandez@self.xyz>
Co-authored-by: Seshanth.S🐺 <35675963+seshanthS@users.noreply.github.com>
Co-authored-by: vishal <vishalkoolkarni0045@gmail.com>
2025-09-19 17:36:01 -07:00

109 lines
2.4 KiB
TypeScript

// Type exports from constants
export type {
AadhaarData,
CertificateData,
DocumentCategory,
IdDocInput,
PassportData,
PassportMetadata,
PublicKeyDetailsECDSA,
PublicKeyDetailsRSA,
SelfApp,
SelfAppDisclosureConfig,
UserIdType,
} from './src/utils/index.js';
// Constants exports
export type { Country3LetterCode } from './src/constants/index.js';
// Utils exports
export {
API_URL,
API_URL_STAGING,
CSCA_TREE_URL,
CSCA_TREE_URL_ID_CARD,
CSCA_TREE_URL_STAGING,
CSCA_TREE_URL_STAGING_ID_CARD,
DEFAULT_MAJORITY,
DSC_TREE_URL,
DSC_TREE_URL_ID_CARD,
DSC_TREE_URL_STAGING,
DSC_TREE_URL_STAGING_ID_CARD,
IDENTITY_TREE_URL,
IDENTITY_TREE_URL_ID_CARD,
IDENTITY_TREE_URL_STAGING,
IDENTITY_TREE_URL_STAGING_ID_CARD,
ID_CARD_ATTESTATION_ID,
PASSPORT_ATTESTATION_ID,
PCR0_MANAGER_ADDRESS,
REDIRECT_URL,
RPC_URL,
TREE_URL,
TREE_URL_STAGING,
WS_DB_RELAYER,
WS_DB_RELAYER_STAGING,
attributeToPosition,
attributeToPosition_ID,
commonNames,
countries,
countryCodes,
} from './src/constants/index.js';
// Type exports
export {
EndpointType,
Mode,
SelfAppBuilder,
bigIntToString,
brutforceSignatureAlgorithmDsc,
buildSMT,
calculateUserIdentifierHash,
findStartPubKeyIndex,
formatEndpoint,
formatMrz,
genAndInitMockPassportData,
genMockIdDoc,
genMockIdDocAndInitDataParsing,
generateCircuitInputsDSC,
generateCircuitInputsRegister,
generateCircuitInputsRegisterForTests,
generateCircuitInputsVCandDisclose,
generateCommitment,
generateMockDSC,
generateNullifier,
getCircuitNameFromPassportData,
getLeafCscaTree,
getLeafDscTree,
getSKIPEM,
getSolidityPackedUserContextData,
getUniversalLink,
hashEndpointWithScope,
initElliptic,
initPassportDataParsing,
parseCertificateSimple,
parseDscCertificateData,
stringToBigInt,
} from './src/utils/index.js';
export { createSelector } from './src/utils/aadhaar/constants.js';
// Hash utilities
export {
customHasher,
flexiblePoseidon,
getHashLen,
hash,
packBytesAndPoseidon,
} from './src/utils/hash.js';
export { generateTestData, testCustomData } from './src/utils/aadhaar/utils.js';
export { isAadhaarDocument, isMRZDocument } from './src/utils/index.js';
export {
prepareAadhaarDiscloseData,
prepareAadhaarDiscloseTestData,
prepareAadhaarRegisterData,
prepareAadhaarRegisterTestData,
} from './src/utils/aadhaar/mockData.js';