Skip to content

Commit 66f38a3

Browse files
paulsouchebjlaaClemog
authored
Release 2.0.0 (#337)
* Merge main Release 1.0.7 * ✨ Tracker les liens dans les emails (NGC-922) (#143) * 🚧 setup lint and format properly (#147) * Modification du schéma Simulation pour sauvegarder les sous-cat + nouveau format pour les (#146) * ✨ setup logger (NGC 1139) (#150) * ➕ logger dependencies * 🔧 setup logger * 💩 evaluate computedResults on fetch (NGC-1140) (#151) * 💩 evaluate computedResults on fetch (NGC-1140) * 💩 evaluate computedResults on fetch groups (NGC-1140) * ♻️ make engine really static * 🐛 empty computedResults in database (#154) * 🔖 v1.0.10 * 🧱 migrate northstar ratings to postgre (NGC-1143) (#153) * ➕ prisma orm dependencies * 🔧 init prisma * 🗃️ northstar ratings migration * 🧪 add a failing test * 🦺 northstar ratings validation * 🧪 add a failing test * ✨ northstar ratings creation * 🧪 add a failing test * ✨ northstar ratings creation in database * 🔧 run migrations during scalingo deploy * 🚨 lint * 🐳 docker-compose services * 📝 README * 🗑️ deprecate old route * 🧱 migrate quizz answers to postgre (NGC-1144) (#156) * 🗃️ quizz answers migration * ✨ quizz answers creation in database * 🗑️ deprecate old route * ✅ northstar improvements * 🧱 migrate users to postgre (NGC-1160) (#157) * 🗃️ users migration * ✨ users creation in database * ♻️ update also in postgres * 🐛 empty computedResults in polls simulations (#159) * 🧱 migrate legacy schemas to postgre (NGC-1163) (#158) * 🔥 remove unused schemas * 🗃️ surveys migration * ✨ surveys creation in database * ♻️ update also in postgres * 🗃️ email-simulations migration * ✨ email simulations creation in database * 🗃️ answers migration * ✨ answers creation in database * 🦺 northstar ratings documents * 🦺 quizz answers documents * 🦺 users documents * ♻️ update also in postgres * 🐛 create simulation with group and no email (#160) * 🔖 v1.1.0 * ✨ migrate organisations simulations computedResults (#162) * ⬆️ model package * ✨ eau metric on organisations simulations migration --------- Co-authored-by: Paul Souche <paul@bettercallpaul.fr> * 🐛 remove groups bad participants (NGC-1188) (#164) * 🧱 migrate groups to postgre (NGC-1167) (#163) * 🗃️ groups migration * ♻️ remove debug try catch * ✨ groups creation in database * 🚨 unused vars shenanigan * ✅ bumping prismock to fix bug * ✨ create groups route * ✨ update group route * ✨ participant joins route * ✨ participant leaves route * ✨ fetch user groups route * ✨ fetch user group route * ✨ delete user group route * 🔧 exclude coverage from workspace * ♻️ update also in postgres * 🐛 don't erase email if empty * ♻️ features api v1 * 🐛 avoid capital letters in emails * 🗃️ groups simulations full computedResults migration (NGC-1113) (#166) * 🗃️ groups migration (NGC-1113) * 🐛 sync mongo & pg group id * ✨ Send the water footprint to Brevo (#167) * 🔖 v1.1.1 * 🐛 fix postgre replication errors (#170) * 🧱 migrate organisations to postgre (NGC-1173) (#165) * 🔥 dead function * 🗃️ verification-codes migration * 🗃️ organisations migration * ✨ organisations creation in database * ✨ verification codes creation in database * ♻️ update also in postgres * 🐛 fix postgre replication errors (#172) * 🔖 v1.1.2 * ♻️ Remove decimal from water footprint (#174) * ✨ Send the water footprint to Brevo * ♻️ Remove decimal in the water footprint * 👔 groups simulations fetch logic (#176) * 🐛 various replication issues (#175) * 🐛 groups replication * 🐛 polls replication * 🐛 organisations replication * ♻️ organisations import really idempotent * 🔖 v1.1.3 * ✨ new authentication system (NGC-287) (#168) * ✨ create verification codes route * ✨ EventBus for side effects * ✨ new Brevo adapter * ✨ send verification code email * ✨ login * ✨ logout * ♻️ remove cookies constants * ♻️ authentication middleware * ♻️ remove generateRandomNumberWithLength * ✨ agir export situation use-case NGC-1294 (#179) * ✅ improve tests to avoid flakyness (#181) * ⬆️ bump prismock to fix a bug * ♻️ decorate prismock delegates to avoid boilerplate * 🐛 increase test timeout * ✅ clean nock after each test * ✅ no need to JSON.stringify nock payload * 🎨 improve tests labels * ✅ ensure database is cleared after each test * ✨ Organisations routes (NGC-1215) (#171) * ✅ nock.cleanAll the right place * 🐛 timeout the right place * ✨ create organisations route * ✨ update organisation route * ✨ fetch organisation(s) routes * ✨ create poll route * ✨ update poll route * ✨ delete poll route * ✨ fetch poll(s) routes * ♻️ organisations with custom questions * 🧱 migrate simulations to postgre (NGC-1242, NGC-1235) (#178) * 🗃️ simulations migration * ✨ simulations creation in database * ♻️ update also in postgres * ✨ simulations create route * ✨ simulations create side effects * ✨ fetch simulation(s) routes * ✨ poll simulations create route * ✨ poll simulations create side effects * 👔 groups routes logic * ✨ group & participant create side effects * ✏️ review comments * 🐛 organisation import * 🐛 postgre sync simulation needed for participant * 🔖 v1.2.0 * 🛂 decomission send email calls (#184) * 🐛 create simulation various fixes (NGC-1235) (#183) * 👔 do not send emails on unfinished simulations * 👔 replicate on new API * 👔 return polls slugs instead of ids * 🎨 look for token in all cookies * 🐛 do not crash server when sending several create simulation * 🎨 better test structure to welcome new cases * ✅ add non regression tests on authenticationmiddleware (#185) * 🔖 v1.2.1 * 🗃️ ngc schema (#193) * 🛂 database grant select access to ngc schema (#194) * 🐛 numberOfCollaborators: Invalid value provided (#192) * ✨ sync brevo contact when needed (NGC-1274) (#190) * ♻️ brevo constants in one place * ✨ update brevo contact on authentication NGC-1274 * ✨ update brevo contact on organisations NGC-1274 * ✨ update brevo contact on groups NGC-1274 * ✨ update brevo contact on simulations NGC-1274 * ✨ handle ListIds.GROUP_JOINED * ✨ handle ListIds.UNFINISHED_SIMULATION * ✨ handle NEWSLETTERS * 🎨 group edge case where a paticipant joins before admin * 🔖 v1.3.0 * ✨ device change (NGC-1310) (#191) * ♻️ auth middleware in unauthenticated mode (NGC-1310) * ✨ device change (NGC-1310) * ♻️ prisma transactions (#195) * ⬆️ update prisma client * ♻️ transactions when needed * 🐛 some simulations have no progression on preprod (#197) * 🐛 some simulations have no user on preprod * 👔 API changes for the frontend (#198) * ✅ test configuration * ⬆️ update model * ♻️ common selects to avoid circular references * 👔 organisation in polls * ✨ polls public data * 👔 simulations details in polls * ✨ public poll simulations * ✨ public poll dashboard * 👔 groups public data * 💥 create simulations endpoints * 🐛 brevo returns 400 instead of 200 * 🦺 allow nullable organisation dtos values to reset field * 🐛 organisation administrator email change (#199) * 🐛 organisation administrator email change * 🔧 change test setup to connect to pg-lite * ✅ increase timeout * :refactor: change afterEach cleanUp to avoid constraint errors * :refactor: updatedAt prisma flag is now correctly handled * :refactor: bye prismock * :refactor: ensure transaction everywhere * 🔖 v1.4.0 * 🐛 don't grant in parallel during deploy * 🔖 v1.4.1 * ✅ fix sync user data (#202) * ⚡ do not sync data twice * 🗃️ add simulation user index * ✅ sync user data * 💄 variables naming * 👔 change send simulation email logic (#203) * ✨ create view for computedResults `bilan` (NGC-1437) (#204) * feat: create view for `bilan` * fix: convert extracted field to text * feat: improve view * feat: add migration file to test config * fix: wrong filename * 🎨 ran prisma format * ✅ flaky test --------- Co-authored-by: Paul Souche <paul@bettercallpaul.fr> * 🔖 v1.5.0 * ✨ newsletter routes refactored (#206) * ✨ get newsletter subscribers * ✨ get user contact * ✨ update user contact * 🧑‍💻 various improvements (#208) * 🧑‍💻 husky * 🗑️ old API * ⬆️ nosgestesclimat model (#207) * ⬆️ nosgestesclimat model * 💚 fix CI job * ✨ export situation on 2 tonnes (NGC-1445) (#209) * ✨ export situation on 2 tonnes (NGC-1445) * 🦺 improve agir validation * ♻️ use prisma client enums instead of redefining them (#211) * ♻️ QuizzAnswerIsAnswerCorrect enum * ♻️ NorthstarRatingType enum * ♻️ PollDefaultAdditionalQuestionType enum * ♻️ SimulationAdditionalQuestionAnswerType enum * ♻️ OrganisationType enum * ♻️ optional verification code user (#213) * 🗃️ optional verification code user * ♻️ wrap verification code in event * 🗃️ remove useless migrations (#214) * 🗃️ remove useless migrations * 🔧 jest generic migrations * 🔖 v1.6.0 * ✨ api authentication (NGC-1503) (#210) * 🗃️ models for integrations API * ♻️ allows multiple post migration scripts * 🗃️ integrations API scopes creation * 🗃️ integrations API whitelist creation * ➕ ts-rest * ✨ openapi * ✨ generate API token route * ✨ recover API token route * ✨ refresh API token route * 🚑 public poll simulations for admin (#217) * 🧪 failing test * 💚 fix failing test * 🩹 public poll dashboard * 🔖 v1.6.1 * ⬆️ nosgestesclimat model (#219) * ✨ email whitelist crud (NGC-1504) (#216) * ✨ init feature * ✨ create email whitelist route * ✨ delete email whitelist route * ✨ fetch email whitelists route * ✨ update email whitelist route * ♻️ put things at the right place * 👔 Change update user & contact logic (NGC-1442) (#221) * 👔 change update user logic WIP * 🎨 test not it * 🎨 remove brevo from API * 💩 make poll simulations public again (NGC-1551) (#222) * ✨ mapping files CRUD (NGC-1505) (#220) * ✨ init feature (NGC-1505) * 🔧 scaleway client * ✨ create mapping file route * ✨ delete mapping file route * ✨ fetch mapping file route * 🔖 v1.7.0 * ✨ add model in simulations (NGC-1166) (#226) * 🗃️ simulation model migration (NGC-1166) * 👔 change simulations logic (NGC-1166) * ✨ map situation (NGC-1531) (#223) * ✨ init feature (NGC-1531) * ✨ map situation (NGC-1531) * 🐛 fix sentry issue (#228) * ⬆️ publicode * 🐛 fix sentry issue * 🔧 pin engine version (#229) * 🔧 setup sentry (NGC-1564) (#227) * ⬆️ nosgestesclimat model (#230) * 🔖 v1.8.0 * Revert "🐛 fix sentry issue (#228)" This reverts commit fdd5688. * Revert ":wrench: setup sentry (NGC-1564) (#227)" This reverts commit 0e38dad. * 🔖 v1.8.1 * 🔥 remove mongodb and socket.io (NGC-1523) (#233) * ✨ organisation type default value (NGC-1515) (#232) * 🗃️ organisation type default value (NGC-1515) * ♻️ migration code changes (NGC-1515) * 👔 public simulations (#235) * 🐛 update settings email is in body (#236) * 🔖 v1.9.0 * ✨ remove params prefix on partner call (NGC-1620) (#239) * 🔥 forgotten files (#238) * 🐛 organisation administrator are not admin for all public polls (#240) * 🧪 public polls admin * 🐛 do not return organisation administrators for logged users * 🔖 v1.9.1 * ♻️ put ugly funfacts code back in place (#242) * ♻️ put ugly funfacts code back in place * 🧪 compare engine and algorithm * 💚 fix tests except averageOfElectricityConsumption * ♻️ remove ugly compute on average funfacts * ♻️ remove global engine (could not change the rules anyway) * ⬆️ nosgestesclimat model * 🔖 v1.9.2 * 💩 public polls are public (NGC-1642) (#244) * 🩹 stop trusting userId for administrators email is the truth (NGC-1654) (#246) * 🧪 public poll with device change * 🩹 stop trusting userId for administrators email is the truth * 🔧 remove mongo image (NGC-1523) (#245) * ✨ change case following query param (NGC-1659) (#247) * 🔖 v1.10.0 * ✨ be able to handle asynchronous events (NGC-1621) (#249) * 🔧 setup redis (NGC-1621) * 🏷️ runtime event types * ✨ emit redis event again * 🩹 do not send email twice when participating to something (NGC-1625) (#250) * 🧪 do not send email twice when participating to a poll * 🩹 do not send email twice when participating to a poll * 🧪 do not send email twice when joining a group * 🩹 do not send email twice when joining a group * 🔊 improve logs (NGC-1731) (#253) * 🔖 v1.11.0 * ✨ funfacts worker (NGC-1724) (#254) * ♻️ simulation repository done well * 💄 clean bootstrap * 🔧 declare worker * 🗃️ fun facts in polls (NGC-1621) * ✨ flush EventBus * ♻️ eventbus should be flushed in tests * ♻️ async SimulationUpsertedEvent * 🧪 compute poll fun facts * ✨ compute poll fun facts * 🔧 scalingo cors configuration (NGC-1656) (#255) * 🔊 ip + JSON format (NGC-1656) (#256) * 🔊 ip + JSON format (NGC-1656) * 💚 flaky tests * ✨ geoip (NGC-1726) (#257) * ✨ geoip to redis (NGC-1726) * ♻️ database scripts (NGC-1726) * 💚 flaky tests (#258) * 💚 flaky tests * ♻️ jest => vitest * ♻️ nock => msw * ➕ coverage * ✨ geolocation endpoint (NGC-1726) (#259) * 🦺 improve geo ip validation * ✨ geolocation endpoint * ✏️ review comments * ⬆️ publicode (#251) * ⬆️ publicode * 💩 but don't use the engine * 🔖 v1.12.1 * 🩹 return less data on poll simulations (NGC-1783) (#262) * 🔖 v1.12.2 * 🗃️ populate polls funFacts (NGC-1784) (#264) * ♻️ stream poll simulations to not explode memory (NGC-1784) * 🗃️ populate polls funFacts (NGC-1784) * 🔖 v1.12.3 * ♻️ transactions (#266) * ♻️ open a transaction is not a repository job * ♻️ mitigate transaction usage * ✨ update user newsletters (NGC-1727) (#267) * ✨ update user newsletters * ✨ newsletters confirmation * ✨ partners endpoint (NGC-1840) (#268) * ✨ partners endpoint (NGC-1840) * ✨ partners features (NGC-1840) * ♻️ newsletter-confirmation (NGC-1727) (#269) * 🔖 v1.13.0 * ♻️ remove transactions on fetch requests * 🔖 v1.13.1 * 🚑 stop returning all poll simulations * 🔖 v1.13.2 * 🚑 no session in worker * 🔖 v1.13.3 * 🚑 fun facts worker loop (#274) * ♻️ simulation upsert informations on event * ⚰️ remove dashboard endpoint * 🚑 poll funfacts worker do not loop over simulations every time * 🔖 v1.14.0 * 🚑 remove user deduplication transaction * 🔖 v1.14.1 * 🚑 various fixes for performances issues (#277) * 🚑 remove administrator query transaction * 🚑 remove duplicated dedupe user logic * 🔖 v1.14.2 * 🚑 worker polls redis cache (#279) * 🧪 be sure cache is used * ♻️ avoid any query in worker with cache * 🔖 v1.14.3 * ⚡ change slow query * 🔖 v1.14.4 * 🛂 rate limiting middleware (NGC-1872) (#283) * Release 1.14.4 (#281) * Merge main Release 1.0.7 * ✨ Tracker les liens dans les emails (NGC-922) (#143) * 🚧 setup lint and format properly (#147) * Modification du schéma Simulation pour sauvegarder les sous-cat + nouveau format pour les (#146) * ✨ setup logger (NGC 1139) (#150) * ➕ logger dependencies * 🔧 setup logger * 💩 evaluate computedResults on fetch (NGC-1140) (#151) * 💩 evaluate computedResults on fetch (NGC-1140) * 💩 evaluate computedResults on fetch groups (NGC-1140) * ♻️ make engine really static * 🐛 empty computedResults in database (#154) * 🔖 v1.0.10 * 🧱 migrate northstar ratings to postgre (NGC-1143) (#153) * ➕ prisma orm dependencies * 🔧 init prisma * 🗃️ northstar ratings migration * 🧪 add a failing test * 🦺 northstar ratings validation * 🧪 add a failing test * ✨ northstar ratings creation * 🧪 add a failing test * ✨ northstar ratings creation in database * 🔧 run migrations during scalingo deploy * 🚨 lint * 🐳 docker-compose services * 📝 README * 🗑️ deprecate old route * 🧱 migrate quizz answers to postgre (NGC-1144) (#156) * 🗃️ quizz answers migration * ✨ quizz answers creation in database * 🗑️ deprecate old route * ✅ northstar improvements * 🧱 migrate users to postgre (NGC-1160) (#157) * 🗃️ users migration * ✨ users creation in database * ♻️ update also in postgres * 🐛 empty computedResults in polls simulations (#159) * 🧱 migrate legacy schemas to postgre (NGC-1163) (#158) * 🔥 remove unused schemas * 🗃️ surveys migration * ✨ surveys creation in database * ♻️ update also in postgres * 🗃️ email-simulations migration * ✨ email simulations creation in database * 🗃️ answers migration * ✨ answers creation in database * 🦺 northstar ratings documents * 🦺 quizz answers documents * 🦺 users documents * ♻️ update also in postgres * 🐛 create simulation with group and no email (#160) * 🔖 v1.1.0 * ✨ migrate organisations simulations computedResults (#162) * ⬆️ model package * ✨ eau metric on organisations simulations migration --------- Co-authored-by: Paul Souche <paul@bettercallpaul.fr> * 🐛 remove groups bad participants (NGC-1188) (#164) * 🧱 migrate groups to postgre (NGC-1167) (#163) * 🗃️ groups migration * ♻️ remove debug try catch * ✨ groups creation in database * 🚨 unused vars shenanigan * ✅ bumping prismock to fix bug * ✨ create groups route * ✨ update group route * ✨ participant joins route * ✨ participant leaves route * ✨ fetch user groups route * ✨ fetch user group route * ✨ delete user group route * 🔧 exclude coverage from workspace * ♻️ update also in postgres * 🐛 don't erase email if empty * ♻️ features api v1 * 🐛 avoid capital letters in emails * 🗃️ groups simulations full computedResults migration (NGC-1113) (#166) * 🗃️ groups migration (NGC-1113) * 🐛 sync mongo & pg group id * ✨ Send the water footprint to Brevo (#167) * 🔖 v1.1.1 * 🐛 fix postgre replication errors (#170) * 🧱 migrate organisations to postgre (NGC-1173) (#165) * 🔥 dead function * 🗃️ verification-codes migration * 🗃️ organisations migration * ✨ organisations creation in database * ✨ verification codes creation in database * ♻️ update also in postgres * 🐛 fix postgre replication errors (#172) * 🔖 v1.1.2 * ♻️ Remove decimal from water footprint (#174) * ✨ Send the water footprint to Brevo * ♻️ Remove decimal in the water footprint * 👔 groups simulations fetch logic (#176) * 🐛 various replication issues (#175) * 🐛 groups replication * 🐛 polls replication * 🐛 organisations replication * ♻️ organisations import really idempotent * 🔖 v1.1.3 * ✨ new authentication system (NGC-287) (#168) * ✨ create verification codes route * ✨ EventBus for side effects * ✨ new Brevo adapter * ✨ send verification code email * ✨ login * ✨ logout * ♻️ remove cookies constants * ♻️ authentication middleware * ♻️ remove generateRandomNumberWithLength * ✨ agir export situation use-case NGC-1294 (#179) * ✅ improve tests to avoid flakyness (#181) * ⬆️ bump prismock to fix a bug * ♻️ decorate prismock delegates to avoid boilerplate * 🐛 increase test timeout * ✅ clean nock after each test * ✅ no need to JSON.stringify nock payload * 🎨 improve tests labels * ✅ ensure database is cleared after each test * ✨ Organisations routes (NGC-1215) (#171) * ✅ nock.cleanAll the right place * 🐛 timeout the right place * ✨ create organisations route * ✨ update organisation route * ✨ fetch organisation(s) routes * ✨ create poll route * ✨ update poll route * ✨ delete poll route * ✨ fetch poll(s) routes * ♻️ organisations with custom questions * 🧱 migrate simulations to postgre (NGC-1242, NGC-1235) (#178) * 🗃️ simulations migration * ✨ simulations creation in database * ♻️ update also in postgres * ✨ simulations create route * ✨ simulations create side effects * ✨ fetch simulation(s) routes * ✨ poll simulations create route * ✨ poll simulations create side effects * 👔 groups routes logic * ✨ group & participant create side effects * ✏️ review comments * 🐛 organisation import * 🐛 postgre sync simulation needed for participant * 🔖 v1.2.0 * 🛂 decomission send email calls (#184) * 🐛 create simulation various fixes (NGC-1235) (#183) * 👔 do not send emails on unfinished simulations * 👔 replicate on new API * 👔 return polls slugs instead of ids * 🎨 look for token in all cookies * 🐛 do not crash server when sending several create simulation * 🎨 better test structure to welcome new cases * ✅ add non regression tests on authenticationmiddleware (#185) * 🔖 v1.2.1 * 🗃️ ngc schema (#193) * 🛂 database grant select access to ngc schema (#194) * 🐛 numberOfCollaborators: Invalid value provided (#192) * ✨ sync brevo contact when needed (NGC-1274) (#190) * ♻️ brevo constants in one place * ✨ update brevo contact on authentication NGC-1274 * ✨ update brevo contact on organisations NGC-1274 * ✨ update brevo contact on groups NGC-1274 * ✨ update brevo contact on simulations NGC-1274 * ✨ handle ListIds.GROUP_JOINED * ✨ handle ListIds.UNFINISHED_SIMULATION * ✨ handle NEWSLETTERS * 🎨 group edge case where a paticipant joins before admin * 🔖 v1.3.0 * ✨ device change (NGC-1310) (#191) * ♻️ auth middleware in unauthenticated mode (NGC-1310) * ✨ device change (NGC-1310) * ♻️ prisma transactions (#195) * ⬆️ update prisma client * ♻️ transactions when needed * 🐛 some simulations have no progression on preprod (#197) * 🐛 some simulations have no user on preprod * 👔 API changes for the frontend (#198) * ✅ test configuration * ⬆️ update model * ♻️ common selects to avoid circular references * 👔 organisation in polls * ✨ polls public data * 👔 simulations details in polls * ✨ public poll simulations * ✨ public poll dashboard * 👔 groups public data * 💥 create simulations endpoints * 🐛 brevo returns 400 instead of 200 * 🦺 allow nullable organisation dtos values to reset field * 🐛 organisation administrator email change (#199) * 🐛 organisation administrator email change * 🔧 change test setup to connect to pg-lite * ✅ increase timeout * :refactor: change afterEach cleanUp to avoid constraint errors * :refactor: updatedAt prisma flag is now correctly handled * :refactor: bye prismock * :refactor: ensure transaction everywhere * 🔖 v1.4.0 * 🐛 don't grant in parallel during deploy * 🔖 v1.4.1 * ✅ fix sync user data (#202) * ⚡ do not sync data twice * 🗃️ add simulation user index * ✅ sync user data * 💄 variables naming * 👔 change send simulation email logic (#203) * ✨ create view for computedResults `bilan` (NGC-1437) (#204) * feat: create view for `bilan` * fix: convert extracted field to text * feat: improve view * feat: add migration file to test config * fix: wrong filename * 🎨 ran prisma format * ✅ flaky test --------- Co-authored-by: Paul Souche <paul@bettercallpaul.fr> * 🔖 v1.5.0 * ✨ newsletter routes refactored (#206) * ✨ get newsletter subscribers * ✨ get user contact * ✨ update user contact * 🧑‍💻 various improvements (#208) * 🧑‍💻 husky * 🗑️ old API * ⬆️ nosgestesclimat model (#207) * ⬆️ nosgestesclimat model * 💚 fix CI job * ✨ export situation on 2 tonnes (NGC-1445) (#209) * ✨ export situation on 2 tonnes (NGC-1445) * 🦺 improve agir validation * ♻️ use prisma client enums instead of redefining them (#211) * ♻️ QuizzAnswerIsAnswerCorrect enum * ♻️ NorthstarRatingType enum * ♻️ PollDefaultAdditionalQuestionType enum * ♻️ SimulationAdditionalQuestionAnswerType enum * ♻️ OrganisationType enum * ♻️ optional verification code user (#213) * 🗃️ optional verification code user * ♻️ wrap verification code in event * 🗃️ remove useless migrations (#214) * 🗃️ remove useless migrations * 🔧 jest generic migrations * 🔖 v1.6.0 * ✨ api authentication (NGC-1503) (#210) * 🗃️ models for integrations API * ♻️ allows multiple post migration scripts * 🗃️ integrations API scopes creation * 🗃️ integrations API whitelist creation * ➕ ts-rest * ✨ openapi * ✨ generate API token route * ✨ recover API token route * ✨ refresh API token route * 🚑 public poll simulations for admin (#217) * 🧪 failing test * 💚 fix failing test * 🩹 public poll dashboard * 🔖 v1.6.1 * ⬆️ nosgestesclimat model (#219) * ✨ email whitelist crud (NGC-1504) (#216) * ✨ init feature * ✨ create email whitelist route * ✨ delete email whitelist route * ✨ fetch email whitelists route * ✨ update email whitelist route * ♻️ put things at the right place * 👔 Change update user & contact logic (NGC-1442) (#221) * 👔 change update user logic WIP * 🎨 test not it * 🎨 remove brevo from API * 💩 make poll simulations public again (NGC-1551) (#222) * ✨ mapping files CRUD (NGC-1505) (#220) * ✨ init feature (NGC-1505) * 🔧 scaleway client * ✨ create mapping file route * ✨ delete mapping file route * ✨ fetch mapping file route * 🔖 v1.7.0 * ✨ add model in simulations (NGC-1166) (#226) * 🗃️ simulation model migration (NGC-1166) * 👔 change simulations logic (NGC-1166) * ✨ map situation (NGC-1531) (#223) * ✨ init feature (NGC-1531) * ✨ map situation (NGC-1531) * 🐛 fix sentry issue (#228) * ⬆️ publicode * 🐛 fix sentry issue * 🔧 pin engine version (#229) * 🔧 setup sentry (NGC-1564) (#227) * ⬆️ nosgestesclimat model (#230) * 🔖 v1.8.0 * Revert "🐛 fix sentry issue (#228)" This reverts commit fdd5688. * Revert ":wrench: setup sentry (NGC-1564) (#227)" This reverts commit 0e38dad. * 🔖 v1.8.1 * 🔥 remove mongodb and socket.io (NGC-1523) (#233) * ✨ organisation type default value (NGC-1515) (#232) * 🗃️ organisation type default value (NGC-1515) * ♻️ migration code changes (NGC-1515) * 👔 public simulations (#235) * 🐛 update settings email is in body (#236) * 🔖 v1.9.0 * ✨ remove params prefix on partner call (NGC-1620) (#239) * 🔥 forgotten files (#238) * 🐛 organisation administrator are not admin for all public polls (#240) * 🧪 public polls admin * 🐛 do not return organisation administrators for logged users * 🔖 v1.9.1 * ♻️ put ugly funfacts code back in place (#242) * ♻️ put ugly funfacts code back in place * 🧪 compare engine and algorithm * 💚 fix tests except averageOfElectricityConsumption * ♻️ remove ugly compute on average funfacts * ♻️ remove global engine (could not change the rules anyway) * ⬆️ nosgestesclimat model * 🔖 v1.9.2 * 💩 public polls are public (NGC-1642) (#244) * 🩹 stop trusting userId for administrators email is the truth (NGC-1654) (#246) * 🧪 public poll with device change * 🩹 stop trusting userId for administrators email is the truth * 🔧 remove mongo image (NGC-1523) (#245) * ✨ change case following query param (NGC-1659) (#247) * 🔖 v1.10.0 * ✨ be able to handle asynchronous events (NGC-1621) (#249) * 🔧 setup redis (NGC-1621) * 🏷️ runtime event types * ✨ emit redis event again * 🩹 do not send email twice when participating to something (NGC-1625) (#250) * 🧪 do not send email twice when participating to a poll * 🩹 do not send email twice when participating to a poll * 🧪 do not send email twice when joining a group * 🩹 do not send email twice when joining a group * 🔊 improve logs (NGC-1731) (#253) * 🔖 v1.11.0 * ✨ funfacts worker (NGC-1724) (#254) * ♻️ simulation repository done well * 💄 clean bootstrap * 🔧 declare worker * 🗃️ fun facts in polls (NGC-1621) * ✨ flush EventBus * ♻️ eventbus should be flushed in tests * ♻️ async SimulationUpsertedEvent * 🧪 compute poll fun facts * ✨ compute poll fun facts * 🔧 scalingo cors configuration (NGC-1656) (#255) * 🔊 ip + JSON format (NGC-1656) (#256) * 🔊 ip + JSON format (NGC-1656) * 💚 flaky tests * ✨ geoip (NGC-1726) (#257) * ✨ geoip to redis (NGC-1726) * ♻️ database scripts (NGC-1726) * 💚 flaky tests (#258) * 💚 flaky tests * ♻️ jest => vitest * ♻️ nock => msw * ➕ coverage * ✨ geolocation endpoint (NGC-1726) (#259) * 🦺 improve geo ip validation * ✨ geolocation endpoint * ✏️ review comments * ⬆️ publicode (#251) * ⬆️ publicode * 💩 but don't use the engine * 🔖 v1.12.1 * 🩹 return less data on poll simulations (NGC-1783) (#262) * 🔖 v1.12.2 * 🗃️ populate polls funFacts (NGC-1784) (#264) * ♻️ stream poll simulations to not explode memory (NGC-1784) * 🗃️ populate polls funFacts (NGC-1784) * 🔖 v1.12.3 * ♻️ transactions (#266) * ♻️ open a transaction is not a repository job * ♻️ mitigate transaction usage * ✨ update user newsletters (NGC-1727) (#267) * ✨ update user newsletters * ✨ newsletters confirmation * ✨ partners endpoint (NGC-1840) (#268) * ✨ partners endpoint (NGC-1840) * ✨ partners features (NGC-1840) * ♻️ newsletter-confirmation (NGC-1727) (#269) * 🔖 v1.13.0 * ♻️ remove transactions on fetch requests * 🔖 v1.13.1 * 🚑 stop returning all poll simulations * 🔖 v1.13.2 * 🚑 no session in worker * 🔖 v1.13.3 * 🚑 fun facts worker loop (#274) * ♻️ simulation upsert informations on event * ⚰️ remove dashboard endpoint * 🚑 poll funfacts worker do not loop over simulations every time * 🔖 v1.14.0 * 🚑 remove user deduplication transaction * 🔖 v1.14.1 * 🚑 various fixes for performances issues (#277) * 🚑 remove administrator query transaction * 🚑 remove duplicated dedupe user logic * 🔖 v1.14.2 * 🚑 worker polls redis cache (#279) * 🧪 be sure cache is used * ♻️ avoid any query in worker with cache * 🔖 v1.14.3 * ⚡ change slow query * 🔖 v1.14.4 --------- Co-authored-by: Benjamin Arias <bjlaa@proton.me> Co-authored-by: Clément <55186402+Clemog@users.noreply.github.com> * 🛂 rate limiting middleware * ✨ use middleware on create poll simulation --------- Co-authored-by: Benjamin Arias <bjlaa@proton.me> Co-authored-by: Clément <55186402+Clemog@users.noreply.github.com> * 🔖 v1.15.0 * ✨ update user email (NGC-1827) (#282) * ♻️ brevo contact fixture * ✨ update user email (NGC-1827) * 👔 2 tons changes (NGC-1893) (#286) * ✨ be able to deactiivate polls real time stats on big polls (NGC-1892) (#285) * 🗃️ poll computeRealTimeStats migration * ✨ poll computeRealTimeStats (NGC-1892) * ✨ compute poll stats cron (NGC-1892) * ⚡ polls requests memory usage (#287) * 🔖 v1.16.0 * 🩹 cache for brevo newsletters (NGC-1920) (#290) * 🔖 v1.16.1 * ✨ import matomo stats (#292) * 🗃️ stats table * 🔧 2 matomal clients * 🔧 add missing env * ✨ matomo adapters * ✨ add script * ⬆️ model (#293) * 🔖 v1.17.0 * 🩹 consider cache alive in case of timeouts (NGC-1855) (#296) * 🔖 v1.17.1 * ✨ campaign excel stats (NGC-1811) (#295) * 🗃️ jobs table * ✨ download simulations results route (NGC-1811) * ✨ download simulations results worker (NGC-1811) * ✨ download simulations results job (NGC-1811) * 🛂 cannot run job twice and specific to user (NGC-1811) * 🚑 poll funFacts redis cache (#298) * 🔊 debug poll funFacts * 🚑 poll funFacts redis cache * ✏️ missing quote (#299) * 🔖 v1.18.0 * 🩹 textile situation (#302) * 👔 add historical actions (#300) * 👔 add historical actions * 👔 iframe actions and segments * 🩹 nbvisits fallback * 🔖 v1.18.1 * ✨ fix last recovery stats errors and make a cron (#304) * 🩹 handle last stats errors * ✨ make import a CRON (NGC-1779) * 🔖 v1.18.2 * 🐛 Fix additionalQuestions being duplicated on save (#307) * 🐛 Fix additionalQuestions being duplicated on save * ♻️ Remove temp code --------- Co-authored-by: Benjamin Arias <12382534+bjlaa@users.noreply.github.com> * 💚 rest countries api changes (#308) * ⬆️ nosgestesclimat model (#309) * 🔖 v1.19.0 * 📝 database (NGC-1332) (#312) * ✨ store newsletter stats every day (NGC-2045) (#311) * 🗃️ brevo newsletter stats (NGC-2045) * ♻️ enum are bad (NGC-2045) * ✨ store newsletters subscriptions (NGC-2045) * ✨ add cron job (NGC-2045) * 🔖 v1.20.0 * 🔥 remove listId 35 (NGC-1282) (#314) * ✨ 2 links on organisation joined (#315) * 🔖 v1.21.0 * 📦 Update model version (#317) Co-authored-by: Benjamin Arias <12382534+bjlaa@users.noreply.github.com> * ⬆️ dependabot + model (NGC-2173) (#319) * ⬆️ dependabot pass * ⬆️ nosgestesclimat model * 🔥 stats api (#320) * 🔖 v1.23.0 * Revert "⬆️ nosgestesclimat model" (#322) This reverts commit b5fd431. * 🔖 v1.23.1 * ✨ various improvements (#324) * ✏️ bad variable * 🔥 artillery * ⬆️ eslint * 🎨 @typescript-eslint/require-await rule * 🧱 move to esm * ⬆️ esm dependencies * 👔 newsletter confirmation origin (#325) * 👔 pass origin to confirmation email * 👔 use confirmation email origin * ✨ /api/stats route (NGC-2175) (#326) * ➕ replace ts-node * ✨ /api/stats route * 🔖 v1.24.0 * 🚑 production deployment (#328) * 🔥 remove useless AptFile * 🔧 prune devDependencies * 🔥 deprecated APIs * ✅ be sure no http call is unhandled during tests * 🚑 production runtime * 🔖 v1.24.1 * 🔧 stats cron 3AM => 7AM (#330) * 🩹 unknown brevo listIds (NGC-2180) (#332) * 👔 remove funfacts default values (NGC-2251) (#331) * 🔖 v1.24.2 * ✨ add last NL * ✅ all newsletters * 🔥 remove old routes (NGC-1330) (#335) * ⬆️ server update (NGC-2277) (#336) * ♻️ more conventions (MGC-2277) * ⬆️ dependabot pass (NGC-2277) * 🔖 v2.0.0 --------- Co-authored-by: Benjamin Arias <bjlaa@proton.me> Co-authored-by: Clément <55186402+Clemog@users.noreply.github.com> Co-authored-by: Benjamin Arias <12382534+bjlaa@users.noreply.github.com> Co-authored-by: Clément <clem.auger@hotmail.fr>
1 parent d192f59 commit 66f38a3

28 files changed

+1240
-1296
lines changed

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nosgestesclimat-server",
3-
"version": "1.24.2",
3+
"version": "2.0.0",
44
"description": "The server part of the website nosgestesclimat.fr",
55
"main": "./dist/index.js",
66
"type": "module",
@@ -31,24 +31,24 @@
3131
"author": "",
3232
"license": "MIT",
3333
"dependencies": {
34-
"@aws-sdk/client-s3": "^3.848.0",
35-
"@aws-sdk/s3-request-presigner": "^3.848.0",
34+
"@aws-sdk/client-s3": "^3.864.0",
35+
"@aws-sdk/s3-request-presigner": "^3.864.0",
3636
"@incubateur-ademe/nosgestesclimat": "3.9.0",
3737
"@prisma/client": "^6.0.0",
3838
"@publicodes/tools": "^1.7.2",
39-
"@sentry/node": "^9.40.0",
39+
"@sentry/node": "^10.5.0",
4040
"@ts-rest/core": "^3.52.1",
4141
"@ts-rest/express": "^3.52.1",
4242
"@ts-rest/open-api": "^3.52.1",
43-
"axios": "^1.10.0",
43+
"axios": "^1.11.0",
4444
"axios-retry": "^4.5.0",
4545
"change-case": "^5.4.4",
4646
"cors": "^2.8.5",
4747
"dayjs": "^1.11.13",
48-
"dotenv": "^17.2.0",
48+
"dotenv": "^17.2.1",
4949
"express": "^4.17.2",
5050
"http-status-codes": "^2.3.0",
51-
"ioredis": "^5.6.1",
51+
"ioredis": "^5.7.0",
5252
"jsonwebtoken": "^9.0.2",
5353
"morgan": "^1.10.1",
5454
"multer": "^2.0.2",
@@ -57,49 +57,49 @@
5757
"publicodes": "^1.9.0",
5858
"request-ip": "^3.3.0",
5959
"slugify": "^1.6.6",
60-
"supertest": "^7.1.3",
6160
"swagger-ui-express": "^5.0.1",
6261
"winston": "^3.17.0",
6362
"winston-transport-sentry-node": "^3.0.0",
6463
"xlsx": "^0.18.5",
65-
"yaml": "^2.8.0",
64+
"yaml": "^2.8.1",
6665
"yargs": "^18.0.0",
6766
"zod": "^3.23.8",
6867
"zod-express-middleware": "^1.4.0"
6968
},
7069
"devDependencies": {
71-
"@electric-sql/pglite": "^0.3.5",
70+
"@electric-sql/pglite": "^0.3.7",
7271
"@faker-js/faker": "^9.9.0",
7372
"@tsconfig/node22": "^22.0.2",
7473
"@types/cors": "^2.8.19",
7574
"@types/express": "^4.17.23",
7675
"@types/jsonwebtoken": "^9.0.10",
7776
"@types/morgan": "^1.9.10",
7877
"@types/multer": "^2.0.0",
79-
"@types/node": "^24.0.15",
78+
"@types/node": "^24.3.0",
8079
"@types/papaparse": "^5.3.16",
8180
"@types/redis-mock": "^0.17.3",
8281
"@types/request-ip": "^0.0.41",
8382
"@types/supertest": "^6.0.3",
8483
"@types/swagger-ui-express": "^4.1.8",
8584
"@types/yargs": "^17.0.33",
8685
"@vitest/coverage-v8": "^3.2.4",
87-
"eslint": "^9.31.0",
86+
"eslint": "^9.33.0",
8887
"eslint-config-prettier": "^10.1.8",
8988
"eslint-import-resolver-typescript": "^4.4.4",
9089
"eslint-plugin-import": "^2.32.0",
91-
"eslint-plugin-prettier": "^5.5.3",
90+
"eslint-plugin-prettier": "^5.5.4",
9291
"husky": "^9.1.7",
93-
"lint-staged": "^16.1.2",
94-
"msw": "^2.10.4",
92+
"lint-staged": "^16.1.5",
93+
"msw": "^2.10.5",
9594
"nodemon": "^3.1.10",
9695
"pglite-prisma-adapter": "^0.3.0",
9796
"prettier": "^3.6.2",
9897
"redis-mock": "^0.56.3",
9998
"rimraf": "^6.0.1",
100-
"tsx": "^4.20.3",
101-
"typescript": "^5.8.3",
102-
"typescript-eslint": "^8.38.0",
99+
"supertest": "^7.1.4",
100+
"tsx": "^4.20.4",
101+
"typescript": "^5.9.2",
102+
"typescript-eslint": "^8.39.1",
103103
"vitest": "^3.2.4"
104104
},
105105
"lint-staged": {

scripts/NGC-1784-20250331.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { prisma } from '../src/adapters/prisma/client'
2-
import { batchFindMany } from '../src/core/batchFindMany'
2+
import { batchFindMany } from '../src/core/batch-find-many'
33
import { updatePollFunFacts } from '../src/features/organisations/organisations.service'
44
import logger from '../src/logger'
55

scripts/NGC-1961-20250602.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { JsonObject, JsonValue } from '@prisma/client/runtime/library'
22
import { prisma } from '../src/adapters/prisma/client'
3-
import { batchFindMany } from '../src/core/batchFindMany'
3+
import { batchFindMany } from '../src/core/batch-find-many'
44
import logger from '../src/logger'
55

66
const hasPreciseChoice = (situation: JsonValue): situation is JsonObject =>

src/adapters/brevo/constant.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export const ListIds = {
4242
GROUP_JOINED: 30,
4343
TRANSPORT_NEWSLETTER: 32,
4444
LOGEMENT_NEWSLETTER: 36,
45+
CONSO_NEWSLETTER: 40,
46+
ALIMENTATION_NEWSLETTER: 41,
47+
CITOYENS_NEWSLETTER: 42,
4548
} as const
4649

4750
export type ListIds = ValueOf<typeof ListIds>
@@ -50,6 +53,9 @@ export const AllNewsletters = [
5053
ListIds.MAIN_NEWSLETTER,
5154
ListIds.LOGEMENT_NEWSLETTER,
5255
ListIds.TRANSPORT_NEWSLETTER,
56+
ListIds.CONSO_NEWSLETTER,
57+
ListIds.ALIMENTATION_NEWSLETTER,
58+
ListIds.CITOYENS_NEWSLETTER,
5359
] as const
5460

5561
// Matomo campaigns & keywords

src/app.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import type { Request } from 'express'
2-
import express from 'express'
3-
import morgan from 'morgan'
4-
import requestIp from 'request-ip'
5-
61
import { createExpressEndpoints } from '@ts-rest/express'
72
import { generateOpenApi } from '@ts-rest/open-api'
83
import cors from 'cors'
4+
import type { Request } from 'express'
5+
import express from 'express'
96
import { StatusCodes } from 'http-status-codes'
7+
import morgan from 'morgan'
108
import path from 'path'
9+
import requestIp from 'request-ip'
1110
import swaggerUi from 'swagger-ui-express'
1211
import { origin } from './config.js'
1312
import authenticationController from './features/authentication/authentication.controller.js'
@@ -23,8 +22,6 @@ import simulationController from './features/simulations/simulations.controller.
2322
import statsController from './features/stats/stats.controller.js'
2423
import usersController from './features/users/users.controller.js'
2524
import logger from './logger.js'
26-
import getNewsletterSubscriptions from './routes/settings/getNewsletterSubscriptions.js'
27-
import updateSettingsRoute from './routes/settings/updateSettings.js'
2825

2926
const app = express()
3027

@@ -65,11 +62,6 @@ app.use(
6562
)
6663
)
6764

68-
// Deprecated routes
69-
app.use('/update-settings', updateSettingsRoute)
70-
app.use('/get-newsletter-subscriptions', getNewsletterSubscriptions)
71-
72-
// new API routes
7365
app.use('/authentication', authenticationController)
7466
app.use('/modele', modeleController)
7567
app.use('/groups', groupsController)

src/constants/axios.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

src/features/integrations/api/mapping-situation/__tests__/map-situation.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ import supertest from 'supertest'
77
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
88
import { client } from '../../../../../adapters/scaleway/client.js'
99
import app from '../../../../../app.js'
10-
import {
11-
MAPPING_CASES,
12-
MAPPING_CASES_FUNC,
13-
} from '../../../../../constants/change-case.js'
1410
import logger from '../../../../../logger.js'
1511
import { getRandomPersonaSituation } from '../../../../simulations/__tests__/fixtures/simulations.fixtures.js'
1612
import type { SituationSchema } from '../../../../simulations/simulations.validator.js'
1713
import { ExternalServiceTypeEnum } from '../../../integrations.validator.js'
1814
import { randomPartner } from '../../mapping-file/__tests__/fixtures/index.js'
1915
import type { MappingFileKind } from '../../mapping-file/mapping-file.contract.js'
16+
import {
17+
MAPPING_CASES,
18+
MAPPING_CASES_FUNC,
19+
} from '../mapping-situation.constant.js'
2020

2121
const mockS3Files = (
2222
filesContent: Partial<
File renamed without changes.

0 commit comments

Comments
 (0)