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 { export interface WalletCoreVersion {
/**
* @deprecated
*/
hash: string | undefined; hash: string | undefined;
version: string; version: string;
exchange: string; exchange: string;

View File

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

View File

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

View File

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

View File

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

View File

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