Skip to content

Commit

Permalink
ALL-9923 Fixed version in report for Docker (#113)
Browse files Browse the repository at this point in the history
* ALL-9923 Fixed version in report for Docker

* ALL-9923 Fixed version in response header

---------

Co-authored-by: Oleksandr Loiko <[email protected]>
  • Loading branch information
alexloiko and Oleksandr Loiko authored Dec 16, 2024
1 parent fc790e0 commit 1d14a97
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tatumio/tatum-kms",
"version": "7.0.7",
"version": "7.0.8",
"description": "Tatum KMS - Key Management System for Tatum-powered apps.",
"main": "dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
4 changes: 3 additions & 1 deletion src/management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import {
import { utils } from './utils'
import semver from 'semver'

import { version } from '../package.json'

const ensurePathExists = (path: string) => {
const dir = dirname(path)
if (!existsSync(dir)) {
Expand Down Expand Up @@ -545,7 +547,7 @@ export const getQuestion = (q: string, e?: string) => {
}

const getKmsVersion = (): string => {
return process.env.npm_package_version ?? 'N/A'
return version || 'N/A'
}

const getPathToWallet = (path?: string) => {
Expand Down
5 changes: 3 additions & 2 deletions src/signatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import { ExternalUrlMethod, Wallet } from './interfaces'
import { getManagedWallets, getWallet, getWalletForSignature } from './management'
import semver from 'semver'
import { Config, ConfigOption } from './config'
import { version } from '../package.json'

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

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

if (
!versionUpdateState.running &&
Expand Down Expand Up @@ -562,7 +563,7 @@ const getPendingTransactions = async (
{
headers: {
'x-api-key': Config.getValue(ConfigOption.TATUM_API_KEY),
'x-ttm-kms-client-version': process.env.npm_package_version ?? '',
'x-ttm-kms-client-version': version ?? '',
},
},
)
Expand Down

0 comments on commit 1d14a97

Please sign in to comment.