Skip to content
Snippets Groups Projects
package.json 8.00 KiB
{
  "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",