Skip to content
Snippets Groups Projects
Commit dbc08bbd authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

bump dependencies version to latest

parent b9e8a452
No related branches found
No related tags found
1 merge request!57chore: node 20 + refactor dependencies
Pipeline #103283 passed
...@@ -35,20 +35,20 @@ ...@@ -35,20 +35,20 @@
"travisDeployKey": "./bin/generate_travis_deploy_key" "travisDeployKey": "./bin/generate_travis_deploy_key"
}, },
"dependencies": { "dependencies": {
"@sentry/node": "^7.23.0", "@sentry/node": "^8.12.0",
"@sentry/tracing": "^7.23.0", "@sentry/tracing": "^7.114.0",
"axios": "^0.27.2", "axios": "^1.7.2",
"cozy-konnector-libs": "5.0.0", "cozy-konnector-libs": "5.11.0",
"easy-soap-request": "^4.7.0", "easy-soap-request": "^5.6.1",
"moment": "^2.29.3", "moment": "^2.30.1",
"moment-timezone": "^0.5.34", "moment-timezone": "^0.5.45",
"xml2js": "^0.4.23" "xml2js": "^0.6.2"
}, },
"devDependencies": { "devDependencies": {
"cozy-jobs-cli": "2.0.0", "cozy-jobs-cli": "2.4.2",
"cozy-konnector-build": "1.4.5", "cozy-konnector-build": "1.7.0",
"jest": "^28.1.3", "jest": "^29.7.0",
"jest-junit": "^14.0.0", "jest-junit": "^16.0.0",
"standard-version": "^9.5.0" "standard-version": "^9.5.0"
} }
} }
\ No newline at end of file
// @ts-check // @ts-check
require('./instrument.js') // Sentry initialization
const { const {
BaseKonnector, BaseKonnector,
log, log,
...@@ -38,11 +39,8 @@ const { ...@@ -38,11 +39,8 @@ const {
terminateContract, terminateContract,
} = require('./core') } = require('./core')
const { getAccount, saveAccountData } = require('./requests/cozy') const { getAccount, saveAccountData } = require('./requests/cozy')
const { isLocal, isDev } = require('./helpers/env') const { isLocal } = require('./helpers/env')
const Sentry = require('@sentry/node') const Sentry = require('@sentry/node')
// eslint-disable-next-line
const Tracing = require('@sentry/tracing') // Needed for tracking performance in Sentry
const { version } = require('../package.json')
const { catchRequestReject } = require('./helpers/catch') const { catchRequestReject } = require('./helpers/catch')
moment.locale('fr') // set the language moment.locale('fr') // set the language
...@@ -62,25 +60,6 @@ const NO_DATA = process.env.NO_DATA === 'true' ...@@ -62,25 +60,6 @@ const NO_DATA = process.env.NO_DATA === 'true'
module.exports = new BaseKonnector(start) module.exports = new BaseKonnector(start)
/**
* Sentry
*/
Sentry.init({
dsn: 'https://18747a93401447f2a81b83cd8c4bbbdf@grandlyon.errors.cozycloud.cc/5',
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: isLocal() ? 0 : 1.0,
release: version,
environment: isDev() ? 'development' : 'production',
debug: isDev(),
integrations: [
// enable HTTP calls tracing
new Sentry.Integrations.Http({ tracing: true }),
],
})
/** /**
* The start function is run by the BaseKonnector instance only when it got all the account * The start function is run by the BaseKonnector instance only when it got all the account
* information (fields). When you run this connector yourself in "standalone" mode or "dev" mode, * information (fields). When you run this connector yourself in "standalone" mode or "dev" mode,
...@@ -91,11 +70,6 @@ Sentry.init({ ...@@ -91,11 +70,6 @@ Sentry.init({
* @param {{secret: fields}} cozyParameters * @param {{secret: fields}} cozyParameters
*/ */
async function start(fields, cozyParameters) { async function start(fields, cozyParameters) {
const transaction = Sentry.startTransaction({
op: 'konnector',
name: 'SGE Konnector',
})
transaction.startChild({ op: 'Konnector starting' })
try { try {
log('info', 'Konnector configuration ...') log('info', 'Konnector configuration ...')
log('info', `isManual execution: ${manualExecution}`) log('info', `isManual execution: ${manualExecution}`)
...@@ -154,7 +128,6 @@ async function start(fields, cozyParameters) { ...@@ -154,7 +128,6 @@ async function start(fields, cozyParameters) {
const boUrlSGE = new URL('/api/sge', boBaseUrl).href const boUrlSGE = new URL('/api/sge', boBaseUrl).href
if (isFirstStart(await getAccount(ACCOUNT_ID))) { if (isFirstStart(await getAccount(ACCOUNT_ID))) {
log('info', 'First start...') log('info', 'First start...')
transaction.startChild({ op: 'First start' })
const user = await verifyUserIdentity( const user = await verifyUserIdentity(
fields, fields,
baseUrl, baseUrl,
...@@ -221,7 +194,6 @@ async function start(fields, cozyParameters) { ...@@ -221,7 +194,6 @@ async function start(fields, cozyParameters) {
}) })
} else { } else {
log('info', 'Alternate start...') log('info', 'Alternate start...')
transaction.startChild({ op: 'Alternate start' })
const accountData = await getAccount(ACCOUNT_ID) const accountData = await getAccount(ACCOUNT_ID)
const userConsent = await getBoConsent( const userConsent = await getBoConsent(
boUrlSGE, boUrlSGE,
...@@ -272,7 +244,6 @@ async function start(fields, cozyParameters) { ...@@ -272,7 +244,6 @@ async function start(fields, cozyParameters) {
log('info', 'Successfully logged in') log('info', 'Successfully logged in')
await gatherData(baseUrl, apiAuthKey, sgeLogin, pointId) await gatherData(baseUrl, apiAuthKey, sgeLogin, pointId)
transaction.finish()
log('info', 'Konnector success') log('info', 'Konnector success')
} catch (error) { } catch (error) {
const errorMessage = `SGE konnector encountered an error. Response data: ${JSON.stringify( const errorMessage = `SGE konnector encountered an error. Response data: ${JSON.stringify(
...@@ -283,8 +254,6 @@ async function start(fields, cozyParameters) { ...@@ -283,8 +254,6 @@ async function start(fields, cozyParameters) {
section: 'start', section: 'start',
}, },
}) })
transaction.setStatus(Tracing.spanStatusfromHttpCode(409))
transaction.finish()
await Sentry.flush() await Sentry.flush()
throw error throw error
} }
......
const Sentry = require('@sentry/node')
const { version } = require('../package.json')
const { isDev } = require('./helpers/env')
Sentry.init({
dsn: 'https://18747a93401447f2a81b83cd8c4bbbdf@grandlyon.errors.cozycloud.cc/5',
tracesSampleRate: 1.0,
release: version,
environment: isDev() ? 'development' : 'production',
debug: isDev(),
autoSessionTracking: true,
})
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment