diff --git a/machines/Issuers/IssuersMachine.typegen.ts b/machines/Issuers/IssuersMachine.typegen.ts index e8260fc2..48bce5ea 100644 --- a/machines/Issuers/IssuersMachine.typegen.ts +++ b/machines/Issuers/IssuersMachine.typegen.ts @@ -1,357 +1,130 @@ -// 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.checkKeyPair:invocation[0]': { - type: 'done.invoke.issuersMachine.checkKeyPair:invocation[0]'; - 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.getKeyPairFromKeystore:invocation[0]': { - type: 'done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.issuersMachine.performAuthorization.setSelectedKey:invocation[0]': { - type: 'done.invoke.issuersMachine.performAuthorization.setSelectedKey: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.getKeyPairFromKeystore:invocation[0]': { - type: 'error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]'; - data: unknown; - }; - 'error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]': { - type: 'error.platform.issuersMachine.performAuthorization.setSelectedKey: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]'; - getKeyOrderList: 'done.invoke.issuersMachine.performAuthorization.setSelectedKey:invocation[0]'; - getKeyPair: 'done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]'; - getSelectedKey: 'done.invoke.issuersMachine.checkKeyPair: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: - | 'downloadIssuerWellknown' - | 'loadKeyPair' - | 'logDownloaded' - | 'resetError' - | 'resetIsVerified' - | 'resetLoadingReason' - | 'resetSelectedCredentialType' - | 'resetVerificationErrorMessage' - | 'sendBackupEvent' - | 'sendDownloadingFailedToVcMeta' - | 'sendErrorEndEvent' - | 'sendImpressionEvent' - | 'sendSuccessEndEvent' - | 'setCredentialTypeListDownloadFailureError' - | 'setCredentialWrapper' - | 'setError' - | 'setFetchWellknownError' - | 'setIsVerified' - | 'setIssuers' - | 'setLoadingReasonAsDisplayIssuers' - | 'setLoadingReasonAsDownloadingCredentials' - | 'setLoadingReasonAsSettingUp' - | 'setMetadataInCredentialData' - | 'setNoInternet' - | 'setOIDCConfigError' - | 'setPrivateKey' - | 'setPublicKey' - | 'setSelectedCredentialType' - | 'setSelectedIssuerId' - | 'setSelectedIssuers' - | 'setSelectedKey' - | 'setSupportedCredentialTypes' - | 'setTokenResponse' - | 'setVCMetadata' - | 'setVerifiableCredential' - | 'storeKeyPair' - | 'storeVcMetaContext' - | 'storeVcsContext' - | 'storeVerifiableCredentialData' - | 'storeVerifiableCredentialMeta' - | 'updateIssuerFromWellknown' - | 'updateSelectedIssuerWellknownResponse' - | 'updateVerificationErrorMessage'; - delays: never; - guards: - | 'canSelectIssuerAgain' - | 'hasKeyPair' - | 'hasUserCancelledBiometric' - | 'isCustomSecureKeystore' - | 'isGenericError' - | 'isInternetConnected' - | 'isKeyTypeNotFound' - | 'isOIDCConfigError' - | 'isOIDCflowCancelled' - | 'isSignedIn' - | 'isVerificationPendingBecauseOfNetworkIssue' - | 'shouldFetchIssuersAgain'; - services: - | 'checkInternet' - | 'downloadCredential' - | 'downloadCredentialTypes' - | 'downloadIssuerWellknown' - | 'downloadIssuersList' - | 'generateKeyPair' - | 'getKeyOrderList' - | 'getKeyPair' - | 'getSelectedKey' - | 'invokeAuthorization' - | 'isUserSignedAlready' - | 'verifyCredential'; - }; - eventsCausingActions: { - downloadIssuerWellknown: 'TRY_AGAIN'; - loadKeyPair: 'done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]'; - 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.getKeyPairFromKeystore:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization.setSelectedKey: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.getKeyPairFromKeystore:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization.setSelectedKey: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.getKeyPairFromKeystore:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization.setSelectedKey: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]'; - setCredentialTypeListDownloadFailureError: 'error.platform.issuersMachine.downloadCredentialTypes:invocation[0]'; - setCredentialWrapper: 'done.invoke.issuersMachine.downloadCredentials:invocation[0]'; - setError: - | 'error.platform.issuersMachine.displayIssuers:invocation[0]' - | 'error.platform.issuersMachine.downloadCredentials:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization:invocation[0]'; - setFetchWellknownError: 'error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]'; - setIsVerified: 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'; - setIssuers: 'done.invoke.issuersMachine.displayIssuers:invocation[0]'; - setLoadingReasonAsDisplayIssuers: 'TRY_AGAIN'; - setLoadingReasonAsDownloadingCredentials: - | 'TRY_AGAIN' - | 'done.invoke.issuersMachine.generateKeyPair:invocation[0]' - | 'done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore: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'; - setSelectedKey: 'done.invoke.issuersMachine.performAuthorization.setSelectedKey: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]'; - updateIssuerFromWellknown: 'done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]'; - updateSelectedIssuerWellknownResponse: 'done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]'; - updateVerificationErrorMessage: 'error.platform.issuersMachine.verifyingCredential:invocation[0]'; - }; - eventsCausingDelays: {}; - eventsCausingGuards: { - canSelectIssuerAgain: 'TRY_AGAIN'; - hasKeyPair: 'done.invoke.issuersMachine.checkKeyPair:invocation[0]'; - hasUserCancelledBiometric: - | 'error.platform.issuersMachine.downloadCredentials:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]'; - isCustomSecureKeystore: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]'; - isGenericError: 'error.platform.issuersMachine.downloadCredentials:invocation[0]'; - isInternetConnected: 'done.invoke.checkInternet'; - isKeyTypeNotFound: 'error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]'; - 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: - | 'done.invoke.issuersMachine.checkKeyPair:invocation[0]' - | '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: 'done.invoke.issuersMachine.checkKeyPair:invocation[0]'; - getKeyOrderList: 'done.invoke.issuersMachine.performAuthorization:invocation[0]'; - getKeyPair: - | 'TRY_AGAIN' - | 'done.invoke.issuersMachine.performAuthorization.setSelectedKey:invocation[0]'; - getSelectedKey: - | 'done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]'; - 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.getKeyPairFromKeystore' - | 'performAuthorization.idle' - | 'performAuthorization.setSelectedKey' - | 'performAuthorization.userCancelledBiometric' - | 'selectingCredentialType' - | 'selectingIssuer' - | 'storing' - | 'verifyingCredential' - | { - downloadCredentials?: 'idle' | 'userCancelledBiometric'; - performAuthorization?: - | 'getKeyPairFromKeystore' - | 'idle' - | 'setSelectedKey' - | '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.checkKeyPair:invocation[0]": { type: "done.invoke.issuersMachine.checkKeyPair:invocation[0]"; 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.getKeyPairFromKeystore:invocation[0]": { type: "done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." }; +"done.invoke.issuersMachine.performAuthorization.setSelectedKey:invocation[0]": { type: "done.invoke.issuersMachine.performAuthorization.setSelectedKey: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.getKeyPairFromKeystore:invocation[0]": { type: "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]"; data: unknown }; +"error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]": { type: "error.platform.issuersMachine.performAuthorization.setSelectedKey: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]"; +"getKeyOrderList": "done.invoke.issuersMachine.performAuthorization.setSelectedKey:invocation[0]"; +"getKeyPair": "done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]"; +"getSelectedKey": "done.invoke.issuersMachine.checkKeyPair: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: "downloadIssuerWellknown" | "loadKeyPair" | "logDownloaded" | "resetError" | "resetIsVerified" | "resetLoadingReason" | "resetSelectedCredentialType" | "resetVerificationErrorMessage" | "sendBackupEvent" | "sendDownloadingFailedToVcMeta" | "sendErrorEndEvent" | "sendImpressionEvent" | "sendSuccessEndEvent" | "setCredentialTypeListDownloadFailureError" | "setCredentialWrapper" | "setError" | "setFetchWellknownError" | "setIsVerified" | "setIssuers" | "setLoadingReasonAsDisplayIssuers" | "setLoadingReasonAsDownloadingCredentials" | "setLoadingReasonAsSettingUp" | "setMetadataInCredentialData" | "setNoInternet" | "setOIDCConfigError" | "setPrivateKey" | "setPublicKey" | "setSelectedCredentialType" | "setSelectedIssuerId" | "setSelectedIssuers" | "setSelectedKey" | "setSupportedCredentialTypes" | "setTokenResponse" | "setVCMetadata" | "setVerifiableCredential" | "storeKeyPair" | "storeVcMetaContext" | "storeVcsContext" | "storeVerifiableCredentialData" | "storeVerifiableCredentialMeta" | "updateIssuerFromWellknown" | "updateSelectedIssuerWellknownResponse" | "updateVerificationErrorMessage"; + delays: never; + guards: "canSelectIssuerAgain" | "hasKeyPair" | "hasUserCancelledBiometric" | "isCustomSecureKeystore" | "isGenericError" | "isInternetConnected" | "isKeyTypeNotFound" | "isOIDCConfigError" | "isOIDCflowCancelled" | "isSignedIn" | "isVerificationPendingBecauseOfNetworkIssue" | "shouldFetchIssuersAgain"; + services: "checkInternet" | "downloadCredential" | "downloadCredentialTypes" | "downloadIssuerWellknown" | "downloadIssuersList" | "generateKeyPair" | "getKeyOrderList" | "getKeyPair" | "getSelectedKey" | "invokeAuthorization" | "isUserSignedAlready" | "verifyCredential"; + }; + eventsCausingActions: { + "downloadIssuerWellknown": "TRY_AGAIN"; +"loadKeyPair": "done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]"; +"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.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.setSelectedKey: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.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.setSelectedKey: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.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.setSelectedKey: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]"; +"setCredentialTypeListDownloadFailureError": "error.platform.issuersMachine.downloadCredentialTypes:invocation[0]"; +"setCredentialWrapper": "done.invoke.issuersMachine.downloadCredentials:invocation[0]"; +"setError": "error.platform.issuersMachine.displayIssuers:invocation[0]" | "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]" | "error.platform.issuersMachine.performAuthorization:invocation[0]"; +"setFetchWellknownError": "error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]"; +"setIsVerified": "done.invoke.issuersMachine.verifyingCredential:invocation[0]"; +"setIssuers": "done.invoke.issuersMachine.displayIssuers:invocation[0]"; +"setLoadingReasonAsDisplayIssuers": "TRY_AGAIN"; +"setLoadingReasonAsDownloadingCredentials": "TRY_AGAIN" | "done.invoke.issuersMachine.generateKeyPair:invocation[0]" | "done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore: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"; +"setSelectedKey": "done.invoke.issuersMachine.performAuthorization.setSelectedKey: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]"; +"updateIssuerFromWellknown": "done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]"; +"updateSelectedIssuerWellknownResponse": "done.invoke.issuersMachine.downloadIssuerWellknown:invocation[0]"; +"updateVerificationErrorMessage": "error.platform.issuersMachine.verifyingCredential:invocation[0]"; + }; + eventsCausingDelays: { + + }; + eventsCausingGuards: { + "canSelectIssuerAgain": "TRY_AGAIN"; +"hasKeyPair": "done.invoke.issuersMachine.checkKeyPair:invocation[0]"; +"hasUserCancelledBiometric": "error.platform.issuersMachine.downloadCredentials:invocation[0]" | "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]"; +"isCustomSecureKeystore": "done.invoke.issuersMachine.generateKeyPair:invocation[0]"; +"isGenericError": "error.platform.issuersMachine.downloadCredentials:invocation[0]"; +"isInternetConnected": "done.invoke.checkInternet"; +"isKeyTypeNotFound": "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]"; +"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": "done.invoke.issuersMachine.checkKeyPair:invocation[0]" | "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": "done.invoke.issuersMachine.checkKeyPair:invocation[0]"; +"getKeyOrderList": "done.invoke.issuersMachine.performAuthorization:invocation[0]"; +"getKeyPair": "TRY_AGAIN" | "done.invoke.issuersMachine.performAuthorization.setSelectedKey:invocation[0]"; +"getSelectedKey": "done.invoke.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]" | "error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]"; +"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.getKeyPairFromKeystore" | "performAuthorization.idle" | "performAuthorization.setSelectedKey" | "performAuthorization.userCancelledBiometric" | "selectingCredentialType" | "selectingIssuer" | "storing" | "verifyingCredential" | { "downloadCredentials"?: "idle" | "userCancelledBiometric"; +"performAuthorization"?: "getKeyPairFromKeystore" | "idle" | "setSelectedKey" | "userCancelledBiometric"; }; + tags: never; + } + \ No newline at end of file diff --git a/machines/app.ts b/machines/app.ts index 35544dad..01dd371b 100644 --- a/machines/app.ts +++ b/machines/app.ts @@ -35,7 +35,7 @@ import { } from './VerifiableCredential/VCMetaMachine/VCMetaMachine'; import { checkAllKeyPairs, - generateKeyPairsAndStore, + generateKeyPairsAndStoreOrder, } from '../shared/cryptoutil/cryptoUtil'; const QrLoginIntent = NativeModules.QrLoginIntent; @@ -139,7 +139,7 @@ export const appMachine = model.createMachine( }, generateKeyPairs: { invoke: { - src: 'generateKeyPairsAndStore', + src: 'generateKeyPairsAndStoreOrder', onDone: [ { target: 'checkKeyPairs', @@ -467,8 +467,8 @@ export const appMachine = model.createMachine( return await checkAllKeyPairs(); }, - generateKeyPairsAndStore: async () => { - return await generateKeyPairsAndStore(); + generateKeyPairsAndStoreOrder: async () => { + return await generateKeyPairsAndStoreOrder(); }, checkNetworkState: () => callback => { return NetInfo.addEventListener(state => { diff --git a/machines/app.typegen.ts b/machines/app.typegen.ts index fe9d5d8b..e69de29b 100644 --- a/machines/app.typegen.ts +++ b/machines/app.typegen.ts @@ -1,117 +0,0 @@ -// This file was automatically generated. Edits will be overwritten - -export interface Typegen0 { - '@@xstate/typegen': true; - internalEvents: { - 'done.invoke.app.init.checkKeyPairs:invocation[0]': { - type: 'done.invoke.app.init.checkKeyPairs:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.app.init.generateKeyPairs:invocation[0]': { - type: 'done.invoke.app.init.generateKeyPairs:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.app.ready.focus.active:invocation[0]': { - type: 'done.invoke.app.ready.focus.active:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'error.platform.app.init.checkKeyPairs:invocation[0]': { - type: 'error.platform.app.init.checkKeyPairs:invocation[0]'; - data: unknown; - }; - 'xstate.init': {type: 'xstate.init'}; - }; - invokeSrcNameMap: { - checkFocusState: 'done.invoke.app.ready.focus:invocation[0]'; - checkKeyPairs: 'done.invoke.app.init.checkKeyPairs:invocation[0]'; - checkNetworkState: 'done.invoke.app.ready.network:invocation[0]'; - generateKeyPairsAndStore: 'done.invoke.app.init.generateKeyPairs:invocation[0]'; - getAppInfo: 'done.invoke.app.init.info:invocation[0]'; - isQrLoginByDeepLink: 'done.invoke.app.ready.focus.active:invocation[0]'; - resetQRLoginDeepLinkData: 'done.invoke.app.ready.focus.active:invocation[1]'; - }; - missingImplementations: { - actions: 'forwardToServices'; - delays: never; - guards: never; - services: never; - }; - eventsCausingActions: { - forwardToServices: 'ACTIVE' | 'INACTIVE' | 'OFFLINE' | 'ONLINE'; - loadCredentialRegistryHostFromStorage: 'READY'; - loadCredentialRegistryInConstants: 'STORE_RESPONSE'; - loadEsignetHostFromConstants: 'STORE_RESPONSE'; - loadEsignetHostFromStorage: 'READY'; - logServiceEvents: 'done.invoke.app.init.checkKeyPairs:invocation[0]'; - logStoreEvents: - | 'KEY_INVALIDATE_ERROR' - | 'RESET_KEY_INVALIDATE_ERROR_DISMISS' - | 'xstate.init'; - requestDeviceInfo: 'REQUEST_DEVICE_INFO'; - resetKeyInvalidateError: 'READY' | 'RESET_KEY_INVALIDATE_ERROR_DISMISS'; - resetLinkCode: 'RESET_LINKCODE'; - setAppInfo: 'APP_INFO_RECEIVED'; - setIsDecryptError: 'DECRYPT_ERROR'; - setIsReadError: 'ERROR'; - setLinkCode: 'done.invoke.app.ready.focus.active:invocation[0]'; - spawnServiceActors: 'done.invoke.app.init.checkKeyPairs:invocation[0]'; - 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'; - checkKeyPairs: - | 'READY' - | 'done.invoke.app.init.generateKeyPairs:invocation[0]'; - checkNetworkState: 'APP_INFO_RECEIVED'; - generateKeyPairsAndStore: 'error.platform.app.init.checkKeyPairs:invocation[0]'; - getAppInfo: 'STORE_RESPONSE'; - isQrLoginByDeepLink: 'ACTIVE'; - resetQRLoginDeepLinkData: 'ACTIVE'; - }; - matchesStates: - | 'init' - | 'init.checkKeyPairs' - | 'init.credentialRegistry' - | 'init.generateKeyPairs' - | '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?: - | 'checkKeyPairs' - | 'credentialRegistry' - | 'generateKeyPairs' - | 'info' - | 'services' - | 'store'; - ready?: - | 'focus' - | 'network' - | { - focus?: 'active' | 'checking' | 'inactive'; - network?: 'checking' | 'offline' | 'online'; - }; - }; - tags: never; -} diff --git a/machines/auth.ts b/machines/auth.ts index 4baf97c3..9308ea79 100644 --- a/machines/auth.ts +++ b/machines/auth.ts @@ -12,7 +12,6 @@ const model = createModel( passcode: '', passcodeSalt: '', biometrics: '', - keySetup: false, canUseBiometrics: false, selectLanguage: false, toggleFromSettings: false, @@ -88,7 +87,6 @@ export const authMachine = model.createMachine( checkingAuth: { always: [ {cond: 'hasLanguageset', target: 'languagesetup'}, - {cond: 'hasKeySetup', target: 'keySetup'}, {cond: 'hasPasscodeSet', target: 'unauthorized'}, {cond: 'hasBiometricSet', target: 'unauthorized'}, {target: 'settingUp'}, @@ -97,14 +95,6 @@ export const authMachine = model.createMachine( languagesetup: { on: { SELECT: { - target: 'keySetup', - }, - }, - }, - keySetup: { - on: { - SELECT: { - actions: 'setKeySetup', target: 'introSlider', }, }, @@ -165,10 +155,6 @@ export const authMachine = model.createMachine( to: context => context.serviceRefs.store, }), - setKeySetup: model.assign({ - keySetup: true, - }), - setIsToggleFromSettings: assign({ toggleFromSettings: (_, event) => event.isToggleFromSettings, }), @@ -230,7 +216,6 @@ export const authMachine = model.createMachine( }, guards: { - hasKeySetup: (context, event: any) => !context.keySetup, hasData: (_, event: StoreResponseEvent) => event.response != null, hasPasscodeSet: context => { diff --git a/machines/auth.typegen.ts b/machines/auth.typegen.ts index 73c68d93..9d3b9e72 100644 --- a/machines/auth.typegen.ts +++ b/machines/auth.typegen.ts @@ -1,73 +1,51 @@ -// This file was automatically generated. Edits will be overwritten -export interface Typegen0 { - '@@xstate/typegen': true; - internalEvents: { - '': {type: ''}; - 'done.invoke.auth.authorized:invocation[0]': { - type: 'done.invoke.auth.authorized:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'done.invoke.auth.introSlider:invocation[0]': { - type: 'done.invoke.auth.introSlider:invocation[0]'; - data: unknown; - __tip: 'See the XState TS docs to learn how to strongly type this.'; - }; - 'xstate.init': {type: 'xstate.init'}; - }; - invokeSrcNameMap: { - downloadFaceSdkModel: 'done.invoke.auth.authorized:invocation[0]'; - generatePasscodeSalt: 'done.invoke.auth.introSlider:invocation[0]'; - }; - missingImplementations: { - actions: never; - delays: never; - guards: never; - services: never; - }; - eventsCausingActions: { - requestStoredContext: 'xstate.init'; - setBiometrics: 'SETUP_BIOMETRICS'; - setContext: 'STORE_RESPONSE'; - setInitialDownloadDone: 'INITIAL_DOWNLOAD_DONE'; - setIsToggleFromSettings: 'CHANGE_METHOD'; - setKeySetup: 'SELECT'; - setLanguage: 'SETUP_BIOMETRICS' | 'SETUP_PASSCODE'; - setOnboardingDone: 'ONBOARDING_DONE'; - setPasscode: 'SETUP_PASSCODE'; - setPasscodeSalt: 'done.invoke.auth.introSlider:invocation[0]'; - setTourGuide: 'SET_TOUR_GUIDE'; - storeContext: - | 'INITIAL_DOWNLOAD_DONE' - | 'ONBOARDING_DONE' - | 'SETUP_BIOMETRICS' - | 'SETUP_PASSCODE' - | 'STORE_RESPONSE' - | 'done.invoke.auth.authorized:invocation[0]' - | 'done.invoke.auth.introSlider:invocation[0]'; - }; - eventsCausingDelays: {}; - eventsCausingGuards: { - hasBiometricSet: ''; - hasData: 'STORE_RESPONSE'; - hasKeySetup: ''; - hasLanguageset: ''; - hasPasscodeSet: ''; - }; - eventsCausingServices: { - downloadFaceSdkModel: 'LOGIN' | 'SETUP_BIOMETRICS' | 'SETUP_PASSCODE'; - generatePasscodeSalt: 'SELECT'; - }; - matchesStates: - | 'authorized' - | 'checkingAuth' - | 'init' - | 'introSlider' - | 'keySetup' - | 'languagesetup' - | 'savingDefaults' - | 'settingUp' - | 'unauthorized'; - tags: never; -} + // This file was automatically generated. Edits will be overwritten + + export interface Typegen0 { + '@@xstate/typegen': true; + internalEvents: { + "": { type: "" }; +"done.invoke.auth.authorized:invocation[0]": { type: "done.invoke.auth.authorized:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." }; +"done.invoke.auth.introSlider:invocation[0]": { type: "done.invoke.auth.introSlider:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." }; +"xstate.init": { type: "xstate.init" }; + }; + invokeSrcNameMap: { + "downloadFaceSdkModel": "done.invoke.auth.authorized:invocation[0]"; +"generatePasscodeSalt": "done.invoke.auth.introSlider:invocation[0]"; + }; + missingImplementations: { + actions: never; + delays: never; + guards: never; + services: never; + }; + eventsCausingActions: { + "requestStoredContext": "xstate.init"; +"setBiometrics": "SETUP_BIOMETRICS"; +"setContext": "STORE_RESPONSE"; +"setInitialDownloadDone": "INITIAL_DOWNLOAD_DONE"; +"setIsToggleFromSettings": "CHANGE_METHOD"; +"setLanguage": "SETUP_BIOMETRICS" | "SETUP_PASSCODE"; +"setOnboardingDone": "ONBOARDING_DONE"; +"setPasscode": "SETUP_PASSCODE"; +"setPasscodeSalt": "done.invoke.auth.introSlider:invocation[0]"; +"setTourGuide": "SET_TOUR_GUIDE"; +"storeContext": "INITIAL_DOWNLOAD_DONE" | "ONBOARDING_DONE" | "SETUP_BIOMETRICS" | "SETUP_PASSCODE" | "STORE_RESPONSE" | "done.invoke.auth.authorized:invocation[0]" | "done.invoke.auth.introSlider:invocation[0]"; + }; + eventsCausingDelays: { + + }; + eventsCausingGuards: { + "hasBiometricSet": ""; +"hasData": "STORE_RESPONSE"; +"hasLanguageset": ""; +"hasPasscodeSet": ""; + }; + eventsCausingServices: { + "downloadFaceSdkModel": "LOGIN" | "SETUP_BIOMETRICS" | "SETUP_PASSCODE"; +"generatePasscodeSalt": "SELECT"; + }; + matchesStates: "authorized" | "checkingAuth" | "init" | "introSlider" | "languagesetup" | "savingDefaults" | "settingUp" | "unauthorized"; + tags: never; + } + \ No newline at end of file diff --git a/machines/settings.typegen.ts b/machines/settings.typegen.ts index e69de29b..e38eca5d 100644 --- a/machines/settings.typegen.ts +++ b/machines/settings.typegen.ts @@ -0,0 +1,57 @@ + + // This file was automatically generated. Edits will be overwritten + + export interface Typegen0 { + '@@xstate/typegen': true; + internalEvents: { + "done.invoke.settings.resetInjiProps:invocation[0]": { type: "done.invoke.settings.resetInjiProps:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." }; +"error.platform.settings.resetInjiProps:invocation[0]": { type: "error.platform.settings.resetInjiProps:invocation[0]"; data: unknown }; +"xstate.init": { type: "xstate.init" }; + }; + invokeSrcNameMap: { + "resetInjiProps": "done.invoke.settings.resetInjiProps:invocation[0]"; + }; + missingImplementations: { + actions: never; + delays: never; + guards: never; + services: never; + }; + eventsCausingActions: { + "requestStoredContext": "xstate.init"; +"resetCredentialRegistryResponse": "CANCEL" | "UPDATE_HOST"; +"resetIsBiometricToggled": "DISMISS"; +"resetKeyOrderingResponse": "RESET_KEY_ORDER_RESPONSE"; +"setBackupAndRestoreOptionExplored": "SET_IS_BACKUP_AND_RESTORE_EXPLORED"; +"setContext": "STORE_RESPONSE"; +"setIsBiometricToggled": "TOGGLE_BIOMETRIC_UNLOCK"; +"setKeyManagementExplored": "SET_KEY_MANAGEMENT_EXPLORED"; +"setKeyManagementTourGuideExplored": "SET_KEY_MANAGEMENT_TOUR_GUIDE_EXPLORED"; +"setKeyOrderingResponse": "SET_KEY_ORDER_RESPONSE"; +"storeContext": "ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS" | "SET_IS_BACKUP_AND_RESTORE_EXPLORED" | "SET_KEY_MANAGEMENT_EXPLORED" | "SHOWN_ACCOUNT_SELECTION_CONFIRMATION" | "STORE_RESPONSE" | "TOGGLE_BIOMETRIC_UNLOCK" | "UPDATE_HOST" | "UPDATE_NAME" | "UPDATE_VC_LABEL" | "done.invoke.settings.resetInjiProps:invocation[0]"; +"toggleBiometricUnlock": "TOGGLE_BIOMETRIC_UNLOCK"; +"updateCredentialRegistry": "done.invoke.settings.resetInjiProps:invocation[0]"; +"updateCredentialRegistryResponse": "error.platform.settings.resetInjiProps:invocation[0]"; +"updateCredentialRegistrySuccess": "done.invoke.settings.resetInjiProps:invocation[0]"; +"updateDefaults": "STORE_RESPONSE"; +"updateEsignetHostUrl": "UPDATE_HOST"; +"updateIsAccountSelectionConfirmationShown": "SHOWN_ACCOUNT_SELECTION_CONFIRMATION"; +"updateName": "UPDATE_NAME"; +"updatePartialDefaults": "STORE_RESPONSE"; +"updateUserShownWithHardwareKeystoreNotExists": "ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS"; +"updateVcLabel": "UPDATE_VC_LABEL"; + }; + eventsCausingDelays: { + + }; + eventsCausingGuards: { + "hasData": "STORE_RESPONSE"; +"hasPartialData": "STORE_RESPONSE"; + }; + eventsCausingServices: { + "resetInjiProps": "UPDATE_HOST"; + }; + matchesStates: "idle" | "init" | "resetInjiProps" | "showInjiTourGuide" | "storingDefaults"; + tags: never; + } + \ No newline at end of file diff --git a/routes/index.ts b/routes/index.ts index 0f3d57f3..7258e0c5 100644 --- a/routes/index.ts +++ b/routes/index.ts @@ -14,7 +14,6 @@ import {IntroSlidersScreen} from '../screens/Home/IntroSlidersScreen'; import {RequestLayout} from '../screens/Request/RequestLayout'; import {SplashScreen} from '../screens/SplashScreen'; import {RequestStackParamList} from './routesConstants'; -import {SetupKeySelectionScreen} from '../screens/SetupKeySelectionScreen'; import {KeyManagementScreen} from '../screens/Settings/KeyManagementScreen'; export const baseRoutes: Screen[] = [ @@ -36,10 +35,6 @@ export const baseRoutes: Screen[] = [ headerShown: false, }, }, - { - name: 'KeySetup', - component: SetupKeySelectionScreen, - }, { name: 'IntroSliders', component: IntroSlidersScreen, diff --git a/screens/Settings/KeyManagementScreen.tsx b/screens/Settings/KeyManagementScreen.tsx index 8179caf2..545e0eb5 100644 --- a/screens/Settings/KeyManagementScreen.tsx +++ b/screens/Settings/KeyManagementScreen.tsx @@ -3,10 +3,9 @@ import {useTranslation} from 'react-i18next'; import {NativeModules, TouchableOpacity, BackHandler, View} from 'react-native'; import DragList from 'react-native-draglist'; import {ListItem, Icon} from 'react-native-elements'; -import {Row, Text, Button} from '../../components/ui'; +import {Text, Button} from '../../components/ui'; import {Theme} from '../../components/ui/styleUtils'; import {HelpScreen} from '../../components/HelpScreen'; -import {SvgImage} from '../../components/ui/svg'; import {BannerNotificationContainer} from '../../components/BannerNotificationContainer'; import {BackButton} from '../../components/ui/backButton/BackButton'; import {Copilot} from '../../components/ui/Copilot'; diff --git a/screens/SetupKeySelectionScreen.tsx b/screens/SetupKeySelectionScreen.tsx deleted file mode 100644 index 5107f411..00000000 --- a/screens/SetupKeySelectionScreen.tsx +++ /dev/null @@ -1,150 +0,0 @@ -import React, {useEffect, useState} from 'react'; -import {useTranslation} from 'react-i18next'; -import {Button, Column, Row} from '../components/ui'; -import {Theme} from '../components/ui/styleUtils'; -import {Icon, ListItem} from 'react-native-elements'; -import {RootRouteProps} from '../routes'; -import {useWelcomeScreen} from './WelcomeScreenController'; -import { - BackHandler, - Dimensions, - NativeModules, - TouchableOpacity, - View, -} from 'react-native'; -import {useBackupRestoreScreen} from './Settings/BackupRestoreController'; -import DragList from 'react-native-draglist'; -import {Text} from '../components/ui'; -import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants'; -import { - sendEndEvent, - getEndEventData, -} from '../shared/telemetry/TelemetryUtils'; -import {SUPPORTED_KEY_TYPES} from '../shared/constants'; - -export const SetupKeySelectionScreen: React.FC = props => { - const {RNSecureKeystoreModule} = NativeModules; - const {t} = useTranslation('SetupKey'); - const controller = useWelcomeScreen(props); - const backupRestoreController = useBackupRestoreScreen(); - const keys = Object.entries(SUPPORTED_KEY_TYPES).map(([label, value]) => ({ - label, - value, - })); - const [keyOrder, setKeyOrder] = useState(keys); - - const renderItem = ({item, onDragStart, onDragEnd}) => { - return ( - - - - - {item.label} - - - - - - - ); - }; - - const handleReorder = (fromIndex, toIndex) => { - const newData = [...keyOrder]; - const item = newData.splice(fromIndex, 1)[0]; - newData.splice(toIndex, 0, item); - setKeyOrder(newData); - }; - - const convertToKeyValue = items => { - const result = {}; - items.forEach((item, index) => { - result[index] = item.value; - }); - return result; - }; - - useEffect(() => { - backupRestoreController.DOWNLOAD_UNSYNCED_BACKUP_FILES(); - }, []); - - useEffect(() => { - const backAction = () => { - BackHandler.exitApp(); - return true; - }; - - const backHandler = BackHandler.addEventListener( - 'hardwareBackPress', - backAction, - ); - - return () => backHandler.remove(); - }, []); - - return ( - - - - - {t('header')} - - - {t('description')} - - - - item.value} - onReordered={handleReorder} - /> - - -