Skip to content

Commit

Permalink
chore: update dependencies (#1756)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsagetlethias authored Sep 13, 2023
1 parent 2c77182 commit 644e9d4
Show file tree
Hide file tree
Showing 67 changed files with 1,290 additions and 838 deletions.
7 changes: 4 additions & 3 deletions packages/app/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ const config = {
files: ["**/*.ts?(x)"],
extends: [
"plugin:@typescript-eslint/recommended",
// MORE STRICT
// "plugin:@typescript-eslint/recommended-requiring-type-checking",
// "plugin:@typescript-eslint/stylistic",
// MORE STRICT, enable when monorepo is down
// "plugin:@typescript-eslint/recommended-type-checked",
],
plugins: ["@typescript-eslint", "typescript-sort-keys"],
rules: {
Expand Down Expand Up @@ -158,7 +159,7 @@ const config = {
fixStyle: "inline-type-imports",
},
],
"@typescript-eslint/sort-type-union-intersection-members": "warn",
"@typescript-eslint/sort-type-constituents": "warn",
// handled by tsc already (also not working -_-')
"import/no-unresolved": "off",
},
Expand Down
36 changes: 18 additions & 18 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@
"migrateSimulations": "ts-node --project scripts/tsconfig.json scripts/sql-scripts/migrate-simulations.ts"
},
"dependencies": {
"@codegouvfr/react-dsfr": "^0.63.1",
"@formkit/auto-animate": "^0.7.0",
"@codegouvfr/react-dsfr": "^0.75.8",
"@formkit/auto-animate": "^0.8.0",
"@hookform/resolvers": "^3.1.1",
"@json2csv/node": "^7.0.1",
"@octokit/rest": "^19.0.13",
"@octokit/rest": "^20.0.1",
"@react-pdf/renderer": "^3.1.12",
"@socialgouv/matomo-next": "^1.4.0",
"chart.js": "^4.3.0",
"chartjs-plugin-datalabels": "^2.2.0",
"clsx": "^1.2.1",
"clsx": "^2.0.0",
"cors": "^2.8.5",
"date-fns": "^2.29.3",
"http-status-codes": "^2.2.0",
"i18next": "^23.2.11",
"i18next": "^23.5.1",
"immer": "^10.0.2",
"js-xlsx": "^0.8.22",
"jsonwebtoken": "^9.0.1",
"lodash": "^4.17.21",
"lru-cache": "^10.0.0",
"mime": "^3.0.0",
"moize": "^6.1.3",
"next": "13.4.9",
"next": "13.4.19",
"next-auth": "^4.22.1",
"nodemailer": "^6.8.0",
"pg": "^8.8.0",
Expand All @@ -53,44 +53,44 @@
"sharp": "^0.32.0",
"simple-zustand-devtools": "^1.1.0",
"swr": "^2.1.2",
"swr-devtools": "^1.2.2",
"swr-devtools": "^1.3.2",
"tiny-invariant": "^1.3.1",
"uuid": "^9.0.0",
"uuid": "^9.0.1",
"xlsx": "^0.18.5",
"zod": "^3.21.4",
"zod-i18n-map": "^2.13.2",
"zustand": "^4.3.7"
},
"devDependencies": {
"@babel/core": "^7.22.8",
"@babel/core": "^7.22.17",
"@faker-js/faker": "^8.0.2",
"@hookform/devtools": "^4.3.0",
"@next/eslint-plugin-next": "13.4.9",
"@next/eslint-plugin-next": "13.4.19",
"@tsconfig/next": "^2.0.0",
"@tsconfig/node16": "^16.1.0",
"@types/cors": "^2.8.13",
"@types/dotenv": "^8.2.0",
"@types/jsonwebtoken": "^9.0.2",
"@types/mime": "^3.0.1",
"@types/node": "^20.4.1",
"@types/nodemailer": "^6.4.6",
"@types/node": "^20.6.0",
"@types/nodemailer": "^6.4.10",
"@types/pg": "^8.6.5",
"@types/qs": "^6.9.7",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"babel-loader": "^9.1.3",
"dotenv": "^16.0.1",
"eslint": "^8.24.0",
"eslint": "^8.49.0",
"eslint-config-next": "^13.4.9",
"eslint-config-prettier": "^8.3.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-lodash": "^7.4.0",
"eslint-plugin-prettier": "^5.0.0-alpha.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-typescript-sort-keys": "^2.1.0",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-plugin-typescript-sort-keys": "^3.0.0",
"eslint-plugin-unused-imports": "^3.0.0",
"json-schema-to-typescript": "^12.0.0",
"prettier": "^3.0.0",
"sass": "^1.63.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const tokenCache = new LRUCache<string, VerificationToken>({
ttl: 24 * 60 * 60 * 1000,
});

export const egaproNextAuthAdapter: Adapter<true> = {
export const egaproNextAuthAdapter: Adapter = {
async createUser(user) {
return { id: user.email, ...user };
},
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/api/core-domain/infra/auth/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ declare module "next-auth" {
};
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface Profile extends MonCompteProProfile {}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { type Siren } from "@common/core-domain/domain/valueObjects/Siren";
import { type Siret } from "@common/core-domain/domain/valueObjects/Siret";
import { type CodeNaf } from "@common/models/generated";
import { type Service } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type Service } from "@common/shared-domain";

type EtatAdministratif = "A" | "C" | "F";
export interface Convention {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import { stringify } from "querystring";

import {
type Entreprise,
EntrepriseServiceError,
EntrepriseServiceNotFoundError,
type Etablissement,
type IEntrepriseService,
type SearchParameters,
} from "../IEntrepriseService";
import { EntrepriseServiceError, EntrepriseServiceNotFoundError } from "../IEntrepriseService";

const RECHERCHE_ENTREPRISE_URL = new URL("https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import { type OwnershipRequest } from "@common/core-domain/domain/OwnershipReque
import { OwnershipRequestStatus } from "@common/core-domain/domain/valueObjects/ownership_request/OwnershipRequestStatus";
import { type GetOwnershipRequestDbOrderBy } from "@common/core-domain/dtos/OwnershipRequestDTO";
import { ownershipRequestMap } from "@common/core-domain/mappers/ownershipRequestMap";
import { type SQLCount } from "@common/shared-domain";
import { UnexpectedRepositoryError } from "@common/shared-domain";
import { type SQLCount, UnexpectedRepositoryError } from "@common/shared-domain";
import { UniqueID } from "@common/shared-domain/domain/valueObjects";
import { type Any } from "@common/utils/types";
import { ensureRequired } from "@common/utils/types";
import { type Any, ensureRequired } from "@common/utils/types";

import { type IOwnershipRequestRepo, type OwnershipSearchCriteria } from "../IOwnershipRequestRepo";
import { PostgresOwnershipRepo } from "./PostgresOwnershipRepo";
Expand Down Expand Up @@ -100,8 +98,8 @@ export class PostgresOwnershipRequestRepo implements IOwnershipRequestRepo {
public async updateWithOwnership(item: OwnershipRequest): Promise<void> {
await this.sql.begin(async transac => {
const ownership = new Ownership({
email: item.email!, // eslint-disable-line @typescript-eslint/no-non-null-assertion -- let it throw
siren: item.siren!, // eslint-disable-line @typescript-eslint/no-non-null-assertion -- let it throw
email: item.email!,
siren: item.siren!,
});
const ownershipRepo = new PostgresOwnershipRepo(transac);
const thisRepo = new PostgresOwnershipRequestRepo(transac);
Expand All @@ -117,8 +115,8 @@ export class PostgresOwnershipRequestRepo implements IOwnershipRequestRepo {
.map(
item =>
new Ownership({
email: item.email!, // eslint-disable-line @typescript-eslint/no-non-null-assertion -- let it throw
siren: item.siren!, // eslint-disable-line @typescript-eslint/no-non-null-assertion -- let it throw
email: item.email!,
siren: item.siren!,
}),
);
const ownershipRepo = new PostgresOwnershipRepo(transac);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { OwnershipRequest } from "@common/core-domain/domain/OwnershipRequest";
import { type ErrorDetailTuple } from "@common/core-domain/domain/valueObjects/ownership_request/ErrorDetail";
import { ErrorDetail } from "@common/core-domain/domain/valueObjects/ownership_request/ErrorDetail";
import {
ErrorDetail,
type ErrorDetailTuple,
} from "@common/core-domain/domain/valueObjects/ownership_request/ErrorDetail";
import { OwnershipRequestStatus } from "@common/core-domain/domain/valueObjects/ownership_request/OwnershipRequestStatus";
import { Siren } from "@common/core-domain/domain/valueObjects/Siren";
import { type OwnershipRequestWarningsDTO } from "@common/core-domain/dtos/OwnershipRequestWarningDTO";
import { type UseCase } from "@common/shared-domain";
import { AppError, ValidationError } from "@common/shared-domain";
import { AppError, type UseCase, ValidationError } from "@common/shared-domain";
import { Email } from "@common/shared-domain/domain/valueObjects";

import { type IEntrepriseService } from "../infra/services/IEntrepriseService";
import { EntrepriseServiceNotFoundError } from "../infra/services/IEntrepriseService";
import { EntrepriseServiceNotFoundError, type IEntrepriseService } from "../infra/services/IEntrepriseService";
import { type IOwnershipRequestRepo } from "../repo/IOwnershipRequestRepo";

interface Input {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { type IJsxPdfService } from "@api/shared-domain/infra/pdf/IJsxPdfService";
import { Siren } from "@common/core-domain/domain/valueObjects/Siren";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { PositiveNumber } from "@common/shared-domain/domain/valueObjects";

import { RepresentationEquilibreeReceipt } from "../infra/pdf/templates/RepresentationEquilibreeReceipt";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Siren } from "@common/core-domain/domain/valueObjects/Siren";
import { type DeclarationDTO } from "@common/core-domain/dtos/DeclarationDTO";
import { declarationMap } from "@common/core-domain/mappers/declarationMap";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";

import { type IDeclarationRepo } from "../repo/IDeclarationRepo";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Siren } from "@common/core-domain/domain/valueObjects/Siren";
import { type DeclarationDTO } from "@common/core-domain/dtos/DeclarationDTO";
import { declarationMap } from "@common/core-domain/mappers/declarationMap";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { PositiveNumber } from "@common/shared-domain/domain/valueObjects";

import { type IDeclarationRepo } from "../repo/IDeclarationRepo";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import {
type GetOwnershipRequestInputDTO,
} from "@common/core-domain/dtos/OwnershipRequestDTO";
import { ownershipRequestMap } from "@common/core-domain/mappers/ownershipRequestMap";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { sortBy } from "lodash";

import { type IEntrepriseService } from "../infra/services/IEntrepriseService";
import { EntrepriseServiceNotFoundError } from "../infra/services/IEntrepriseService";
import { EntrepriseServiceNotFoundError, type IEntrepriseService } from "../infra/services/IEntrepriseService";
import { type IOwnershipRequestRepo } from "../repo/IOwnershipRequestRepo";

export class GetOwnershipRequest implements UseCase<GetOwnershipRequestInputDTO, GetOwnershipRequestDTO> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Siren } from "@common/core-domain/domain/valueObjects/Siren";
import { type RepresentationEquilibreeDTO } from "@common/core-domain/dtos/RepresentationEquilibreeDTO";
import { representationEquilibreeMap } from "@common/core-domain/mappers/representationEquilibreeMap";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";

import { type IRepresentationEquilibreeRepo } from "../repo/IRepresentationEquilibreeRepo";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Siren } from "@common/core-domain/domain/valueObjects/Siren";
import { type RepresentationEquilibreeDTO } from "@common/core-domain/dtos/RepresentationEquilibreeDTO";
import { representationEquilibreeMap } from "@common/core-domain/mappers/representationEquilibreeMap";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { PositiveNumber } from "@common/shared-domain/domain/valueObjects";

import { type IRepresentationEquilibreeRepo } from "../repo/IRepresentationEquilibreeRepo";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { RepresentationEquilibreeSpecification } from "@common/core-domain/domai
import { Siren } from "@common/core-domain/domain/valueObjects/Siren";
import { type CreateRepresentationEquilibreeDTO } from "@common/core-domain/dtos/CreateRepresentationEquilibreeDTO";
import { companyMap } from "@common/core-domain/mappers/companyMap";
import { type EntityPropsToJson, type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type EntityPropsToJson, type UseCase } from "@common/shared-domain";
import { PositiveNumber } from "@common/shared-domain/domain/valueObjects";
import { add, isAfter } from "date-fns";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { type IJsxPdfService } from "@api/shared-domain/infra/pdf/IJsxPdfService";
import { config } from "@common/config";
import { Siren } from "@common/core-domain/domain/valueObjects/Siren";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { PositiveNumber } from "@common/shared-domain/domain/valueObjects";

import { type IGlobalMailerService } from "../infra/mail/IGlobalMailerService";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Siren } from "@common/core-domain/domain/valueObjects/Siren";
import { type UpdateOpMcDTO } from "@common/core-domain/dtos/UpdateOpMcDTO";
import { OPMC_OPEN_DURATION_AFTER_EDIT } from "@common/dict";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { PositiveNumber } from "@common/shared-domain/domain/valueObjects";
import { isDateBeforeDuration, parseDate } from "@common/utils/date";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
type OwnershipRequestActionDTO,
} from "@common/core-domain/dtos/OwnershipRequestActionDTO";
import { type OwnershipRequestWarningsDTO } from "@common/core-domain/dtos/OwnershipRequestWarningDTO";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { UniqueID } from "@common/shared-domain/domain/valueObjects";
import { ensureRequired } from "@common/utils/types";
import { partition } from "lodash";
Expand Down Expand Up @@ -191,7 +190,6 @@ export class UpdateOwnershipRequestStatus implements UseCase<OwnershipRequestAct
// 4
if (errorDetail.errorCode !== "ALREADY_PROCESSED") {
try {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- always found
const request = ownershipRequests.find(r => r.id?.getValue() === uuid)!;
request.changeStatus(OwnershipRequestStatus.Enum.ERROR, errorDetail);
await this.ownershipRequestRepo.update(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { County } from "@common/core-domain/domain/valueObjects/County";
import { ReferentType } from "@common/core-domain/domain/valueObjects/referent/ReferentType";
import { Region } from "@common/core-domain/domain/valueObjects/Region";
import { type CreateReferentDTO } from "@common/core-domain/dtos/ReferentDTO";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { Email, Url } from "@common/shared-domain/domain/valueObjects";

import { type IReferentRepo } from "../../repo/IReferentRepo";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { UniqueID } from "@common/shared-domain/domain/valueObjects";

import { type IReferentRepo } from "../../repo/IReferentRepo";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { ReferentType } from "@common/core-domain/domain/valueObjects/referent/R
import { Region } from "@common/core-domain/domain/valueObjects/Region";
import { type EditReferentDTO, type ReferentDTO } from "@common/core-domain/dtos/ReferentDTO";
import { referentMap } from "@common/core-domain/mappers/referentMap";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { Email, UniqueID, Url } from "@common/shared-domain/domain/valueObjects";

import { type IReferentRepo } from "../../repo/IReferentRepo";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { type ReferentDTO } from "@common/core-domain/dtos/ReferentDTO";
import { referentMap } from "@common/core-domain/mappers/referentMap";
import { COUNTIES, REGIONS } from "@common/dict";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { Object } from "@common/utils/overload";
import { type SimpleObject } from "@common/utils/types";
import { AsyncParser } from "@json2csv/node";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { type ReferentDTO } from "@common/core-domain/dtos/ReferentDTO";
import { referentMap } from "@common/core-domain/mappers/referentMap";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";

import { type IReferentRepo } from "../../repo/IReferentRepo";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { County } from "@common/core-domain/domain/valueObjects/County";
import { ReferentType } from "@common/core-domain/domain/valueObjects/referent/ReferentType";
import { Region } from "@common/core-domain/domain/valueObjects/Region";
import { type CreateReferentDTO } from "@common/core-domain/dtos/ReferentDTO";
import { type UseCase } from "@common/shared-domain";
import { AppError } from "@common/shared-domain";
import { AppError, type UseCase } from "@common/shared-domain";
import { Email, Url } from "@common/shared-domain/domain/valueObjects";

import { type IReferentRepo } from "../../repo/IReferentRepo";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */

import { COUNTIES, NAF, REGIONS, REGIONS_TO_COUNTIES } from "@common/dict";
import { Object } from "@common/utils/overload";
import { sample } from "lodash";
Expand Down
3 changes: 1 addition & 2 deletions packages/app/src/api/shared-domain/infra/mail/nodemailer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { config } from "@common/config";
import { type SendMailOptions } from "nodemailer";
import { createTransport } from "nodemailer";
import { createTransport, type SendMailOptions } from "nodemailer";
import SMTPConnection from "nodemailer/lib/smtp-connection";

import { mailerConfig } from "./config";
Expand Down
Loading

0 comments on commit 644e9d4

Please sign in to comment.