From 56097fd11dbc303037f074cb51b6c578131ff888 Mon Sep 17 00:00:00 2001 From: CarlosGamero <101278162+CarlosGamero@users.noreply.github.com> Date: Thu, 29 Aug 2024 15:07:16 +0200 Subject: [PATCH] Adding wasSuccessful param to TransactionObservabilityManager (#155) * Adding new wasSuccessful optional param to TransactionObservabilityManager * Lint fix * Preventing more lint issues on package.json after auto-release --- package.json | 9 +++------ src/observability/observabilityTypes.ts | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d6e6f48..193ea8a 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,7 @@ "url": "git://github.com/lokalise/node-core.git" }, "license": "Apache-2.0", - "files": [ - "dist/**", - "LICENSE", - "README.md" - ], + "files": ["dist/**", "LICENSE", "README.md"], "main": "dist/index.js", "types": "dist/index.d.ts", "type": "commonjs", @@ -31,7 +27,8 @@ "lint": "biome check . && tsc --project tsconfig.lint.json --noEmit", "lint:fix": "biome check --write", "version": "auto-changelog -p && git add CHANGELOG.md", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "postversion": "biome check --write package.json" }, "dependencies": { "dot-prop": "6.0.1", diff --git a/src/observability/observabilityTypes.ts b/src/observability/observabilityTypes.ts index d0b6fe6..64895c4 100644 --- a/src/observability/observabilityTypes.ts +++ b/src/observability/observabilityTypes.ts @@ -23,6 +23,7 @@ export type TransactionObservabilityManager = { /** * Ends the transaction * @param uniqueTransactionKey - used for identifying specific ongoing transaction. Must be reasonably unique to reduce possibility of collisions + * @param wasSuccessful - indicates if the transaction was successful or not */ - stop: (uniqueTransactionKey: string) => unknown + stop: (uniqueTransactionKey: string, wasSuccessful?: boolean) => unknown }