{
  "name": "camino-api",
  "version": "1.0.0",
  "description": "Camino api",
  "private": true,
  "main": "./src/index.js",
  "type": "module",
  "scripts": {
    "build": "tsc --incremental",
    "daily": "node --loader ts-node/esm/transpile-only ./src/scripts/daily.ts",
    "monthly": "node --loader ts-node/esm/transpile-only ./src/scripts/monthly.ts",
    "db:dump": "rm -rf ./backups/* && pg_dump --host=localhost --username=postgres --clean --if-exists --format=d --no-owner --no-privileges --dbname=camino --file=./backups/",
    "db:import": "pg_restore --host=localhost --username=postgres --clean --if-exists --no-owner --no-privileges --dbname=camino ./backups",
    "db:import-without-files": "pg_restore --host=localhost --username=postgres --clean --if-exists --no-owner --no-privileges --dbname=camino < ./backup_without_files.backup",
    "db:prod-fetch": "rm -rf ./backups/* && ssh camino.beta.gouv.fr 'rm -f ~/backup.tgz && cd  /srv/backups/dump/ && tar cvzf ~/backup.tgz .' && scp camino.beta.gouv.fr:~/backup.tgz backups/ && tar xvf backups/backup.tgz --directory ./backups",
    "db:prod-fetch-without-files": "scp camino.beta.gouv.fr:/srv/backups/dump_without_files.backup ./backup_without_files.backup",
    "db:recreate": "dropdb --host=localhost --username=postgres camino && createdb --host=localhost --username=postgres camino",
    "db:migrate": "node --loader ts-node/esm/transpile-only ./src/knex/migrate.ts",
    "db:add-migration": "NODE_OPTIONS='--loader ts-node/esm/transpile-only' knex migrate:make",
    "db:watch": "npx --yes --package=@pgtyped/cli pgtyped -w -c pgtyped-config.json",
    "db:check": "npx --yes --package=@pgtyped/cli pgtyped -c pgtyped-config.ci.json",
    "dev": "node --watch --enable-source-maps --loader ts-node/esm/transpile-only --inspect ./src/index.ts",
    "daily-debug": "node  --inspect-brk=3000 --loader ts-node/esm/transpile-only ./src/scripts/daily.ts",
    "dev:update": "npm-check-updates -u && npm install && npm audit fix",
    "documents:check": "node NODE_OPTIONS='--loader ts-node/esm/transpile-only' ./api/src/scripts/documents-check.ts",
    "lint": "prettier --write . && eslint --fix .",
    "start": "node --enable-source-maps --loader ts-node/esm/transpile-only ./src/index.ts",
    "test": "npm run test:unit && npm run test:integration",
    "test:unit": "vitest --environment node --root src/ --config ../vitest.unit.config.ts",
    "test:integration": "vitest --environment node --root src/ --config ../vitest.integration.config.ts",
    "test:generate-data": "node --loader ts-node/esm/transpile-only src/tools/demarches/tests-creation.ts",
    "test:generate-sections-data": "node --loader ts-node/esm/transpile-only src/tools/activites/tests-creation.ts",
    "ci:lint": "prettier --check . && eslint .",
    "matrices": "node --loader ts-node/esm/transpile-only ./src/scripts/matrices.ts"
  },
  "@comment dependencies": {
    "--enable-source-maps": "Vient de l'issue https://github.com/TypeStrong/ts-node/issues/2053",
    "modules esm": "On doit pouvoir migrer ts-node maintenant qu'on a supprimé express-graphql : https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c. mettre à jour express-jwt et graphql-upload"
  },
  "dependencies": {
    "@graphql-tools/graphql-file-loader": "^8.0.1",
    "@graphql-tools/load": "^8.0.2",
    "@pgtyped/runtime": "^2.3.0",
    "@sentry/node": "^7.112.2",
    "@swc/core": "^1.6.5",
    "@tus/file-store": "^1.3.2",
    "@tus/server": "^1.5.0",
    "@types/basic-auth": "^1.1.8",
    "@types/bcryptjs": "^2.4.6",
    "@types/compression": "1.7.5",
    "@types/cors": "^2.8.17",
    "@types/express": "^4.17.21",
    "@types/express-serve-static-core": "^4.19.0",
    "@types/graphql-type-json": "^0.3.5",
    "@types/jsonwebtoken": "^9.0.6",
    "@types/node": "^20.12.7",
    "@types/pg": "^8.11.5",
    "@types/shpjs": "^3.4.7",
    "basic-auth": "^2.0.1",
    "bcryptjs": "^2.4.3",
    "camino-common": "1.0.0",
    "compression": "^1.7.4",
    "cookie-parser": "^1.4.6",
    "cors": "^2.8.5",
    "decimal.js": "^10.4.3",
    "dotenv": "^16.4.5",
    "express": "^4.19.2",
    "express-jwt": "^8.4.1",
    "express-rate-limit": "^7.2.0",
    "graphql": "^16.8.1",
    "graphql-fields": "^2.0.3",
    "graphql-http": "^1.22.1",
    "graphql-scalars": "^1.23.0",
    "graphql-type-json": "^0.3.2",
    "html-to-text": "^9.0.5",
    "jsondiffpatch": "^0.6.0",
    "jsonwebtoken": "^9.0.2",
    "jszip": "^3.10.1",
    "knex": "^3.1.0",
    "node-mailjet": "^6.0.5",
    "objection": "^3.1.4",
    "pg": "^8.11.5",
    "pg-large-object": "^2.0.0",
    "prettier": "^3.2.5",
    "qs": "^6.12.1",
    "shpjs": "^4.0.4",
    "stream-chain": "^2.2.5",
    "stream-json": "^1.8.0",
    "ts-node": "^10.9.2",
    "xlsx": "^0.18.5",
    "xstate": "^5.12.0",
    "zod": "^3.23.4"
  },
  "devDependencies": {
    "@types/carbone": "^3.2.5",
    "@types/cookie-parser": "^1.4.7",
    "@types/pg-large-object": "^2.0.7",
    "@types/stream-json": "^1.7.7",
    "@types/supertest": "^6.0.2",
    "@typescript-eslint/eslint-plugin": "^7.12.0",
    "@typescript-eslint/parser": "^7.12.0",
    "@vitest/coverage-v8": "^1.5.2",
    "carbone": "^3.5.5",
    "eslint": "^8.56.0",
    "eslint-config-prettier": "^8.10.0",
    "eslint-config-standard": "^17.1.0",
    "eslint-plugin-import": "^2.29.1",
    "eslint-plugin-n": "^16.6.2",
    "eslint-plugin-promise": "^6.1.1",
    "eslint-plugin-sql": "^2.5.0",
    "supertest": "^7.0.0",
    "typescript": "^5.4.5",
    "vitest": "^1.5.2"
  },
  "prettier": {
    "semi": false,
    "singleQuote": true,
    "arrowParens": "avoid",
    "trailingComma": "es5",
    "printWidth": 200
  },
  "eslintConfig": {
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
      "project": true
    },
    "overrides": [
      {
        "files": [
          "src/database/models/*.ts"
        ],
        "rules": {
          "@typescript-eslint/no-unsafe-declaration-merging": "off"
        }
      }
    ],
    "extends": [
      "eslint:recommended",
      "plugin:@typescript-eslint/eslint-recommended",
      "plugin:@typescript-eslint/recommended",
      "standard",
      "prettier"
    ],
    "env": {
      "node": true
    },
    "plugins": [
      "@typescript-eslint",
      "sql"
    ],
    "rules": {
      "camelcase": 0,
      "sql/format": [
        0,
        {
          "ignoreExpressions": false,
          "ignoreInline": true,
          "ignoreTagless": true
        }
      ],
      "sql/no-unsafe-query": [
        2,
        {
          "allowLiteral": false
        }
      ],
      "newline-before-return": 1,
      "no-use-before-define": 0,
      "no-redeclare": 0,
      "no-return-await": "error",
      "default-param-last": 0,
      "no-unused-vars": 0,
      "no-restricted-syntax": [
        "error",
        {
          "message": "leftJoinRelation is deprecated. Use leftJoinRelated instead.",
          "selector": "Identifier[name='leftJoinRelation']"
        },
        {
          "message": "no 'run' call from PgTyped allowed. Use dbQueryAndValidate.",
          "selector": "CallExpression[callee.property.name='run'][arguments.length=2]"
        },
        {
          "message": "dbQueryAndValidate is to be used only in .queries.ts files",
          "selector": "CallExpression[callee.name='dbQueryAndValidate']"
        }
      ],
      "no-console": [
        "error",
        {
          "allow": [
            "debug",
            "info",
            "warn",
            "error",
            "time",
            "timeEnd"
          ]
        }
      ],
      "@typescript-eslint/explicit-function-return-type": 0,
      "@typescript-eslint/explicit-module-boundary-types": 0,
      "@typescript-eslint/no-empty-interface": 0,
      "@typescript-eslint/no-explicit-any": 0,
      "@typescript-eslint/no-non-null-assertion": 0,
      "@typescript-eslint/no-var-requires": 0,
      "@typescript-eslint/ban-ts-comment": 0,
      "@typescript-eslint/no-unused-vars": [
        "error",
        {
          "argsIgnorePattern": "^_",
          "varsIgnorePattern": "^_"
        }
      ],
      "@typescript-eslint/strict-boolean-expressions": "warn"
    }
  }
}