diff --git a/.env b/.env index d48cd5a260..3c462bb674 100644 --- a/.env +++ b/.env @@ -6,8 +6,6 @@ MIMOTO_HOST=https://api.qa-inji.mosip.net ESIGNET_HOST=https://api.qa-inji.mosip.net -GOOGLE_NEARBY_MESSAGES_API_KEY= - OBSRV_HOST = https://dataset-api.obsrv.mosip.net #Application Theme can be ( orange | purple ) diff --git a/.github/workflows/android-beta-build.yml b/.github/workflows/android-beta-build.yml index 21844566c1..ee3a53e59e 100644 --- a/.github/workflows/android-beta-build.yml +++ b/.github/workflows/android-beta-build.yml @@ -104,13 +104,6 @@ jobs: gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - name: Setup Firebase - run: | - cd android - if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ];then rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg;fi - env: - FIREBASE_SECRET: ${{ secrets.GPG_SECRET }} - - name: Generate keystore run: | echo "$ANDROID_KEYSTORE_FILE" > release.keystore.b64 diff --git a/.github/workflows/android-build-verify.yml b/.github/workflows/android-build-verify.yml index aa59299565..50f95ad0f8 100644 --- a/.github/workflows/android-build-verify.yml +++ b/.github/workflows/android-build-verify.yml @@ -109,20 +109,6 @@ jobs: gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - name: Setup Firebase - run: | - cd android - - if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ]; - then - rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg; - else - echo "Using Dummy Google Service JSON for firebase" - echo "$DUMMY_GOOGLE_SERVICE_JSON" > app/google-services.json - fi - env: - FIREBASE_SECRET: ${{ secrets.GPG_SECRET }} - - name: Generate keystore run: | keytool \ diff --git a/.github/workflows/android-internal-build.yml b/.github/workflows/android-internal-build.yml index bbf9061938..6684204c91 100644 --- a/.github/workflows/android-internal-build.yml +++ b/.github/workflows/android-internal-build.yml @@ -92,13 +92,6 @@ jobs: gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - name: Setup Firebase - run: | - cd android - if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ];then rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg;fi - env: - FIREBASE_SECRET: ${{ secrets.GPG_SECRET }} - - name: Generate keystore run: | echo "$ANDROID_KEYSTORE_FILE" > release.keystore.b64 @@ -182,13 +175,6 @@ jobs: gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg - - name: Setup Firebase - run: | - cd android - if [ ! -z "$FIREBASE_SECRET" ] && [ -f app/google-services.json.gpg ];then rm -f app/google-services.json;gpg2 --quiet --batch --passphrase=$FIREBASE_SECRET --pinentry-mode loopback --decrypt --output app/google-services.json app/mosip-google-services.json.gpg;fi - env: - FIREBASE_SECRET: ${{ secrets.GPG_SECRET }} - - name: Generate keystore run: | echo "$ANDROID_KEYSTORE_FILE" > release.keystore.b64 diff --git a/.github/workflows/ios-build.yml b/.github/workflows/ios-build.yml index a5a2f2e89d..2e71c7d28f 100644 --- a/.github/workflows/ios-build.yml +++ b/.github/workflows/ios-build.yml @@ -88,6 +88,9 @@ jobs: SLACK_URL: '${{ secrets.SLACK_WEBHOOK_DEVOPS }}' MATCH_PASSWORD: '${{ secrets.INJI_IOS_MATCH_PASSWORD }}' APPLICATION_THEME: ${{ github.event.inputs.theme }} + CREDENTIAL_REGISTRY_EDIT: ${{ github.event.inputs.registry_edit }} + MIMOTO_HOST: ${{ github.event.inputs.mimotoBackendServiceUrl }} + ESIGNET_HOST: ${{ github.event.inputs.esignetBackendServiceUrl }} TESTFLIGHT_INTERNAL_TESTERS_GROUP: ${{ github.event.inputs.internal-testers }} TESTFLIGHT_BETA_APP_DESCRIPTION: ${{ github.event.inputs.buildDescription }} diff --git a/.talismanrc b/.talismanrc index 2d3425104d..76d03dfb22 100644 --- a/.talismanrc +++ b/.talismanrc @@ -2,7 +2,7 @@ fileignoreconfig: - filename: package.json checksum: fdd5905228a1afbfb004c710fd6c61adf073a12840200327c0592b76bea5e7e3 - filename: package-lock.json - checksum: a4c1fe2521067e1a279610f079446c600e8b7d5cf1553934dc419c3c476b4844 + checksum: fc26d97edecbacd0b7507032c6fc1acfcea9f01f5dbe66a2a0341506e2f0daca - filename: components/PasscodeVerify.tsx checksum: 14654c0f038979fcd0d260170a45894a072f81e0767ca9a0e66935d33b5cc703 - filename: i18n.ts @@ -33,6 +33,11 @@ fileignoreconfig: checksum: c8d874aa373bdf526bf59192139822f56915e702ef673bac4e0d7549b0fea3d0 - filename: screens/Issuers/IssuersScreen.tsx checksum: bc12c43ccc27ac04e5763fa6a6ed3cee63e4362ba5666c160b5e53269de924ab + checksum: 9a61cd59a3718adf1f14faf3024fec66a3295ef373878a878a28e5cb1287afaa +- filename: ios/Podfile.lock + checksum: cc123c3e1f04d41b394ceb16843b15c08bac3ba619ae853ff322717739761a85 +- filename: ios/Podfile.lock + checksum: cc123c3e1f04d41b394ceb16843b15c08bac3ba619ae853ff322717739761a85 - filename: screens/Home/IntroSlidersScreen.tsx checksum: 72ef913857448ef05763e52e32356faa2d1f3de8130a1c638d1897f44823031f - filename: shared/commonUtil.ts @@ -51,7 +56,5 @@ fileignoreconfig: checksum: f1f504bd8c14496ee71f8eb7f40d54411cc05be03347d644dcc2cca187a20678 - filename: machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.ts checksum: 237a2640b7db70770d65da67c79f2929581e32f1162517e50b8d37e409f3387d -- filename: machines/store.ts - checksum: 0695d833df9ec1e1f6ae2bd81631630bb1039dec387718acb153bcb843c952cd - filename: shared/cryptoutil/cryptoUtil.ts checksum: b785ff3f01ab9530119072c4d38195048bfeee6155c54ea7dd031559acb722f3 diff --git a/README.md b/README.md index 48d5ad3694..401bb699b3 100644 --- a/README.md +++ b/README.md @@ -52,15 +52,10 @@ Create a `.env.local` file using `.env` as your template: ``` MIMOTO_HOST= -GOOGLE_NEARBY_MESSAGES_API_KEY= ``` And `android/local.properties`: -``` -GOOGLE_NEARBY_MESSAGES_API_KEY= -``` - More info here: [Setup Google Nearby Messages in React](https://github.com/mrousavy/react-native-google-nearby-messages#usage) ### Android diff --git a/android/app/build.gradle b/android/app/build.gradle index 48608aa17d..2b2d0d8a0b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -3,8 +3,6 @@ plugins { } apply plugin: "com.android.application" -apply plugin: 'com.google.gms.google-services' -apply plugin: 'com.google.firebase.crashlytics' apply plugin: "com.facebook.react" import com.android.build.OutputFile @@ -121,7 +119,6 @@ android { manifestPlaceholders = [ APP_NAME: APP_NAME_RELEASE, - GOOGLE_NEARBY_MESSAGES_API_KEY: "${properties.getProperty('GOOGLE_NEARBY_MESSAGES_API_KEY')}", appAuthRedirectScheme: 'io.mosip.residentapp.inji' ] } @@ -219,6 +216,7 @@ dependencies { if (isGifEnabled || isWebpEnabled) { implementation 'com.facebook.fresco:fresco:2.0.0' implementation 'com.facebook.fresco:imagepipeline-okhttp3:2.0.0' + implementation 'com.squareup.okhttp3:okhttp-urlconnection:4.4.1' } if (isGifEnabled) { @@ -250,20 +248,8 @@ dependencies { } else { implementation jscFlavor } - // Firebase - implementation 'com.google.firebase:firebase-crashlytics:17.3.1' - implementation 'com.google.firebase:firebase-analytics:18.0.2' implementation 'com.jakewharton.timber:timber:4.7.1' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) -apply from: "./eas-build.gradle" - -try { - def servicesJSON = file('google-services.json') - if (servicesJSON.text) { - apply plugin: 'com.google.gms.google-services' - } -} catch(Exception e) { - logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work") -} \ No newline at end of file +apply from: "./eas-build.gradle" \ No newline at end of file diff --git a/android/app/google-services.json b/android/app/google-services.json deleted file mode 100644 index 3d2bb016da..0000000000 --- a/android/app/google-services.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "project_info": { - "project_number": "259470317171", - "project_id": "mosip-resident-app", - "storage_bucket": "mosip-resident-app.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "", - "android_client_info": { - "package_name": "io.mosip.residentapp" - } - }, - "oauth_client": [ - { - "client_id": "", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "", - "client_type": 3 - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/android/app/google-services.json.gpg b/android/app/google-services.json.gpg deleted file mode 100644 index 6303fa5765..0000000000 Binary files a/android/app/google-services.json.gpg and /dev/null differ diff --git a/android/app/mosip-google-services.json.gpg b/android/app/mosip-google-services.json.gpg deleted file mode 100644 index 8b7b3382bb..0000000000 Binary files a/android/app/mosip-google-services.json.gpg and /dev/null differ diff --git a/android/app/src/main/java/io/mosip/residentapp/MainApplication.java b/android/app/src/main/java/io/mosip/residentapp/MainApplication.java index d952ffcff7..0271f4666d 100644 --- a/android/app/src/main/java/io/mosip/residentapp/MainApplication.java +++ b/android/app/src/main/java/io/mosip/residentapp/MainApplication.java @@ -21,8 +21,6 @@ import timber.log.Timber; import com.facebook.react.bridge.JSIModulePackage; -import com.google.firebase.analytics.FirebaseAnalytics; -import com.google.firebase.crashlytics.FirebaseCrashlytics; import java.lang.reflect.InvocationTargetException; import java.util.List; @@ -77,36 +75,9 @@ public void onCreate() { if (BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); } - // Setup Firebase - FirebaseAnalytics.getInstance(this); - Timber.plant(new CrashReportingTree()); ApplicationLifecycleDispatcher.onApplicationCreate(this); } - - /** - * A tree which logs important information for crash reporting. - */ - private static class CrashReportingTree extends Timber.Tree { - FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance(); - @Override - protected void log(int priority, String tag, @NonNull String message, Throwable t) { - if (priority == Log.VERBOSE || priority == Log.DEBUG) { - return; - } - - crashlytics.setCustomKey("priority", priority); - crashlytics.setCustomKey("tag", tag); - crashlytics.log(message); - - if (t != null) { - if (priority == Log.ERROR) { - crashlytics.recordException(t); - } - } - } - } - @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); diff --git a/android/build.gradle b/android/build.gradle index 6df566b221..0824a6e5f8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -17,8 +17,6 @@ buildscript { } dependencies { classpath("com.android.tools.build:gradle:7.3.1") - classpath 'com.google.gms:google-services:4.3.5' - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1' classpath("com.facebook.react:react-native-gradle-plugin") } } diff --git a/components/CopyButton.tsx b/components/CopyButton.tsx index 1d4f97a915..5427aaa8ed 100644 --- a/components/CopyButton.tsx +++ b/components/CopyButton.tsx @@ -1,13 +1,13 @@ -import React, { useState } from 'react'; -import { Pressable } from 'react-native'; -import { Theme } from './ui/styleUtils'; +import React, {useState} from 'react'; +import {Pressable} from 'react-native'; +import {Theme} from './ui/styleUtils'; import Clipboard from '@react-native-clipboard/clipboard'; -import { Icon } from 'react-native-elements'; -import { Text } from './ui'; -import { useTranslation } from 'react-i18next'; +import {Icon} from 'react-native-elements'; +import {Text} from './ui'; +import {useTranslation} from 'react-i18next'; -export const CopyButton: React.FC = ({ content }) => { - const { t } = useTranslation('common'); +export const CopyButton: React.FC = ({content}) => { + const {t} = useTranslation('common'); const [buttonText, setButtonText] = useState(t('clipboard.copy')); return ( @@ -22,10 +22,12 @@ export const CopyButton: React.FC = ({ content }) => { type={'material'} name={'file-copy'} color={Theme.Colors.Icon} - style={{ marginRight: 2 }} + style={{marginRight: 2}} size={19} /> - {buttonText} + + {buttonText} + ); }; diff --git a/components/EditableListItem.tsx b/components/EditableListItem.tsx index 4a6443ee8a..54bf378fd3 100644 --- a/components/EditableListItem.tsx +++ b/components/EditableListItem.tsx @@ -37,7 +37,7 @@ export const EditableListItem: React.FC = props => { color={Theme.Colors.Icon} /> - + {props.title} diff --git a/components/FaceScanner.tsx b/components/FaceScanner.tsx index 077b1b8d06..6f200e0eb9 100644 --- a/components/FaceScanner.tsx +++ b/components/FaceScanner.tsx @@ -130,12 +130,6 @@ export const FaceScanner: React.FC = props => { )} - {/* TODO: remove warning when iOS SDK is ready */} - {isIOS() && ( - - (face-matching in iOS is mocked) - - )} ); diff --git a/components/MessageOverlay.tsx b/components/MessageOverlay.tsx index 92d375bae4..2f91480c2a 100644 --- a/components/MessageOverlay.tsx +++ b/components/MessageOverlay.tsx @@ -29,6 +29,7 @@ export const MessageOverlay: React.FC = props => { {props.title && ( props.onPress(service)} showOnlyBindedVc={props.showOnlyBindedVc} /> diff --git a/components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx b/components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx index 1be39d95ab..4e7e5aca23 100644 --- a/components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx +++ b/components/VC/MosipVCItem/MosipVCItemActivationStatus.tsx @@ -2,8 +2,6 @@ import React from 'react'; import {useTranslation} from 'react-i18next'; import {Dimensions} from 'react-native'; import {Icon} from 'react-native-elements'; -import {ActorRefFrom} from 'xstate'; -import {ExistingMosipVCItemMachine} from '../../../machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine'; import {VerifiableCredential} from '../../../types/VC/ExistingMosipVC/vc'; import {Row, Text} from '../../ui'; import {Theme} from '../../ui/styleUtils'; @@ -89,13 +87,11 @@ export const MosipVCItemActivationStatus: React.FC< {props.emptyWalletBindingId ? ( ) : ( )} @@ -104,18 +100,15 @@ export const MosipVCItemActivationStatus: React.FC< interface ExistingMosipVCItemActivationStatusProps { showOnlyBindedVc: boolean; - onPress: (vcRef?: ActorRefFrom) => void; verifiableCredential: VerifiableCredential; emptyWalletBindingId: boolean; } interface WalletVerifiedDetailsProps { showOnlyBindedVc: boolean; - onPress: (vcRef?: ActorRefFrom) => void; verifiableCredential: VerifiableCredential; } interface WalletUnVerifiedDetailsProps { - onPress: (vcRef?: ActorRefFrom) => void; verifiableCredential: VerifiableCredential; } diff --git a/components/VC/MosipVCItem/MosipVCItemContent.tsx b/components/VC/MosipVCItem/MosipVCItemContent.tsx index 090aeb61c8..3039839761 100644 --- a/components/VC/MosipVCItem/MosipVCItemContent.tsx +++ b/components/VC/MosipVCItem/MosipVCItemContent.tsx @@ -7,7 +7,7 @@ import VerifiedIcon from '../../VerifiedIcon'; import {Column, Row, Text} from '../../ui'; import {Theme} from '../../ui/styleUtils'; import {CheckBox, Icon} from 'react-native-elements'; -import testIDProps from '../../../shared/commonUtil'; +import testIDProps, {getMaskedText} from '../../../shared/commonUtil'; import {logoType} from '../../../machines/issuersMachine'; const getDetails = (arg1, arg2, verifiableCredential) => { @@ -84,10 +84,6 @@ const getDetails = (arg1, arg2, verifiableCredential) => { } }; -function getIdNumber(id: string) { - return '*'.repeat(id.length - 4) + id.slice(-4); -} - const getIssuerLogo = (isOpenId4VCI: boolean, issuerLogo: logoType) => { if (isOpenId4VCI) { return ( @@ -243,7 +239,7 @@ export const MosipVCItemContent: React.FC< weight="semibold" size="extraSmall" color={Theme.Colors.statusLabel}> - {getIdNumber(uin)} + {getMaskedText(uin)} ) : null} @@ -262,7 +258,7 @@ export const MosipVCItemContent: React.FC< weight="semibold" size="extraSmall" color={Theme.Colors.Details}> - {getIdNumber(vid)} + {getMaskedText(vid)} ) : null} diff --git a/components/ui/Button.tsx b/components/ui/Button.tsx index d98dfb82bd..7cb39897e2 100644 --- a/components/ui/Button.tsx +++ b/components/ui/Button.tsx @@ -45,6 +45,7 @@ export const Button: React.FC = props => { raised={props.raised} title={ = props => { raised={props.raised} title={ = props => { const {t} = useTranslation('ScanScreen'); + useEffect(() => { + const backHandler = BackHandler.addEventListener( + 'hardwareBackPress', + () => true, + ); + return () => backHandler.remove(); + }, []); + return ( @@ -17,7 +25,7 @@ export const Loader: React.FC = props => { fill align={'flex-start'} style={Theme.LoaderStyles.titleContainer}> - + @@ -81,7 +89,7 @@ export const Loader: React.FC = props => { export interface LoaderProps { isVisible: boolean; - title?: string; + title: string; subTitle?: string; label?: string; hint?: string; diff --git a/components/ui/SetupPicker.tsx b/components/ui/SetupPicker.tsx index 171a2fea2f..57ec85e452 100644 --- a/components/ui/SetupPicker.tsx +++ b/components/ui/SetupPicker.tsx @@ -40,7 +40,7 @@ export const SetupPicker: Picker = (props: PickerProps) => { onPress={() => selectItem(index)} key={index}> - + diff --git a/components/ui/themes/DefaultTheme.ts b/components/ui/themes/DefaultTheme.ts index 8e0c45a509..efa02518b4 100644 --- a/components/ui/themes/DefaultTheme.ts +++ b/components/ui/themes/DefaultTheme.ts @@ -1,5 +1,5 @@ /* eslint-disable sonarjs/no-duplicate-string */ -import {Dimensions, Platform, StyleSheet, ViewStyle} from 'react-native'; +import {Dimensions, StyleSheet, ViewStyle} from 'react-native'; import {Spacing} from '../styleUtils'; import {isIOS} from '../../../shared/constants'; @@ -549,12 +549,11 @@ export const DefaultTheme = { borderBottomColor: Colors.platinumGrey, borderBottomWidth: 1.3, }, - downloadFabIcon: { + downloadFabIconContainer: { height: 70, width: 70, borderRadius: 200, padding: 10, - backgroundColor: Colors.Orange, shadowColor: '#000', shadowOpacity: 0.4, elevation: 5, @@ -562,6 +561,21 @@ export const DefaultTheme = { bottom: Dimensions.get('window').width * 0.1, right: Dimensions.get('window').width * 0.1, }, + downloadFabIconNormal: { + borderRadius: 200, + height: 70, + width: 70, + justifyContent: 'center', + position: 'absolute', + }, + downloadFabIconPressed: { + borderRadius: 200, + height: 70, + width: 70, + backgroundColor: Colors.Orange, + justifyContent: 'center', + position: 'absolute', + }, boxShadow: generateBoxShadowStyle(), }), QrCodeStyles: StyleSheet.create({ @@ -636,14 +650,14 @@ export const DefaultTheme = { fontFamily: 'Inter_700Bold', fontSize: 18, lineHeight: 19, - paddingTop: 4, + paddingTop: 5, }, subHeader: { color: Colors.mediumLightGrayText, fontFamily: 'Inter_600SemiBold', lineHeight: 19, fontSize: 13, - paddingTop: 3, + paddingTop: 4, }, semiBoldHeader: { color: Colors.Black, @@ -755,6 +769,10 @@ export const DefaultTheme = { marginBottom: 17, marginTop: 22, }, + heading: { + flex: 1, + flexDirection: 'column', + }, }), ButtonStyles: StyleSheet.create({ fill: { @@ -1200,6 +1218,7 @@ export const DefaultTheme = { lineHeight: 17, paddingHorizontal: 3, paddingBottom: 4, + paddingTop: 1.7, }, issuerDescription: { fontSize: 11, @@ -1207,6 +1226,7 @@ export const DefaultTheme = { color: Colors.ShadeOfGrey, paddingVertical: 5, paddingHorizontal: 3, + paddingTop: 1.4, }, issuerIcon: { resizeMode: 'contain', @@ -1216,10 +1236,6 @@ export const DefaultTheme = { marginTop: 8, marginLeft: 2.5, }, - loaderHeadingText: { - flex: 1, - flexDirection: 'column', - }, }), ErrorStyles: StyleSheet.create({ image: {marginTop: -60, paddingBottom: 26}, diff --git a/components/ui/themes/PurpleTheme.ts b/components/ui/themes/PurpleTheme.ts index e51a484387..d88987e3eb 100644 --- a/components/ui/themes/PurpleTheme.ts +++ b/components/ui/themes/PurpleTheme.ts @@ -1,5 +1,5 @@ /* eslint-disable sonarjs/no-duplicate-string */ -import {Dimensions, Platform, StyleSheet, ViewStyle} from 'react-native'; +import {Dimensions, StyleSheet, ViewStyle} from 'react-native'; import {Spacing} from '../styleUtils'; import {isIOS} from '../../../shared/constants'; @@ -552,12 +552,11 @@ export const PurpleTheme = { borderBottomColor: Colors.platinumGrey, borderBottomWidth: 1.3, }, - downloadFabIcon: { + downloadFabIconContainer: { height: 70, width: 70, borderRadius: 200, padding: 10, - backgroundColor: Colors.Purple, shadowColor: '#000', shadowOpacity: 0.4, elevation: 5, @@ -565,6 +564,21 @@ export const PurpleTheme = { bottom: Dimensions.get('window').width * 0.1, right: Dimensions.get('window').width * 0.1, }, + downloadFabIconNormal: { + borderRadius: 200, + height: 70, + width: 70, + justifyContent: 'center', + position: 'absolute', + }, + downloadFabIconPressed: { + borderRadius: 200, + height: 70, + width: 70, + backgroundColor: Colors.Purple, + justifyContent: 'center', + position: 'absolute', + }, boxShadow: generateBoxShadowStyle(), }), QrCodeStyles: StyleSheet.create({ @@ -639,14 +653,14 @@ export const PurpleTheme = { fontFamily: 'Inter_700Bold', fontSize: 18, lineHeight: 19, - paddingTop: 4, + paddingTop: 5, }, subHeader: { color: Colors.mediumLightGrayText, fontFamily: 'Inter_600SemiBold', lineHeight: 19, fontSize: 13, - paddingTop: 3, + paddingTop: 4, }, semiBoldHeader: { color: Colors.Black, @@ -758,6 +772,10 @@ export const PurpleTheme = { marginBottom: 17, marginTop: 22, }, + heading: { + flex: 1, + flexDirection: 'column', + }, }), ButtonStyles: StyleSheet.create({ fill: { @@ -1201,11 +1219,13 @@ export const PurpleTheme = { fontFamily: 'Inter_600SemiBold', fontSize: 14, lineHeight: 17, + paddingTop: 1.7, }, issuerDescription: { fontSize: 11, lineHeight: 14, color: Colors.ShadeOfGrey, + paddingTop: 1.4, }, issuerIcon: { resizeMode: 'contain', @@ -1215,10 +1235,6 @@ export const PurpleTheme = { marginTop: 8, marginLeft: 2.5, }, - loaderHeadingText: { - flex: 1, - flexDirection: 'column', - }, }), ErrorStyles: StyleSheet.create({ image: {marginTop: -60, paddingBottom: 26}, diff --git a/ios/Podfile.lock b/ios/Podfile.lock index ef341cf69a..cefb35a58f 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -6,6 +6,8 @@ PODS: - AppAuth/ExternalUserAgent (1.6.2): - AppAuth/Core - ASN1Decoder (1.8.0) + - BiometricSdk (0.5.4): + - TensorFlowLiteObjC (= 2.12.0) - boost (1.76.0) - BVLinearGradient (2.8.2): - React-Core @@ -78,7 +80,8 @@ PODS: - MMKV (1.2.13): - MMKVCore (~> 1.2.13) - MMKVCore (1.2.16) - - mosip-inji-face-sdk (0.1.12): + - mosip-mobileid-sdk (0.1.0): + - BiometricSdk (= 0.5.4) - React-Core - Permission-BluetoothPeripheral (3.8.4): - RNPermissions @@ -481,6 +484,13 @@ PODS: - React - RNSVG (13.4.0): - React-Core + - TensorFlowLiteC (2.12.0): + - TensorFlowLiteC/Core (= 2.12.0) + - TensorFlowLiteC/Core (2.12.0) + - TensorFlowLiteObjC (2.12.0): + - TensorFlowLiteObjC/Core (= 2.12.0) + - TensorFlowLiteObjC/Core (2.12.0): + - TensorFlowLiteC (= 2.12.0) - Yoga (1.14.0) - ZXingObjC/Core (3.6.5) - ZXingObjC/OneD (3.6.5): @@ -516,7 +526,7 @@ DEPENDENCIES: - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - libevent (~> 2.1.12) - - mosip-inji-face-sdk (from `../node_modules/mosip-inji-face-sdk`) + - mosip-mobileid-sdk (from `../node_modules/mosip-mobileid-sdk`) - Permission-BluetoothPeripheral (from `../node_modules/react-native-permissions/ios/BluetoothPeripheral`) - Permission-Camera (from `../node_modules/react-native-permissions/ios/Camera`) - Permission-LocationAccuracy (from `../node_modules/react-native-permissions/ios/LocationAccuracy`) @@ -579,6 +589,7 @@ SPEC REPOS: trunk: - AppAuth - ASN1Decoder + - BiometricSdk - CatCrypto - CrcSwift - fmt @@ -586,6 +597,8 @@ SPEC REPOS: - libevent - MMKV - MMKVCore + - TensorFlowLiteC + - TensorFlowLiteObjC - ZXingObjC EXTERNAL SOURCES: @@ -641,8 +654,8 @@ EXTERNAL SOURCES: :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" hermes-engine: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" - mosip-inji-face-sdk: - :path: "../node_modules/mosip-inji-face-sdk" + mosip-mobileid-sdk: + :path: "../node_modules/mosip-mobileid-sdk" Permission-BluetoothPeripheral: :path: "../node_modules/react-native-permissions/ios/BluetoothPeripheral" Permission-Camera: @@ -759,6 +772,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570 ASN1Decoder: 6110fdeacfdb41559b1481457a1645be716610aa + BiometricSdk: 1d16c395413164d92a280b78006abba4307063e6 boost: 57d2868c099736d80fcd648bf211b4431e51a558 BVLinearGradient: 916632041121a658c704df89d99f04acb038de0f CatCrypto: a477899b6be4954e75be4897e732da098cc0a5a8 @@ -792,7 +806,7 @@ SPEC CHECKSUMS: libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 MMKV: aac95d817a100479445633f2b3ed8961b4ac5043 MMKVCore: 9cfef4c48c6c46f66226fc2e4634d78490206a48 - mosip-inji-face-sdk: d5bc0fb66721c25450f92d3297efcb2cf0117271 + mosip-mobileid-sdk: 6b8182276896194fdcacdde148b02d5d2d16b02a Permission-BluetoothPeripheral: 2b88a131074edafd8a46a5cda4ba610ec986d2fb Permission-Camera: 7ec9ee99704766ff9b90198183387a7f5d82b0c1 Permission-LocationAccuracy: a38ddb5c5d0b8e656f3c86e4a500f9bb88bc099d @@ -848,6 +862,8 @@ SPEC CHECKSUMS: RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f RNSecureRandom: 07efbdf2cd99efe13497433668e54acd7df49fef RNSVG: 07dbd870b0dcdecc99b3a202fa37c8ca163caec2 + TensorFlowLiteC: 20785a69299185a379ba9852b6625f00afd7984a + TensorFlowLiteObjC: 9a46a29a76661c513172cfffd3bf712b11ef25c3 Yoga: 065f0b74dba4832d6e328238de46eb72c5de9556 ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb diff --git a/lib/mosip-inji-face-sdk/faceAuth.ios.ts b/lib/mosip-inji-face-sdk/faceAuth.ios.ts deleted file mode 100644 index f15162e252..0000000000 --- a/lib/mosip-inji-face-sdk/faceAuth.ios.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default async function faceAuth(capturedImage: string, vcImage: string) { - // TODO: iOS implementation - return Promise.resolve(true); -} diff --git a/lib/mosip-inji-face-sdk/faceAuth.ts b/lib/mosip-inji-face-sdk/faceAuth.ts deleted file mode 100644 index 9d621c03e8..0000000000 --- a/lib/mosip-inji-face-sdk/faceAuth.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { faceAuth } from 'mosip-inji-face-sdk'; - -export default faceAuth; diff --git a/locales/ara.json b/locales/ara.json index afa299427f..a366067ebf 100644 --- a/locales/ara.json +++ b/locales/ara.json @@ -159,13 +159,15 @@ }, "IssuersScreen": { "title": "أضف بطاقة جديدة", - "header": "يرجى تحديد الطريقة المفضلة من الأسفل لإضافة بطاقة جديدة", + "header": "يرجى اختيار جهة الإصدار المفضلة لديك من الخيارات أدناه لإضافة بطاقة جديدة.", + "itemHeading": "التنزيل عبر {{issuer}}", + "itemSubHeading": "أدخل رقم الهوية الوطنية الخاص بك لتنزيل بطاقتك.", "loaders": { "loading": "جار التحميل...", "subTitle": { - "displayIssuers": "Fetching Issuers", - "settingUp": "Setting up", - "downloadingCredentials": "Downloading Credentials", + "displayIssuers": "جلب جهات الإصدار", + "settingUp": "اعداد", + "downloadingCredentials": "تنزيل بيانات الاعتماد" } }, "errors":{ diff --git a/locales/en.json b/locales/en.json index 4aca4ed1c3..2cb41c1d3b 100644 --- a/locales/en.json +++ b/locales/en.json @@ -160,13 +160,9 @@ }, "IssuersScreen": { "title": "Add new card", - "header": "Please select a preferred method from below to add a new card", + "header": "Please choose your preferred issuer from the options below to add a new card.", "itemHeading": "Download via {{issuer}}", - "itemSubHeading": "Enter the mentioned ID and get your card", - "modal": { - "title": "In Progress", - "hint": "downloading your credential from issuer" - }, + "itemSubHeading": "Enter your national ID to download your card.", "loaders": { "loading": "Loading...", "subTitle": { diff --git a/locales/fil.json b/locales/fil.json index d8c3883005..9398494275 100644 --- a/locales/fil.json +++ b/locales/fil.json @@ -158,13 +158,15 @@ }, "IssuersScreen": { "title": "Magdagdag ng bagong card", - "header": "Mangyaring pumili ng gustong paraan mula sa ibaba upang magdagdag ng bagong card", + "header": "Mangyaring piliin ang iyong gustong tagabigay mula sa mga opsyon sa ibaba upang magdagdag ng bagong card.", + "itemHeading": "I-download sa pamamagitan ng {{issuer}}", + "itemSubHeading": "Ilagay ang iyong national ID para i-download ang iyong card.", "loaders": { "loading": "Naglo-load...", "subTitle": { - "displayIssuers": "Fetching Issuers", - "settingUp": "Setting up", - "downloadingCredentials": "Downloading Credentials", + "displayIssuers": "Kinukuha ang mga Isyu", + "settingUp": "Inaayos", + "downloadingCredentials": "Nagda-download ng Mga Kredensyal" } }, "errors": { diff --git a/locales/hin.json b/locales/hin.json index 8ab7fefc9d..b57110f105 100644 --- a/locales/hin.json +++ b/locales/hin.json @@ -156,8 +156,9 @@ }, "IssuersScreen": { "title": "नया कार्ड जोड़ें", - "header": "नया कार्ड जोड़ने के लिए कृपया नीचे से कोई पसंदीदा विधि चुनें", - + "header": "नया कार्ड जोड़ने के लिए कृपया नीचे दिए गए विकल्पों में से अपना पसंदीदा जारीकर्ता चुनें।", + "itemHeading": "{{issuer}} के माध्यम से डाउनलोड करें", + "itemSubHeading": "अपना कार्ड डाउनलोड करने के लिए अपनी राष्ट्रीय आईडी दर्ज करें।", "loaders": { "loading": "लोड हो रहा है...", "subTitle": { diff --git a/locales/kan.json b/locales/kan.json index 221c6cdc37..01454fe612 100644 --- a/locales/kan.json +++ b/locales/kan.json @@ -155,13 +155,15 @@ }, "IssuersScreen": { "title": "ಹೊಸ ಕಾರ್ಡ್ ಸೇರಿಸಿ", - "header": "ದಯವಿಟ್ಟು ಹೊಸ ಕಾರ್ಡ್ ಸೇರಿಸಲು ಕೆಳಗಿನಿಂದ ಆದ್ಯತೆಯ ವಿಧಾನವನ್ನು ಆಯ್ಕೆಮಾಡಿ", + "header": "ದಯವಿಟ್ಟು ಹೊಸ ಕಾರ್ಡ್ ಸೇರಿಸಲು ಕೆಳಗಿನ ಆಯ್ಕೆಗಳಿಂದ ನಿಮ್ಮ ಆದ್ಯತೆ ನೀಡುವವರನ್ನು ಆಯ್ಕೆಮಾಡಿ.", + "itemHeading": "{{issuer}} ಮೂಲಕ ಡೌನ್‌ಲೋಡ್ ಮಾಡಿ", + "itemSubHeading": "ನಿಮ್ಮ ಕಾರ್ಡ್ ಅನ್ನು ಡೌನ್‌ಲೋಡ್ ಮಾಡಲು ನಿಮ್ಮ ರಾಷ್ಟ್ರೀಯ ID ಅನ್ನು ನಮೂದಿಸಿ.", "loaders": { "loading": "ಲೋಡ್ ಆಗುತ್ತಿದೆ...", "subTitle": { - "displayIssuers": "Fetching Issuers", - "settingUp": "Setting up", - "downloadingCredentials": "Downloading Credentials" + "displayIssuers": "ವಿತರಕರನ್ನು ಪಡೆಯಲಾಗುತ್ತಿದೆ", + "settingUp": "ಸ್ಥಾಪನೆಗೆ", + "downloadingCredentials": "ರುಜುವಾತುಗಳನ್ನು ಡೌನ್‌ಲೋಡ್ ಮಾಡಲಾಗುತ್ತಿದೆ" } }, "errors": { @@ -346,8 +348,8 @@ } }, "MainLayout": { - "home": "ಲೇಔಟ್", - "scan": "ಮನೆ", + "home": "ಮನೆ", + "scan": "ಸ್ಕ್ಯಾನ್", "history": "ಇತಿಹಾಸ", "request": "ವಿನಂತಿ", "settings": "ಸೆಟ್ಟಿಂಗ್‌ಗಳು" diff --git a/locales/spa.json b/locales/spa.json index ae11e60355..0edfaf3f2b 100644 --- a/locales/spa.json +++ b/locales/spa.json @@ -272,6 +272,30 @@ "logout": "Cerrar sesión", "resetInjiProps": "Restableciendo accesorios Inji..." }, + "IssuersScreen": { + "title": "Agregar nueva tarjeta", + "header": "Elija su emisor preferido entre las opciones siguientes para agregar una nueva tarjeta.", + "itemHeading": "Descargar vía {{issuer}}", + "itemSubHeading": "Introduce tu DNI para descargar tu tarjeta.", + "loaders": { + "loading": "Cargando...", + "subTitle": { + "displayIssuers": "Obteniendo emisores", + "settingUp": "Configurando", + "downloadingCredentials": "Descarga de credenciales" + } + }, + "errors": { + "noInternetConnection": { + "title": "Sin conexión a Internet", + "message": "Por favor verifique su conexión y vuelva a intentarlo" + }, + "generic": { + "title": "¡Algo salió mal!", + "message": "Estamos teniendo algunos problemas con su solicitud. Inténtalo de nuevo." + } + } + }, "QrLogin": { "title": "Inicio de sesión con código QR", "alignQr": "Alinea el código QR dentro del marco para escanearlo", diff --git a/locales/tam.json b/locales/tam.json index 47eee37121..60bf85e5d6 100644 --- a/locales/tam.json +++ b/locales/tam.json @@ -155,13 +155,15 @@ }, "IssuersScreen": { "title": "புதிய அட்டையைச் சேர்க்கவும்", - "header": "புதிய கார்டைச் சேர்க்க கீழே இருந்து விருப்பமான முறையைத் தேர்ந்தெடுக்கவும்", + "header": "புதிய கார்டைச் சேர்க்க, கீழே உள்ள விருப்பங்களிலிருந்து உங்களுக்கு விருப்பமான வழங்குபவரைத் தேர்ந்தெடுக்கவும்.", + "itemHeading": "{{issuer}} மூலம் பதிவிறக்கவும்", + "itemSubHeading": "உங்கள் கார்டைப் பதிவிறக்க உங்கள் தேசிய ஐடியை உள்ளிடவும்.", "loaders": { "loading": "ஏற்றுகிறது...", "subTitle": { - "displayIssuers": "Fetching Issuers", - "settingUp": "Setting up", - "downloadingCredentials": "Downloading Credentials", + "displayIssuers": "வழங்குபவர்களைப் பெறுதல்", + "settingUp": "அமைக்கிறது", + "downloadingCredentials": "நற்சான்றிதழ்களைப் பதிவிறக்குகிறது" } }, "errors": { diff --git a/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.ts b/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.ts index d2b9b492ba..f2911c44e9 100644 --- a/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.ts +++ b/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.ts @@ -32,6 +32,7 @@ import { sendStartEvent, TelemetryConstants, } from '../../../shared/telemetry/TelemetryUtils'; +import {API_URLS} from '../../../shared/api'; const model = createModel( { @@ -834,8 +835,8 @@ export const EsignetMosipVCItemMachine = model.createMachine( }, addWalletBindnigId: async context => { const response = await request( - 'POST', - '/residentmobileapp/wallet-binding', + API_URLS.walletBinding.method, + API_URLS.walletBinding.buildURL(), { requestTime: String(new Date().toISOString()), request: { @@ -883,8 +884,8 @@ export const EsignetMosipVCItemMachine = model.createMachine( }, requestBindingOtp: async context => { const response = await request( - 'POST', - '/residentmobileapp/binding-otp', + API_URLS.bindingOtp.method, + API_URLS.bindingOtp.buildURL(), { requestTime: String(new Date().toISOString()), request: { diff --git a/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.typegen.ts b/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.typegen.ts index e187312c7d..a68bfeb04b 100644 --- a/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.typegen.ts +++ b/machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine.typegen.ts @@ -252,251 +252,3 @@ export interface Typegen0 { }; tags: never; } - -// This file was automatically generated. Edits will be overwritten - -export interface Typegen0 { - '@@xstate/typegen': true; - internalEvents: { - 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]': { - type: 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]': { - type: 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]': { - type: 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]': { - type: 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]': { - type: 'done.invoke.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]': { - type: 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item-openid4vci.requestingBindingOtp:invocation[0]': { - type: 'done.invoke.vc-item-openid4vci.requestingBindingOtp:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]': { - type: 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'error.platform.vc-item-openid4vci.addKeyPair:invocation[0]': { - type: 'error.platform.vc-item-openid4vci.addKeyPair:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item-openid4vci.addingWalletBindingId:invocation[0]': { - type: 'error.platform.vc-item-openid4vci.addingWalletBindingId:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]': { - type: 'error.platform.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]': { - type: 'error.platform.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]': { - type: 'error.platform.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]': { - type: 'error.platform.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item-openid4vci.requestingBindingOtp:invocation[0]': { - type: 'error.platform.vc-item-openid4vci.requestingBindingOtp:invocation[0]'; - data: unknown; - }; - 'error.platform.vc-item-openid4vci.updatingPrivateKey:invocation[0]': { - type: 'error.platform.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; - data: unknown; - }; - 'xstate.init': {type: 'xstate.init'}; - }; - invokeSrcNameMap: { - addWalletBindnigId: - | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; - generateKeyPair: - | 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; - requestBindingOtp: - | 'done.invoke.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]' - | 'done.invoke.vc-item-openid4vci.requestingBindingOtp:invocation[0]'; - requestOtp: - | 'done.invoke.vc-item-openid4vci.acceptingBindingOtp.resendOTP:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.acceptingBindingOtp.resendOTP:invocation[0]'; - updatePrivateKey: - | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; - }; - missingImplementations: { - actions: 'clearTransactionId'; - delays: never; - guards: never; - services: 'requestOtp'; - }; - eventsCausingActions: { - VcUpdated: 'STORE_RESPONSE'; - clearOtp: - | 'DISMISS' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]' - | 'done.invoke.vc-item-openid4vci.requestingBindingOtp:invocation[0]'; - clearTransactionId: 'DISMISS'; - logVCremoved: 'STORE_RESPONSE'; - logWalletBindingFailure: - | 'error.platform.vc-item-openid4vci.addKeyPair:invocation[0]' - | 'error.platform.vc-item-openid4vci.addingWalletBindingId:invocation[0]' - | 'error.platform.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'error.platform.vc-item-openid4vci.requestingBindingOtp:invocation[0]' - | 'error.platform.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; - logWalletBindingSuccess: - | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; - removeVcItem: 'CONFIRM'; - removedVc: 'STORE_RESPONSE'; - requestStoredContext: 'GET_VC_RESPONSE' | 'REFRESH'; - requestVcContext: 'DISMISS' | 'xstate.init'; - resetWalletBindingSuccess: 'DISMISS'; - sendVcUpdated: 'STORE_RESPONSE'; - sendWalletBindingSuccess: - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]'; - setContext: 'GET_VC_RESPONSE' | 'STORE_RESPONSE'; - setGeneratedOn: 'GET_VC_RESPONSE'; - setOtp: 'INPUT_OTP'; - setPinCard: 'PIN_CARD'; - setPrivateKey: - | 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; - setPublicKey: - | 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; - setThumbprintForWalletBindingId: - | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; - setVcKey: 'REMOVE'; - setVcMetadata: 'UPDATE_VC_METADATA'; - setVerifiableCredential: 'GET_VC_RESPONSE' | 'STORE_RESPONSE'; - setWalletBindingError: - | 'error.platform.vc-item-openid4vci.addKeyPair:invocation[0]' - | 'error.platform.vc-item-openid4vci.addingWalletBindingId:invocation[0]' - | 'error.platform.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]' - | 'error.platform.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'error.platform.vc-item-openid4vci.kebabPopUp.requestingBindingOtp:invocation[0]' - | 'error.platform.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'error.platform.vc-item-openid4vci.requestingBindingOtp:invocation[0]' - | 'error.platform.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; - setWalletBindingErrorEmpty: - | 'CANCEL' - | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; - setWalletBindingId: - | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; - setWalletBindingSuccess: 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; - storeContext: - | 'PIN_CARD' - | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; - updatePrivateKey: - | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; - updateVc: - | 'STORE_RESPONSE' - | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.updatingPrivateKey:invocation[0]' - | 'done.invoke.vc-item-openid4vci.updatingPrivateKey:invocation[0]'; - }; - eventsCausingDelays: {}; - eventsCausingGuards: { - hasCredential: 'GET_VC_RESPONSE'; - isCustomSecureKeystore: - | 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]' - | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; - }; - eventsCausingServices: { - addWalletBindnigId: - | 'done.invoke.vc-item-openid4vci.addKeyPair:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addKeyPair:invocation[0]'; - generateKeyPair: 'INPUT_OTP'; - requestBindingOtp: 'CONFIRM'; - requestOtp: 'RESEND_OTP'; - updatePrivateKey: - | 'done.invoke.vc-item-openid4vci.addingWalletBindingId:invocation[0]' - | 'done.invoke.vc-item-openid4vci.kebabPopUp.addingWalletBindingId:invocation[0]'; - }; - matchesStates: - | 'acceptingBindingOtp' - | 'acceptingBindingOtp.idle' - | 'acceptingBindingOtp.resendOTP' - | 'addKeyPair' - | 'addingWalletBindingId' - | 'checkingStore' - | 'checkingVc' - | 'idle' - | 'kebabPopUp' - | 'kebabPopUp.acceptingBindingOtp' - | 'kebabPopUp.acceptingBindingOtp.idle' - | 'kebabPopUp.acceptingBindingOtp.resendOTP' - | 'kebabPopUp.addKeyPair' - | 'kebabPopUp.addingWalletBindingId' - | 'kebabPopUp.idle' - | 'kebabPopUp.removeWallet' - | 'kebabPopUp.removingVc' - | 'kebabPopUp.requestingBindingOtp' - | 'kebabPopUp.showActivities' - | 'kebabPopUp.showBindingWarning' - | 'kebabPopUp.showingWalletBindingError' - | 'kebabPopUp.updatingPrivateKey' - | 'pinCard' - | 'requestingBindingOtp' - | 'showBindingWarning' - | 'showingWalletBindingError' - | 'updatingPrivateKey' - | { - acceptingBindingOtp?: 'idle' | 'resendOTP'; - kebabPopUp?: - | 'acceptingBindingOtp' - | 'addKeyPair' - | 'addingWalletBindingId' - | 'idle' - | 'removeWallet' - | 'removingVc' - | 'requestingBindingOtp' - | 'showActivities' - | 'showBindingWarning' - | 'showingWalletBindingError' - | 'updatingPrivateKey' - | {acceptingBindingOtp?: 'idle' | 'resendOTP'}; - }; - tags: never; -} diff --git a/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.ts b/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.ts index 54d9c42964..100f68f70e 100644 --- a/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.ts +++ b/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.ts @@ -4,10 +4,10 @@ import {MIMOTO_BASE_URL, MY_VCS_STORE_KEY} from '../../../shared/constants'; import {AppServices} from '../../../shared/GlobalContext'; import {CredentialDownloadResponse, request} from '../../../shared/request'; import { + DecodedCredential, VC, - VerifiableCredential, VcIdType, - DecodedCredential, + VerifiableCredential, } from '../../../types/VC/ExistingMosipVC/vc'; import {StoreEvents} from '../../store'; import {ActivityLogEvents} from '../../activityLog'; @@ -31,16 +31,15 @@ import i18n from '../../../i18n'; import SecureKeystore from 'react-native-secure-keystore'; import {VCMetadata} from '../../../shared/VCMetadata'; import { - sendStartEvent, - getStartEventData, getEndEventData, + getStartEventData, sendEndEvent, TelemetryConstants, sendInteractEvent, getInteractEventData, - sendErrorEvent, - getErrorEventData, + sendStartEvent, } from '../../../shared/telemetry/TelemetryUtils'; +import {API_URLS} from '../../../shared/api'; const model = createModel( { @@ -1286,8 +1285,8 @@ export const ExistingMosipVCItemMachine = addWalletBindnigId: async context => { const response = await request( - 'POST', - '/residentmobileapp/wallet-binding', + API_URLS.walletBinding.method, + API_URLS.walletBinding.buildURL(), { requestTime: String(new Date().toISOString()), request: { @@ -1346,8 +1345,8 @@ export const ExistingMosipVCItemMachine = requestBindingOtp: async context => { const response = await request( - 'POST', - '/residentmobileapp/binding-otp', + API_URLS.bindingOtp.method, + API_URLS.bindingOtp.buildURL(), { requestTime: String(new Date().toISOString()), request: { @@ -1370,8 +1369,10 @@ export const ExistingMosipVCItemMachine = onReceive(async event => { if (event.type === 'POLL_STATUS') { const response = await request( - 'GET', - `/residentmobileapp/credentialshare/request/status/${context.vcMetadata.requestId}`, + API_URLS.credentialStatus.method, + API_URLS.credentialStatus.buildURL( + context.vcMetadata.requestId, + ), ); switch (response.response?.statusCode) { case 'NEW': @@ -1396,8 +1397,8 @@ export const ExistingMosipVCItemMachine = onReceive(async event => { if (event.type === 'POLL_DOWNLOAD') { const response: CredentialDownloadResponse = await request( - 'POST', - '/residentmobileapp/credentialshare/download', + API_URLS.credentialDownload.method, + API_URLS.credentialDownload.buildURL(), { individualId: context.vcMetadata.id, requestId: context.vcMetadata.requestId, @@ -1431,12 +1432,16 @@ export const ExistingMosipVCItemMachine = requestOtp: async context => { try { - return request('POST', '/residentmobileapp/req/otp', { - individualId: context.vcMetadata.id, - individualIdType: context.vcMetadata.idType, - otpChannel: ['EMAIL', 'PHONE'], - transactionID: context.transactionId, - }); + return request( + API_URLS.requestOtp.method, + API_URLS.requestOtp.buildURL(), + { + individualId: context.vcMetadata.id, + individualIdType: context.vcMetadata.idType, + otpChannel: ['EMAIL', 'PHONE'], + transactionID: context.transactionId, + }, + ); } catch (error) { console.error(error); } @@ -1446,8 +1451,8 @@ export const ExistingMosipVCItemMachine = let response = null; if (context.locked) { response = await request( - 'POST', - '/residentmobileapp/req/auth/unlock', + API_URLS.authUnLock.method, + API_URLS.authUnLock.buildURL(), { individualId: context.vcMetadata.id, individualIdType: context.vcMetadata.idType, @@ -1459,8 +1464,8 @@ export const ExistingMosipVCItemMachine = ); } else { response = await request( - 'POST', - '/residentmobileapp/req/auth/lock', + API_URLS.authLock.method, + API_URLS.authLock.buildURL(), { individualId: context.vcMetadata.id, individualIdType: context.vcMetadata.idType, @@ -1476,8 +1481,8 @@ export const ExistingMosipVCItemMachine = requestRevoke: async context => { try { return request( - 'PATCH', - `/residentmobileapp/vid/${context.vcMetadata.id}`, + API_URLS.requestRevoke.method, + API_URLS.requestRevoke.buildURL(context.vcMetadata.id), { transactionID: context.transactionId, vidStatus: 'REVOKED', diff --git a/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts b/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts index e69de29bb2..df05eec2ad 100644 --- a/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts +++ b/machines/VCItemMachine/ExistingMosipVCItem/ExistingMosipVCItemMachine.typegen.ts @@ -0,0 +1,401 @@ +// This file was automatically generated. Edits will be overwritten + +export interface Typegen0 { + '@@xstate/typegen': true; + internalEvents: { + '': {type: ''}; + 'done.invoke.checkStatus': { + type: 'done.invoke.checkStatus'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.downloadCredential': { + type: 'done.invoke.downloadCredential'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.addKeyPair:invocation[0]': { + type: 'done.invoke.vc-item.addKeyPair:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.addingWalletBindingId:invocation[0]': { + type: 'done.invoke.vc-item.addingWalletBindingId:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]': { + type: 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]': { + type: 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]': { + type: 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]': { + type: 'done.invoke.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]': { + type: 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.requestingBindingOtp:invocation[0]': { + type: 'done.invoke.vc-item.requestingBindingOtp:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.requestingLock:invocation[0]': { + type: 'done.invoke.vc-item.requestingLock:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.requestingOtp:invocation[0]': { + type: 'done.invoke.vc-item.requestingOtp:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.requestingRevoke:invocation[0]': { + type: 'done.invoke.vc-item.requestingRevoke:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.updatingPrivateKey:invocation[0]': { + type: 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.vc-item.verifyingCredential:invocation[0]': { + type: 'done.invoke.vc-item.verifyingCredential:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'error.platform.checkStatus': { + type: 'error.platform.checkStatus'; + data: unknown; + }; + 'error.platform.downloadCredential': { + type: 'error.platform.downloadCredential'; + data: unknown; + }; + 'error.platform.vc-item.addKeyPair:invocation[0]': { + type: 'error.platform.vc-item.addKeyPair:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item.addingWalletBindingId:invocation[0]': { + type: 'error.platform.vc-item.addingWalletBindingId:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]': { + type: 'error.platform.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item.kebabPopUp.addKeyPair:invocation[0]': { + type: 'error.platform.vc-item.kebabPopUp.addKeyPair:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]': { + type: 'error.platform.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]': { + type: 'error.platform.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]': { + type: 'error.platform.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item.requestingBindingOtp:invocation[0]': { + type: 'error.platform.vc-item.requestingBindingOtp:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item.requestingLock:invocation[0]': { + type: 'error.platform.vc-item.requestingLock:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item.requestingRevoke:invocation[0]': { + type: 'error.platform.vc-item.requestingRevoke:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item.updatingPrivateKey:invocation[0]': { + type: 'error.platform.vc-item.updatingPrivateKey:invocation[0]'; + data: unknown; + }; + 'error.platform.vc-item.verifyingCredential:invocation[0]': { + type: 'error.platform.vc-item.verifyingCredential:invocation[0]'; + data: unknown; + }; + 'xstate.init': {type: 'xstate.init'}; + }; + invokeSrcNameMap: { + addWalletBindnigId: + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; + checkDownloadExpiryLimit: 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; + checkStatus: 'done.invoke.checkStatus'; + downloadCredential: 'done.invoke.downloadCredential'; + generateKeyPair: + | 'done.invoke.vc-item.addKeyPair:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]'; + requestBindingOtp: + | 'done.invoke.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]' + | 'done.invoke.vc-item.requestingBindingOtp:invocation[0]'; + requestLock: 'done.invoke.vc-item.requestingLock:invocation[0]'; + requestOtp: + | 'done.invoke.vc-item.acceptingOtpInput.resendOTP:invocation[0]' + | 'done.invoke.vc-item.requestingOtp:invocation[0]'; + requestRevoke: 'done.invoke.vc-item.requestingRevoke:invocation[0]'; + updatePrivateKey: + | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; + verifyCredential: 'done.invoke.vc-item.verifyingCredential:invocation[0]'; + }; + missingImplementations: { + actions: never; + delays: never; + guards: never; + services: never; + }; + eventsCausingActions: { + addVcToInProgressDownloads: 'STORE_RESPONSE'; + clearOtp: + | '' + | 'CANCEL' + | 'DISMISS' + | 'REVOKE_VC' + | 'STORE_RESPONSE' + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]' + | 'done.invoke.vc-item.requestingBindingOtp:invocation[0]' + | 'done.invoke.vc-item.requestingOtp:invocation[0]' + | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item.verifyingCredential:invocation[0]' + | 'error.platform.vc-item.requestingLock:invocation[0]' + | 'error.platform.vc-item.requestingRevoke:invocation[0]' + | 'error.platform.vc-item.verifyingCredential:invocation[0]'; + clearTransactionId: + | '' + | 'CANCEL' + | 'DISMISS' + | 'STORE_RESPONSE' + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item.verifyingCredential:invocation[0]' + | 'error.platform.vc-item.verifyingCredential:invocation[0]'; + incrementDownloadCounter: 'POLL'; + logDownloaded: 'STORE_RESPONSE'; + logRevoked: 'STORE_RESPONSE'; + logVCremoved: 'STORE_RESPONSE'; + logWalletBindingFailure: + | 'error.platform.vc-item.addKeyPair:invocation[0]' + | 'error.platform.vc-item.addingWalletBindingId:invocation[0]' + | 'error.platform.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'error.platform.vc-item.requestingBindingOtp:invocation[0]' + | 'error.platform.vc-item.updatingPrivateKey:invocation[0]'; + logWalletBindingSuccess: + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; + markVcValid: 'done.invoke.vc-item.verifyingCredential:invocation[0]'; + refreshMyVcs: 'STORE_RESPONSE'; + removeTamperedVcItem: 'TAMPERED_VC'; + removeVcFromInProgressDownloads: 'STORE_RESPONSE'; + removeVcItem: 'CONFIRM'; + removeVcMetaDataFromStorage: 'STORE_ERROR'; + removeVcMetaDataFromVcMachine: 'DISMISS'; + requestStoredContext: 'GET_VC_RESPONSE' | 'REFRESH'; + requestVcContext: 'DISMISS' | 'xstate.init'; + resetWalletBindingSuccess: 'DISMISS'; + revokeVID: 'done.invoke.vc-item.requestingRevoke:invocation[0]'; + sendActivationFailedEndEvent: 'DISMISS'; + sendActivationStartEvent: 'CONFIRM'; + sendActivationSuccessEvent: + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; + sendDownloadLimitExpire: 'error.platform.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; + sendTamperedVc: 'TAMPERED_VC'; + sendTelemetryEvents: 'STORE_RESPONSE'; + sendVcUpdated: 'PIN_CARD'; + sendWalletBindingSuccess: + | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]'; + setCredential: 'GET_VC_RESPONSE' | 'STORE_RESPONSE'; + setDownloadInterval: 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; + setLock: 'done.invoke.vc-item.requestingLock:invocation[0]'; + setMaxDownloadCount: 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; + setOtp: 'INPUT_OTP'; + setOtpError: + | 'error.platform.vc-item.requestingLock:invocation[0]' + | 'error.platform.vc-item.requestingRevoke:invocation[0]'; + setPinCard: 'PIN_CARD'; + setPrivateKey: + | 'done.invoke.vc-item.addKeyPair:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]'; + setPublicKey: + | 'done.invoke.vc-item.addKeyPair:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]'; + setRevoke: 'done.invoke.vc-item.requestingRevoke:invocation[0]'; + setStoreVerifiableCredential: 'CREDENTIAL_DOWNLOADED'; + setThumbprintForWalletBindingId: + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; + setTransactionId: + | 'INPUT_OTP' + | 'REVOKE_VC' + | 'done.invoke.vc-item.requestingOtp:invocation[0]' + | 'error.platform.vc-item.requestingLock:invocation[0]' + | 'error.platform.vc-item.requestingRevoke:invocation[0]'; + setVcKey: 'REMOVE'; + setVcMetadata: 'UPDATE_VC_METADATA'; + setVerifiableCredential: 'STORE_RESPONSE'; + setWalletBindingError: + | 'error.platform.vc-item.addKeyPair:invocation[0]' + | 'error.platform.vc-item.addingWalletBindingId:invocation[0]' + | 'error.platform.vc-item.kebabPopUp.addKeyPair:invocation[0]' + | 'error.platform.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'error.platform.vc-item.kebabPopUp.requestingBindingOtp:invocation[0]' + | 'error.platform.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'error.platform.vc-item.requestingBindingOtp:invocation[0]' + | 'error.platform.vc-item.updatingPrivateKey:invocation[0]'; + setWalletBindingErrorEmpty: + | 'CANCEL' + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; + setWalletBindingId: + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; + setWalletBindingSuccess: 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; + storeContext: + | 'CREDENTIAL_DOWNLOADED' + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item.verifyingCredential:invocation[0]'; + storeLock: 'done.invoke.vc-item.requestingLock:invocation[0]'; + updatePrivateKey: + | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]'; + updateVc: + | 'STORE_RESPONSE' + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item.updatingPrivateKey:invocation[0]' + | 'done.invoke.vc-item.verifyingCredential:invocation[0]'; + }; + eventsCausingDelays: {}; + eventsCausingGuards: { + hasCredential: 'GET_VC_RESPONSE' | 'STORE_RESPONSE'; + isCustomSecureKeystore: + | 'done.invoke.vc-item.addKeyPair:invocation[0]' + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; + isDownloadAllowed: 'POLL'; + isVcValid: ''; + }; + eventsCausingServices: { + addWalletBindnigId: + | 'done.invoke.vc-item.addKeyPair:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addKeyPair:invocation[0]'; + checkDownloadExpiryLimit: 'STORE_RESPONSE'; + checkStatus: + | 'done.invoke.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]' + | 'error.platform.vc-item.checkingServerData.verifyingDownloadLimitExpiry:invocation[0]'; + downloadCredential: 'DOWNLOAD_READY'; + generateKeyPair: 'INPUT_OTP'; + requestBindingOtp: 'CONFIRM'; + requestLock: 'INPUT_OTP'; + requestOtp: 'LOCK_VC' | 'RESEND_OTP'; + requestRevoke: 'INPUT_OTP'; + updatePrivateKey: + | 'done.invoke.vc-item.addingWalletBindingId:invocation[0]' + | 'done.invoke.vc-item.kebabPopUp.addingWalletBindingId:invocation[0]'; + verifyCredential: '' | 'VERIFY'; + }; + matchesStates: + | 'acceptingBindingOtp' + | 'acceptingOtpInput' + | 'acceptingOtpInput.idle' + | 'acceptingOtpInput.resendOTP' + | 'acceptingRevokeInput' + | 'addKeyPair' + | 'addingWalletBindingId' + | 'checkingServerData' + | 'checkingServerData.checkingStatus' + | 'checkingServerData.downloadingCredential' + | 'checkingServerData.savingFailed' + | 'checkingServerData.savingFailed.idle' + | 'checkingServerData.savingFailed.viewingVc' + | 'checkingServerData.verifyingDownloadLimitExpiry' + | 'checkingStore' + | 'checkingVc' + | 'checkingVerificationStatus' + | 'idle' + | 'invalid' + | 'invalid.backend' + | 'invalid.otp' + | 'kebabPopUp' + | 'kebabPopUp.acceptingBindingOtp' + | 'kebabPopUp.addKeyPair' + | 'kebabPopUp.addingWalletBindingId' + | 'kebabPopUp.idle' + | 'kebabPopUp.removeWallet' + | 'kebabPopUp.removingVc' + | 'kebabPopUp.requestingBindingOtp' + | 'kebabPopUp.showActivities' + | 'kebabPopUp.showBindingWarning' + | 'kebabPopUp.showingWalletBindingError' + | 'kebabPopUp.updatingPrivateKey' + | 'lockingVc' + | 'loggingRevoke' + | 'pinCard' + | 'requestingBindingOtp' + | 'requestingLock' + | 'requestingOtp' + | 'requestingRevoke' + | 'revokingVc' + | 'showBindingWarning' + | 'showingWalletBindingError' + | 'updatingPrivateKey' + | 'verifyingCredential' + | { + acceptingOtpInput?: 'idle' | 'resendOTP'; + checkingServerData?: + | 'checkingStatus' + | 'downloadingCredential' + | 'savingFailed' + | 'verifyingDownloadLimitExpiry' + | {savingFailed?: 'idle' | 'viewingVc'}; + invalid?: 'backend' | 'otp'; + kebabPopUp?: + | 'acceptingBindingOtp' + | 'addKeyPair' + | 'addingWalletBindingId' + | 'idle' + | 'removeWallet' + | 'removingVc' + | 'requestingBindingOtp' + | 'showActivities' + | 'showBindingWarning' + | 'showingWalletBindingError' + | 'updatingPrivateKey'; + }; + tags: never; +} diff --git a/machines/auth.ts b/machines/auth.ts index 89d39aa925..3cee14ff2c 100644 --- a/machines/auth.ts +++ b/machines/auth.ts @@ -1,4 +1,3 @@ -import {init} from 'mosip-inji-face-sdk'; import {assign, ContextFrom, EventFrom, send, StateFrom} from 'xstate'; import {createModel} from 'xstate/lib/model'; import getAllConfigurations, { diff --git a/machines/faceScanner.ts b/machines/faceScanner.ts index f22480c966..7d18996b5c 100644 --- a/machines/faceScanner.ts +++ b/machines/faceScanner.ts @@ -1,10 +1,10 @@ -import { Camera, CameraCapturedPicture, PermissionResponse } from 'expo-camera'; -import { CameraType, Face, ImageType } from 'expo-camera/build/Camera.types'; -import { Linking } from 'react-native'; -import { assign, EventFrom, StateFrom } from 'xstate'; -import { createModel } from 'xstate/lib/model'; +import {Camera, CameraCapturedPicture, PermissionResponse} from 'expo-camera'; +import {CameraType, Face, ImageType} from 'expo-camera/build/Camera.types'; +import {Linking} from 'react-native'; +import {assign, EventFrom, StateFrom} from 'xstate'; +import {createModel} from 'xstate/lib/model'; -import mosipFaceAuth from '../lib/mosip-inji-face-sdk/faceAuth'; +import {faceAuth} from 'mosip-mobileid-sdk'; const model = createModel( { @@ -19,15 +19,15 @@ const model = createModel( }, { events: { - READY: (cameraRef: Camera) => ({ cameraRef }), + READY: (cameraRef: Camera) => ({cameraRef}), FLIP_CAMERA: () => ({}), CAPTURE: () => ({}), - DENIED: (response: PermissionResponse) => ({ response }), + DENIED: (response: PermissionResponse) => ({response}), GRANTED: () => ({}), OPEN_SETTINGS: () => ({}), APP_FOCUSED: () => ({}), }, - } + }, ); export const FaceScannerEvents = model.events; @@ -176,7 +176,7 @@ export const createFaceScannerMachine = (vcImage: string) => }), flipWhichCamera: model.assign({ - whichCamera: (context) => + whichCamera: context => context.whichCamera === Camera.Constants.Type.front ? Camera.Constants.Type.back : Camera.Constants.Type.front, @@ -190,7 +190,7 @@ export const createFaceScannerMachine = (vcImage: string) => }, services: { - checkPermission: () => async (callback) => { + checkPermission: () => async callback => { const result = await Camera.getCameraPermissionsAsync(); if (result.granted) { callback(FaceScannerEvents.GRANTED()); @@ -199,7 +199,7 @@ export const createFaceScannerMachine = (vcImage: string) => } }, - requestPermission: () => async (callback) => { + requestPermission: () => async callback => { const result = await Camera.requestCameraPermissionsAsync(); if (result.granted) { callback(FaceScannerEvents.GRANTED()); @@ -208,19 +208,19 @@ export const createFaceScannerMachine = (vcImage: string) => } }, - captureImage: (context) => { + captureImage: context => { return context.cameraRef.takePictureAsync({ base64: true, imageType: ImageType.jpg, }); }, - verifyImage: (context) => { + verifyImage: context => { context.cameraRef.pausePreview(); const rxDataURI = /data:(?[\w/\-.]+);(?\w+),(?.*)/; const matches = rxDataURI.exec(vcImage).groups; - return mosipFaceAuth(context.capturedImage.base64, matches.data); + return faceAuth(context.capturedImage.base64, matches.data); }, }, @@ -231,7 +231,7 @@ export const createFaceScannerMachine = (vcImage: string) => doesFaceMatch: (_context, event) => event.data, }, - } + }, ); type State = StateFrom>; diff --git a/machines/revoke.ts b/machines/revoke.ts index 57432739bc..e3e38b0545 100644 --- a/machines/revoke.ts +++ b/machines/revoke.ts @@ -1,5 +1,5 @@ import {TextInput} from 'react-native'; -import {assign, ErrorPlatformEvent, StateFrom, send, EventFrom} from 'xstate'; +import {assign, ErrorPlatformEvent, EventFrom, send, StateFrom} from 'xstate'; import {log} from 'xstate/lib/actions'; import i18n from '../i18n'; @@ -11,6 +11,7 @@ import {request} from '../shared/request'; import {VcIdType} from '../types/VC/ExistingMosipVC/vc'; import {MY_VCS_STORE_KEY} from '../shared/constants'; import {VCMetadata} from '../shared/VCMetadata'; +import {API_URLS} from '../shared/api'; const model = createModel( { @@ -236,12 +237,16 @@ export const revokeVidsMachine = services: { requestOtp: async context => { const transactionId = String(new Date().valueOf()).substring(3, 13); - return request('POST', '/residentmobileapp/req/otp', { - individualId: context.VIDsMetadata[0].id, - individualIdType: 'VID', - otpChannel: ['EMAIL', 'PHONE'], - transactionID: transactionId, - }); + return request( + API_URLS.requestOtp.method, + API_URLS.requestOtp.buildURL(), + { + individualId: context.VIDsMetadata[0].id, + individualIdType: 'VID', + otpChannel: ['EMAIL', 'PHONE'], + transactionID: transactionId, + }, + ); }, requestRevoke: context => async callback => { @@ -253,8 +258,8 @@ export const revokeVidsMachine = 13, ); return request( - 'PATCH', - `/residentmobileapp/vid/${metadata.id}`, + API_URLS.requestRevoke.method, + API_URLS.requestRevoke.buildURL(metadata.id), { transactionID: transactionId, vidStatus: 'REVOKED', diff --git a/machines/store.ts b/machines/store.ts index f36247418b..4a99821a80 100644 --- a/machines/store.ts +++ b/machines/store.ts @@ -16,7 +16,6 @@ import {MY_VCS_STORE_KEY} from '../shared/constants'; import SecureKeystore from 'react-native-secure-keystore'; import { AUTH_TIMEOUT, - clear, decryptJson, DUMMY_KEY_FOR_BIOMETRIC_ALIAS, ENCRYPTION_ID, @@ -275,7 +274,7 @@ export const storeMachine = }, services: { - clear, + clear: () => clear(), hasAndroidEncryptionKey: () => async callback => { const hasSetCredentials = SecureKeystore.hasAlias(ENCRYPTION_ID); if (hasSetCredentials) { @@ -630,6 +629,18 @@ export async function removeVCMetaData( } } +export async function clear() { + try { + console.log('clearing entire storage'); + if (isHardwareKeystoreExists) { + SecureKeystore.clearKeys(); + } + await Storage.clear(); + } catch (e) { + console.error('error clear:', e); + throw e; + } +} export async function removeItems( key: string, values: string[], diff --git a/machines/store.typegen.ts b/machines/store.typegen.ts index e69de29bb2..a7ee5b5379 100644 --- a/machines/store.typegen.ts +++ b/machines/store.typegen.ts @@ -0,0 +1,78 @@ +// This file was automatically generated. Edits will be overwritten + +export interface Typegen0 { + '@@xstate/typegen': true; + internalEvents: { + 'done.invoke._store': { + type: 'done.invoke._store'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'done.invoke.store.resettingStorage:invocation[0]': { + type: 'done.invoke.store.resettingStorage:invocation[0]'; + data: unknown; + __tip: 'See the XState TS docs to learn how to strongly type this.'; + }; + 'error.platform._store': {type: 'error.platform._store'; data: unknown}; + 'xstate.init': {type: 'xstate.init'}; + }; + invokeSrcNameMap: { + checkStorageInitialisedOrNot: 'done.invoke.store.checkStorageInitialisation:invocation[0]'; + clear: 'done.invoke.store.resettingStorage:invocation[0]'; + generateEncryptionKey: 'done.invoke.store.generatingEncryptionKey:invocation[0]'; + getEncryptionKey: 'done.invoke.store.gettingEncryptionKey:invocation[0]'; + hasAndroidEncryptionKey: 'done.invoke.store.checkEncryptionKey:invocation[0]'; + store: 'done.invoke._store'; + }; + missingImplementations: { + actions: never; + delays: never; + guards: never; + services: never; + }; + eventsCausingActions: { + cacheVCFilesData: + | 'KEY_RECEIVED' + | 'READY' + | 'done.invoke.store.resettingStorage:invocation[0]'; + forwardStoreRequest: + | 'APPEND' + | 'CLEAR' + | 'GET' + | 'PREPEND' + | 'REMOVE' + | 'REMOVE_ITEMS' + | 'REMOVE_VC_METADATA' + | 'SET' + | 'UPDATE'; + notifyParent: + | 'KEY_RECEIVED' + | 'READY' + | 'done.invoke.store.resettingStorage:invocation[0]'; + setEncryptionKey: 'KEY_RECEIVED'; + }; + eventsCausingDelays: {}; + eventsCausingGuards: { + isCustomSecureKeystore: 'KEY_RECEIVED'; + }; + eventsCausingServices: { + checkStorageInitialisedOrNot: 'ERROR'; + clear: 'KEY_RECEIVED'; + generateEncryptionKey: 'ERROR' | 'IGNORE' | 'READY'; + getEncryptionKey: 'TRY_AGAIN'; + hasAndroidEncryptionKey: never; + store: + | 'KEY_RECEIVED' + | 'READY' + | 'done.invoke.store.resettingStorage:invocation[0]'; + }; + matchesStates: + | 'checkEncryptionKey' + | 'checkStorageInitialisation' + | 'failedReadingKey' + | 'generatingEncryptionKey' + | 'gettingEncryptionKey' + | 'ready' + | 'resettingStorage'; + tags: never; +} diff --git a/package-lock.json b/package-lock.json index 1e7e40aba5..2c252d0e6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "i18next": "^21.6.16", "iso-639-3": "^3.0.1", "jwt-decode": "^3.1.2", - "mosip-inji-face-sdk": "^0.1.12", + "mosip-mobileid-sdk": "git://github.com/mosip/mosip-mobileid-sdk.git#IrisScan", "node-forge": "^1.3.1", "node-jose": "^2.2.0", "patch-package": "^6.5.1", @@ -84,7 +84,7 @@ "react-native-vector-icons": "^10.0.0", "short-unique-id": "^4.4.4", "simple-pem2jwk": "^0.2.4", - "telemetry-sdk": "git://github.com/mosip/sunbird-telemetry-sdk.git#develop", + "telemetry-sdk": "git://github.com/mosip/sunbird-telemetry-sdk.git#f762be5732ee552c0c70bdd540aa4e2701554c71", "xstate": "^4.35.0" }, "devDependencies": { @@ -24420,14 +24420,16 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/mosip-inji-face-sdk": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/mosip-inji-face-sdk/-/mosip-inji-face-sdk-0.1.12.tgz", - "integrity": "sha512-lnoaa2lL0pS9u/9fwH4Q9OU2U56oqjXf2z4JjGxX80DQOqJGWvj49PfvPMYGFEfVucqIJyQBZUfvfpqfYO0+vw==", + "node_modules/mosip-mobileid-sdk": { + "version": "0.1.0", + "resolved": "git+ssh://git@github.com/mosip/mosip-mobileid-sdk.git#ff4647a6c949b0acf8f36ae968dcbd407df7fb83", + "license": "MIT", + "engines": { + "node": ">= 16.0.0" + }, "peerDependencies": { "react": "*", - "react-native": "*", - "react-native-fs": "*" + "react-native": "*" } }, "node_modules/ms": { @@ -49542,10 +49544,9 @@ "minimist": "^1.2.6" } }, - "mosip-inji-face-sdk": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/mosip-inji-face-sdk/-/mosip-inji-face-sdk-0.1.12.tgz", - "integrity": "sha512-lnoaa2lL0pS9u/9fwH4Q9OU2U56oqjXf2z4JjGxX80DQOqJGWvj49PfvPMYGFEfVucqIJyQBZUfvfpqfYO0+vw==", + "mosip-mobileid-sdk": { + "version": "git+ssh://git@github.com/mosip/mosip-mobileid-sdk.git#ff4647a6c949b0acf8f36ae968dcbd407df7fb83", + "from": "mosip-mobileid-sdk@git://github.com/mosip/mosip-mobileid-sdk.git#IrisScan", "requires": {} }, "ms": { @@ -53475,7 +53476,7 @@ "telemetry-sdk": { "version": "git+ssh://git@github.com/mosip/sunbird-telemetry-sdk.git#f762be5732ee552c0c70bdd540aa4e2701554c71", "integrity": "sha512-aeA7uO77JzNQVSuUpxzUXK3I+BtYiOzDhcmYbD6R3pAETun4toP1/GR5PBfT9/iE3N5MdGJg70sQArwCIL1XaQ==", - "from": "telemetry-sdk@git://github.com/mosip/sunbird-telemetry-sdk.git#develop", + "from": "telemetry-sdk@git://github.com/mosip/sunbird-telemetry-sdk.git#f762be5732ee552c0c70bdd540aa4e2701554c71", "requires": { "axios": "^1.4.0", "grunt-karma": "^0.12.2", diff --git a/package.json b/package.json index 8620a79271..5375fb82e8 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "i18next": "^21.6.16", "iso-639-3": "^3.0.1", "jwt-decode": "^3.1.2", - "mosip-inji-face-sdk": "^0.1.12", + "mosip-mobileid-sdk": "git://github.com/mosip/mosip-mobileid-sdk.git#IrisScan", "node-forge": "^1.3.1", "node-jose": "^2.2.0", "patch-package": "^6.5.1", diff --git a/screens/AuthScreen.tsx b/screens/AuthScreen.tsx index 86d8ea1fa6..a517e39909 100644 --- a/screens/AuthScreen.tsx +++ b/screens/AuthScreen.tsx @@ -47,12 +47,14 @@ export const AuthScreen: React.FC = props => { {t('header')} diff --git a/screens/History/HistoryScreen.tsx b/screens/History/HistoryScreen.tsx index c00642d72a..c696d21e0b 100644 --- a/screens/History/HistoryScreen.tsx +++ b/screens/History/HistoryScreen.tsx @@ -1,15 +1,15 @@ import React from 'react'; -import { RefreshControl } from 'react-native'; -import { Icon } from 'react-native-elements'; -import { useTranslation } from 'react-i18next'; -import { Centered, Column, Text } from '../../components/ui'; -import { useHistoryTab } from './HistoryScreenController'; -import { ActivityLogText } from '../../components/ActivityLogText'; -import { MainRouteProps } from '../../routes/main'; -import { Theme } from '../../components/ui/styleUtils'; +import {RefreshControl} from 'react-native'; +import {Icon} from 'react-native-elements'; +import {useTranslation} from 'react-i18next'; +import {Centered, Column, Text} from '../../components/ui'; +import {useHistoryTab} from './HistoryScreenController'; +import {ActivityLogText} from '../../components/ActivityLogText'; +import {MainRouteProps} from '../../routes/main'; +import {Theme} from '../../components/ui/styleUtils'; export const HistoryScreen: React.FC = () => { - const { t } = useTranslation('HistoryScreen'); + const {t} = useTranslation('HistoryScreen'); const controller = useHistoryTab(); return ( @@ -23,7 +23,7 @@ export const HistoryScreen: React.FC = () => { onRefresh={controller.REFRESH} /> }> - {controller.activities.map((activity) => ( + {controller.activities.map(activity => ( = () => { {controller.activities.length === 0 && ( - + {t('noHistory')} diff --git a/screens/Home/HomeScreen.tsx b/screens/Home/HomeScreen.tsx index 75c07d61c3..7345b0250a 100644 --- a/screens/Home/HomeScreen.tsx +++ b/screens/Home/HomeScreen.tsx @@ -1,6 +1,6 @@ import React, {useEffect} from 'react'; import {Icon, Tab} from 'react-native-elements'; -import {Button, Column, Text} from '../../components/ui'; +import {Column, Text} from '../../components/ui'; import {Theme} from '../../components/ui/styleUtils'; import {HomeRouteProps} from '../../routes/main'; import {MyVcsTab} from './MyVcsTab'; @@ -14,6 +14,7 @@ import {ExistingMosipVCItemMachine} from '../../machines/VCItemMachine/ExistingM import LinearGradient from 'react-native-linear-gradient'; import {EsignetMosipVCItemMachine} from '../../machines/VCItemMachine/EsignetMosipVCItem/EsignetMosipVCItemMachine'; import {ErrorMessageOverlay} from '../../components/MessageOverlay'; +import {Pressable} from 'react-native'; export const HomeScreen: React.FC = props => { const {t} = useTranslation('HomeScreen'); @@ -43,16 +44,19 @@ export const HomeScreen: React.FC = props => { return ( -