Skip to content

Commit 81216f0

Browse files
paulsouchebjlaaClemog
authored
Release 1.24.0 (#327)
* 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 --------- 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>
1 parent f6bda0f commit 81216f0

File tree

201 files changed

+2424
-5297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+2424
-5297
lines changed

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/soak-load-tests.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/spike-load-tests.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import eslint from '@eslint/js'
2+
import eslintPluginImport from 'eslint-plugin-import'
3+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
4+
import typescriptEslint from 'typescript-eslint'
5+
6+
export default [
7+
{
8+
ignores: ['node_modules', 'coverage', 'dist'],
9+
},
10+
{
11+
languageOptions: {
12+
parserOptions: {
13+
projectService: true,
14+
},
15+
},
16+
settings: {
17+
'import/resolver': {
18+
typescript: true,
19+
node: {
20+
extensions: ['.js', '.ts', '.json'],
21+
},
22+
},
23+
},
24+
},
25+
eslint.configs.recommended,
26+
...typescriptEslint.configs.recommended,
27+
eslintPluginImport.flatConfigs.recommended,
28+
eslintPluginPrettierRecommended,
29+
{
30+
rules: {
31+
'@typescript-eslint/consistent-type-imports': 'error',
32+
'@typescript-eslint/no-unused-vars': [
33+
'error',
34+
{
35+
argsIgnorePattern: '^_.*$',
36+
varsIgnorePattern: '^_.*$',
37+
},
38+
],
39+
'@typescript-eslint/require-await': 'error',
40+
'import/order': [
41+
'error',
42+
{
43+
groups: [
44+
['internal', 'external', 'builtin'],
45+
'parent',
46+
'sibling',
47+
'index',
48+
],
49+
},
50+
],
51+
},
52+
},
53+
]

package.json

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "nosgestesclimat-server",
3-
"version": "1.23.0",
3+
"version": "1.24.0",
44
"description": "The server part of the website nosgestesclimat.fr",
55
"main": "./dist/index.js",
6+
"type": "module",
67
"engines": {
78
"node": "^22"
89
},
@@ -16,19 +17,15 @@
1617
"dev": "NODE_ENV=development nodemon --watch ./src ./src/index.ts",
1718
"dev:worker": "NODE_ENV=development nodemon --watch ./src ./src/worker.ts",
1819
"format": "prettier --write \"**/*.{js,ts,md,json}\" && eslint . --fix --ext .js,.ts",
19-
"generateEnvDeclaration": "yarn run-script scripts/generateEnvDeclaration.ts",
2020
"jobs:computePollStats": "node dist/src/jobs/compute-poll-stats.js",
2121
"jobs:recoverMatomoStats": "node dist/src/jobs/recover-matomo-stats.js",
2222
"jobs:recoverNewsletterStats": "node dist/src/jobs/recover-newsletter-stats.js",
2323
"lint": "prettier --check \"**/*.{js,ts,md,json}\" && eslint . --ext .js,.ts",
24-
"run-script": "ts-node --project tsconfig.json",
2524
"prestart": "yarn db:doc",
2625
"start": "NODE_OPTIONS=--max-old-space-size=8192 node ./dist/src/index.js",
2726
"start:worker": "NODE_OPTIONS=--max-old-space-size=8192 node ./dist/src/worker.js",
2827
"test": "vitest run",
2928
"test:coverage": "vitest run --coverage",
30-
"test:load:spike": "artillery run ./tests/load/spike-test.yml",
31-
"test:load:soak": "artillery run ./tests/load/soak-test.yml",
3229
"prepare": "husky"
3330
},
3431
"author": "",
@@ -45,7 +42,7 @@
4542
"@ts-rest/open-api": "^3.52.1",
4643
"axios": "^1.10.0",
4744
"axios-retry": "^4.5.0",
48-
"change-case": "^4.1.2",
45+
"change-case": "^5.4.4",
4946
"cors": "^2.8.5",
5047
"dayjs": "^1.11.13",
5148
"dotenv": "^17.2.0",
@@ -66,7 +63,7 @@
6663
"winston-transport-sentry-node": "^3.0.0",
6764
"xlsx": "^0.18.5",
6865
"yaml": "^2.8.0",
69-
"yargs": "^17.7.2",
66+
"yargs": "^18.0.0",
7067
"zod": "^3.23.8",
7168
"zod-express-middleware": "^1.4.0"
7269
},
@@ -87,11 +84,10 @@
8784
"@types/supertest": "^6.0.3",
8885
"@types/swagger-ui-express": "^4.1.8",
8986
"@types/yargs": "^17.0.33",
90-
"@typescript-eslint/eslint-plugin": "^8.37.0",
91-
"@typescript-eslint/parser": "^8.37.0",
9287
"@vitest/coverage-v8": "^3.2.4",
93-
"artillery": "^2.0.8",
94-
"eslint": "^8.0.1",
88+
"eslint": "^9.31.0",
89+
"eslint-config-prettier": "^10.1.8",
90+
"eslint-import-resolver-typescript": "^4.4.4",
9591
"eslint-plugin-import": "^2.32.0",
9692
"eslint-plugin-prettier": "^5.5.3",
9793
"husky": "^9.1.7",
@@ -103,8 +99,9 @@
10399
"prisma": "^5.18.0",
104100
"redis-mock": "^0.56.3",
105101
"rimraf": "^6.0.1",
106-
"ts-node": "^10.9.2",
102+
"tsx": "^4.20.3",
107103
"typescript": "^5.8.3",
104+
"typescript-eslint": "^8.37.0",
108105
"vitest": "^3.2.4"
109106
},
110107
"lint-staged": {

prisma/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { PrismaClient } from '@prisma/client'
2-
import { redis } from '../src/adapters/redis/client'
2+
import { redis } from '../src/adapters/redis/client.js'
33

44
const prisma = new PrismaClient()
55

66
const main = async () => {
77
// Order matters here
88
const scripts = [
9-
await import('./scripts/grant-roles'),
10-
await import('./scripts/add-integrations-api-scopes'),
11-
await import('./scripts/add-integrations-email-whitelist'),
12-
await import('./scripts/geolocation-sorted-ips'),
13-
await import('./scripts/geolocation-countries'),
9+
await import('./scripts/grant-roles.js'),
10+
await import('./scripts/add-integrations-api-scopes.js'),
11+
await import('./scripts/add-integrations-email-whitelist.js'),
12+
await import('./scripts/geolocation-sorted-ips.js'),
13+
await import('./scripts/geolocation-countries.js'),
1414
]
1515

1616
try {

prisma/scripts/geolocation-countries.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import axios from 'axios'
22
import type Redis from 'ioredis'
33
import { z } from 'zod'
4-
import { KEYS } from '../../src/adapters/redis/constant'
5-
import type { ValueOf } from '../../src/types/types'
4+
import { KEYS } from '../../src/adapters/redis/constant.js'
5+
import type { ValueOf } from '../../src/types/types.js'
66

77
const REGIONS = {
88
Antarctic: 'Antarctic',

prisma/scripts/geolocation-sorted-ips.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { isIPv4 } from 'node:net'
44
import { createGunzip } from 'node:zlib'
55
import Papa from 'papaparse'
66
import { z } from 'zod'
7-
import { KEYS } from '../../src/adapters/redis/constant'
8-
import { convertIpToNumber } from '../../src/features/modele/geolocation.repository'
7+
import { KEYS } from '../../src/adapters/redis/constant.js'
8+
import { convertIpToNumber } from '../../src/features/modele/geolocation.repository.js'
99

1010
const GeoIpCsvValidator = z.object({
1111
ipStart: z.string(),

src/adapters/2tonnes/client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import axios, { isAxiosError } from 'axios'
22
import axiosRetry from 'axios-retry'
33
import { z } from 'zod'
4-
import { config } from '../../config'
5-
import { isNetworkOrTimeoutOrRetryableError } from '../../core/typeguards/isRetryableAxiosError'
6-
import type { SituationExportQueryParamsSchema } from '../../features/integrations/integrations.validator'
7-
import type { SituationSchema } from '../../features/simulations/simulations.validator'
4+
import { config } from '../../config.js'
5+
import { isNetworkOrTimeoutOrRetryableError } from '../../core/typeguards/isRetryableAxiosError.js'
6+
import type { SituationExportQueryParamsSchema } from '../../features/integrations/integrations.validator.js'
7+
import type { SituationSchema } from '../../features/simulations/simulations.validator.js'
88

99
const twoTons = axios.create({
1010
baseURL: config.thirdParty.twoTons.url,

0 commit comments

Comments
 (0)