mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-10 05:58:01 -05:00
* [INJIMOB-3392] add token request logic in wallet for vci flow Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] chore: update integration of VCIClient native module Changes are updated as per new changes in the library Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3390] refactor: event structure of token request Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3392] fix tokenEndpoint method and refactorings Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] cnonce decode from accesstoken and credential response destructuring fix Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3390] add: getIssuerMetadata in kotlin NativeModule Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3393] fix: auth callback in android Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3390] fix: proofJwt issue in download flow Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> * [INJIMOB-3392] fix credentialofferflow Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392]fix format issues in bridge layer Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392]fix activity log texts on application reopen Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392]cache issuer metadata by key: issuerhost Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] fix error scenarios and cleanup issuermachine Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] refactor request method to handle missing error scenarios Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] fix max lines for txcode description to 2 Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] rename credentialissueruri to credentialissuer Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] take cnonce from outside accesstoken Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] declare random-values at entry file Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] set fallback keytype to user priority first Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] add locales for network request failed error Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] remove console log Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-3392] refactor and clean up code Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> --------- Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com> Co-authored-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
107 lines
2.7 KiB
TypeScript
107 lines
2.7 KiB
TypeScript
import {ErrorMessage} from '../../shared/openId4VCI/Utils';
|
|
import {StateFrom} from 'xstate';
|
|
import {IssuersMachine} from './IssuersMachine';
|
|
|
|
type State = StateFrom<typeof IssuersMachine>;
|
|
|
|
export function selectIssuers(state: State) {
|
|
return state.context.issuers;
|
|
}
|
|
|
|
export function selectSelectedIssuer(state: State) {
|
|
return state.context.selectedIssuer;
|
|
}
|
|
|
|
export function selectAuthWebViewStatus(state: State) {
|
|
return state.context.authEndpointToOpen;
|
|
}
|
|
|
|
export function selectAuthEndPoint(state: State) {
|
|
return state.context.authEndpoint;
|
|
}
|
|
|
|
export function selectErrorMessageType(state: State) {
|
|
return state.context.errorMessage;
|
|
}
|
|
|
|
export function selectLoadingReason(state: State) {
|
|
return state.context.loadingReason;
|
|
}
|
|
|
|
export function selectIsDownloadCredentials(state: State) {
|
|
return state.matches('downloadCredentials');
|
|
}
|
|
|
|
export function selectIsTxCodeRequested(state: State) {
|
|
return state.context.isTransactionCodeRequested;
|
|
}
|
|
|
|
export function selectIsConsentRequested(state: State) {
|
|
return state.context.isConsentRequested;
|
|
}
|
|
export function selectIssuerLogo(state: State) {
|
|
return state.context.issuerLogo;
|
|
}
|
|
|
|
export function selectIssuerName(state: State) {
|
|
return state.context.issuerName;
|
|
}
|
|
|
|
export function selectTxCodeDisplayDetails(state: State) {
|
|
const context = state.context;
|
|
return {
|
|
inputMode: context.txCodeInputMode,
|
|
description: context.txCodeDescription,
|
|
length: context.txCodeLength,
|
|
};
|
|
}
|
|
|
|
export function selectIsBiometricCancelled(state: State) {
|
|
return (
|
|
state.matches('downloadCredentials.userCancelledBiometric') ||
|
|
state.matches('downloadCredentials.keyManagement.userCancelledBiometric') ||
|
|
state.matches(
|
|
'credentialDownloadFromOffer.keyManagement.userCancelledBiometric',
|
|
)
|
|
);
|
|
}
|
|
|
|
export function selectIsNonGenericError(state: State) {
|
|
return (
|
|
state.context.errorMessage !== ErrorMessage.GENERIC &&
|
|
state.context.errorMessage !== ''
|
|
);
|
|
}
|
|
|
|
export function selectIsDone(state: State) {
|
|
return state.matches('done');
|
|
}
|
|
|
|
export function selectIsIdle(state: State) {
|
|
return state.matches('idle');
|
|
}
|
|
|
|
export function selectStoring(state: State) {
|
|
return state.matches('storing');
|
|
}
|
|
|
|
export function selectIsError(state: State) {
|
|
return state.matches('error');
|
|
}
|
|
|
|
export function selectVerificationErrorMessage(state: State) {
|
|
return state.context.verificationErrorMessage;
|
|
}
|
|
|
|
export function selectSelectingCredentialType(state: State) {
|
|
return state.matches('selectingCredentialType');
|
|
}
|
|
|
|
export function selectSupportedCredentialTypes(state: State) {
|
|
return state.context.supportedCredentialTypes;
|
|
}
|
|
|
|
export function selectIsQrScanning(state: State) {
|
|
return state.matches('waitingForQrScan');
|
|
}
|