mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 13:38:01 -05:00
INJIMOB-898 Remove Metro warnings (#1329)
* [INJIMOB-898] remove telemetry dependency from crypto utils Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-898] remove vcMetadata dependency from utils file Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-898] move common props key to constants Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com> * [INJIMOB-898] remove vcUtils dependency from vcVerification Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-898] remove profileIcon dependency from svg Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-898] remove vcItemFeild dependecy from vcUtils Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-898] remove vc dependecy from esignetVcItem and existing vcItem Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-898] remove storage dependency from api.ts Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-898] remove store dependency from storage Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-898] remove commom props dependency from api.ts Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-898] remove main.ts dependency from scanLayout Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-898] move VcItemConatinerProfileImage to different component Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-898] throw error when error is ENOENT and spell check Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-898] rename types to routeTypes and edit imports Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> * [INJIMOB-898] move to idle state on tamperedVCs state Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> --------- Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> Signed-off-by: PoojaBabusing <115976560+PoojaBabusing@users.noreply.github.com> Co-authored-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com> Co-authored-by: PuBHARGAVI <46226958+PuBHARGAVI@users.noreply.github.com>
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
import {request} from './request';
|
||||
import {API_CACHED_STORAGE_KEYS} from './storage';
|
||||
import {COMMON_PROPS_KEY} from './commonprops/commonProps';
|
||||
import {
|
||||
API_CACHED_STORAGE_KEYS,
|
||||
COMMON_PROPS_KEY,
|
||||
changeCrendetialRegistry,
|
||||
} from './constants';
|
||||
import {INITIAL_CONFIG} from './InitialConfig';
|
||||
import Keychain from 'react-native-keychain';
|
||||
import {getItem, setItem} from '../machines/store';
|
||||
import {faceMatchConfig} from './commonUtil';
|
||||
import {configure} from '@iriscan/biometric-sdk-react-native';
|
||||
import {
|
||||
getErrorEventData,
|
||||
getImpressionEventData,
|
||||
sendErrorEvent,
|
||||
sendImpressionEvent,
|
||||
} from './telemetry/TelemetryUtils';
|
||||
import {TelemetryConstants} from './telemetry/TelemetryConstants';
|
||||
|
||||
export const API_URLS: ApiUrls = {
|
||||
issuersList: {
|
||||
@@ -261,6 +273,60 @@ async function generateCacheAPIFunctionWithAPIPreference(
|
||||
}
|
||||
}
|
||||
|
||||
export default async function getAllConfigurations(
|
||||
host = undefined,
|
||||
isCachePreferred = true,
|
||||
) {
|
||||
host && changeCrendetialRegistry(host);
|
||||
return await CACHED_API.getAllProperties(isCachePreferred);
|
||||
}
|
||||
|
||||
export async function downloadModel() {
|
||||
try {
|
||||
console.log('restart Face model init');
|
||||
var injiProp = await getAllConfigurations();
|
||||
const maxRetryStr = injiProp.modelDownloadMaxRetry;
|
||||
const maxRetry = parseInt(maxRetryStr);
|
||||
const resp: string = injiProp != null ? injiProp.faceSdkModelUrl : null;
|
||||
|
||||
if (resp != null) {
|
||||
for (let counter = 0; counter < maxRetry; counter++) {
|
||||
let config = faceMatchConfig(resp);
|
||||
var result = await configure(config);
|
||||
console.log('model download result is = ' + result);
|
||||
if (result) {
|
||||
sendImpressionEvent(
|
||||
getImpressionEventData(
|
||||
TelemetryConstants.FlowType.faceModelInit,
|
||||
TelemetryConstants.Screens.home,
|
||||
{status: TelemetryConstants.EndEventStatus.success},
|
||||
),
|
||||
);
|
||||
break;
|
||||
} else if (!result && counter === maxRetry - 1) {
|
||||
sendErrorEvent(
|
||||
getErrorEventData(
|
||||
TelemetryConstants.FlowType.faceModelInit,
|
||||
TelemetryConstants.ErrorId.failure,
|
||||
TelemetryConstants.ErrorMessage.faceModelInitFailed,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
sendErrorEvent(
|
||||
getErrorEventData(
|
||||
TelemetryConstants.FlowType.faceModelInit,
|
||||
TelemetryConstants.ErrorId.failure,
|
||||
TelemetryConstants.ErrorMessage.faceModelInitFailed,
|
||||
error,
|
||||
),
|
||||
);
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
type Api_Params = {
|
||||
method: 'GET' | 'POST' | 'PATCH'; // Define the HTTP methods
|
||||
buildURL: (param?: string) => `/${string}`; // Define the buildURL function signature
|
||||
@@ -287,3 +353,8 @@ type ApiUrls = {
|
||||
sendConsent: Api_Params;
|
||||
googleAccountProfileInfo: Api_Params;
|
||||
};
|
||||
|
||||
export interface DownloadProps {
|
||||
maxDownloadLimit: number;
|
||||
downloadInterval: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user