@defra/bng-utils-lib 0.238.0 → 0.238.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "@defra/bng-utils-lib",
3
- "version": "0.238.0",
3
+ "version": "0.238.5",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "A library of utilities for the Biodiversity Net Gain Service",
7
7
  "main": "src/utils.js",
8
- "scripts": {
9
- "test": "echo \\\"Error: run tests from root\\\" && exit 1"
10
- },
11
8
  "repository": {
12
9
  "type": "git",
13
10
  "url": "https://github.com/DEFRA/biodiversity-net-gain-service.git",
@@ -17,8 +14,8 @@
17
14
  "license": "OGL-UK-3.0",
18
15
  "dependencies": {
19
16
  "@azure/identity": "^3.3.2",
20
- "@defra/bng-connectors-lib": "0.238.0",
17
+ "@defra/bng-connectors-lib": "0.238.5",
21
18
  "axios": "^1.6.0"
22
19
  },
23
- "gitHead": "692026b1d3f71a7378b29a17ca67ab3b70e57347"
20
+ "gitHead": "e454cb76bc4b8ff2ea7b9dfd07cd9125277e80b3"
24
21
  }
@@ -2,14 +2,14 @@ import { postgresConnector } from '@defra/bng-connectors-lib'
2
2
  import { DefaultAzureCredential } from '@azure/identity'
3
3
  import DbConfig from './db-config.js'
4
4
 
5
- const getDBConnection = async () => {
5
+ const getDBConnection = async (context) => {
6
6
  // Clone so that we don't store the token (which will expire)
7
7
  const dbConfig = JSON.parse(JSON.stringify(DbConfig))
8
8
  if (!dbConfig.password) {
9
9
  const credential = new DefaultAzureCredential()
10
10
  dbConfig.password = (await credential.getToken('https://ossrdbms-aad.database.windows.net')).token
11
11
  }
12
- return new postgresConnector.Db(dbConfig)
12
+ return new postgresConnector.Db(dbConfig, context)
13
13
  }
14
14
 
15
15
  export default getDBConnection