From 937d9204e6c66bdc13e7b770a125d008bdfc6587 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 23 Jan 2024 22:29:21 +0100 Subject: wallet-core: expose build version info via request --- packages/taler-wallet-core/src/versions.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'packages/taler-wallet-core/src/versions.ts') diff --git a/packages/taler-wallet-core/src/versions.ts b/packages/taler-wallet-core/src/versions.ts index 023cbb1ff..bf8a9f7c8 100644 --- a/packages/taler-wallet-core/src/versions.ts +++ b/packages/taler-wallet-core/src/versions.ts @@ -68,3 +68,19 @@ export const WALLET_CORE_API_IMPLEMENTATION_VERSION = "3:0:2"; * If any interfaces have been removed or changed since the last public * release, then set age to 0. */ + +// Provided either by bundler or in the next lines. +declare global { + const walletCoreBuildInfo: { + implementationSemver: string; + implementationGitHash: string; + }; +} + +// Provide walletCoreBuildInfo if the bundler does not override it. +if (!("walletCoreBuildInfo" in globalThis)) { + (globalThis as any).walletCoreBuildInfo = { + implementationSemver: "unknown", + implementationGitHash: "unknown", + } satisfies typeof walletCoreBuildInfo; +} -- cgit v1.2.3