[INJIMOB-1093] draft13 changes (#1566)

* [INJIMOB-1093] integrate wellknown api, download and display vc based on wellknown response

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

[INJIMOB-1093] change in wellknown endpoint and refactor

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

* [INJIMOB-1093] update version of vci-client

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>

---------

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
This commit is contained in:
abhip2565
2024-07-29 16:54:04 +05:30
committed by GitHub
parent 2054580516
commit 07d02f21c5
23 changed files with 620 additions and 1216 deletions

View File

@@ -287,7 +287,7 @@ dependencies {
}
compileOnly project(':react-native-android-location-services-dialog-box')
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation "io.mosip:inji-vci-client:0.1.0-SNAPSHOT"
implementation "io.mosip:inji-vci-client:0.2.0-SNAPSHOT"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group: 'com.facebook.flipper'

View File

@@ -36,15 +36,17 @@ export const VCCardView: React.FC<VCItemProps> = props => {
const [wellknown, setWellknown] = useState(null);
useEffect(() => {
getCredentialIssuersWellKnownConfig(
verifiableCredentialData?.issuer,
verifiableCredentialData?.wellKnown,
verifiableCredentialData?.credentialTypes,
CARD_VIEW_DEFAULT_FIELDS,
).then(response => {
setWellknown(response.wellknown);
setFields(response.fields);
});
const {issuer, wellKnown, credentialTypes} = verifiableCredentialData;
if (wellKnown) {
getCredentialIssuersWellKnownConfig(
issuer,
credentialTypes,
CARD_VIEW_DEFAULT_FIELDS,
).then(response => {
setWellknown(response.wellknown);
setFields(response.fields);
});
}
}, [verifiableCredentialData?.wellKnown]);
if (!isVCLoaded(controller.credential, fields)) {

View File

@@ -9,7 +9,11 @@ import {Theme} from '../../ui/styleUtils';
import {CheckBox, Icon} from 'react-native-elements';
import {SvgImage} from '../../ui/svg';
import {VcItemContainerProfileImage} from '../../VcItemContainerProfileImage';
import {isVCLoaded, getBackgroundColour} from '../common/VCUtils';
import {
isVCLoaded,
getBackgroundColour,
getBackgroundImage,
} from '../common/VCUtils';
import {VCItemFieldValue} from '../common/VCItemField';
import {WalletBinding} from '../../../screens/Home/MyVcs/WalletBinding';
import {VCVerification} from '../../VCVerification';
@@ -42,10 +46,12 @@ export const VCCardViewContent: React.FC<VCItemContentProps> = props => {
const {start} = useCopilot();
const {t} = useTranslation();
return (
<ImageBackground
source={Theme.CloseCard}
source={getBackgroundImage(props.wellknown, Theme.CloseCard)}
resizeMode="stretch"
imageStyle={Theme.Styles.vcBg}
style={[
Theme.Styles.backgroundImageContainer,
getBackgroundColour(props.wellknown),

View File

@@ -16,6 +16,7 @@ import {
DETAIL_VIEW_BOTTOM_SECTION_FIELDS,
fieldItemIterator,
getBackgroundColour,
getBackgroundImage,
getTextColor,
} from '../common/VCUtils';
import {ProfileIcon} from '../../ProfileIcon';
@@ -64,14 +65,14 @@ export const VCDetailView: React.FC<VCItemDetailsProps> = props => {
padding="10 10 3 10"
backgroundColor={Theme.Colors.DetailedViewBackground}>
<ImageBackground
imageStyle={{width: '100%'}}
imageStyle={Theme.Styles.vcDetailBg}
resizeMethod="scale"
resizeMode="stretch"
style={[
Theme.Styles.openCardBgContainer,
getBackgroundColour(props.wellknown),
]}
source={Theme.OpenCard}>
source={getBackgroundImage(props.wellknown, Theme.OpenCard)}>
<Row padding="14 14 0 14" margin="0 0 0 0">
<Column crossAlign="center">
{getProfileImage(face)}

View File

@@ -102,6 +102,10 @@ export const getBackgroundColour = (wellknown: any) => {
return wellknown?.display[0]?.background_color ?? Theme.Colors.textValue;
};
export const getBackgroundImage = (wellknown: any, defaultBackground: any) => {
return wellknown?.display[0]?.background_image ?? defaultBackground;
};
export const getTextColor = (wellknown: any, defaultColor: string) => {
return wellknown?.display[0]?.text_color ?? defaultColor;
};
@@ -209,7 +213,7 @@ export const getIdType = (
) {
let supportedCredentialsWellknown;
wellknown = parseJSON(wellknown) as unknown as Object[];
if (!!!wellknown['credentials_supported']) {
if (!!!wellknown['credential_configurations_supported']) {
return i18n.t('VcDetails:nationalCard');
}
supportedCredentialsWellknown = getSelectedCredentialTypeDetails(

View File

@@ -343,6 +343,17 @@ export const DefaultTheme = {
marginTop: 10,
alignItems: 'flex-start',
},
vcDetailBg: {
width: '100%',
opacity: 0.1,
},
vcBg: {
opacity: 0.1,
},
shimmer: {
borderRadius: 5,
marginLeft: 2,
},
openCardBgContainer: {
borderRadius: 10,
margin: 8,

View File

@@ -216,6 +216,17 @@ export const PurpleTheme = {
flexDirection: 'row',
paddingRight: 90,
},
vcDetailBg: {
width: '100%',
opacity: 0.1,
},
vcBg: {
opacity: 0.1,
},
shimmer: {
borderRadius: 5,
marginLeft: 2,
},
loadingContainer: {
flex: 1,
flexDirection: 'row',

View File

@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objectVersion = 60;
objects = {
/* Begin PBXBuildFile section */

View File

@@ -165,7 +165,19 @@ export const IssuersActions = (model: any) => {
),
setSelectedIssuers: model.assign({
selectedIssuer: (_: any, event: any) => event.data,
selectedIssuer: (context: any, event: any) =>
context.issuers.find(issuer => issuer.credential_issuer === event.id),
}),
updateIssuerFromWellknown: model.assign({
selectedIssuer: (context: any, event: any) => ({
...context.selectedIssuer,
credential_audience: event.data.credential_issuer,
credential_endpoint: event.data.credential_endpoint,
credential_configurations_supported:
event.data.credential_configurations_supported,
authorization_servers: event.data.authorization_servers,
}),
}),
setSelectedIssuerId: model.assign({
selectedIssuerId: (_: any, event: any) => event.id,

View File

@@ -64,7 +64,7 @@ export const IssuersMachine = model.createMachine(
description:
'issuers config is available and downloading credentials is retriable',
actions: ['setLoadingReasonAsSettingUp', 'resetError'],
target: 'downloadIssuerConfig',
target: 'downloadIssuerWellknown',
},
],
RESET_ERROR: {
@@ -80,17 +80,21 @@ export const IssuersMachine = model.createMachine(
actions: sendParent('DOWNLOAD_ID'),
},
SELECTED_ISSUER: {
actions: ['setSelectedIssuerId', 'setLoadingReasonAsSettingUp'],
target: 'downloadIssuerConfig',
actions: [
'setSelectedIssuerId',
'setLoadingReasonAsSettingUp',
'setSelectedIssuers',
],
target: 'downloadIssuerWellknown',
},
},
},
downloadIssuerConfig: {
description: 'downloads the configuration of the selected issuer',
downloadIssuerWellknown: {
description: 'fetches the wellknown of the selected issuer',
invoke: {
src: 'downloadIssuerConfig',
src: 'downloadIssuerWellknown',
onDone: {
actions: 'setSelectedIssuers',
actions: 'updateIssuerFromWellknown',
target: 'downloadCredentialTypes',
},
onError: {
@@ -415,23 +419,25 @@ export interface displayType {
language: string;
logo: logoType;
background_color: string;
background_image: string;
text_color: string;
title: string;
description: string;
}
export interface issuerType {
authorization_servers: [string];
credential_issuer: string;
protocol: string;
client_id: string;
'.well-known': string;
redirect_uri: string;
additional_headers: object;
authorization_endpoint: string;
token_endpoint: string;
proxy_token_endpoint: string;
credential_endpoint: string;
credential_audience: string;
credential_configurations_supported: object;
display: [displayType];
credentialTypes: [CredentialTypes];
}

View File

@@ -1,295 +1,114 @@
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
'done.invoke.checkInternet': {
type: 'done.invoke.checkInternet';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.displayIssuers:invocation[0]': {
type: 'done.invoke.issuersMachine.displayIssuers:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]': {
type: 'done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.downloadCredentials:invocation[0]': {
type: 'done.invoke.issuersMachine.downloadCredentials:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.downloadIssuerConfig:invocation[0]': {
type: 'done.invoke.issuersMachine.downloadIssuerConfig:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.generateKeyPair:invocation[0]': {
type: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.performAuthorization:invocation[0]': {
type: 'done.invoke.issuersMachine.performAuthorization:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.storing:invocation[0]': {
type: 'done.invoke.issuersMachine.storing:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.issuersMachine.verifyingCredential:invocation[0]': {
type: 'done.invoke.issuersMachine.verifyingCredential:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'error.platform.checkInternet': {
type: 'error.platform.checkInternet';
data: unknown;
};
'error.platform.issuersMachine.displayIssuers:invocation[0]': {
type: 'error.platform.issuersMachine.displayIssuers:invocation[0]';
data: unknown;
};
'error.platform.issuersMachine.downloadCredentialTypes:invocation[0]': {
type: 'error.platform.issuersMachine.downloadCredentialTypes:invocation[0]';
data: unknown;
};
'error.platform.issuersMachine.downloadCredentials:invocation[0]': {
type: 'error.platform.issuersMachine.downloadCredentials:invocation[0]';
data: unknown;
};
'error.platform.issuersMachine.downloadIssuerConfig:invocation[0]': {
type: 'error.platform.issuersMachine.downloadIssuerConfig:invocation[0]';
data: unknown;
};
'error.platform.issuersMachine.performAuthorization:invocation[0]': {
type: 'error.platform.issuersMachine.performAuthorization:invocation[0]';
data: unknown;
};
'error.platform.issuersMachine.verifyingCredential:invocation[0]': {
type: 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
data: unknown;
};
'xstate.init': {type: 'xstate.init'};
};
invokeSrcNameMap: {
checkInternet: 'done.invoke.checkInternet';
downloadCredential: 'done.invoke.issuersMachine.downloadCredentials:invocation[0]';
downloadCredentialTypes: 'done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]';
downloadIssuerConfig: 'done.invoke.issuersMachine.downloadIssuerConfig:invocation[0]';
downloadIssuersList: 'done.invoke.issuersMachine.displayIssuers:invocation[0]';
generateKeyPair: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
invokeAuthorization: 'done.invoke.issuersMachine.performAuthorization:invocation[0]';
isUserSignedAlready: 'done.invoke.issuersMachine.storing:invocation[0]';
verifyCredential: 'done.invoke.issuersMachine.verifyingCredential:invocation[0]';
};
missingImplementations: {
actions:
| 'getKeyPairFromStore'
| 'loadKeyPair'
| 'logDownloaded'
| 'resetError'
| 'resetIsVerified'
| 'resetLoadingReason'
| 'resetSelectedCredentialType'
| 'resetVerificationErrorMessage'
| 'sendBackupEvent'
| 'sendDownloadingFailedToVcMeta'
| 'sendErrorEndEvent'
| 'sendImpressionEvent'
| 'sendSuccessEndEvent'
| 'setCredentialWrapper'
| 'setError'
| 'setIsVerified'
| 'setIssuers'
| 'setLoadingReasonAsDisplayIssuers'
| 'setLoadingReasonAsDownloadingCredentials'
| 'setLoadingReasonAsSettingUp'
| 'setMetadataInCredentialData'
| 'setNoInternet'
| 'setOIDCConfigError'
| 'setPrivateKey'
| 'setPublicKey'
| 'setSelectedCredentialType'
| 'setSelectedIssuerId'
| 'setSelectedIssuers'
| 'setSupportedCredentialTypes'
| 'setTokenResponse'
| 'setVCMetadata'
| 'setVerifiableCredential'
| 'storeKeyPair'
| 'storeVcMetaContext'
| 'storeVcsContext'
| 'storeVerifiableCredentialData'
| 'storeVerifiableCredentialMeta'
| 'updateVerificationErrorMessage';
delays: never;
guards:
| 'canSelectIssuerAgain'
| 'hasKeyPair'
| 'hasUserCancelledBiometric'
| 'isCustomSecureKeystore'
| 'isGenericError'
| 'isInternetConnected'
| 'isOIDCConfigError'
| 'isOIDCflowCancelled'
| 'isSignedIn'
| 'isVerificationPendingBecauseOfNetworkIssue'
| 'shouldFetchIssuersAgain';
services:
| 'checkInternet'
| 'downloadCredential'
| 'downloadCredentialTypes'
| 'downloadIssuerConfig'
| 'downloadIssuersList'
| 'generateKeyPair'
| 'invokeAuthorization'
| 'isUserSignedAlready'
| 'verifyCredential';
};
eventsCausingActions: {
getKeyPairFromStore:
| 'TRY_AGAIN'
| 'done.invoke.issuersMachine.performAuthorization:invocation[0]';
loadKeyPair: 'STORE_RESPONSE';
logDownloaded:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
resetError:
| 'RESET_ERROR'
| 'TRY_AGAIN'
| 'error.platform.issuersMachine.performAuthorization:invocation[0]';
resetIsVerified: 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
resetLoadingReason:
| 'RESET_ERROR'
| 'done.invoke.checkInternet'
| 'done.invoke.issuersMachine.displayIssuers:invocation[0]'
| 'error.platform.issuersMachine.downloadCredentialTypes:invocation[0]'
| 'error.platform.issuersMachine.downloadCredentials:invocation[0]'
| 'error.platform.issuersMachine.downloadIssuerConfig:invocation[0]'
| 'error.platform.issuersMachine.performAuthorization:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
resetSelectedCredentialType:
| 'CANCEL'
| 'error.platform.issuersMachine.downloadCredentials:invocation[0]'
| 'error.platform.issuersMachine.performAuthorization:invocation[0]';
resetVerificationErrorMessage: 'RESET_VERIFY_ERROR';
sendBackupEvent: 'done.invoke.issuersMachine.storing:invocation[0]';
sendDownloadingFailedToVcMeta: 'error.platform.issuersMachine.downloadCredentials:invocation[0]';
sendErrorEndEvent: 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
sendImpressionEvent: 'done.invoke.issuersMachine.displayIssuers:invocation[0]';
sendSuccessEndEvent: 'done.invoke.issuersMachine.verifyingCredential:invocation[0]';
setCredentialWrapper: 'done.invoke.issuersMachine.downloadCredentials:invocation[0]';
setError:
| 'error.platform.issuersMachine.displayIssuers:invocation[0]'
| 'error.platform.issuersMachine.downloadCredentialTypes:invocation[0]'
| 'error.platform.issuersMachine.downloadCredentials:invocation[0]'
| 'error.platform.issuersMachine.downloadIssuerConfig:invocation[0]'
| 'error.platform.issuersMachine.performAuthorization:invocation[0]';
setIsVerified: 'done.invoke.issuersMachine.verifyingCredential:invocation[0]';
setIssuers: 'done.invoke.issuersMachine.displayIssuers:invocation[0]';
setLoadingReasonAsDisplayIssuers: 'TRY_AGAIN';
setLoadingReasonAsDownloadingCredentials:
| 'STORE_ERROR'
| 'STORE_RESPONSE'
| 'TRY_AGAIN'
| 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
setLoadingReasonAsSettingUp:
| 'SELECTED_ISSUER'
| 'TRY_AGAIN'
| 'done.invoke.issuersMachine.performAuthorization:invocation[0]';
setMetadataInCredentialData:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
setNoInternet: 'done.invoke.checkInternet';
setOIDCConfigError: 'error.platform.issuersMachine.performAuthorization:invocation[0]';
setPrivateKey: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
setPublicKey: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
setSelectedCredentialType: 'SELECTED_CREDENTIAL_TYPE';
setSelectedIssuerId: 'SELECTED_ISSUER';
setSelectedIssuers: 'done.invoke.issuersMachine.downloadIssuerConfig:invocation[0]';
setSupportedCredentialTypes: 'done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]';
setTokenResponse: 'done.invoke.issuersMachine.performAuthorization:invocation[0]';
setVCMetadata:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
setVerifiableCredential: 'done.invoke.issuersMachine.downloadCredentials:invocation[0]';
storeKeyPair: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
storeVcMetaContext:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
storeVcsContext:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
storeVerifiableCredentialData:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
storeVerifiableCredentialMeta:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
updateVerificationErrorMessage: 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
};
eventsCausingDelays: {};
eventsCausingGuards: {
canSelectIssuerAgain: 'TRY_AGAIN';
hasKeyPair: 'CHECK_KEY_PAIR';
hasUserCancelledBiometric: 'error.platform.issuersMachine.downloadCredentials:invocation[0]';
isCustomSecureKeystore: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
isGenericError: 'error.platform.issuersMachine.downloadCredentials:invocation[0]';
isInternetConnected: 'done.invoke.checkInternet';
isOIDCConfigError: 'error.platform.issuersMachine.performAuthorization:invocation[0]';
isOIDCflowCancelled: 'error.platform.issuersMachine.performAuthorization:invocation[0]';
isSignedIn: 'done.invoke.issuersMachine.storing:invocation[0]';
isVerificationPendingBecauseOfNetworkIssue: 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
shouldFetchIssuersAgain: 'TRY_AGAIN';
};
eventsCausingServices: {
checkInternet:
| 'SELECTED_CREDENTIAL_TYPE'
| 'done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]';
downloadCredential:
| 'CHECK_KEY_PAIR'
| 'done.invoke.issuersMachine.generateKeyPair:invocation[0]';
downloadCredentialTypes: 'done.invoke.issuersMachine.downloadIssuerConfig:invocation[0]';
downloadIssuerConfig: 'SELECTED_ISSUER' | 'TRY_AGAIN';
downloadIssuersList: 'CANCEL' | 'TRY_AGAIN' | 'xstate.init';
generateKeyPair: 'CHECK_KEY_PAIR';
invokeAuthorization: 'done.invoke.checkInternet';
isUserSignedAlready:
| 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'
| 'error.platform.issuersMachine.verifyingCredential:invocation[0]';
verifyCredential: 'done.invoke.issuersMachine.downloadCredentials:invocation[0]';
};
matchesStates:
| 'checkInternet'
| 'checkKeyPair'
| 'displayIssuers'
| 'done'
| 'downloadCredentialTypes'
| 'downloadCredentials'
| 'downloadCredentials.idle'
| 'downloadCredentials.userCancelledBiometric'
| 'downloadIssuerConfig'
| 'error'
| 'generateKeyPair'
| 'handleVCVerificationFailure'
| 'idle'
| 'performAuthorization'
| 'performAuthorization.idle'
| 'performAuthorization.userCancelledBiometric'
| 'selectingCredentialType'
| 'selectingIssuer'
| 'storing'
| 'verifyingCredential'
| {
downloadCredentials?: 'idle' | 'userCancelledBiometric';
performAuthorization?: 'idle' | 'userCancelledBiometric';
};
tags: never;
}
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
"done.invoke.checkInternet": { type: "done.invoke.checkInternet"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.displayIssuers:invocation[0]": { type: "done.invoke.issuersMachine.displayIssuers:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]": { type: "done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.downloadCredentials:invocation[0]": { type: "done.invoke.issuersMachine.downloadCredentials:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]": { type: "done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.generateKeyPair:invocation[0]": { type: "done.invoke.issuersMachine.generateKeyPair:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.performAuthorization:invocation[0]": { type: "done.invoke.issuersMachine.performAuthorization:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.storing:invocation[0]": { type: "done.invoke.issuersMachine.storing:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.issuersMachine.verifyingCredential:invocation[0]": { type: "done.invoke.issuersMachine.verifyingCredential:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"error.platform.checkInternet": { type: "error.platform.checkInternet"; data: unknown };
"error.platform.issuersMachine.displayIssuers:invocation[0]": { type: "error.platform.issuersMachine.displayIssuers:invocation[0]"; data: unknown };
"error.platform.issuersMachine.downloadCredentialTypes:invocation[0]": { type: "error.platform.issuersMachine.downloadCredentialTypes:invocation[0]"; data: unknown };
"error.platform.issuersMachine.downloadCredentials:invocation[0]": { type: "error.platform.issuersMachine.downloadCredentials:invocation[0]"; data: unknown };
"error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]": { type: "error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]"; data: unknown };
"error.platform.issuersMachine.performAuthorization:invocation[0]": { type: "error.platform.issuersMachine.performAuthorization:invocation[0]"; data: unknown };
"error.platform.issuersMachine.verifyingCredential:invocation[0]": { type: "error.platform.issuersMachine.verifyingCredential:invocation[0]"; data: unknown };
"xstate.init": { type: "xstate.init" };
};
invokeSrcNameMap: {
"checkInternet": "done.invoke.checkInternet";
"downloadCredential": "done.invoke.issuersMachine.downloadCredentials:invocation[0]";
"downloadCredentialTypes": "done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]";
"downloadIssuerWellknown": "done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]";
"downloadIssuersList": "done.invoke.issuersMachine.displayIssuers:invocation[0]";
"generateKeyPair": "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"invokeAuthorization": "done.invoke.issuersMachine.performAuthorization:invocation[0]";
"isUserSignedAlready": "done.invoke.issuersMachine.storing:invocation[0]";
"verifyCredential": "done.invoke.issuersMachine.verifyingCredential:invocation[0]";
};
missingImplementations: {
actions: "getKeyPairFromStore" | "loadKeyPair" | "logDownloaded" | "resetError" | "resetIsVerified" | "resetLoadingReason" | "resetSelectedCredentialType" | "resetVerificationErrorMessage" | "sendBackupEvent" | "sendDownloadingFailedToVcMeta" | "sendErrorEndEvent" | "sendImpressionEvent" | "sendSuccessEndEvent" | "setCredentialWrapper" | "setError" | "setIsVerified" | "setIssuers" | "setLoadingReasonAsDisplayIssuers" | "setLoadingReasonAsDownloadingCredentials" | "setLoadingReasonAsSettingUp" | "setMetadataInCredentialData" | "setNoInternet" | "setOIDCConfigError" | "setPrivateKey" | "setPublicKey" | "setSelectedCredentialType" | "setSelectedIssuerId" | "setSelectedIssuers" | "setSupportedCredentialTypes" | "setTokenResponse" | "setVCMetadata" | "setVerifiableCredential" | "storeKeyPair" | "storeVcMetaContext" | "storeVcsContext" | "storeVerifiableCredentialData" | "storeVerifiableCredentialMeta" | "updateIssuerFromWellknown" | "updateVerificationErrorMessage";
delays: never;
guards: "canSelectIssuerAgain" | "hasKeyPair" | "hasUserCancelledBiometric" | "isCustomSecureKeystore" | "isGenericError" | "isInternetConnected" | "isOIDCConfigError" | "isOIDCflowCancelled" | "isSignedIn" | "isVerificationPendingBecauseOfNetworkIssue" | "shouldFetchIssuersAgain";
services: "checkInternet" | "downloadCredential" | "downloadCredentialTypes" | "downloadIssuerWellknown" | "downloadIssuersList" | "generateKeyPair" | "invokeAuthorization" | "isUserSignedAlready" | "verifyCredential";
};
eventsCausingActions: {
"getKeyPairFromStore": "TRY_AGAIN" | "done.invoke.issuersMachine.performAuthorization:invocation[0]";
"loadKeyPair": "STORE_RESPONSE";
"logDownloaded": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"resetError": "RESET_ERROR" | "TRY_AGAIN" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
"resetIsVerified": "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"resetLoadingReason": "RESET_ERROR" | "done.invoke.checkInternet" | "done.invoke.issuersMachine.displayIssuers:invocation[0]" | "error.platform.issuersMachine.downloadCredentialTypes:invocation[0]" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"resetSelectedCredentialType": "CANCEL" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
"resetVerificationErrorMessage": "RESET_VERIFY_ERROR";
"sendBackupEvent": "done.invoke.issuersMachine.storing:invocation[0]";
"sendDownloadingFailedToVcMeta": "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
"sendErrorEndEvent": "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"sendImpressionEvent": "done.invoke.issuersMachine.displayIssuers:invocation[0]";
"sendSuccessEndEvent": "done.invoke.issuersMachine.verifyingCredential:invocation[0]";
"setCredentialWrapper": "done.invoke.issuersMachine.downloadCredentials:invocation[0]";
"setError": "error.platform.issuersMachine.displayIssuers:invocation[0]" | "error.platform.issuersMachine.downloadCredentialTypes:invocation[0]" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]";
"setIsVerified": "done.invoke.issuersMachine.verifyingCredential:invocation[0]";
"setIssuers": "done.invoke.issuersMachine.displayIssuers:invocation[0]";
"setLoadingReasonAsDisplayIssuers": "TRY_AGAIN";
"setLoadingReasonAsDownloadingCredentials": "STORE_ERROR" | "STORE_RESPONSE" | "TRY_AGAIN" | "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"setLoadingReasonAsSettingUp": "SELECTED_ISSUER" | "TRY_AGAIN" | "done.invoke.issuersMachine.performAuthorization:invocation[0]";
"setMetadataInCredentialData": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"setNoInternet": "done.invoke.checkInternet";
"setOIDCConfigError": "error.platform.issuersMachine.performAuthorization:invocation[0]";
"setPrivateKey": "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"setPublicKey": "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"setSelectedCredentialType": "SELECTED_CREDENTIAL_TYPE";
"setSelectedIssuerId": "SELECTED_ISSUER";
"setSelectedIssuers": "SELECTED_ISSUER";
"setSupportedCredentialTypes": "done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]";
"setTokenResponse": "done.invoke.issuersMachine.performAuthorization:invocation[0]";
"setVCMetadata": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"setVerifiableCredential": "done.invoke.issuersMachine.downloadCredentials:invocation[0]";
"storeKeyPair": "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"storeVcMetaContext": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"storeVcsContext": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"storeVerifiableCredentialData": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"storeVerifiableCredentialMeta": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"updateIssuerFromWellknown": "done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]";
"updateVerificationErrorMessage": "error.platform.issuersMachine.verifyingCredential:invocation[0]";
};
eventsCausingDelays: {
};
eventsCausingGuards: {
"canSelectIssuerAgain": "TRY_AGAIN";
"hasKeyPair": "CHECK_KEY_PAIR";
"hasUserCancelledBiometric": "error.platform.issuersMachine.downloadCredentials:invocation[0]";
"isCustomSecureKeystore": "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"isGenericError": "error.platform.issuersMachine.downloadCredentials:invocation[0]";
"isInternetConnected": "done.invoke.checkInternet";
"isOIDCConfigError": "error.platform.issuersMachine.performAuthorization:invocation[0]";
"isOIDCflowCancelled": "error.platform.issuersMachine.performAuthorization:invocation[0]";
"isSignedIn": "done.invoke.issuersMachine.storing:invocation[0]";
"isVerificationPendingBecauseOfNetworkIssue": "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"shouldFetchIssuersAgain": "TRY_AGAIN";
};
eventsCausingServices: {
"checkInternet": "SELECTED_CREDENTIAL_TYPE" | "done.invoke.issuersMachine.downloadCredentialTypes:invocation[0]";
"downloadCredential": "CHECK_KEY_PAIR" | "done.invoke.issuersMachine.generateKeyPair:invocation[0]";
"downloadCredentialTypes": "done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]";
"downloadIssuerWellknown": "SELECTED_ISSUER" | "TRY_AGAIN";
"downloadIssuersList": "CANCEL" | "TRY_AGAIN" | "xstate.init";
"generateKeyPair": "CHECK_KEY_PAIR";
"invokeAuthorization": "done.invoke.checkInternet";
"isUserSignedAlready": "done.invoke.issuersMachine.verifyingCredential:invocation[0]" | "error.platform.issuersMachine.verifyingCredential:invocation[0]";
"verifyCredential": "done.invoke.issuersMachine.downloadCredentials:invocation[0]";
};
matchesStates: "checkInternet" | "checkKeyPair" | "displayIssuers" | "done" | "downloadCredentialTypes" | "downloadCredentials" | "downloadCredentials.idle" | "downloadCredentials.userCancelledBiometric" | "downloadIssuerWellknown" | "error" | "generateKeyPair" | "handleVCVerificationFailure" | "idle" | "performAuthorization" | "performAuthorization.idle" | "performAuthorization.userCancelledBiometric" | "selectingCredentialType" | "selectingIssuer" | "storing" | "verifyingCredential" | { "downloadCredentials"?: "idle" | "userCancelledBiometric";
"performAuthorization"?: "idle" | "userCancelledBiometric"; };
tags: never;
}

View File

@@ -36,28 +36,22 @@ export const IssuersService = () => {
return await CACHED_API.fetchIssuers();
},
checkInternet: async () => await NetInfo.fetch(),
downloadIssuerConfig: async (context: any) => {
let issuersConfig = await CACHED_API.fetchIssuerConfig(
context.selectedIssuerId,
);
if (issuersConfig['.well-known']) {
const wellknownResponse = await CACHED_API.fetchIssuerWellknownConfig(
downloadIssuerWellknown: async (context: any) => {
const wellknownResponse = await CACHED_API.fetchIssuerWellknownConfig(
context.selectedIssuerId,
issuersConfig['.well-known'],
);
if (wellknownResponse) {
issuersConfig.credential_audience =
wellknownResponse.credential_issuer;
issuersConfig.credential_endpoint =
wellknownResponse.credential_endpoint;
issuersConfig.credentials_supported =
wellknownResponse.credentials_supported;
}
}
return issuersConfig;
return wellknownResponse;
},
downloadCredentialTypes: async (context: any) => {
return context.selectedIssuer.credentials_supported;
const credentialTypes = [];
for (const key in context.selectedIssuer
.credential_configurations_supported) {
credentialTypes.push(
context.selectedIssuer.credential_configurations_supported[key],
);
}
return credentialTypes;
},
downloadCredential: async (context: any) => {
const downloadTimeout = await vcDownloadTimeout();
@@ -93,13 +87,15 @@ export const IssuersService = () => {
TelemetryConstants.Screens.webViewPage,
),
);
return await authorize(
constructAuthorizationConfiguration(
context.selectedIssuer,
context.selectedCredentialType.scope,
),
);
},
return await authorize(
constructAuthorizationConfiguration(
context.selectedIssuer,
context.selectedCredentialType.scope,
),
);
},
generateKeyPair: async () => {
if (!isHardwareKeystoreExists) {
return await generateKeys();

View File

@@ -1,465 +1,142 @@
// 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-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]': {
type: 'done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromContext.fetchWellknown:invocation[0]': {
type: 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromContext.fetchWellknown:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]': {
type: 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]': {
type: 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload:invocation[0]': {
type: 'done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]': {
type: 'done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]': {
type: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]': {
type: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]': {
type: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]': {
type: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]': {
type: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'done.invoke.vc-item-machine.verifyState.verifyingCredential:invocation[0]': {
type: 'done.invoke.vc-item-machine.verifyState.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-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]': {
type: 'error.platform.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]';
data: unknown;
};
'error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]': {
type: 'error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]';
data: unknown;
};
'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]': {
type: 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]';
data: unknown;
};
'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]': {
type: 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]';
data: unknown;
};
'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]': {
type: 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]';
data: unknown;
};
'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]': {
type: 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]';
data: unknown;
};
'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]': {
type: 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
data: unknown;
};
'error.platform.vc-item-machine.verifyState.verifyingCredential:invocation[0]': {
type: 'error.platform.vc-item-machine.verifyState.verifyingCredential:invocation[0]';
data: unknown;
};
'xstate.after(500)#vc-item-machine.verifyState.verifyingCredential': {
type: 'xstate.after(500)#vc-item-machine.verifyState.verifyingCredential';
};
'xstate.init': {type: 'xstate.init'};
'xstate.stop': {type: 'xstate.stop'};
};
invokeSrcNameMap: {
addWalletBindingId: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]';
checkDownloadExpiryLimit: 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]';
checkStatus: 'done.invoke.checkStatus';
downloadCredential: 'done.invoke.downloadCredential';
fetchIssuerWellknown: 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromContext.fetchWellknown:invocation[0]';
generateKeyPair: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]';
isUserSignedAlready:
| 'done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload:invocation[0]';
loadDownloadLimitConfig: 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]';
requestBindingOTP:
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]';
updatePrivateKey: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
verifyCredential:
| 'done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]'
| 'done.invoke.vc-item-machine.verifyState.verifyingCredential:invocation[0]';
};
missingImplementations: {
actions:
| 'addVcToInProgressDownloads'
| 'closeViewVcModal'
| 'incrementDownloadCounter'
| 'logDownloaded'
| 'logRemovedVc'
| 'logWalletBindingFailure'
| 'logWalletBindingSuccess'
| 'refreshAllVcs'
| 'removeVcFromInProgressDownloads'
| 'removeVcItem'
| 'removeVcMetaDataFromStorage'
| 'removeVcMetaDataFromVcMachineContext'
| 'removeVerificationStatusFromVcMeta'
| 'requestVcContext'
| 'resetIsMachineInKebabPopupState'
| 'resetIsVerified'
| 'resetPrivateKey'
| 'resetVerificationStatus'
| 'sendActivationStartEvent'
| 'sendActivationSuccessEvent'
| 'sendBackupEvent'
| 'sendDownloadLimitExpire'
| 'sendDownloadingFailedToVcMeta'
| 'sendTelemetryEvents'
| 'sendUserCancelledActivationFailedEndEvent'
| 'sendVerificationError'
| 'sendVerificationStatusToVcMeta'
| 'sendWalletBindingErrorEvent'
| 'sendWalletBindingSuccess'
| 'setCommunicationDetails'
| 'setContext'
| 'setDownloadInterval'
| 'setErrorAsVerificationError'
| 'setErrorAsWalletBindingError'
| 'setIsVerified'
| 'setMaxDownloadCount'
| 'setOTP'
| 'setPinCard'
| 'setPrivateKey'
| 'setPublicKey'
| 'setThumbprintForWalletBindingId'
| 'setVcKey'
| 'setVcMetadata'
| 'setVerificationStatus'
| 'setWalletBindingResponse'
| 'showVerificationBannerStatus'
| 'storeContext'
| 'storeVcInContext'
| 'unSetBindingTransactionId'
| 'unSetError'
| 'unSetOTP'
| 'updateVcMetadata'
| 'updateWellknownResponse';
delays: never;
guards:
| 'hasCredential'
| 'hasCredentialAndWellknown'
| 'isCustomSecureKeystore'
| 'isDownloadAllowed'
| 'isSignedIn'
| 'isVerificationPendingBecauseOfNetworkIssue';
services:
| 'addWalletBindingId'
| 'checkDownloadExpiryLimit'
| 'checkStatus'
| 'downloadCredential'
| 'fetchIssuerWellknown'
| 'generateKeyPair'
| 'isUserSignedAlready'
| 'loadDownloadLimitConfig'
| 'requestBindingOTP'
| 'updatePrivateKey'
| 'verifyCredential';
};
eventsCausingActions: {
addVcToInProgressDownloads: 'GET_VC_RESPONSE';
closeViewVcModal: 'CLOSE_VC_MODAL' | 'STORE_RESPONSE';
incrementDownloadCounter:
| 'POLL'
| 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]';
logDownloaded: 'STORE_RESPONSE';
logRemovedVc:
| 'STORE_RESPONSE'
| 'done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]';
logWalletBindingFailure:
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
logWalletBindingSuccess:
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
refreshAllVcs:
| 'STORE_RESPONSE'
| 'done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]';
removeVcFromInProgressDownloads:
| 'STORE_RESPONSE'
| 'error.platform.downloadCredential'
| 'error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]';
removeVcItem: 'CONFIRM';
removeVcMetaDataFromStorage:
| 'STORE_ERROR'
| 'error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]';
removeVcMetaDataFromVcMachineContext: 'DISMISS';
removeVerificationStatusFromVcMeta: 'RESET_VERIFICATION_STATUS';
requestVcContext: 'DISMISS' | 'REFRESH' | 'STORE_ERROR' | 'xstate.init';
resetIsMachineInKebabPopupState:
| ''
| 'ADD_WALLET_BINDING_ID'
| 'CANCEL'
| 'CLOSE_VC_MODAL'
| 'DISMISS'
| 'REFRESH'
| 'REMOVE'
| 'SHOW_ACTIVITY'
| 'done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]'
| 'xstate.stop';
resetIsVerified:
| 'error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]'
| 'error.platform.vc-item-machine.verifyState.verifyingCredential:invocation[0]';
resetPrivateKey:
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
resetVerificationStatus:
| 'REMOVE_VERIFICATION_STATUS_BANNER'
| 'RESET_VERIFICATION_STATUS';
sendActivationStartEvent: 'CONFIRM';
sendActivationSuccessEvent:
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
sendBackupEvent:
| 'done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload:invocation[0]';
sendDownloadLimitExpire:
| 'FAILED'
| 'error.platform.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]';
sendDownloadingFailedToVcMeta: 'error.platform.downloadCredential';
sendTelemetryEvents: 'STORE_RESPONSE';
sendUserCancelledActivationFailedEndEvent: 'DISMISS';
sendVerificationError: 'STORE_RESPONSE';
sendVerificationStatusToVcMeta: 'STORE_RESPONSE';
sendWalletBindingErrorEvent:
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
sendWalletBindingSuccess: 'SHOW_BINDING_STATUS';
setCommunicationDetails:
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]';
setContext: 'CREDENTIAL_DOWNLOADED' | 'GET_VC_RESPONSE';
setDownloadInterval: 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]';
setErrorAsVerificationError: 'error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]';
setErrorAsWalletBindingError:
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
setIsVerified:
| 'done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]'
| 'done.invoke.vc-item-machine.verifyState.verifyingCredential:invocation[0]';
setMaxDownloadCount: 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]';
setOTP: 'INPUT_OTP';
setPinCard: 'PIN_CARD';
setPrivateKey: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]';
setPublicKey: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]';
setThumbprintForWalletBindingId:
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
setVcKey: 'REMOVE';
setVcMetadata: 'UPDATE_VC_METADATA';
setVerificationStatus:
| 'SET_VERIFICATION_STATUS'
| 'SHOW_VERIFICATION_STATUS_BANNER'
| 'STORE_RESPONSE';
setWalletBindingResponse: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]';
showVerificationBannerStatus:
| 'SHOW_VERIFICATION_STATUS_BANNER'
| 'STORE_RESPONSE'
| 'xstate.after(500)#vc-item-machine.verifyState.verifyingCredential';
storeContext:
| 'done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]'
| 'done.invoke.vc-item-machine.verifyState.verifyingCredential:invocation[0]'
| 'error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]'
| 'error.platform.vc-item-machine.verifyState.verifyingCredential:invocation[0]';
storeVcInContext:
| 'STORE_RESPONSE'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
unSetBindingTransactionId: 'DISMISS';
unSetError:
| 'CANCEL'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]';
unSetOTP:
| 'DISMISS'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]';
updateVcMetadata: 'PIN_CARD' | 'STORE_RESPONSE';
updateWellknownResponse: 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromContext.fetchWellknown:invocation[0]';
};
eventsCausingDelays: {};
eventsCausingGuards: {
hasCredential: 'GET_VC_RESPONSE';
hasCredentialAndWellknown: 'GET_VC_RESPONSE';
isCustomSecureKeystore:
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]';
isDownloadAllowed: 'POLL';
isSignedIn:
| 'done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]'
| 'done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload:invocation[0]';
isVerificationPendingBecauseOfNetworkIssue:
| 'error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]'
| 'error.platform.vc-item-machine.verifyState.verifyingCredential:invocation[0]';
};
eventsCausingServices: {
addWalletBindingId: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]';
checkDownloadExpiryLimit:
| 'POLL'
| 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]';
checkStatus: 'done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]';
downloadCredential: 'DOWNLOAD_READY';
fetchIssuerWellknown: 'GET_VC_RESPONSE';
generateKeyPair: 'INPUT_OTP';
isUserSignedAlready: 'STORE_RESPONSE';
loadDownloadLimitConfig: 'GET_VC_RESPONSE' | 'STORE_ERROR';
requestBindingOTP: 'CONFIRM' | 'RESEND_OTP';
updatePrivateKey: 'done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]';
verifyCredential: 'CREDENTIAL_DOWNLOADED' | 'VERIFY';
};
matchesStates:
| 'vcUtilitiesState'
| 'vcUtilitiesState.idle'
| 'vcUtilitiesState.kebabPopUp'
| 'vcUtilitiesState.kebabPopUp.idle'
| 'vcUtilitiesState.kebabPopUp.pinCard'
| 'vcUtilitiesState.kebabPopUp.removeWallet'
| 'vcUtilitiesState.kebabPopUp.removingVc'
| 'vcUtilitiesState.kebabPopUp.showActivities'
| 'vcUtilitiesState.kebabPopUp.triggerAutoBackup'
| 'vcUtilitiesState.loadVc'
| 'vcUtilitiesState.loadVc.loadVcFromContext'
| 'vcUtilitiesState.loadVc.loadVcFromContext.fetchWellknown'
| 'vcUtilitiesState.loadVc.loadVcFromContext.idle'
| 'vcUtilitiesState.loadVc.loadVcFromServer'
| 'vcUtilitiesState.loadVc.loadVcFromServer.checkingStatus'
| 'vcUtilitiesState.loadVc.loadVcFromServer.downloadingCredential'
| 'vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig'
| 'vcUtilitiesState.loadVc.loadVcFromServer.savingFailed'
| 'vcUtilitiesState.loadVc.loadVcFromServer.savingFailed.idle'
| 'vcUtilitiesState.loadVc.loadVcFromServer.savingFailed.viewingVc'
| 'vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry'
| 'vcUtilitiesState.verifyingCredential'
| 'vcUtilitiesState.verifyingCredential.handleVCVerificationFailure'
| 'vcUtilitiesState.verifyingCredential.idle'
| 'vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload'
| 'vcUtilitiesState.walletBinding'
| 'vcUtilitiesState.walletBinding.acceptingBindingOTP'
| 'vcUtilitiesState.walletBinding.acceptingBindingOTP.idle'
| 'vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP'
| 'vcUtilitiesState.walletBinding.addKeyPair'
| 'vcUtilitiesState.walletBinding.addingWalletBindingId'
| 'vcUtilitiesState.walletBinding.requestingBindingOTP'
| 'vcUtilitiesState.walletBinding.showBindingWarning'
| 'vcUtilitiesState.walletBinding.showingWalletBindingError'
| 'vcUtilitiesState.walletBinding.updatingContextVariables'
| 'vcUtilitiesState.walletBinding.updatingPrivateKey'
| 'verifyState'
| 'verifyState.idle'
| 'verifyState.verificationCompleted'
| 'verifyState.verifyingCredential'
| {
vcUtilitiesState?:
| 'idle'
| 'kebabPopUp'
| 'loadVc'
| 'verifyingCredential'
| 'walletBinding'
| {
kebabPopUp?:
| 'idle'
| 'pinCard'
| 'removeWallet'
| 'removingVc'
| 'showActivities'
| 'triggerAutoBackup';
loadVc?:
| 'loadVcFromContext'
| 'loadVcFromServer'
| {
loadVcFromContext?: 'fetchWellknown' | 'idle';
loadVcFromServer?:
| 'checkingStatus'
| 'downloadingCredential'
| 'loadDownloadLimitConfig'
| 'savingFailed'
| 'verifyingDownloadLimitExpiry'
| {savingFailed?: 'idle' | 'viewingVc'};
};
verifyingCredential?:
| 'handleVCVerificationFailure'
| 'idle'
| 'triggerAutoBackupForVcDownload';
walletBinding?:
| 'acceptingBindingOTP'
| 'addKeyPair'
| 'addingWalletBindingId'
| 'requestingBindingOTP'
| 'showBindingWarning'
| 'showingWalletBindingError'
| 'updatingContextVariables'
| 'updatingPrivateKey'
| {acceptingBindingOTP?: 'idle' | 'resendOTP'};
};
verifyState?: 'idle' | 'verificationCompleted' | 'verifyingCredential';
};
tags: never;
}
// 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-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]": { type: "done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromContext.fetchWellknown:invocation[0]": { type: "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromContext.fetchWellknown:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]": { type: "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]": { type: "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload:invocation[0]": { type: "done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]": { type: "done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]": { type: "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]": { type: "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]": { type: "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]": { type: "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]": { type: "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.vc-item-machine.verifyState.verifyingCredential:invocation[0]": { type: "done.invoke.vc-item-machine.verifyState.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-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]": { type: "error.platform.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]"; data: unknown };
"error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]": { type: "error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]"; data: unknown };
"error.platform.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]": { type: "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]"; data: unknown };
"error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]": { type: "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]"; data: unknown };
"error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]": { type: "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]"; data: unknown };
"error.platform.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]": { type: "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]"; data: unknown };
"error.platform.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]": { type: "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]"; data: unknown };
"error.platform.vc-item-machine.verifyState.verifyingCredential:invocation[0]": { type: "error.platform.vc-item-machine.verifyState.verifyingCredential:invocation[0]"; data: unknown };
"xstate.after(500)#vc-item-machine.verifyState.verifyingCredential": { type: "xstate.after(500)#vc-item-machine.verifyState.verifyingCredential" };
"xstate.init": { type: "xstate.init" };
"xstate.stop": { type: "xstate.stop" };
};
invokeSrcNameMap: {
"addWalletBindingId": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]";
"checkDownloadExpiryLimit": "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]";
"checkStatus": "done.invoke.checkStatus";
"downloadCredential": "done.invoke.downloadCredential";
"fetchIssuerWellknown": "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromContext.fetchWellknown:invocation[0]";
"generateKeyPair": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]";
"isUserSignedAlready": "done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload:invocation[0]";
"loadDownloadLimitConfig": "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]";
"requestBindingOTP": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]";
"updatePrivateKey": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]";
"verifyCredential": "done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]" | "done.invoke.vc-item-machine.verifyState.verifyingCredential:invocation[0]";
};
missingImplementations: {
actions: "addVcToInProgressDownloads" | "closeViewVcModal" | "incrementDownloadCounter" | "logDownloaded" | "logRemovedVc" | "logWalletBindingFailure" | "logWalletBindingSuccess" | "refreshAllVcs" | "removeVcFromInProgressDownloads" | "removeVcItem" | "removeVcMetaDataFromStorage" | "removeVcMetaDataFromVcMachineContext" | "removeVerificationStatusFromVcMeta" | "requestVcContext" | "resetIsMachineInKebabPopupState" | "resetIsVerified" | "resetPrivateKey" | "resetVerificationStatus" | "sendActivationStartEvent" | "sendActivationSuccessEvent" | "sendBackupEvent" | "sendDownloadLimitExpire" | "sendDownloadingFailedToVcMeta" | "sendTelemetryEvents" | "sendUserCancelledActivationFailedEndEvent" | "sendVerificationError" | "sendVerificationStatusToVcMeta" | "sendWalletBindingErrorEvent" | "sendWalletBindingSuccess" | "setCommunicationDetails" | "setContext" | "setDownloadInterval" | "setErrorAsVerificationError" | "setErrorAsWalletBindingError" | "setIsVerified" | "setMaxDownloadCount" | "setOTP" | "setPinCard" | "setPrivateKey" | "setPublicKey" | "setThumbprintForWalletBindingId" | "setVcKey" | "setVcMetadata" | "setVerificationStatus" | "setWalletBindingResponse" | "showVerificationBannerStatus" | "storeContext" | "storeVcInContext" | "unSetBindingTransactionId" | "unSetError" | "unSetOTP" | "updateVcMetadata" | "updateWellknownResponse";
delays: never;
guards: "hasCredential" | "hasCredentialAndWellknown" | "isCustomSecureKeystore" | "isDownloadAllowed" | "isSignedIn" | "isVerificationPendingBecauseOfNetworkIssue";
services: "addWalletBindingId" | "checkDownloadExpiryLimit" | "checkStatus" | "downloadCredential" | "fetchIssuerWellknown" | "generateKeyPair" | "isUserSignedAlready" | "loadDownloadLimitConfig" | "requestBindingOTP" | "updatePrivateKey" | "verifyCredential";
};
eventsCausingActions: {
"addVcToInProgressDownloads": "GET_VC_RESPONSE";
"closeViewVcModal": "CLOSE_VC_MODAL" | "STORE_RESPONSE";
"incrementDownloadCounter": "POLL" | "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]";
"logDownloaded": "STORE_RESPONSE";
"logRemovedVc": "STORE_RESPONSE" | "done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]";
"logWalletBindingFailure": "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]";
"logWalletBindingSuccess": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]";
"refreshAllVcs": "STORE_RESPONSE" | "done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]";
"removeVcFromInProgressDownloads": "STORE_RESPONSE" | "error.platform.downloadCredential" | "error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]";
"removeVcItem": "CONFIRM";
"removeVcMetaDataFromStorage": "STORE_ERROR" | "error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]";
"removeVcMetaDataFromVcMachineContext": "DISMISS";
"removeVerificationStatusFromVcMeta": "RESET_VERIFICATION_STATUS";
"requestVcContext": "DISMISS" | "REFRESH" | "STORE_ERROR" | "xstate.init";
"resetIsMachineInKebabPopupState": "" | "ADD_WALLET_BINDING_ID" | "CANCEL" | "CLOSE_VC_MODAL" | "DISMISS" | "REFRESH" | "REMOVE" | "SHOW_ACTIVITY" | "done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]" | "xstate.stop";
"resetIsVerified": "error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]" | "error.platform.vc-item-machine.verifyState.verifyingCredential:invocation[0]";
"resetPrivateKey": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]";
"resetVerificationStatus": "REMOVE_VERIFICATION_STATUS_BANNER" | "RESET_VERIFICATION_STATUS";
"sendActivationStartEvent": "CONFIRM";
"sendActivationSuccessEvent": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]";
"sendBackupEvent": "done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload:invocation[0]";
"sendDownloadLimitExpire": "FAILED" | "error.platform.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]";
"sendDownloadingFailedToVcMeta": "error.platform.downloadCredential";
"sendTelemetryEvents": "STORE_RESPONSE";
"sendUserCancelledActivationFailedEndEvent": "DISMISS";
"sendVerificationError": "STORE_RESPONSE";
"sendVerificationStatusToVcMeta": "STORE_RESPONSE";
"sendWalletBindingErrorEvent": "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]";
"sendWalletBindingSuccess": "SHOW_BINDING_STATUS";
"setCommunicationDetails": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]";
"setContext": "CREDENTIAL_DOWNLOADED" | "GET_VC_RESPONSE";
"setDownloadInterval": "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]";
"setErrorAsVerificationError": "error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]";
"setErrorAsWalletBindingError": "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]";
"setIsVerified": "done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]" | "done.invoke.vc-item-machine.verifyState.verifyingCredential:invocation[0]";
"setMaxDownloadCount": "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]";
"setOTP": "INPUT_OTP";
"setPinCard": "PIN_CARD";
"setPrivateKey": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]";
"setPublicKey": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]";
"setThumbprintForWalletBindingId": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]";
"setVcKey": "REMOVE";
"setVcMetadata": "UPDATE_VC_METADATA";
"setVerificationStatus": "SET_VERIFICATION_STATUS" | "SHOW_VERIFICATION_STATUS_BANNER" | "STORE_RESPONSE";
"setWalletBindingResponse": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]";
"showVerificationBannerStatus": "SHOW_VERIFICATION_STATUS_BANNER" | "STORE_RESPONSE" | "xstate.after(500)#vc-item-machine.verifyState.verifyingCredential";
"storeContext": "done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]" | "done.invoke.vc-item-machine.verifyState.verifyingCredential:invocation[0]" | "error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]" | "error.platform.vc-item-machine.verifyState.verifyingCredential:invocation[0]";
"storeVcInContext": "STORE_RESPONSE" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]";
"unSetBindingTransactionId": "DISMISS";
"unSetError": "CANCEL" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.updatingPrivateKey:invocation[0]";
"unSetOTP": "DISMISS" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.requestingBindingOTP:invocation[0]";
"updateVcMetadata": "PIN_CARD" | "STORE_RESPONSE";
"updateWellknownResponse": "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromContext.fetchWellknown:invocation[0]";
};
eventsCausingDelays: {
};
eventsCausingGuards: {
"hasCredential": "GET_VC_RESPONSE";
"hasCredentialAndWellknown": "GET_VC_RESPONSE";
"isCustomSecureKeystore": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]";
"isDownloadAllowed": "POLL";
"isSignedIn": "done.invoke.vc-item-machine.vcUtilitiesState.kebabPopUp.triggerAutoBackup:invocation[0]" | "done.invoke.vc-item-machine.vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload:invocation[0]";
"isVerificationPendingBecauseOfNetworkIssue": "error.platform.vc-item-machine.vcUtilitiesState.verifyingCredential:invocation[0]" | "error.platform.vc-item-machine.verifyState.verifyingCredential:invocation[0]";
};
eventsCausingServices: {
"addWalletBindingId": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addKeyPair:invocation[0]";
"checkDownloadExpiryLimit": "POLL" | "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig:invocation[0]";
"checkStatus": "done.invoke.vc-item-machine.vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry:invocation[0]";
"downloadCredential": "DOWNLOAD_READY";
"fetchIssuerWellknown": "GET_VC_RESPONSE";
"generateKeyPair": "INPUT_OTP";
"isUserSignedAlready": "STORE_RESPONSE";
"loadDownloadLimitConfig": "GET_VC_RESPONSE" | "STORE_ERROR";
"requestBindingOTP": "CONFIRM" | "RESEND_OTP";
"updatePrivateKey": "done.invoke.vc-item-machine.vcUtilitiesState.walletBinding.addingWalletBindingId:invocation[0]";
"verifyCredential": "CREDENTIAL_DOWNLOADED" | "VERIFY";
};
matchesStates: "vcUtilitiesState" | "vcUtilitiesState.idle" | "vcUtilitiesState.kebabPopUp" | "vcUtilitiesState.kebabPopUp.idle" | "vcUtilitiesState.kebabPopUp.pinCard" | "vcUtilitiesState.kebabPopUp.removeWallet" | "vcUtilitiesState.kebabPopUp.removingVc" | "vcUtilitiesState.kebabPopUp.showActivities" | "vcUtilitiesState.kebabPopUp.triggerAutoBackup" | "vcUtilitiesState.loadVc" | "vcUtilitiesState.loadVc.loadVcFromContext" | "vcUtilitiesState.loadVc.loadVcFromContext.fetchWellknown" | "vcUtilitiesState.loadVc.loadVcFromContext.idle" | "vcUtilitiesState.loadVc.loadVcFromServer" | "vcUtilitiesState.loadVc.loadVcFromServer.checkingStatus" | "vcUtilitiesState.loadVc.loadVcFromServer.downloadingCredential" | "vcUtilitiesState.loadVc.loadVcFromServer.loadDownloadLimitConfig" | "vcUtilitiesState.loadVc.loadVcFromServer.savingFailed" | "vcUtilitiesState.loadVc.loadVcFromServer.savingFailed.idle" | "vcUtilitiesState.loadVc.loadVcFromServer.savingFailed.viewingVc" | "vcUtilitiesState.loadVc.loadVcFromServer.verifyingDownloadLimitExpiry" | "vcUtilitiesState.verifyingCredential" | "vcUtilitiesState.verifyingCredential.handleVCVerificationFailure" | "vcUtilitiesState.verifyingCredential.idle" | "vcUtilitiesState.verifyingCredential.triggerAutoBackupForVcDownload" | "vcUtilitiesState.walletBinding" | "vcUtilitiesState.walletBinding.acceptingBindingOTP" | "vcUtilitiesState.walletBinding.acceptingBindingOTP.idle" | "vcUtilitiesState.walletBinding.acceptingBindingOTP.resendOTP" | "vcUtilitiesState.walletBinding.addKeyPair" | "vcUtilitiesState.walletBinding.addingWalletBindingId" | "vcUtilitiesState.walletBinding.requestingBindingOTP" | "vcUtilitiesState.walletBinding.showBindingWarning" | "vcUtilitiesState.walletBinding.showingWalletBindingError" | "vcUtilitiesState.walletBinding.updatingContextVariables" | "vcUtilitiesState.walletBinding.updatingPrivateKey" | "verifyState" | "verifyState.idle" | "verifyState.verificationCompleted" | "verifyState.verifyingCredential" | { "vcUtilitiesState"?: "idle" | "kebabPopUp" | "loadVc" | "verifyingCredential" | "walletBinding" | { "kebabPopUp"?: "idle" | "pinCard" | "removeWallet" | "removingVc" | "showActivities" | "triggerAutoBackup";
"loadVc"?: "loadVcFromContext" | "loadVcFromServer" | { "loadVcFromContext"?: "fetchWellknown" | "idle";
"loadVcFromServer"?: "checkingStatus" | "downloadingCredential" | "loadDownloadLimitConfig" | "savingFailed" | "verifyingDownloadLimitExpiry" | { "savingFailed"?: "idle" | "viewingVc"; }; };
"verifyingCredential"?: "handleVCVerificationFailure" | "idle" | "triggerAutoBackupForVcDownload";
"walletBinding"?: "acceptingBindingOTP" | "addKeyPair" | "addingWalletBindingId" | "requestingBindingOTP" | "showBindingWarning" | "showingWalletBindingError" | "updatingContextVariables" | "updatingPrivateKey" | { "acceptingBindingOTP"?: "idle" | "resendOTP"; }; };
"verifyState"?: "idle" | "verificationCompleted" | "verifyingCredential"; };
tags: never;
}

View File

@@ -121,7 +121,6 @@ export const VCItemServices = model => {
fetchIssuerWellknown: async context => {
const wellknownResponse = await CACHED_API.fetchIssuerWellknownConfig(
context.vcMetadata.issuer,
context.verifiableCredential.wellKnown,
true,
);
const wellknownOfCredential = getSelectedCredentialTypeDetails(

View File

@@ -1,114 +1,62 @@
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
'done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]': {
type: 'done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'xstate.init': {type: 'xstate.init'};
};
invokeSrcNameMap: {
isUserSignedAlready: 'done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]';
};
missingImplementations: {
actions:
| 'addVcToInProgressDownloads'
| 'getVcItemResponse'
| 'loadMyVcs'
| 'loadReceivedVcs'
| 'logTamperedVCsremoved'
| 'prependToMyVcsMetadata'
| 'removeDownloadFailedVcsFromStorage'
| 'removeDownloadingFailedVcsFromMyVcs'
| 'removeVcFromInProgressDownlods'
| 'removeVcFromMyVcsMetadata'
| 'resetDownloadCreadentialsFailed'
| 'resetDownloadFailedVcs'
| 'resetInProgressVcsDownloaded'
| 'resetTamperedVcs'
| 'resetVerificationErrorMessage'
| 'resetVerificationStatus'
| 'resetWalletBindingSuccess'
| 'sendBackupEvent'
| 'setDownloadCreadentialsFailed'
| 'setDownloadedVc'
| 'setDownloadingFailedVcs'
| 'setMyVcs'
| 'setReceivedVcs'
| 'setUpdatedVcMetadatas'
| 'setVerificationErrorMessage'
| 'setVerificationStatus'
| 'setWalletBindingSuccess'
| 'updateMyVcsMetadata';
delays: never;
guards: 'isAnyVcTampered' | 'isSignedIn';
services: 'isUserSignedAlready';
};
eventsCausingActions: {
addVcToInProgressDownloads: 'ADD_VC_TO_IN_PROGRESS_DOWNLOADS';
getVcItemResponse: 'GET_VC_ITEM';
loadMyVcs:
| 'REFRESH_MY_VCS'
| 'REFRESH_RECEIVED_VCS'
| 'STORE_RESPONSE'
| 'VERIFY_VC_FAILED'
| 'xstate.init';
loadReceivedVcs: 'REFRESH_RECEIVED_VCS' | 'STORE_RESPONSE';
logTamperedVCsremoved: 'done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]';
prependToMyVcsMetadata: 'VC_ADDED';
removeDownloadFailedVcsFromStorage: 'DELETE_VC';
removeDownloadingFailedVcsFromMyVcs: 'STORE_RESPONSE';
removeVcFromInProgressDownlods:
| 'DOWNLOAD_LIMIT_EXPIRED'
| 'REMOVE_VC_FROM_IN_PROGRESS_DOWNLOADS'
| 'VERIFY_VC_FAILED';
removeVcFromMyVcsMetadata: 'REMOVE_VC_FROM_CONTEXT';
resetDownloadCreadentialsFailed: 'RESET_DOWNLOADING_FAILED';
resetDownloadFailedVcs: 'STORE_RESPONSE';
resetInProgressVcsDownloaded: 'RESET_IN_PROGRESS_VCS_DOWNLOADED';
resetTamperedVcs: 'REMOVE_TAMPERED_VCS';
resetVerificationErrorMessage: 'RESET_VERIFY_ERROR';
resetVerificationStatus: 'RESET_VERIFICATION_STATUS';
resetWalletBindingSuccess: 'RESET_WALLET_BINDING_SUCCESS';
sendBackupEvent: 'done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]';
setDownloadCreadentialsFailed: 'VC_DOWNLOADING_FAILED';
setDownloadedVc: 'VC_DOWNLOADED';
setDownloadingFailedVcs: 'DOWNLOAD_LIMIT_EXPIRED';
setMyVcs: 'STORE_RESPONSE';
setReceivedVcs: 'STORE_RESPONSE';
setUpdatedVcMetadatas: 'VC_METADATA_UPDATED';
setVerificationErrorMessage: 'VERIFY_VC_FAILED';
setVerificationStatus: 'SET_VERIFICATION_STATUS';
setWalletBindingSuccess: 'WALLET_BINDING_SUCCESS';
updateMyVcsMetadata: 'VC_METADATA_UPDATED';
};
eventsCausingDelays: {};
eventsCausingGuards: {
isAnyVcTampered: 'SHOW_TAMPERED_POPUP';
isSignedIn: 'done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]';
};
eventsCausingServices: {
isUserSignedAlready: 'REMOVE_TAMPERED_VCS';
};
matchesStates:
| 'deletingFailedVcs'
| 'ready'
| 'ready.myVcs'
| 'ready.receivedVcs'
| 'ready.showTamperedPopup'
| 'ready.tamperedVCs'
| 'ready.tamperedVCs.idle'
| 'ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion'
| {
ready?:
| 'myVcs'
| 'receivedVcs'
| 'showTamperedPopup'
| 'tamperedVCs'
| {tamperedVCs?: 'idle' | 'triggerAutoBackupForTamperedVcDeletion'};
};
tags: never;
}
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
"done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]": { type: "done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"xstate.init": { type: "xstate.init" };
};
invokeSrcNameMap: {
"isUserSignedAlready": "done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]";
};
missingImplementations: {
actions: "addVcToInProgressDownloads" | "getVcItemResponse" | "loadMyVcs" | "loadReceivedVcs" | "logTamperedVCsremoved" | "prependToMyVcsMetadata" | "removeDownloadFailedVcsFromStorage" | "removeDownloadingFailedVcsFromMyVcs" | "removeVcFromInProgressDownlods" | "removeVcFromMyVcsMetadata" | "resetDownloadCreadentialsFailed" | "resetDownloadFailedVcs" | "resetInProgressVcsDownloaded" | "resetTamperedVcs" | "resetVerificationErrorMessage" | "resetVerificationStatus" | "resetWalletBindingSuccess" | "sendBackupEvent" | "setDownloadCreadentialsFailed" | "setDownloadedVc" | "setDownloadingFailedVcs" | "setMyVcs" | "setReceivedVcs" | "setUpdatedVcMetadatas" | "setVerificationErrorMessage" | "setVerificationStatus" | "setWalletBindingSuccess" | "updateMyVcsMetadata";
delays: never;
guards: "isAnyVcTampered" | "isSignedIn";
services: "isUserSignedAlready";
};
eventsCausingActions: {
"addVcToInProgressDownloads": "ADD_VC_TO_IN_PROGRESS_DOWNLOADS";
"getVcItemResponse": "GET_VC_ITEM";
"loadMyVcs": "REFRESH_MY_VCS" | "REFRESH_RECEIVED_VCS" | "STORE_RESPONSE" | "VERIFY_VC_FAILED" | "xstate.init";
"loadReceivedVcs": "REFRESH_RECEIVED_VCS" | "STORE_RESPONSE";
"logTamperedVCsremoved": "done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]";
"prependToMyVcsMetadata": "VC_ADDED";
"removeDownloadFailedVcsFromStorage": "DELETE_VC";
"removeDownloadingFailedVcsFromMyVcs": "STORE_RESPONSE";
"removeVcFromInProgressDownlods": "DOWNLOAD_LIMIT_EXPIRED" | "REMOVE_VC_FROM_IN_PROGRESS_DOWNLOADS" | "VERIFY_VC_FAILED";
"removeVcFromMyVcsMetadata": "REMOVE_VC_FROM_CONTEXT";
"resetDownloadCreadentialsFailed": "RESET_DOWNLOADING_FAILED";
"resetDownloadFailedVcs": "STORE_RESPONSE";
"resetInProgressVcsDownloaded": "RESET_IN_PROGRESS_VCS_DOWNLOADED";
"resetTamperedVcs": "REMOVE_TAMPERED_VCS";
"resetVerificationErrorMessage": "RESET_VERIFY_ERROR";
"resetVerificationStatus": "RESET_VERIFICATION_STATUS";
"resetWalletBindingSuccess": "RESET_WALLET_BINDING_SUCCESS";
"sendBackupEvent": "done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]";
"setDownloadCreadentialsFailed": "VC_DOWNLOADING_FAILED";
"setDownloadedVc": "VC_DOWNLOADED";
"setDownloadingFailedVcs": "DOWNLOAD_LIMIT_EXPIRED";
"setMyVcs": "STORE_RESPONSE";
"setReceivedVcs": "STORE_RESPONSE";
"setUpdatedVcMetadatas": "VC_METADATA_UPDATED";
"setVerificationErrorMessage": "VERIFY_VC_FAILED";
"setVerificationStatus": "SET_VERIFICATION_STATUS";
"setWalletBindingSuccess": "WALLET_BINDING_SUCCESS";
"updateMyVcsMetadata": "VC_METADATA_UPDATED";
};
eventsCausingDelays: {
};
eventsCausingGuards: {
"isAnyVcTampered": "SHOW_TAMPERED_POPUP";
"isSignedIn": "done.invoke.vcMeta.ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion:invocation[0]";
};
eventsCausingServices: {
"isUserSignedAlready": "REMOVE_TAMPERED_VCS";
};
matchesStates: "deletingFailedVcs" | "ready" | "ready.myVcs" | "ready.receivedVcs" | "ready.showTamperedPopup" | "ready.tamperedVCs" | "ready.tamperedVCs.idle" | "ready.tamperedVCs.triggerAutoBackupForTamperedVcDeletion" | { "ready"?: "myVcs" | "receivedVcs" | "showTamperedPopup" | "tamperedVCs" | { "tamperedVCs"?: "idle" | "triggerAutoBackupForTamperedVcDeletion"; }; };
tags: never;
}

View File

@@ -62,7 +62,6 @@ export interface Credential {
export interface VerifiableCredential {
issuerLogo: logoType;
format: string;
credential: Credential;
wellKnown: string;
credentialTypes: Object[];
@@ -89,7 +88,7 @@ export interface CredentialTypes {
id: string;
scope: string;
display: [displayType];
proof_types_supported: [string];
proof_types_supported: Object;
credential_definition: {
type: Object[];
credentialSubject: CredentialSubject;
@@ -99,7 +98,7 @@ export interface CredentialTypes {
export interface IssuerWellknownResponse {
credential_issuer: string;
credential_endpoint: string;
credentials_supported: Object[];
credential_configurations_supported: Object;
}
export interface VCLabel {

View File

@@ -1,78 +1,55 @@
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
'xstate.init': {type: 'xstate.init'};
};
invokeSrcNameMap: {
checkFocusState: 'done.invoke.app.ready.focus:invocation[0]';
checkNetworkState: 'done.invoke.app.ready.network:invocation[0]';
getAppInfo: 'done.invoke.app.init.info:invocation[0]';
};
missingImplementations: {
actions: never;
delays: never;
guards: never;
services: never;
};
eventsCausingActions: {
forwardToServices: 'ACTIVE' | 'INACTIVE' | 'OFFLINE' | 'ONLINE';
loadCredentialRegistryHostFromStorage: 'READY';
loadCredentialRegistryInConstants: 'STORE_RESPONSE';
loadEsignetHostFromConstants: 'STORE_RESPONSE';
loadEsignetHostFromStorage: 'READY';
logServiceEvents: 'READY';
logStoreEvents:
| 'KEY_INVALIDATE_ERROR'
| 'RESET_KEY_INVALIDATE_ERROR_DISMISS'
| 'xstate.init';
requestDeviceInfo: 'REQUEST_DEVICE_INFO';
resetKeyInvalidateError: 'READY' | 'RESET_KEY_INVALIDATE_ERROR_DISMISS';
setAppInfo: 'APP_INFO_RECEIVED';
setIsDecryptError: 'DECRYPT_ERROR';
setIsReadError: 'ERROR';
spawnServiceActors: 'READY';
spawnStoreActor:
| 'KEY_INVALIDATE_ERROR'
| 'RESET_KEY_INVALIDATE_ERROR_DISMISS'
| 'xstate.init';
unsetIsDecryptError: 'DECRYPT_ERROR_DISMISS' | 'READY';
unsetIsReadError: 'READY';
updateKeyInvalidateError: 'ERROR' | 'KEY_INVALIDATE_ERROR';
};
eventsCausingDelays: {};
eventsCausingGuards: {};
eventsCausingServices: {
checkFocusState: 'APP_INFO_RECEIVED';
checkNetworkState: 'APP_INFO_RECEIVED';
getAppInfo: 'STORE_RESPONSE';
};
matchesStates:
| 'init'
| 'init.credentialRegistry'
| 'init.info'
| 'init.services'
| 'init.store'
| 'ready'
| 'ready.focus'
| 'ready.focus.active'
| 'ready.focus.checking'
| 'ready.focus.inactive'
| 'ready.network'
| 'ready.network.checking'
| 'ready.network.offline'
| 'ready.network.online'
| 'waiting'
| {
init?: 'credentialRegistry' | 'info' | 'services' | 'store';
ready?:
| 'focus'
| 'network'
| {
focus?: 'active' | 'checking' | 'inactive';
network?: 'checking' | 'offline' | 'online';
};
};
tags: never;
}
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
"xstate.init": { type: "xstate.init" };
};
invokeSrcNameMap: {
"checkFocusState": "done.invoke.app.ready.focus:invocation[0]";
"checkNetworkState": "done.invoke.app.ready.network:invocation[0]";
"getAppInfo": "done.invoke.app.init.info:invocation[0]";
};
missingImplementations: {
actions: never;
delays: never;
guards: never;
services: never;
};
eventsCausingActions: {
"forwardToServices": "ACTIVE" | "INACTIVE" | "OFFLINE" | "ONLINE";
"loadCredentialRegistryHostFromStorage": "READY";
"loadCredentialRegistryInConstants": "STORE_RESPONSE";
"loadEsignetHostFromConstants": "STORE_RESPONSE";
"loadEsignetHostFromStorage": "READY";
"logServiceEvents": "READY";
"logStoreEvents": "KEY_INVALIDATE_ERROR" | "RESET_KEY_INVALIDATE_ERROR_DISMISS" | "xstate.init";
"requestDeviceInfo": "REQUEST_DEVICE_INFO";
"resetKeyInvalidateError": "READY" | "RESET_KEY_INVALIDATE_ERROR_DISMISS";
"setAppInfo": "APP_INFO_RECEIVED";
"setIsDecryptError": "DECRYPT_ERROR";
"setIsReadError": "ERROR";
"spawnServiceActors": "READY";
"spawnStoreActor": "KEY_INVALIDATE_ERROR" | "RESET_KEY_INVALIDATE_ERROR_DISMISS" | "xstate.init";
"unsetIsDecryptError": "DECRYPT_ERROR_DISMISS" | "READY";
"unsetIsReadError": "READY";
"updateKeyInvalidateError": "ERROR" | "KEY_INVALIDATE_ERROR";
};
eventsCausingDelays: {
};
eventsCausingGuards: {
};
eventsCausingServices: {
"checkFocusState": "APP_INFO_RECEIVED";
"checkNetworkState": "APP_INFO_RECEIVED";
"getAppInfo": "STORE_RESPONSE";
};
matchesStates: "init" | "init.credentialRegistry" | "init.info" | "init.services" | "init.store" | "ready" | "ready.focus" | "ready.focus.active" | "ready.focus.checking" | "ready.focus.inactive" | "ready.network" | "ready.network.checking" | "ready.network.offline" | "ready.network.online" | "waiting" | { "init"?: "credentialRegistry" | "info" | "services" | "store";
"ready"?: "focus" | "network" | { "focus"?: "active" | "checking" | "inactive";
"network"?: "checking" | "offline" | "online"; }; };
tags: never;
}

View File

@@ -1,78 +1,48 @@
// 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: {
forwardStoreRequest:
| 'APPEND'
| 'CLEAR'
| 'EXPORT'
| 'FETCH_ALL_WELLKNOWN_CONFIG'
| 'GET'
| 'GET_VCS_DATA'
| 'PREPEND'
| 'REMOVE'
| 'REMOVE_ITEMS'
| 'REMOVE_VC_METADATA'
| 'RESTORE_BACKUP'
| '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;
}
// 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: {
"forwardStoreRequest": "APPEND" | "CLEAR" | "EXPORT" | "FETCH_ALL_WELLKNOWN_CONFIG" | "GET" | "GET_VCS_DATA" | "PREPEND" | "REMOVE" | "REMOVE_ITEMS" | "REMOVE_VC_METADATA" | "RESTORE_BACKUP" | "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;
}

View File

@@ -1,65 +1,40 @@
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
'done.invoke.HomeScreen.tabs.checkStorage:invocation[0]': {
type: 'done.invoke.HomeScreen.tabs.checkStorage:invocation[0]';
data: unknown;
__tip: 'See the XState TS docs to learn how to strongly type this.';
};
'xstate.after(100)#HomeScreen.tabs.init': {
type: 'xstate.after(100)#HomeScreen.tabs.init';
};
'xstate.init': {type: 'xstate.init'};
};
invokeSrcNameMap: {
checkStorageAvailability: 'done.invoke.HomeScreen.tabs.checkStorage:invocation[0]';
};
missingImplementations: {
actions: never;
delays: never;
guards: never;
services: never;
};
eventsCausingActions: {
resetSelectedVc: 'DISMISS_MODAL' | 'xstate.init';
sendAddEvent: 'DOWNLOAD_ID';
setSelectedVc: 'VIEW_VC';
spawnTabActors: 'xstate.init';
};
eventsCausingDelays: {};
eventsCausingGuards: {
isMinimumStorageLimitReached: 'done.invoke.HomeScreen.tabs.checkStorage:invocation[0]';
};
eventsCausingServices: {
checkStorageAvailability: 'GOTO_ISSUERS';
issuersMachine: 'done.invoke.HomeScreen.tabs.checkStorage:invocation[0]';
};
matchesStates:
| 'modals'
| 'modals.none'
| 'modals.viewingVc'
| 'tabs'
| 'tabs.checkStorage'
| 'tabs.gotoIssuers'
| 'tabs.history'
| 'tabs.idle'
| 'tabs.init'
| 'tabs.myVcs'
| 'tabs.receivedVcs'
| 'tabs.storageLimitReached'
| {
modals?: 'none' | 'viewingVc';
tabs?:
| 'checkStorage'
| 'gotoIssuers'
| 'history'
| 'idle'
| 'init'
| 'myVcs'
| 'receivedVcs'
| 'storageLimitReached';
};
tags: never;
}
// This file was automatically generated. Edits will be overwritten
export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
"done.invoke.HomeScreen.tabs.checkStorage:invocation[0]": { type: "done.invoke.HomeScreen.tabs.checkStorage:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"xstate.after(100)#HomeScreen.tabs.init": { type: "xstate.after(100)#HomeScreen.tabs.init" };
"xstate.init": { type: "xstate.init" };
};
invokeSrcNameMap: {
"checkStorageAvailability": "done.invoke.HomeScreen.tabs.checkStorage:invocation[0]";
};
missingImplementations: {
actions: never;
delays: never;
guards: never;
services: never;
};
eventsCausingActions: {
"resetSelectedVc": "DISMISS_MODAL" | "xstate.init";
"sendAddEvent": "DOWNLOAD_ID";
"setSelectedVc": "VIEW_VC";
"spawnTabActors": "xstate.init";
};
eventsCausingDelays: {
};
eventsCausingGuards: {
"isMinimumStorageLimitReached": "done.invoke.HomeScreen.tabs.checkStorage:invocation[0]";
};
eventsCausingServices: {
"checkStorageAvailability": "GOTO_ISSUERS";
"issuersMachine": "done.invoke.HomeScreen.tabs.checkStorage:invocation[0]";
};
matchesStates: "modals" | "modals.none" | "modals.viewingVc" | "tabs" | "tabs.checkStorage" | "tabs.gotoIssuers" | "tabs.history" | "tabs.idle" | "tabs.init" | "tabs.myVcs" | "tabs.receivedVcs" | "tabs.storageLimitReached" | { "modals"?: "none" | "viewingVc";
"tabs"?: "checkStorage" | "gotoIssuers" | "history" | "idle" | "init" | "myVcs" | "receivedVcs" | "storageLimitReached"; };
tags: never;
}

View File

@@ -1,32 +1,32 @@
import React, {useEffect, useState} from 'react';
import {Row} from '../../components/ui';
import {Modal} from '../../components/ui/Modal';
import {MessageOverlay} from '../../components/MessageOverlay';
import {ToastItem} from '../../components/ui/ToastItem';
import {useViewVcModal, ViewVcModalProps} from './ViewVcModalController';
import {useTranslation} from 'react-i18next';
import {OtpVerificationModal} from './MyVcs/OtpVerificationModal';
import {BindingVcWarningOverlay} from './MyVcs/BindingVcWarningOverlay';
import {VcDetailsContainer} from '../../components/VC/VcDetailsContainer';
import {TelemetryConstants} from '../../shared/telemetry/TelemetryConstants';
import {BannerNotificationContainer} from '../../components/BannerNotificationContainer';
import {Icon} from 'react-native-elements';
import {Theme} from '../../components/ui/styleUtils';
import React, { useEffect, useState } from 'react';
import { Row } from '../../components/ui';
import { Modal } from '../../components/ui/Modal';
import { MessageOverlay } from '../../components/MessageOverlay';
import { ToastItem } from '../../components/ui/ToastItem';
import { useViewVcModal, ViewVcModalProps } from './ViewVcModalController';
import { useTranslation } from 'react-i18next';
import { OtpVerificationModal } from './MyVcs/OtpVerificationModal';
import { BindingVcWarningOverlay } from './MyVcs/BindingVcWarningOverlay';
import { VcDetailsContainer } from '../../components/VC/VcDetailsContainer';
import { TelemetryConstants } from '../../shared/telemetry/TelemetryConstants';
import { BannerNotificationContainer } from '../../components/BannerNotificationContainer';
import { Icon } from 'react-native-elements';
import { Theme } from '../../components/ui/styleUtils';
import testIDProps from '../../shared/commonUtil';
import {HelpScreen} from '../../components/HelpScreen';
import {Pressable} from 'react-native';
import {KebabPopUp} from '../../components/KebabPopUp';
import {SvgImage} from '../../components/ui/svg';
import {VCMetadata} from '../../shared/VCMetadata';
import {WalletBinding} from './MyVcs/WalletBinding';
import {RemoveVcWarningOverlay} from './MyVcs/RemoveVcWarningOverlay';
import {HistoryTab} from './MyVcs/HistoryTab';
import {getDetailedViewFields} from '../../shared/openId4VCI/Utils';
import { HelpScreen } from '../../components/HelpScreen';
import { Pressable } from 'react-native';
import { KebabPopUp } from '../../components/KebabPopUp';
import { SvgImage } from '../../components/ui/svg';
import { VCMetadata } from '../../shared/VCMetadata';
import { WalletBinding } from './MyVcs/WalletBinding';
import { RemoveVcWarningOverlay } from './MyVcs/RemoveVcWarningOverlay';
import { HistoryTab } from './MyVcs/HistoryTab';
import { getDetailedViewFields } from '../../shared/openId4VCI/Utils';
import {
DETAIL_VIEW_DEFAULT_FIELDS,
isVCLoaded,
} from '../../components/VC/common/VCUtils';
import {ActivityIndicator} from '../../components/ui/ActivityIndicator';
import { ActivityIndicator } from '../../components/ui/ActivityIndicator';
import ShimmerPlaceholder from 'react-native-shimmer-placeholder';
import LinearGradient from 'react-native-linear-gradient';
import {
@@ -35,7 +35,7 @@ import {
} from '../../components/BannerNotification';
export const ViewVcModal: React.FC<ViewVcModalProps> = props => {
const {t} = useTranslation('ViewVcModal');
const { t } = useTranslation('ViewVcModal');
const controller = useViewVcModal(props);
const profileImage = controller.verifiableCredentialData.face;
const verificationStatus = controller.verificationStatus;
@@ -47,7 +47,7 @@ export const ViewVcModal: React.FC<ViewVcModalProps> = props => {
!controller.verifiableCredentialData.vcMetadata.isVerified &&
!controller.isVerificationInProgress
) {
props.vcItemActor.send({type: 'VERIFY'});
props.vcItemActor.send({ type: 'VERIFY' });
}
}, [controller.verifiableCredentialData.vcMetadata.isVerified]);
@@ -59,7 +59,6 @@ export const ViewVcModal: React.FC<ViewVcModalProps> = props => {
useEffect(() => {
getDetailedViewFields(
verifiableCredentialData?.issuer,
verifiableCredentialData?.wellKnown,
verifiableCredentialData?.credentialTypes,
DETAIL_VIEW_DEFAULT_FIELDS,
).then(response => {
@@ -105,7 +104,7 @@ export const ViewVcModal: React.FC<ViewVcModalProps> = props => {
LinearGradient={LinearGradient}
width={35}
height={35}
style={{borderRadius: 5, marginLeft: 2}}
style={Theme.Styles.shimmer}
/>
)}
</Row>

View File

@@ -1,20 +1,20 @@
import React, {useEffect, useState} from 'react';
import {useTranslation} from 'react-i18next';
import {DeviceInfoList} from '../../components/DeviceInfoList';
import {Button, Column, Text} from '../../components/ui';
import {Theme} from '../../components/ui/styleUtils';
import {useReceiveVcScreen} from './ReceiveVcScreenController';
import {VerifyIdentityOverlay} from '../VerifyIdentityOverlay';
import {MessageOverlay} from '../../components/MessageOverlay';
import {useOverlayVisibleAfterTimeout} from '../../shared/hooks/useOverlayVisibleAfterTimeout';
import {VcDetailsContainer} from '../../components/VC/VcDetailsContainer';
import {SharingStatusModal} from '../Scan/SharingStatusModal';
import {SvgImage} from '../../components/ui/svg';
import {DETAIL_VIEW_DEFAULT_FIELDS} from '../../components/VC/common/VCUtils';
import {getDetailedViewFields} from '../../shared/openId4VCI/Utils';
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { DeviceInfoList } from '../../components/DeviceInfoList';
import { Button, Column, Text } from '../../components/ui';
import { Theme } from '../../components/ui/styleUtils';
import { useReceiveVcScreen } from './ReceiveVcScreenController';
import { VerifyIdentityOverlay } from '../VerifyIdentityOverlay';
import { MessageOverlay } from '../../components/MessageOverlay';
import { useOverlayVisibleAfterTimeout } from '../../shared/hooks/useOverlayVisibleAfterTimeout';
import { VcDetailsContainer } from '../../components/VC/VcDetailsContainer';
import { SharingStatusModal } from '../Scan/SharingStatusModal';
import { SvgImage } from '../../components/ui/svg';
import { DETAIL_VIEW_DEFAULT_FIELDS } from '../../components/VC/common/VCUtils';
import { getDetailedViewFields } from '../../shared/openId4VCI/Utils';
export const ReceiveVcScreen: React.FC = () => {
const {t} = useTranslation('ReceiveVcScreen');
const { t } = useTranslation('ReceiveVcScreen');
const [fields, setFields] = useState([]);
const [wellknown, setWellknown] = useState(null);
const controller = useReceiveVcScreen();
@@ -27,7 +27,6 @@ export const ReceiveVcScreen: React.FC = () => {
useEffect(() => {
getDetailedViewFields(
verifiableCredentialData?.issuer,
verifiableCredentialData?.wellKnown,
verifiableCredentialData?.credentialTypes,
DETAIL_VIEW_DEFAULT_FIELDS,
).then(response => {

View File

@@ -29,7 +29,8 @@ export const API_URLS: ApiUrls = {
},
issuerWellknownConfig: {
method: 'GET',
buildURL: (requestUrl: `/${string}`): `/${string}` => requestUrl,
buildURL: (issuerId: string): `/${string}` =>
`/v1/mimoto/issuers/${issuerId}/.well-known`,
},
allProperties: {
method: 'GET',
@@ -105,10 +106,10 @@ export const API = {
);
return response.response;
},
fetchIssuerWellknownConfig: async (requestUrl: string) => {
fetchIssuerWellknownConfig: async (issuerId: string) => {
const response = await request(
API_URLS.issuerWellknownConfig.method,
API_URLS.issuerWellknownConfig.buildURL(requestUrl),
API_URLS.issuerWellknownConfig.buildURL(issuerId),
);
return response;
},
@@ -142,13 +143,12 @@ export const CACHED_API = {
}),
fetchIssuerWellknownConfig: (
issuerId: string,
requestUrl: string,
isCachePreferred: boolean = false,
) =>
generateCacheAPIFunction({
isCachePreferred,
cacheKey: API_CACHED_STORAGE_KEYS.fetchIssuerWellknownConfig(issuerId),
fetchCall: API.fetchIssuerWellknownConfig.bind(null, requestUrl),
fetchCall: API.fetchIssuerWellknownConfig.bind(null, issuerId),
}),
getAllProperties: (isCachePreferred: boolean) =>

View File

@@ -136,7 +136,8 @@ export const constructAuthorizationConfiguration = (
redirectUrl: selectedIssuer.redirect_uri,
additionalParameters: {ui_locales: i18n.language},
serviceConfiguration: {
authorizationEndpoint: selectedIssuer.authorization_endpoint,
authorizationEndpoint:
selectedIssuer.authorization_servers[0] + '/authorize',
tokenEndpoint: selectedIssuer.token_endpoint,
},
};
@@ -171,9 +172,9 @@ export const getSelectedCredentialTypeDetails = (
wellknown: any,
vcCredentialTypes: Object[],
): Object => {
for (let credential in wellknown.credentials_supported) {
const credentialDetails = wellknown.credentials_supported[credential];
for (let credential in wellknown.credential_configurations_supported) {
const credentialDetails =
wellknown.credential_configurations_supported[credential];
if (
JSON.stringify(credentialDetails.credential_definition.type) ===
JSON.stringify(vcCredentialTypes)
@@ -195,30 +196,24 @@ export const getSelectedCredentialTypeDetails = (
};
export const getCredentialIssuersWellKnownConfig = async (
issuer: string,
wellknown: string,
vcCredentialTypes: Object[],
issuer: string | undefined,
vcCredentialTypes: Object[] | undefined,
defaultFields: string[],
) => {
let fields: string[] = defaultFields;
let credentialDetails: any;
if (wellknown) {
const response = await CACHED_API.fetchIssuerWellknownConfig(
issuer,
wellknown,
const response = await CACHED_API.fetchIssuerWellknownConfig(issuer!);
if (response) {
credentialDetails = getSelectedCredentialTypeDetails(
response,
vcCredentialTypes!,
);
if (response) {
credentialDetails = getSelectedCredentialTypeDetails(
response,
vcCredentialTypes,
if (Object.keys(credentialDetails).includes('order')) {
fields = credentialDetails.order;
} else {
fields = Object.keys(
credentialDetails.credential_definition.credentialSubject,
);
if (Object.keys(credentialDetails).includes('order')) {
fields = credentialDetails.order;
} else {
fields = Object.keys(
credentialDetails.credential_definition.credentialSubject,
);
}
}
}
return {
@@ -229,13 +224,11 @@ export const getCredentialIssuersWellKnownConfig = async (
export const getDetailedViewFields = async (
issuer: string,
wellknown: string,
vcCredentialTypes: Object[],
defaultFields: string[],
) => {
let response = await getCredentialIssuersWellKnownConfig(
issuer,
wellknown,
vcCredentialTypes,
defaultFields,
);