This commit is contained in:
Sebastian 2023-08-02 07:40:28 -03:00
parent e3460de331
commit efed6b32c5
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069
6 changed files with 18 additions and 14 deletions

View File

@ -994,6 +994,9 @@ export interface ExchangeDetailedResponse {
}
export interface WalletCoreVersion {
/**
* @deprecated
*/
hash: string | undefined;
version: string;
exchange: string;

View File

@ -1,2 +1,3 @@
/lib
/coverage
/src/version.json

View File

@ -12,7 +12,7 @@
"author": "Florian Dold",
"license": "GPL-3.0",
"scripts": {
"compile": "tsc --build",
"compile": "jq '{version}' package.json > src/version.json && tsc --build",
"pretty": "prettier --write src",
"test": "tsc && ava",
"coverage": "tsc && c8 --src src --all ava",
@ -85,4 +85,4 @@
"lib/**/*test.*"
]
}
}
}

View File

@ -310,6 +310,7 @@ import {
WalletCoreApiClient,
WalletCoreResponseType,
} from "./wallet-api-types.js";
import versionInfo from "./version.json" assert { type: 'json' };
const logger = new Logger("wallet.ts");
@ -1016,12 +1017,6 @@ export async function getClientFromWalletState(
return client;
}
declare const __VERSION__: string;
declare const __GIT_HASH__: string;
const VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "dev";
const GIT_HASH = typeof __GIT_HASH__ !== "undefined" ? __GIT_HASH__ : undefined;
/**
* Implementation of the "wallet-core" API.
*/
@ -1590,15 +1585,15 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
}
export function getVersion(ws: InternalWalletState): WalletCoreVersion {
const version: WalletCoreVersion = {
hash: GIT_HASH,
version: VERSION,
const result: WalletCoreVersion = {
hash: undefined,
version: versionInfo.version,
exchange: WALLET_EXCHANGE_PROTOCOL_VERSION,
merchant: WALLET_MERCHANT_PROTOCOL_VERSION,
bank: WALLET_BANK_INTEGRATION_PROTOCOL_VERSION,
devMode: false,
};
return version;
return result;
}
/**

View File

@ -7,8 +7,10 @@
"target": "ES2017",
"module": "ESNext",
"moduleResolution": "Node16",
"resolveJsonModule": true,
"sourceMap": true,
"lib": ["es6"],
"resolvePackageJsonImports": true,
"types": ["node"],
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
@ -31,5 +33,8 @@
"path": "../taler-util/"
}
],
"include": ["src/**/*"]
"include": [
"src/**/*",
"src/*.json"
]
}

View File

@ -1,4 +1,4 @@
lockfileVersion: '6.0'
lockfileVersion: '6.1'
settings:
autoInstallPeers: true