diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-06-05 03:20:28 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-06-05 03:20:28 +0200 |
commit | 290459133226503bcbc16f7dc3cb04d7abdc6735 (patch) | |
tree | 0d21f175f60c10f144f9dc6a661979e5e06c8d71 /src/webex/wxApi.ts | |
parent | e95027f37712c37be243403a78ff6a327a83177e (diff) | |
download | wallet-core-290459133226503bcbc16f7dc3cb04d7abdc6735.tar.xz |
pretty reset page
Diffstat (limited to 'src/webex/wxApi.ts')
-rw-r--r-- | src/webex/wxApi.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/webex/wxApi.ts b/src/webex/wxApi.ts index 1968b6575..a064b4133 100644 --- a/src/webex/wxApi.ts +++ b/src/webex/wxApi.ts @@ -39,6 +39,27 @@ import { import { MessageType, MessageMap } from "./messages"; +/** + * Response with information about available version upgrades. + */ +export interface UpgradeResponse { + /** + * Is a reset required because of a new DB version + * that can't be atomatically upgraded? + */ + dbResetRequired: boolean; + + /** + * Current database version. + */ + currentDbVersion: string; + + /** + * Old db version (if applicable). + */ + oldDbVersion: string; +} + async function callBackend<T extends MessageType>(type: T, detail: MessageMap[T]["request"]): Promise<any> { return new Promise<any>((resolve, reject) => { @@ -254,3 +275,17 @@ export function getTabCookie(contractTermsHash: string, merchantSig: string): Pr export function generateNonce(): Promise<string> { return callBackend("generate-nonce", { }); } + +/** + * Check upgrade information + */ +export function checkUpgrade(): Promise<UpgradeResponse> { + return callBackend("check-upgrade", { }); +} + +/** + * Reset database + */ +export function resetDb(): Promise<void> { + return callBackend("reset-db", { }); +} |