Skip to content

Commit 1d14a97

Browse files
alexloikoOleksandr Loiko
andauthored
ALL-9923 Fixed version in report for Docker (#113)
* ALL-9923 Fixed version in report for Docker * ALL-9923 Fixed version in response header --------- Co-authored-by: Oleksandr Loiko <oleksandr.loiko@tatum.io>
1 parent fc790e0 commit 1d14a97

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tatumio/tatum-kms",
3-
"version": "7.0.7",
3+
"version": "7.0.8",
44
"description": "Tatum KMS - Key Management System for Tatum-powered apps.",
55
"main": "dist/index.js",
66
"types": "./dist/index.d.ts",

src/management.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import {
3030
import { utils } from './utils'
3131
import semver from 'semver'
3232

33+
import { version } from '../package.json'
34+
3335
const ensurePathExists = (path: string) => {
3436
const dir = dirname(path)
3537
if (!existsSync(dir)) {
@@ -545,7 +547,7 @@ export const getQuestion = (q: string, e?: string) => {
545547
}
546548

547549
const getKmsVersion = (): string => {
548-
return process.env.npm_package_version ?? 'N/A'
550+
return version || 'N/A'
549551
}
550552

551553
const getPathToWallet = (path?: string) => {

src/signatures.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import { ExternalUrlMethod, Wallet } from './interfaces'
5858
import { getManagedWallets, getWallet, getWalletForSignature } from './management'
5959
import semver from 'semver'
6060
import { Config, ConfigOption } from './config'
61+
import { version } from '../package.json'
6162

6263
const TATUM_URL: string = process.env.TATUM_API_URL || 'https://api.tatum.io'
6364

@@ -516,7 +517,7 @@ const processVersionUpdateHeader = (versionUpdateHeader: string) => {
516517
versionUpdateState.level = parts[1]?.toUpperCase()?.trim()
517518
versionUpdateState.logFunction = versionUpdateState.level === 'ERROR' ? console.error : console.log
518519
versionUpdateState.message = parts[2]?.trim()
519-
versionUpdateState.currentVersion = process.env.npm_package_version ?? ''
520+
versionUpdateState.currentVersion = version ?? ''
520521

521522
if (
522523
!versionUpdateState.running &&
@@ -562,7 +563,7 @@ const getPendingTransactions = async (
562563
{
563564
headers: {
564565
'x-api-key': Config.getValue(ConfigOption.TATUM_API_KEY),
565-
'x-ttm-kms-client-version': process.env.npm_package_version ?? '',
566+
'x-ttm-kms-client-version': version ?? '',
566567
},
567568
},
568569
)

0 commit comments

Comments
 (0)