@defra/bng-utils-lib 0.220.4 → 0.220.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/bng-utils-lib",
3
- "version": "0.220.4",
3
+ "version": "0.220.5",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "A library of utilities for the Biodiversity Net Gain Service",
@@ -18,8 +18,7 @@
18
18
  "dependencies": {
19
19
  "@azure/identity": "^3.3.1",
20
20
  "@defra/bng-connectors-lib": "0.220.4",
21
- "axios": "^1.5.1",
22
- "defra-logging-facade": "git+https://github.com/DEFRA/defra-logging-facade.git#bb51e5b"
21
+ "axios": "^1.5.1"
23
22
  },
24
- "gitHead": "bfe249579f552ae70eb4a857ed30f90aa82e340e"
23
+ "gitHead": "a80ded1aa0ac08eaf8cf4daa027dbdd17a103234"
25
24
  }
@@ -1,19 +1,18 @@
1
1
  import { postgresConnector } from '@defra/bng-connectors-lib'
2
2
  import { DefaultAzureCredential } from '@azure/identity'
3
3
  import DbConfig from './db-config.js'
4
- import { logger } from 'defra-logging-facade'
5
4
 
6
- const getDBConnection = async () => {
5
+ const getDBConnection = async (context) => {
7
6
  // Clone so that we don't store the token (which will expire)
8
7
  const dbConfig = JSON.parse(JSON.stringify(DbConfig))
9
- logger.info('getDBConnection')
10
- logger.info(dbConfig)
8
+ context?.log('getDBConnection')
9
+ context?.log(dbConfig)
11
10
  if (!dbConfig.password) {
12
11
  const credential = new DefaultAzureCredential()
13
- logger.info('Getting database token')
12
+ context?.log('Getting database token')
14
13
  dbConfig.password = (await credential.getToken('https://ossrdbms-aad.database.windows.net')).token
15
14
  }
16
- return new postgresConnector.Db(dbConfig)
15
+ return new postgresConnector.Db(dbConfig, context)
17
16
  }
18
17
 
19
18
  export default getDBConnection