diff --git a/index.js b/index.js index c2392fd83c403f225ac67f85da0fcac27fa9da30..ca43069aef0280996f448efba9d04ff5b01b946e 100644 --- a/index.js +++ b/index.js @@ -163,6 +163,12 @@ function buildGetDataUrl(idPCE, startDate, endDate) { return `${baseUrl}/${idPCE}/donnees_consos_informatives?${queryParams}` } +/** + * @param {string} token + * @param {string} idPCE + * @param {string} startDate 'YYYY-MM-DD' + * @param {string} endDate 'YYYY-MM-DD' + */ async function getData(token, idPCE, startDate, endDate) { log('debug', `getData from ${startDate} to ${endDate}`) const url = buildGetDataUrl(idPCE, startDate, endDate) @@ -203760,6 +203766,8 @@ function getDataGenericErrors(code) { '1000010': errors.CHALLENGE_ASKED, '1000014': errors.USER_ACTION_NEEDED_OAUTH_OUTDATED, // TO DELETE '1000005': errors.USER_ACTION_NEEDED_OAUTH_OUTDATED // TO DELETE + // 1000000 -> Le client semble avoir déménagé et n'est plus titulaire de ce PCE, vous ne pouvez donc plus accéder à ses données + // 1000001 -> Votre droit d'accès sur ce PCE a expiré. Pour continuer à accéder aux données, vous devez faire une nouvelle demande d'accès et, le cas échéant, renouveler le consentement du titulaire. } return errorMappings[code] || errors.VENDOR_DOWN