From c144216ff058bfa77c87e54bc5d142b804cae72e Mon Sep 17 00:00:00 2001 From: Martin Almvik Date: Thu, 14 Nov 2024 15:58:45 +0100 Subject: [PATCH] Legger til wonderwall --- .github/workflows/build_deploy_dev.yml | 1 + .husky/pre-commit | 5 +- .husky/pre-push | 3 - nais/dev/{dev.yaml => preprod.yaml} | 10 +- nais/envs/.env.preprod | 9 + orval.config.ts | 9 +- package-lock.json | 827 ++++++++++-------- package.json | 5 +- src/axios-instance.ts | 84 -- .../Tilgangskontrollside.tsx | 97 +- .../driftsmelding/Driftsmelding.test.ts | 4 +- .../filopplasting/useFilOpplasting.ts | 7 +- src/components/oppgaver/Oppgaver.tsx | 2 +- .../digisos-api-test-controller.msw.ts | 26 +- .../digisos-api-test-controller.ts | 166 ++-- .../forelopig-svar-controller.msw.ts | 10 +- .../forelopig-svar-controller.ts | 97 +- .../hendelse-controller.msw.ts | 10 +- .../hendelse-controller.ts | 82 +- .../info-controller/info-controller.msw.ts | 18 +- .../info-controller/info-controller.ts | 37 +- .../klage-controller/klage-controller.msw.ts | 18 +- .../klage-controller/klage-controller.ts | 109 ++- .../kommune-controller.msw.ts | 10 +- .../kommune-controller/kommune-controller.ts | 85 +- .../model/dokumentasjonkravElement.ts | 2 +- .../dokumentasjonkravElementHendelsetype.ts | 2 +- .../model/dokumentasjonkravElementStatus.ts | 2 +- .../model/dokumentasjonkravResponse.ts | 2 +- src/generated/model/filOpplastingBody.ts | 2 +- src/generated/model/filUrl.ts | 2 +- src/generated/model/forelopigSvarResponse.ts | 2 +- src/generated/model/hendelseResponse.ts | 2 +- src/generated/model/hentSaksDetaljerParams.ts | 2 +- src/generated/model/hentUtbetalingerParams.ts | 2 +- src/generated/model/index.ts | 2 +- src/generated/model/inputKlage.ts | 2 +- src/generated/model/klageDto.ts | 2 +- src/generated/model/klageDtoStatus.ts | 2 +- src/generated/model/kommuneResponse.ts | 2 +- src/generated/model/logg.ts | 2 +- src/generated/model/manedUtbetaling.ts | 2 +- .../nyeOgTidligereUtbetalingerResponse.ts | 2 +- .../model/oppdaterDigisosSakParams.ts | 2 +- src/generated/model/oppgaveElement.ts | 2 +- .../model/oppgaveElementHendelsetype.ts | 2 +- .../model/oppgaveOpplastingResponse.ts | 2 +- .../oppgaveOpplastingResponseHendelsetype.ts | 2 +- src/generated/model/oppgaveResponse.ts | 2 +- src/generated/model/saksDetaljerResponse.ts | 2 +- src/generated/model/saksListeResponse.ts | 2 +- src/generated/model/saksStatusResponse.ts | 2 +- .../model/saksStatusResponseStatus.ts | 2 +- src/generated/model/sendVedleggBody.ts | 2 +- src/generated/model/soknadsStatusResponse.ts | 2 +- .../model/soknadsStatusResponseStatus.ts | 2 +- src/generated/model/tilgangResponse.ts | 2 +- src/generated/model/unit.ts | 2 +- src/generated/model/urlResponse.ts | 2 +- src/generated/model/urlResponseLinkTekst.ts | 2 +- src/generated/model/utbetalingerResponse.ts | 2 +- .../model/vedleggOpplastingResponse.ts | 2 +- .../model/vedleggOpplastingResponseStatus.ts | 2 +- src/generated/model/vedleggResponse.ts | 2 +- src/generated/model/vilkarResponse.ts | 2 +- src/generated/model/vilkarResponseStatus.ts | 2 +- .../oppgave-controller.msw.ts | 58 +- .../oppgave-controller/oppgave-controller.ts | 542 +++++++++--- .../saks-oversikt-controller.msw.ts | 18 +- .../saks-oversikt-controller.ts | 146 +++- .../saks-status-controller.msw.ts | 10 +- .../saks-status-controller.ts | 85 +- .../soknad-med-innsyn-controller.msw.ts | 10 +- .../soknad-med-innsyn-controller.ts | 77 +- .../soknads-status-controller.msw.ts | 10 +- .../soknads-status-controller.ts | 89 +- .../tilgang-controller.msw.ts | 10 +- .../tilgang-controller/tilgang-controller.ts | 66 +- .../utbetalinger-controller.msw.ts | 26 +- .../utbetalinger-controller.ts | 229 +++-- .../vedlegg-controller.msw.ts | 18 +- .../vedlegg-controller/vedlegg-controller.ts | 114 ++- src/middleware.ts | 88 +- src/pages/[id]/status.tsx | 75 +- src/pages/_app.tsx | 1 - src/pages/_document.tsx | 1 + src/pages/api/innsyn-api/[...slug].ts | 52 ++ src/pages/index.tsx | 3 +- src/tsconfig.json | 28 + wonderwall/preprod/idportenclient.yml | 21 + wonderwall/preprod/wonderwall.yml | 69 ++ wonderwall/prod/idportenclient.yml | 22 + wonderwall/prod/wonderwall.yml | 67 ++ 93 files changed, 2359 insertions(+), 1389 deletions(-) rename nais/dev/{dev.yaml => preprod.yaml} (83%) create mode 100644 nais/envs/.env.preprod delete mode 100644 src/axios-instance.ts create mode 100644 src/pages/api/innsyn-api/[...slug].ts create mode 100644 src/tsconfig.json create mode 100644 wonderwall/preprod/idportenclient.yml create mode 100644 wonderwall/preprod/wonderwall.yml create mode 100644 wonderwall/prod/idportenclient.yml create mode 100644 wonderwall/prod/wonderwall.yml diff --git a/.github/workflows/build_deploy_dev.yml b/.github/workflows/build_deploy_dev.yml index bb7b97dd9..7fbaba311 100644 --- a/.github/workflows/build_deploy_dev.yml +++ b/.github/workflows/build_deploy_dev.yml @@ -13,6 +13,7 @@ on: - 'dev' - 'mock' - 'q0' + - 'preprod' workflow_call: inputs: config-file-name: diff --git a/.husky/pre-commit b/.husky/pre-commit index b09f36f28..9b1eb7bba 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npm run lintStaged \ No newline at end of file +npm run lintStaged diff --git a/.husky/pre-push b/.husky/pre-push index 111cc2422..047705026 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,5 +1,2 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - npm run tsc npm run test diff --git a/nais/dev/dev.yaml b/nais/dev/preprod.yaml similarity index 83% rename from nais/dev/dev.yaml rename to nais/dev/preprod.yaml index 70154c037..59bccad59 100644 --- a/nais/dev/dev.yaml +++ b/nais/dev/preprod.yaml @@ -1,7 +1,7 @@ apiVersion: "nais.io/v1alpha1" kind: "Application" metadata: - name: sosialhjelp-innsyn-dev + name: sosialhjelp-innsyn namespace: teamdigisos labels: team: teamdigisos @@ -24,17 +24,19 @@ spec: replicas: min: 1 max: 2 - ingresses: - - "https://sosialhjelp-innsyn-dev.intern.dev.nav.no/sosialhjelp/innsyn" accessPolicy: outbound: rules: - application: nav-dekoratoren namespace: personbruker + - application: sosialhjelp-innsyn-api external: - host: dekoratoren.ekstern.dev.nav.no - - host: digisos.intern.dev.nav.no - host: teamdigisos-unleash-api.nav.cloud.nais.io + - host: login.ekstern.dev.nav.no + inbound: + rules: + - application: wonderwall-innsyn resources: limits: cpu: 200m diff --git a/nais/envs/.env.preprod b/nais/envs/.env.preprod new file mode 100644 index 000000000..d4894b7b8 --- /dev/null +++ b/nais/envs/.env.preprod @@ -0,0 +1,9 @@ +NEXT_PUBLIC_INNSYN_API_SINGLE_LOGOUT_URL=https://loginservice.nav.no/slo +NEXT_INNSYN_API_BASE_URL=https://www.ekstern.dev.nav.no/sosialhjelp/wonderwall-innsyn +NEXT_PUBLIC_INNSYN_API_BASE_URL=https://www.ekstern.dev.nav.no/sosialhjelp/wonderwall-innsyn +NEXT_PUBLIC_LOGIN_BASE_URL=https://login.ekstern.dev.nav.no +NEXT_INNSYN_API_HOSTNAME=sosialhjelp-innsyn +NEXT_PUBLIC_INNSYN_ORIGIN=https://www.ekstern.dev.nav.no +NEXT_PUBLIC_DEKORATOR_MILJO=dev +NEXT_PUBLIC_RUNTIME_ENVIRONMENT=preprod +NEXT_PUBLIC_ASSET_PREFIX=https://cdn.nav.no/teamdigisos/sosialhjelp-innsyn diff --git a/orval.config.ts b/orval.config.ts index f411c11d5..14d42fa9c 100644 --- a/orval.config.ts +++ b/orval.config.ts @@ -6,13 +6,14 @@ export default { target: "src/generated/innsyn-api.ts", schemas: "src/generated/model", client: "react-query", + baseUrl: "/sosialhjelp/innsyn/api/innsyn-api", + httpClient: "fetch", + mock: true, override: { - mutator: { - path: "./src/axios-instance.ts", - name: "axiosInstance", + fetch: { + includeHttpStatusReturnType: false, }, }, - mock: true, }, hooks: { afterAllFilesWrite: "prettier --write", diff --git a/package-lock.json b/package-lock.json index 3b9dcef4a..c4916f4c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,13 +13,14 @@ "@navikt/ds-icons": "^3.4.3", "@navikt/ds-react": "^6.13.0", "@navikt/nav-dekoratoren-moduler": "^2.1.6", + "@navikt/next-api-proxy": "^4.1.3", "@navikt/next-logger": "^1.25.0", + "@navikt/oasis": "^3.4.0", "@sentry/nextjs": "^7.110.1", "@sentry/react": "^8.21.0", "@sentry/tracing": "^7.114.0", "@tanstack/react-query": "^5.51.5", "@unleash/nextjs": "^1.4.2", - "axios": "^1.7.2", "date-fns": "^3.6.0", "i18next": "^23.12.1", "js-cookie": "^3.0.1", @@ -52,7 +53,7 @@ "lint-staged": "^15.2.2", "msw": "^2.3.1", "next-router-mock": "^0.9.13", - "orval": "^6.31.0", + "orval": "^7.2.0", "pino-pretty": "^11.2.1", "prettier": "^3.3.3", "typescript": "^5.5.3", @@ -191,9 +192,9 @@ "dev": true }, "node_modules/@asyncapi/specs": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-4.3.1.tgz", - "integrity": "sha512-EfexhJu/lwF8OdQDm28NKLJHFkx0Gb6O+rcezhZYLPIoNYKXJMh2J1vFGpwmfAcTTh+ffK44Oc2Hs1Q4sLBp+A==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.8.0.tgz", + "integrity": "sha512-1i6xs8+IOh6U5T7yH+bCMGQBF+m7kP/NpwyAlt++XaDQutoGCgACf24mQBgcDVqDWWoY81evQv+9ABvw0BviVg==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.11" @@ -848,9 +849,9 @@ "integrity": "sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw==" }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", + "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==", "cpu": [ "ppc64" ], @@ -860,13 +861,13 @@ "aix" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz", + "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==", "cpu": [ "arm" ], @@ -876,13 +877,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz", + "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==", "cpu": [ "arm64" ], @@ -892,13 +893,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz", + "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==", "cpu": [ "x64" ], @@ -908,13 +909,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz", + "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==", "cpu": [ "arm64" ], @@ -924,13 +925,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz", + "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==", "cpu": [ "x64" ], @@ -940,13 +941,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz", + "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==", "cpu": [ "arm64" ], @@ -956,13 +957,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz", + "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==", "cpu": [ "x64" ], @@ -972,13 +973,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz", + "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==", "cpu": [ "arm" ], @@ -988,13 +989,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz", + "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==", "cpu": [ "arm64" ], @@ -1004,13 +1005,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz", + "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==", "cpu": [ "ia32" ], @@ -1020,13 +1021,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz", + "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==", "cpu": [ "loong64" ], @@ -1036,13 +1037,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz", + "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==", "cpu": [ "mips64el" ], @@ -1052,13 +1053,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz", + "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==", "cpu": [ "ppc64" ], @@ -1068,13 +1069,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz", + "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==", "cpu": [ "riscv64" ], @@ -1084,13 +1085,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz", + "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==", "cpu": [ "s390x" ], @@ -1100,13 +1101,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz", + "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==", "cpu": [ "x64" ], @@ -1116,13 +1117,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz", + "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==", "cpu": [ "x64" ], @@ -1132,13 +1133,29 @@ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz", + "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz", + "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==", "cpu": [ "x64" ], @@ -1148,13 +1165,13 @@ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz", + "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==", "cpu": [ "x64" ], @@ -1164,13 +1181,13 @@ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz", + "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==", "cpu": [ "arm64" ], @@ -1180,13 +1197,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz", + "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==", "cpu": [ "ia32" ], @@ -1196,13 +1213,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", + "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", "cpu": [ "x64" ], @@ -1212,7 +1229,7 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@eslint-community/eslint-utils": { @@ -1420,18 +1437,18 @@ "peer": true }, "node_modules/@ibm-cloud/openapi-ruleset": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/@ibm-cloud/openapi-ruleset/-/openapi-ruleset-1.18.2.tgz", - "integrity": "sha512-Nbdp0Bsadpx2zvwbFadukmtN5QvL8kC/a6V/OxTk9yEDQytfVOssnboZ76IA+OC+IpAehxwjj1EpEirBWIdQKw==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@ibm-cloud/openapi-ruleset/-/openapi-ruleset-1.25.0.tgz", + "integrity": "sha512-nXH+rJJvQLyuxUqaPRcbk5+iyZpYoN6zQW5cqcXxiPzRUTa+JYY7OTuOTXztBdf2RVUYyrB5LppHyk2vHVgR5g==", "dev": true, "dependencies": { - "@ibm-cloud/openapi-ruleset-utilities": "1.3.2", - "@stoplight/spectral-formats": "^1.6.0", - "@stoplight/spectral-functions": "^1.8.0", - "@stoplight/spectral-rulesets": "^1.19.1", + "@ibm-cloud/openapi-ruleset-utilities": "1.4.0", + "@stoplight/spectral-formats": "^1.7.0", + "@stoplight/spectral-functions": "^1.9.0", + "@stoplight/spectral-rulesets": "^1.20.2", "chalk": "^4.1.2", "lodash": "^4.17.21", - "loglevel": "^1.9.1", + "loglevel": "^1.9.2", "loglevel-plugin-prefix": "0.8.4", "minimatch": "^6.2.0", "validator": "^13.11.0" @@ -1441,9 +1458,9 @@ } }, "node_modules/@ibm-cloud/openapi-ruleset-utilities": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@ibm-cloud/openapi-ruleset-utilities/-/openapi-ruleset-utilities-1.3.2.tgz", - "integrity": "sha512-pDZ+YTawZBAMgxfGG0JeCizh7Brmz8h4WRQaJvfJaRfgfdFmp5xZ64oqvnpJQ16XjCdNMBkTB6NJCZjQzq1gpQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@ibm-cloud/openapi-ruleset-utilities/-/openapi-ruleset-utilities-1.4.0.tgz", + "integrity": "sha512-m033WjdlX3k5aSpK2iNX61hS4INEJXUpAxr1l1wBamRQklZpXE2EZKcDQ5AuqVMyz4VV9e46RTp6MAcwXh0gbA==", "dev": true, "engines": { "node": ">=16.0.0" @@ -2611,10 +2628,22 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", "dev": true }, + "node_modules/@jsep-plugin/assignment": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@jsep-plugin/assignment/-/assignment-1.3.0.tgz", + "integrity": "sha512-VVgV+CXrhbMI3aSusQyclHkenWSAm95WaiKrMxRFam3JSUiIaQjoMIw2sEs/OX4XifnqeQUN4DYbJjlA8EfktQ==", + "dev": true, + "engines": { + "node": ">= 10.16.0" + }, + "peerDependencies": { + "jsep": "^0.4.0||^1.0.0" + } + }, "node_modules/@jsep-plugin/regex": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@jsep-plugin/regex/-/regex-1.0.3.tgz", - "integrity": "sha512-XfZgry4DwEZvSFtS/6Y+R48D7qJYJK6R9/yJFyUFHCIUMEEHuJ4X95TDgJp5QkmzfLYvapMPzskV5HpIDrREug==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@jsep-plugin/regex/-/regex-1.0.4.tgz", + "integrity": "sha512-q7qL4Mgjs1vByCaTnDFcBnV9HS7GVPJX5vyVoCgZHNSC9rjwIlmbXG5sUuorR5ndfHAIlJ8pVStxvjXHbNvtUg==", "dev": true, "engines": { "node": ">= 10.16.0" @@ -2624,9 +2653,9 @@ } }, "node_modules/@jsep-plugin/ternary": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@jsep-plugin/ternary/-/ternary-1.1.3.tgz", - "integrity": "sha512-qtLGzCNzPVJ3kdH6/zoLWDPjauHIKiLSBAR71Wa0+PWvGA8wODUQvRgxtpUA5YqAYL3CQ8S4qXhd/9WuWTZirg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@jsep-plugin/ternary/-/ternary-1.1.4.tgz", + "integrity": "sha512-ck5wiqIbqdMX6WRQztBL7ASDty9YLgJ3sSAK5ZpBzXeySvFGCzIvM6UiAI4hTZ22fEcYQVV/zhUbNscggW+Ukg==", "dev": true, "engines": { "node": ">= 10.16.0" @@ -2726,6 +2755,14 @@ "react": "17.x || 18.x" } }, + "node_modules/@navikt/next-api-proxy": { + "version": "4.1.3", + "resolved": "https://npm.pkg.github.com/download/@navikt/next-api-proxy/4.1.3/fa684c85163b5d04ffe47ae13b46cea60a667286", + "integrity": "sha512-aHd+nebE1nNk4nrujF2J738rPHVLzFXhp6pR1kjIYEp6x0C+nNzs/956vAF8xPzpDdcTJZT1Irffy0PJyPA9Zw==", + "peerDependencies": { + "next": "14 || 15" + } + }, "node_modules/@navikt/next-logger": { "version": "1.25.0", "resolved": "https://npm.pkg.github.com/download/@navikt/next-logger/1.25.0/889c2bb99e1efb587552ffcf3869980ab23033db", @@ -2735,6 +2772,17 @@ "pino": "8 || 9" } }, + "node_modules/@navikt/oasis": { + "version": "3.4.0", + "resolved": "https://npm.pkg.github.com/download/@navikt/oasis/3.4.0/7a21e6e8c8e6eca00d7e6a5c06f7e8315c0cc71a", + "integrity": "sha512-le+J+gE/OeLfqyZFQWDqp/pY6f7lzMpP1ynXnDOWBalmkav9tmWor4g/pqb+Xorm6C6bNCdScmCKDHvNVf+CoQ==", + "license": "MIT", + "dependencies": { + "jose": "^5.2.3", + "openid-client": "^5.6.5", + "prom-client": "^15.1.0" + } + }, "node_modules/@next/env": { "version": "14.1.2", "resolved": "https://registry.npmjs.org/@next/env/-/env-14.1.2.tgz", @@ -3018,28 +3066,36 @@ "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==", "dev": true }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/@orval/angular": { - "version": "6.31.0", - "resolved": "https://registry.npmjs.org/@orval/angular/-/angular-6.31.0.tgz", - "integrity": "sha512-cVV/vh6biGUe5FMR0kaOL+pYkD5lM/oHpyHVU19d2eY/hxKCG58/CagUNVDxbowcSalzGpt7NbZOqpauc2cNOA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@orval/angular/-/angular-7.2.0.tgz", + "integrity": "sha512-wjizqcEqu90VzYBrasfRdk4Xy7mzFN+K0ioXiC8UwCzFpNJOqNnLK6Jw09qPKP1BkwRsvYp8STquXJ5Z5DCKsg==", "dev": true, "dependencies": { - "@orval/core": "6.31.0" + "@orval/core": "7.2.0" } }, "node_modules/@orval/axios": { - "version": "6.31.0", - "resolved": "https://registry.npmjs.org/@orval/axios/-/axios-6.31.0.tgz", - "integrity": "sha512-OqWFJ6bDKftsSW3VI7Ouqcb3W4hDhkk8XzDkb/iisn3Dn1rkSE/wafdlHCm+62VQps4esYXaP1+7/HSk/2+Y8A==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@orval/axios/-/axios-7.2.0.tgz", + "integrity": "sha512-RnOMK3xet97h7a2oJ1g0sPv2mTFwM701a3BzNmlQFwC49oOQv2ZhKNiHlKwkTwk5C/PwblkA/WHK9wU9DtUCgw==", "dev": true, "dependencies": { - "@orval/core": "6.31.0" + "@orval/core": "7.2.0" } }, "node_modules/@orval/core": { - "version": "6.31.0", - "resolved": "https://registry.npmjs.org/@orval/core/-/core-6.31.0.tgz", - "integrity": "sha512-ubOPpxzLgOCGbAQsq/dzfe/MIgB4LYWRyuwgnkV2GkL8Zq7cIWfmZU09GTJZQ6cO35OclFfbbyNve0cRMfSBeA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@orval/core/-/core-7.2.0.tgz", + "integrity": "sha512-46BZ+1xCydgbZ7shHxdE3QGMYwhOuKAgOPiTRNZpHvCp4iUdkh64kA9PPObSfQmp5BtYZI+ADVgEue2KBUdK/A==", "dev": true, "dependencies": { "@apidevtools/swagger-parser": "^10.1.0", @@ -3049,7 +3105,7 @@ "chalk": "^4.1.2", "compare-versions": "^6.1.0", "debug": "^4.3.4", - "esbuild": "^0.19.11", + "esbuild": "^0.24.0", "esutils": "2.0.3", "fs-extra": "^11.2.0", "globby": "11.1.0", @@ -3157,63 +3213,65 @@ } }, "node_modules/@orval/fetch": { - "version": "6.31.0", - "resolved": "https://registry.npmjs.org/@orval/fetch/-/fetch-6.31.0.tgz", - "integrity": "sha512-K4pD0TqRX3n1QgsfdzcCLxZPj4WFr4xd51VS5PhtK7wewy+EwaTp5AZeeMT+o8dL4HQcwLsKaXA1HH1YiAuOrA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@orval/fetch/-/fetch-7.2.0.tgz", + "integrity": "sha512-jX82Lrk10hBmRm5gbxALREn97P20IBCbwc0adXmdD1JiuxOESDiTvn3UMM0FJUQAmc7maU3+mWN6+Kr0emD88A==", "dev": true, "dependencies": { - "@orval/core": "6.31.0" + "@orval/core": "7.2.0" } }, "node_modules/@orval/hono": { - "version": "6.31.0", - "resolved": "https://registry.npmjs.org/@orval/hono/-/hono-6.31.0.tgz", - "integrity": "sha512-mM5WISLugu1quNkNUqYwp+StV/Z5/STm33VdPTWkoZyPJtV4NmEUZKPsowk0EN7sBF2kW+aYcp8lsNMXxXfHaw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@orval/hono/-/hono-7.2.0.tgz", + "integrity": "sha512-ENLWcpLltPueq4Ygevqne27ph4HR0T48yGbp9XiTCNPa1IfJYfmh66qaNLvAezbnJ8B1JeiYO8wKhQ9hZQTtWg==", "dev": true, "dependencies": { - "@orval/core": "6.31.0", - "@orval/zod": "6.31.0", + "@orval/core": "7.2.0", + "@orval/zod": "7.2.0", "lodash.uniq": "^4.5.0" } }, "node_modules/@orval/mock": { - "version": "6.31.0", - "resolved": "https://registry.npmjs.org/@orval/mock/-/mock-6.31.0.tgz", - "integrity": "sha512-UBag0IyL0eDVdXWgIMS/YxDF57Q3XC4VRDqcuZ1lB77rfBZ4UiVqTJleczQoIqMGkdtJJlBABgWzRRts1K4img==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@orval/mock/-/mock-7.2.0.tgz", + "integrity": "sha512-9shlOuMUlz93m8FhYb1gJHtmQR0iixdC+262r2NTQcZ0EWKj7Rg7mnvAHCiTfSLhs9cbOpOO1T4VU5jcBQAWCA==", "dev": true, "dependencies": { - "@orval/core": "6.31.0", + "@orval/core": "7.2.0", "lodash.get": "^4.4.2", "lodash.omit": "^4.5.0", "openapi3-ts": "^4.2.2" } }, "node_modules/@orval/query": { - "version": "6.31.0", - "resolved": "https://registry.npmjs.org/@orval/query/-/query-6.31.0.tgz", - "integrity": "sha512-aVyvSU5IbpRQnVbhChNlLX2XDnmoT1cDJ59NEFS3byhiJf1EG5XlzVve98je/BHAsVROrUC8+o6XoIjCtYbW5Q==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@orval/query/-/query-7.2.0.tgz", + "integrity": "sha512-XVSI/dQAPdi9RNIzTjdood7u+PRwNtyGanhN65LFhQr1jMYG1mrPZJW7vyTinHEcJRJnNXdMBdfqoOPUGmBrgQ==", "dev": true, "dependencies": { - "@orval/core": "6.31.0", + "@orval/core": "7.2.0", + "@orval/fetch": "7.2.0", "lodash.omitby": "^4.6.0" } }, "node_modules/@orval/swr": { - "version": "6.31.0", - "resolved": "https://registry.npmjs.org/@orval/swr/-/swr-6.31.0.tgz", - "integrity": "sha512-J9W/kym9jc94GizbTozpuY76yaZRN98rf3ahj+2+eW8+NRW1dVFui32Gew1qj9rcCSA54BwRMONgEn3Xqx6W6A==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@orval/swr/-/swr-7.2.0.tgz", + "integrity": "sha512-LbMFyUVU2RD7PLBRku8GGnktjv9QasQ8VKh996uLhlKlzgVWd1yjE1z5U9k0KKCgJPyRiH7lV3IcTSEa457gUA==", "dev": true, "dependencies": { - "@orval/core": "6.31.0" + "@orval/core": "7.2.0", + "@orval/fetch": "7.2.0" } }, "node_modules/@orval/zod": { - "version": "6.31.0", - "resolved": "https://registry.npmjs.org/@orval/zod/-/zod-6.31.0.tgz", - "integrity": "sha512-v6wqGZf4s3tpWrnmMHlEBfhTLeebu5W3HmhP8vQ5BPkm8AB2asiZqzK3Ne9Y19Rvyx6X4FGnhnalKYkz+XxJ8Q==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@orval/zod/-/zod-7.2.0.tgz", + "integrity": "sha512-WjJabVPrICOgj0ReLB4ooKIxVbvYtqskGcmNkXv1xiNDbgpcpYpYk9HYJ43zTN0bw3T4+8RmpvoLRgHi1TtdzQ==", "dev": true, "dependencies": { - "@orval/core": "6.31.0", + "@orval/core": "7.2.0", "lodash.uniq": "^4.5.0" } }, @@ -4144,9 +4202,9 @@ } }, "node_modules/@stoplight/json": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@stoplight/json/-/json-3.21.0.tgz", - "integrity": "sha512-5O0apqJ/t4sIevXCO3SBN9AHCEKKR/Zb4gaj7wYe5863jme9g02Q0n/GhM7ZCALkL+vGPTe4ZzTETP8TFtsw3g==", + "version": "3.21.7", + "resolved": "https://registry.npmjs.org/@stoplight/json/-/json-3.21.7.tgz", + "integrity": "sha512-xcJXgKFqv/uCEgtGlPxy3tPA+4I+ZI4vAuMJ885+ThkTHFVkC+0Fm58lA9NlsyjnkpxFh4YiQWpH+KefHdbA0A==", "dev": true, "dependencies": { "@stoplight/ordered-object-literal": "^1.0.3", @@ -4219,35 +4277,35 @@ } }, "node_modules/@stoplight/spectral-core": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-core/-/spectral-core-1.18.3.tgz", - "integrity": "sha512-YY8x7X2SWJIhGTLPol+eFiQpWPz0D0mJdkK2i4A0QJG68KkNhypP6+JBC7/Kz3XWjqr0L/RqAd+N5cQLPOKZGQ==", + "version": "1.19.3", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-core/-/spectral-core-1.19.3.tgz", + "integrity": "sha512-tc7B7EBKf1jBiA0iPpPspJahSBrTQ7PC8Jh4wYwquQHlrtc9VSJZJpXWKNetDlW6coKARLIoCDVaBBNBCloUeg==", "dev": true, "dependencies": { "@stoplight/better-ajv-errors": "1.0.3", "@stoplight/json": "~3.21.0", "@stoplight/path": "1.3.2", "@stoplight/spectral-parsers": "^1.0.0", - "@stoplight/spectral-ref-resolver": "^1.0.0", - "@stoplight/spectral-runtime": "^1.0.0", + "@stoplight/spectral-ref-resolver": "^1.0.4", + "@stoplight/spectral-runtime": "^1.1.2", "@stoplight/types": "~13.6.0", "@types/es-aggregate-error": "^1.0.2", "@types/json-schema": "^7.0.11", - "ajv": "^8.6.0", + "ajv": "^8.17.1", "ajv-errors": "~3.0.0", "ajv-formats": "~2.1.0", "es-aggregate-error": "^1.0.7", - "jsonpath-plus": "7.1.0", + "jsonpath-plus": "10.1.0", "lodash": "~4.17.21", "lodash.topath": "^4.5.2", "minimatch": "3.1.2", - "nimma": "0.2.2", - "pony-cause": "^1.0.0", - "simple-eval": "1.0.0", - "tslib": "^2.3.0" + "nimma": "0.2.3", + "pony-cause": "^1.1.1", + "simple-eval": "1.0.1", + "tslib": "^2.8.1" }, "engines": { - "node": "^12.20 || >= 14.13" + "node": "^16.20 || ^18.18 || >= 20.17" } }, "node_modules/@stoplight/spectral-core/node_modules/@stoplight/better-ajv-errors": { @@ -4311,40 +4369,40 @@ "dev": true }, "node_modules/@stoplight/spectral-formats": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-formats/-/spectral-formats-1.6.0.tgz", - "integrity": "sha512-X27qhUfNluiduH0u/QwJqhOd8Wk5YKdxVmKM03Aijlx0AH1H5mYt3l9r7t2L4iyJrsBaFPnMGt7UYJDGxszbNA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-formats/-/spectral-formats-1.8.2.tgz", + "integrity": "sha512-c06HB+rOKfe7tuxg0IdKDEA5XnjL2vrn/m/OVIIxtINtBzphZrOgtRn7epQ5bQF5SWp84Ue7UJWaGgDwVngMFw==", "dev": true, "dependencies": { "@stoplight/json": "^3.17.0", - "@stoplight/spectral-core": "^1.8.0", + "@stoplight/spectral-core": "^1.19.2", "@types/json-schema": "^7.0.7", - "tslib": "^2.3.1" + "tslib": "^2.8.1" }, "engines": { - "node": ">=12" + "node": "^16.20 || ^18.18 || >= 20.17" } }, "node_modules/@stoplight/spectral-functions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-functions/-/spectral-functions-1.8.0.tgz", - "integrity": "sha512-ZrAkYA/ZGbuQ6EyG1gisF4yQ5nWP/+glcqVoGmS6kH6ekaynz2Yp6FL0oIamWj3rWedFUN7ppwTRUdo+9f/uCw==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-functions/-/spectral-functions-1.9.2.tgz", + "integrity": "sha512-E+eh4IcYF73y8IKs4H8krvmeXiwBzTuoMfoTsoqGkdE5+1Vlfhm/1zm+jaZzSEwyWsl//8j3+gD+9RNpNlpa0Q==", "dev": true, "dependencies": { "@stoplight/better-ajv-errors": "1.0.3", "@stoplight/json": "^3.17.1", - "@stoplight/spectral-core": "^1.7.0", - "@stoplight/spectral-formats": "^1.0.0", - "@stoplight/spectral-runtime": "^1.1.0", - "ajv": "^8.6.3", + "@stoplight/spectral-core": "^1.19.2", + "@stoplight/spectral-formats": "^1.8.1", + "@stoplight/spectral-runtime": "^1.1.2", + "ajv": "^8.17.1", "ajv-draft-04": "~1.0.0", "ajv-errors": "~3.0.0", "ajv-formats": "~2.1.0", "lodash": "~4.17.21", - "tslib": "^2.3.0" + "tslib": "^2.8.1" }, "engines": { - "node": ">=12" + "node": "^16.20 || ^18.18 || >= 20.17" } }, "node_modules/@stoplight/spectral-functions/node_modules/@stoplight/better-ajv-errors": { @@ -4409,18 +4467,18 @@ "dev": true }, "node_modules/@stoplight/spectral-parsers": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-parsers/-/spectral-parsers-1.0.4.tgz", - "integrity": "sha512-nCTVvtX6q71M8o5Uvv9kxU31Gk1TRmgD6/k8HBhdCmKG6FWcwgjiZouA/R3xHLn/VwTI/9k8SdG5Mkdy0RBqbQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-parsers/-/spectral-parsers-1.0.5.tgz", + "integrity": "sha512-ANDTp2IHWGvsQDAY85/jQi9ZrF4mRrA5bciNHX+PUxPr4DwS6iv4h+FVWJMVwcEYdpyoIdyL+SRmHdJfQEPmwQ==", "dev": true, "dependencies": { "@stoplight/json": "~3.21.0", "@stoplight/types": "^14.1.1", "@stoplight/yaml": "~4.3.0", - "tslib": "^2.3.1" + "tslib": "^2.8.1" }, "engines": { - "node": "^12.20 || >=14.13" + "node": "^16.20 || ^18.18 || >= 20.17" } }, "node_modules/@stoplight/spectral-parsers/node_modules/@stoplight/types": { @@ -4437,45 +4495,45 @@ } }, "node_modules/@stoplight/spectral-ref-resolver": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-ref-resolver/-/spectral-ref-resolver-1.0.4.tgz", - "integrity": "sha512-5baQIYL0NJTSVy8v6RxOR4U51xOUYM8wJri1YvlAT6bPN8m0EIxMwfVYi0xUZEMVeHcWx869nIkoqyWmOutF2A==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-ref-resolver/-/spectral-ref-resolver-1.0.5.tgz", + "integrity": "sha512-gj3TieX5a9zMW29z3mBlAtDOCgN3GEc1VgZnCVlr5irmR4Qi5LuECuFItAq4pTn5Zu+sW5bqutsCH7D4PkpyAA==", "dev": true, "dependencies": { "@stoplight/json-ref-readers": "1.2.2", "@stoplight/json-ref-resolver": "~3.1.6", "@stoplight/spectral-runtime": "^1.1.2", "dependency-graph": "0.11.0", - "tslib": "^2.3.1" + "tslib": "^2.8.1" }, "engines": { - "node": ">=12" + "node": "^16.20 || ^18.18 || >= 20.17" } }, "node_modules/@stoplight/spectral-rulesets": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-rulesets/-/spectral-rulesets-1.19.1.tgz", - "integrity": "sha512-rfGK87Y1JJCEeLC8MVdLkjUkRH+Y6VnSF388D+UWihfU9xuq2eNB9phWpTFkG+AG4HLRyGx963BmO6PyM9dBag==", + "version": "1.21.2", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-rulesets/-/spectral-rulesets-1.21.2.tgz", + "integrity": "sha512-8i2e6LANHn7cw7i2KUq/7bWjZfb+XNo9MEw1jSKVniime0UIgJKtN2kbG8F57WeXFip+XGScKTigyXOoUD9YTw==", "dev": true, "dependencies": { - "@asyncapi/specs": "^4.1.0", + "@asyncapi/specs": "^6.8.0", "@stoplight/better-ajv-errors": "1.0.3", "@stoplight/json": "^3.17.0", - "@stoplight/spectral-core": "^1.8.1", - "@stoplight/spectral-formats": "^1.5.0", - "@stoplight/spectral-functions": "^1.5.1", - "@stoplight/spectral-runtime": "^1.1.1", + "@stoplight/spectral-core": "^1.19.2", + "@stoplight/spectral-formats": "^1.8.1", + "@stoplight/spectral-functions": "^1.9.1", + "@stoplight/spectral-runtime": "^1.1.2", "@stoplight/types": "^13.6.0", "@types/json-schema": "^7.0.7", - "ajv": "^8.12.0", + "ajv": "^8.17.1", "ajv-formats": "~2.1.0", "json-schema-traverse": "^1.0.0", "leven": "3.1.0", "lodash": "~4.17.21", - "tslib": "^2.3.0" + "tslib": "^2.8.1" }, "engines": { - "node": ">=12" + "node": "^16.20 || ^18.18 || >= 20.17" } }, "node_modules/@stoplight/spectral-rulesets/node_modules/@stoplight/better-ajv-errors": { @@ -4517,34 +4575,21 @@ "dev": true }, "node_modules/@stoplight/spectral-runtime": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-runtime/-/spectral-runtime-1.1.2.tgz", - "integrity": "sha512-fr5zRceXI+hrl82yAVoME+4GvJie8v3wmOe9tU+ZLRRNonizthy8qDi0Z/z4olE+vGreSDcuDOZ7JjRxFW5kTw==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-runtime/-/spectral-runtime-1.1.3.tgz", + "integrity": "sha512-uoKSVX/OYXOEBRQN7EtAaVefl8MlyhBkDcU2aDYEGALwYXHAH+vmF3ljhZrueMA3fSWLHTL3RxWqsjeeCor6lw==", "dev": true, "dependencies": { - "@stoplight/json": "^3.17.0", + "@stoplight/json": "^3.20.1", "@stoplight/path": "^1.3.2", - "@stoplight/types": "^12.3.0", + "@stoplight/types": "^13.6.0", "abort-controller": "^3.0.0", "lodash": "^4.17.21", "node-fetch": "^2.6.7", - "tslib": "^2.3.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@stoplight/spectral-runtime/node_modules/@stoplight/types": { - "version": "12.5.0", - "resolved": "https://registry.npmjs.org/@stoplight/types/-/types-12.5.0.tgz", - "integrity": "sha512-dwqYcDrGmEyUv5TWrDam5TGOxU72ufyQ7hnOIIDdmW5ezOwZaBFoR5XQ9AsH49w7wgvOqB2Bmo799pJPWnpCbg==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.4", - "utility-types": "^3.10.0" + "tslib": "^2.8.1" }, "engines": { - "node": ">=8" + "node": "^16.20 || ^18.18 || >= 20.17" } }, "node_modules/@stoplight/types": { @@ -5936,9 +5981,9 @@ "dev": true }, "node_modules/astring": { - "version": "1.8.6", - "resolved": "https://registry.npmjs.org/astring/-/astring-1.8.6.tgz", - "integrity": "sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz", + "integrity": "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==", "dev": true, "bin": { "astring": "bin/astring" @@ -5981,16 +6026,6 @@ "node": ">=4" } }, - "node_modules/axios": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", - "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, "node_modules/axobject-query": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", @@ -6201,17 +6236,10 @@ } ] }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/bintrees": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", + "integrity": "sha512-VOMgTMwjAaUG580SXn3LacVgjurrbMme7ZZNYGSSV7mmtY6QQRh0Eg3pwIcntQ77DErK1L0NxkbetjcoXzVwKw==" }, "node_modules/brace-expansion": { "version": "1.1.11", @@ -6503,39 +6531,18 @@ } }, "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", + "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", "dev": true, "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "readdirp": "^4.0.1" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 14.16.0" }, "funding": { "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/chokidar/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" } }, "node_modules/chownr": { @@ -7613,41 +7620,42 @@ "dev": true }, "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", + "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" + "@esbuild/aix-ppc64": "0.24.0", + "@esbuild/android-arm": "0.24.0", + "@esbuild/android-arm64": "0.24.0", + "@esbuild/android-x64": "0.24.0", + "@esbuild/darwin-arm64": "0.24.0", + "@esbuild/darwin-x64": "0.24.0", + "@esbuild/freebsd-arm64": "0.24.0", + "@esbuild/freebsd-x64": "0.24.0", + "@esbuild/linux-arm": "0.24.0", + "@esbuild/linux-arm64": "0.24.0", + "@esbuild/linux-ia32": "0.24.0", + "@esbuild/linux-loong64": "0.24.0", + "@esbuild/linux-mips64el": "0.24.0", + "@esbuild/linux-ppc64": "0.24.0", + "@esbuild/linux-riscv64": "0.24.0", + "@esbuild/linux-s390x": "0.24.0", + "@esbuild/linux-x64": "0.24.0", + "@esbuild/netbsd-x64": "0.24.0", + "@esbuild/openbsd-arm64": "0.24.0", + "@esbuild/openbsd-x64": "0.24.0", + "@esbuild/sunos-x64": "0.24.0", + "@esbuild/win32-arm64": "0.24.0", + "@esbuild/win32-ia32": "0.24.0", + "@esbuild/win32-x64": "0.24.0" } }, "node_modules/escalade": { @@ -8394,9 +8402,9 @@ "integrity": "sha512-HPtaa38cPgWvaCFmRNhlc6NG7pv6NUHqjPgVAkWGoB9mQMwYB27/K0CvOM5Czy+qpT3e8XJ6Q4aPAnzpNpzNaw==" }, "node_modules/fast-uri": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", - "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz", + "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==", "dev": true }, "node_modules/fastest-stable-stringify": { @@ -8485,25 +8493,6 @@ "dev": true, "peer": true }, - "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -9333,18 +9322,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/is-boolean-object": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", @@ -11834,6 +11811,14 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/jose": { + "version": "5.9.6", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.9.6.tgz", + "integrity": "sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/joycon": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", @@ -11917,9 +11902,9 @@ } }, "node_modules/jsep": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/jsep/-/jsep-1.3.9.tgz", - "integrity": "sha512-i1rBX5N7VPl0eYb6+mHNp52sEuaS2Wi8CDYx1X5sn9naevL78+265XJqy1qENEk7mRKwS06NHpUqiBwR7qeodw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jsep/-/jsep-1.4.0.tgz", + "integrity": "sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw==", "dev": true, "engines": { "node": ">= 10.16.0" @@ -11995,12 +11980,21 @@ } }, "node_modules/jsonpath-plus": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-7.1.0.tgz", - "integrity": "sha512-gTaNRsPWO/K2KY6MrqaUFClF9kmuM6MFH5Dhg1VYDODgFbByw1yb7xu3hrViE/sz+dGOeMWgCzwUwQtAnCTE9g==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-10.1.0.tgz", + "integrity": "sha512-gHfV1IYqH8uJHYVTs8BJX1XKy2/rR93+f8QQi0xhx95aCiXn1ettYAd5T+7FU6wfqyDoX/wy0pm/fL3jOKJ9Lg==", "dev": true, + "dependencies": { + "@jsep-plugin/assignment": "^1.2.1", + "@jsep-plugin/regex": "^1.0.3", + "jsep": "^1.3.9" + }, + "bin": { + "jsonpath": "bin/jsonpath-cli.js", + "jsonpath-plus": "bin/jsonpath-cli.js" + }, "engines": { - "node": ">=12.0.0" + "node": ">=18.0.0" } }, "node_modules/jsonpointer": { @@ -12619,9 +12613,9 @@ } }, "node_modules/loglevel": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.1.tgz", - "integrity": "sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", + "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", "dev": true, "engines": { "node": ">= 0.6.0" @@ -13312,9 +13306,9 @@ "integrity": "sha512-qsHJle3GU3CmVx7pUoXcghX4sRN+vINkbLdH611T8ZlsP//grzqVW87BSUgOZeSAD4q7ZdZicdwNe/20U2janA==" }, "node_modules/nimma": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/nimma/-/nimma-0.2.2.tgz", - "integrity": "sha512-V52MLl7BU+tH2Np9tDrIXK8bql3MVUadnMIl/0/oZSGC9keuro0O9UUv9QKp0aMvtN8HRew4G7byY7H4eWsxaQ==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/nimma/-/nimma-0.2.3.tgz", + "integrity": "sha512-1ZOI8J+1PKKGceo/5CT5GfQOG6H8I2BencSK06YarZ2wXwH37BSSUWldqJmMJYA5JfqDqffxDXynt6f11AyKcA==", "dev": true, "dependencies": { "@jsep-plugin/regex": "^1.0.1", @@ -13326,20 +13320,10 @@ "node": "^12.20 || >=14.13" }, "optionalDependencies": { - "jsonpath-plus": "^6.0.1", + "jsonpath-plus": "^6.0.1 || ^10.1.0", "lodash.topath": "^4.5.2" } }, - "node_modules/nimma/node_modules/jsonpath-plus": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-6.0.1.tgz", - "integrity": "sha512-EvGovdvau6FyLexFH2OeXfIITlgIbgZoAZe3usiySeaIDm5QS+A10DKNpaPBBqqRSZr2HN6HVNXxtwUAr2apEw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/node-cache": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/node-cache/-/node-cache-5.1.2.tgz", @@ -13554,6 +13538,14 @@ "node": ">=0.10.0" } }, + "node_modules/object-hash": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz", + "integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==", + "engines": { + "node": ">= 6" + } + }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -13670,6 +13662,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/oidc-token-hash": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/oidc-token-hash/-/oidc-token-hash-5.0.3.tgz", + "integrity": "sha512-IF4PcGgzAr6XXSff26Sk/+P4KZFJVuHAJZj3wgO3vX2bMdNVp/QXTP3P7CEm9V1IdG8lDLY3HhiqpsE/nOwpPw==", + "engines": { + "node": "^10.13.0 || >=12.0.0" + } + }, "node_modules/on-exit-leak-free": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.0.tgz", @@ -13714,6 +13714,44 @@ "yaml": "^2.3.4" } }, + "node_modules/openid-client": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.7.0.tgz", + "integrity": "sha512-4GCCGZt1i2kTHpwvaC/sCpTpQqDnBzDzuJcJMbH+y1Q5qI8U8RBvoSh28svarXszZHR5BAMXbJPX1PGPRE3VOA==", + "dependencies": { + "jose": "^4.15.9", + "lru-cache": "^6.0.0", + "object-hash": "^2.2.0", + "oidc-token-hash": "^5.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/openid-client/node_modules/jose": { + "version": "4.15.9", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", + "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/openid-client/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/openid-client/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/optionator": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", @@ -13733,25 +13771,25 @@ } }, "node_modules/orval": { - "version": "6.31.0", - "resolved": "https://registry.npmjs.org/orval/-/orval-6.31.0.tgz", - "integrity": "sha512-515KTDQ4VRJCT+4DsMrK/QROWRq4PXrjgxAoEx3jmP7j+aQBGbx8WhidIF6aX1UgbTxw47Lq7QVp9mbnD0lnWA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/orval/-/orval-7.2.0.tgz", + "integrity": "sha512-4cXVNXnw5yS9+JRLlgpIkbKgBY8NXaOY6NVbUM8SNAPppUCbfU566tPrVbmcFmz6bHMniQfEzxQW8FcbgwuEiQ==", "dev": true, "dependencies": { "@apidevtools/swagger-parser": "^10.1.0", - "@orval/angular": "6.31.0", - "@orval/axios": "6.31.0", - "@orval/core": "6.31.0", - "@orval/fetch": "6.31.0", - "@orval/hono": "6.31.0", - "@orval/mock": "6.31.0", - "@orval/query": "6.31.0", - "@orval/swr": "6.31.0", - "@orval/zod": "6.31.0", + "@orval/angular": "7.2.0", + "@orval/axios": "7.2.0", + "@orval/core": "7.2.0", + "@orval/fetch": "7.2.0", + "@orval/hono": "7.2.0", + "@orval/mock": "7.2.0", + "@orval/query": "7.2.0", + "@orval/swr": "7.2.0", + "@orval/zod": "7.2.0", "ajv": "^8.12.0", "cac": "^6.7.14", "chalk": "^4.1.2", - "chokidar": "^3.6.0", + "chokidar": "^4.0.1", "enquirer": "^2.4.1", "execa": "^5.1.1", "find-up": "5.0.0", @@ -14439,6 +14477,18 @@ "node": ">=0.4.0" } }, + "node_modules/prom-client": { + "version": "15.1.3", + "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-15.1.3.tgz", + "integrity": "sha512-6ZiOBfCywsD4k1BN9IX0uZhF+tJkV8q8llP64G5Hajs4JOeVLPCwpPVcpXy3BwYiUGgyJzsJJQeOIv7+hDSq8g==", + "dependencies": { + "@opentelemetry/api": "^1.4.0", + "tdigest": "^0.1.1" + }, + "engines": { + "node": "^16 || ^18 || >=20" + } + }, "node_modules/promise-retry": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", @@ -14678,15 +14728,16 @@ "integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==" }, "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", + "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, "engines": { - "node": ">=8.10.0" + "node": ">= 14.16.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/real-require": { @@ -15271,12 +15322,12 @@ "dev": true }, "node_modules/simple-eval": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/simple-eval/-/simple-eval-1.0.0.tgz", - "integrity": "sha512-kpKJR+bqTscgC0xuAl2xHN6bB12lHjC2DCUfqjAx19bQyO3R2EVLOurm3H9AUltv/uFVcSCVNc6faegR+8NYLw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-eval/-/simple-eval-1.0.1.tgz", + "integrity": "sha512-LH7FpTAkeD+y5xQC4fzS+tFtaNlvt3Ib1zKzvhjv/Y+cioV4zIuw4IZr2yhRLu67CWL7FR9/6KXKnjRoZTvGGQ==", "dev": true, "dependencies": { - "jsep": "^1.1.2" + "jsep": "^1.3.6" }, "engines": { "node": ">=12" @@ -15992,6 +16043,14 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, + "node_modules/tdigest": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", + "integrity": "sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==", + "dependencies": { + "bintrees": "1.0.2" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -16221,9 +16280,9 @@ } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "node_modules/type-check": { "version": "0.4.0", diff --git a/package.json b/package.json index 6a34ed208..4941601f5 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,14 @@ "@navikt/ds-icons": "^3.4.3", "@navikt/ds-react": "^6.13.0", "@navikt/nav-dekoratoren-moduler": "^2.1.6", + "@navikt/next-api-proxy": "^4.1.3", "@navikt/next-logger": "^1.25.0", + "@navikt/oasis": "^3.4.0", "@sentry/nextjs": "^7.110.1", "@sentry/react": "^8.21.0", "@sentry/tracing": "^7.114.0", "@tanstack/react-query": "^5.51.5", "@unleash/nextjs": "^1.4.2", - "axios": "^1.7.2", "date-fns": "^3.6.0", "i18next": "^23.12.1", "js-cookie": "^3.0.1", @@ -74,7 +75,7 @@ "lint-staged": "^15.2.2", "msw": "^2.3.1", "next-router-mock": "^0.9.13", - "orval": "^6.31.0", + "orval": "^7.2.0", "pino-pretty": "^11.2.1", "prettier": "^3.3.3", "typescript": "^5.5.3", diff --git a/src/axios-instance.ts b/src/axios-instance.ts deleted file mode 100644 index 966e44a86..000000000 --- a/src/axios-instance.ts +++ /dev/null @@ -1,84 +0,0 @@ -import Axios, {AxiosError, AxiosRequestConfig, isCancel} from "axios"; -import {generateCallId, getRedirectPath, HttpErrorType, isLocalhost, isUsingMockAlt} from "./utils/restUtils"; -import {logger} from "@navikt/next-logger"; - -export const AXIOS_INSTANCE = Axios.create({ - xsrfCookieName: "XSRF-TOKEN-INNSYN-API", - xsrfHeaderName: "XSRF-TOKEN-INNSYN-API", - headers: { - "Nav-Call-Id": generateCallId(), - Accept: "application/json, text/plain, */*", - }, - withCredentials: isLocalhost() || isUsingMockAlt(), - withXSRFToken: true, - baseURL: process.env.NEXT_PUBLIC_INNSYN_API_BASE_URL, -}); - -interface CustomConfig { - isServerSide?: boolean; -} - -export const axiosInstance = ( - config: AxiosRequestConfig, - options?: AxiosRequestConfig & CustomConfig -): Promise => { - const source = Axios.CancelToken.source(); - const promise = AXIOS_INSTANCE({ - ...config, - ...options, - cancelToken: source.token, - }) - .then(({data, status}) => { - if (status === 204 && data === "") { - return null; - } - return data; - }) - .catch(async (e) => { - Object.assign(e, {navCallId: e.config?.headers["Nav-Call-Id"]}); - - if (!e.isAxiosError) { - logger.warn(`non-axioserror error ${e} in axiosinstance`, e.navCallId); - } - - if (isCancel(e)) return new Promise(() => {}); - - if (!e.response) { - logger.warn(`Nettverksfeil i axiosInstance: ${config.method} ${config.url} ${e}`, e.navCallId); - throw e; - } - - const {status, data} = e.response; - - if (!options?.isServerSide && status === 401) { - if (window.location.search.split("login_id=")[1] !== data.id) { - const queryDivider = data.loginUrl.includes("?") ? "&" : "?"; - window.location.href = data.loginUrl + queryDivider + getRedirectPath(data.loginUrl, data.id); - } else { - logger.warn( - "Fetch ga 401-error-id selv om kallet ble sendt fra URL med samme login_id (" + - data.id + - "). Dette kan komme av en påloggingsloop (UNAUTHORIZED_LOOP_ERROR).", - e.navCallId - ); - } - - throw new Error(HttpErrorType.UNAUTHORIZED, e); - } - - logger.warn( - `Nettverksfeil i axiosInstance: ${config.method} ${config.url}: ${status} ${data}`, - e.navCallId - ); - throw e; - }); - - // @ts-ignore - promise.cancel = () => { - source.cancel("Query was cancelled"); - }; - - return promise; -}; - -export type ErrorType = AxiosError & {navCallId?: string}; diff --git a/src/components/Tilgangskontrollside/Tilgangskontrollside.tsx b/src/components/Tilgangskontrollside/Tilgangskontrollside.tsx index 7f3c4f7fe..362c75572 100644 --- a/src/components/Tilgangskontrollside/Tilgangskontrollside.tsx +++ b/src/components/Tilgangskontrollside/Tilgangskontrollside.tsx @@ -9,6 +9,9 @@ import {useTranslation} from "next-i18next"; import {useHarTilgang} from "../../generated/tilgang-controller/tilgang-controller"; import {logger} from "@navikt/next-logger"; import {useRouter} from "next/router"; +import {NextResponse} from "next/server"; +import {useEffect} from "react"; +import {useQuery} from "@tanstack/react-query"; const StyledElla = styled.div` display: flex; @@ -24,12 +27,42 @@ export interface TilgangskontrollsideProps { queryHas403: boolean; } +const sessionUrl = process.env.NEXT_PUBLIC_LOGIN_BASE_URL + "/oauth2/session"; +const loginUrl = process.env.NEXT_PUBLIC_LOGIN_BASE_URL + "/oauth2/login"; + +const useDekoratorLogin = () => { + const query = useQuery({ + queryKey: ["dekorator-login"], + queryFn: async () => { + const result = await fetch(sessionUrl, { + method: "get", + credentials: "include", + }); + const data: {session: {active: boolean}} | undefined = + result.status === 200 ? await result.json() : undefined; + return {status: result.status, ...data}; + }, + }); + return query; +}; + const Tilgangskontrollside: React.FC = ({children, queryHas403}) => { - const {data, isLoading, error} = useHarTilgang(); + // const {data, isLoading, error} = useHarTilgang(); const router = useRouter(); const {t} = useTranslation(); + const sessionQuery = useDekoratorLogin(); - if (isLoading) { + useEffect(() => { + console.log("status: ", sessionQuery.data?.status, ", active: ", sessionQuery.data?.session?.active); + if ( + !sessionQuery.isPending && + (sessionQuery.data?.status === 401 || sessionQuery.data?.session?.active === false) + ) { + router.replace(loginUrl + "?redirect=" + window.location.href); + } + }, [sessionQuery.data, sessionQuery.isPending, router]); + + if (sessionQuery.isLoading) { return (
{!router.pathname.includes("/utbetaling") && {t("app.tittel")}} @@ -38,35 +71,37 @@ const Tilgangskontrollside: React.FC = ({children, qu ); } - if (error) { - logger.error(`Fikk feilmelding fra harTilgang. Code: ${error.code}, message: ${error.message}`); - } - - if (!data?.harTilgang || queryHas403) { - const fornavn = data?.fornavn ?? ""; - fornavn === "" - ? logger.warn(`Viser tilgangskontrollside uten fornavn`) - : logger.warn(`Viser tilgangskontrollside med fornavn`); - - return ( -
- {t("app.tittel")} - - - - - - - {t("tilgang.header", { - fornavn, - })} - - {t("tilgang.info")} - - -
- ); - } + // if (error) { + // logger.error( + // `Fikk feilmelding fra harTilgang. Code: ${(error as any).code}, message: ${(error as any).message}` + // ); + // // } + // + // if (!data?.harTilgang || queryHas403) { + // const fornavn = data?.fornavn ?? ""; + // fornavn === "" + // ? logger.warn(`Viser tilgangskontrollside uten fornavn`) + // : logger.warn(`Viser tilgangskontrollside med fornavn`); + // + // return ( + //
+ // {t("app.tittel")} + // + // + // + // + // + // + // {t("tilgang.header", { + // fornavn, + // })} + // + // {t("tilgang.info")} + // + // + //
+ // ); + // } return <>{children}; }; diff --git a/src/components/driftsmelding/Driftsmelding.test.ts b/src/components/driftsmelding/Driftsmelding.test.ts index 78affd359..7b1afadea 100644 --- a/src/components/driftsmelding/Driftsmelding.test.ts +++ b/src/components/driftsmelding/Driftsmelding.test.ts @@ -125,6 +125,6 @@ it("Opplasting av vedlegg er disabled ved riktige caser", () => { it("Opplasting av vedlegg er disabled ved broken soknad pga vedleggmangel", async () => { server.use(brokenSoknad); const {result} = renderHook(() => useFileUploadAllowed(kommuneResponse_alt_er_lov, "broken")); - await waitFor(() => expect(result.current.kanLasteOppVedlegg).toEqual(false)); + await waitFor(() => expect(result.current.kanLasteOppVedlegg).toEqual(false), {timeout: 99999}); await waitFor(() => expect(result.current.textKey).toEqual("driftsmelding.vedlegg.vedleggMangler")); -}); +}, 99999); diff --git a/src/components/filopplasting/useFilOpplasting.ts b/src/components/filopplasting/useFilOpplasting.ts index 483d61ce3..9bb86a4e2 100644 --- a/src/components/filopplasting/useFilOpplasting.ts +++ b/src/components/filopplasting/useFilOpplasting.ts @@ -13,7 +13,6 @@ import { sendVedlegg, useSendVedlegg, } from "../../generated/vedlegg-controller/vedlegg-controller"; -import {ErrorType} from "../../axios-instance"; import useFiksDigisosId from "../../hooks/useFiksDigisosId"; import {getHentHendelserQueryKey} from "../../generated/hendelse-controller/hendelse-controller"; import {logger} from "@navikt/next-logger"; @@ -97,7 +96,7 @@ const useFilOpplasting = ( metadatas: Metadata[], options?: UseMutationOptions< Awaited>, - ErrorType, + unknown, {fiksDigisosId: string; data: SendVedleggBody} > ) => { @@ -275,8 +274,8 @@ const useFilOpplasting = ( onError: (error, variables, context) => { options?.onError?.(error, variables, context); logFileUploadFailedEvent("vedlegg.opplasting_feilmelding"); - logger.warn("Feil med opplasting av vedlegg: " + error.message); - if (error.message === "Mulig virus funnet") { + logger.warn("Feil med opplasting av vedlegg: " + (error as any).message); + if ((error as any).message === "Mulig virus funnet") { logFileUploadFailedEvent(errorStatusToMessage[Feil.VIRUS]); setOuterErrors([{feil: Feil.VIRUS}]); } else { diff --git a/src/components/oppgaver/Oppgaver.tsx b/src/components/oppgaver/Oppgaver.tsx index fdf7a0d3e..d357a15e2 100644 --- a/src/components/oppgaver/Oppgaver.tsx +++ b/src/components/oppgaver/Oppgaver.tsx @@ -77,7 +77,7 @@ const Oppgaver = () => { useEffect(() => { const {error} = utbetalingerQuery; if (error) { - logger.warn(error.message, error.navCallId); + logger.warn((error as any).message, (error as any).navCallId); } }, [utbetalingerQuery.error]); diff --git a/src/generated/digisos-api-test-controller/digisos-api-test-controller.msw.ts b/src/generated/digisos-api-test-controller/digisos-api-test-controller.msw.ts index 6523ab38a..1908f7b20 100644 --- a/src/generated/digisos-api-test-controller/digisos-api-test-controller.msw.ts +++ b/src/generated/digisos-api-test-controller/digisos-api-test-controller.msw.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 @@ -18,6 +18,7 @@ export const getFilOpplastingMockHandler = ( ) => { return http.post("*/api/v1/digisosapi/:fiksDigisosId/filOpplasting", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -26,12 +27,7 @@ export const getFilOpplastingMockHandler = ( : overrideResponse : getFilOpplastingResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -41,6 +37,7 @@ export const getOppdaterDigisosSakMockHandler = ( ) => { return http.post("*/api/v1/digisosapi/oppdaterDigisosSak", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -49,12 +46,7 @@ export const getOppdaterDigisosSakMockHandler = ( : overrideResponse : getOppdaterDigisosSakResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -64,6 +56,7 @@ export const getGetInnsynsfilMockHandler = ( ) => { return http.get("*/api/v1/digisosapi/:digisosId/innsynsfil", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -72,12 +65,7 @@ export const getGetInnsynsfilMockHandler = ( : overrideResponse : getGetInnsynsfilResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/digisos-api-test-controller/digisos-api-test-controller.ts b/src/generated/digisos-api-test-controller/digisos-api-test-controller.ts index 9fdaf9b86..bbd3ffd0f 100644 --- a/src/generated/digisos-api-test-controller/digisos-api-test-controller.ts +++ b/src/generated/digisos-api-test-controller/digisos-api-test-controller.ts @@ -1,59 +1,61 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useMutation, useQuery} from "@tanstack/react-query"; import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, MutationFunction, QueryFunction, QueryKey, + UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, } from "@tanstack/react-query"; import type {FilOpplastingBody, OppdaterDigisosSakParams} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getFilOpplastingUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/digisosapi/${fiksDigisosId}/filOpplasting`; +}; -export const filOpplasting = ( +export const filOpplasting = async ( fiksDigisosId: string, filOpplastingBody: FilOpplastingBody, - options?: SecondParameter -) => { + options?: RequestInit +): Promise => { const formData = new FormData(); formData.append("file", filOpplastingBody.file); - return axiosInstance( - { - url: `/api/v1/digisosapi/${fiksDigisosId}/filOpplasting`, - method: "POST", - headers: {"Content-Type": "multipart/form-data"}, - data: formData, - }, - options - ); + const res = await fetch(getFilOpplastingUrl(fiksDigisosId), { + ...options, + method: "POST", + body: formData, + }); + const data = await res.json(); + + return data as string; }; -export const getFilOpplastingMutationOptions = , TContext = unknown>(options?: { +export const getFilOpplastingMutationOptions = (options?: { mutation?: UseMutationOptions< Awaited>, TError, {fiksDigisosId: string; data: FilOpplastingBody}, TContext >; - request?: SecondParameter; + fetch?: RequestInit; }): UseMutationOptions< Awaited>, TError, {fiksDigisosId: string; data: FilOpplastingBody}, TContext > => { - const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + const {mutation: mutationOptions, fetch: fetchOptions} = options ?? {}; const mutationFn: MutationFunction< Awaited>, @@ -61,7 +63,7 @@ export const getFilOpplastingMutationOptions = , TCo > = (props) => { const {fiksDigisosId, data} = props ?? {}; - return filOpplasting(fiksDigisosId, data, requestOptions); + return filOpplasting(fiksDigisosId, data, fetchOptions); }; return {mutationFn, ...mutationOptions}; @@ -69,16 +71,16 @@ export const getFilOpplastingMutationOptions = , TCo export type FilOpplastingMutationResult = NonNullable>>; export type FilOpplastingMutationBody = FilOpplastingBody; -export type FilOpplastingMutationError = ErrorType; +export type FilOpplastingMutationError = unknown; -export const useFilOpplasting = , TContext = unknown>(options?: { +export const useFilOpplasting = (options?: { mutation?: UseMutationOptions< Awaited>, TError, {fiksDigisosId: string; data: FilOpplastingBody}, TContext >; - request?: SecondParameter; + fetch?: RequestInit; }): UseMutationResult< Awaited>, TError, @@ -89,38 +91,51 @@ export const useFilOpplasting = , TContext = unknown return useMutation(mutationOptions); }; -export const oppdaterDigisosSak = ( +export const getOppdaterDigisosSakUrl = (params?: OppdaterDigisosSakParams) => { + const normalizedParams = new URLSearchParams(); + + Object.entries(params || {}).forEach(([key, value]) => { + if (value !== undefined) { + normalizedParams.append(key, value === null ? "null" : value.toString()); + } + }); + + return normalizedParams.size + ? `/sosialhjelp/innsyn/api/innsyn-api/api/v1/digisosapi/oppdaterDigisosSak?${normalizedParams.toString()}` + : `/sosialhjelp/innsyn/api/innsyn-api/api/v1/digisosapi/oppdaterDigisosSak`; +}; + +export const oppdaterDigisosSak = async ( oppdaterDigisosSakBody: string, params?: OppdaterDigisosSakParams, - options?: SecondParameter -) => { - return axiosInstance( - { - url: `/api/v1/digisosapi/oppdaterDigisosSak`, - method: "POST", - headers: {"Content-Type": "application/json"}, - data: oppdaterDigisosSakBody, - params, - }, - options - ); + options?: RequestInit +): Promise => { + const res = await fetch(getOppdaterDigisosSakUrl(params), { + ...options, + method: "POST", + headers: {"Content-Type": "application/json", ...options?.headers}, + body: JSON.stringify(oppdaterDigisosSakBody), + }); + const data = await res.json(); + + return data as string; }; -export const getOppdaterDigisosSakMutationOptions = , TContext = unknown>(options?: { +export const getOppdaterDigisosSakMutationOptions = (options?: { mutation?: UseMutationOptions< Awaited>, TError, {data: string; params?: OppdaterDigisosSakParams}, TContext >; - request?: SecondParameter; + fetch?: RequestInit; }): UseMutationOptions< Awaited>, TError, {data: string; params?: OppdaterDigisosSakParams}, TContext > => { - const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + const {mutation: mutationOptions, fetch: fetchOptions} = options ?? {}; const mutationFn: MutationFunction< Awaited>, @@ -128,7 +143,7 @@ export const getOppdaterDigisosSakMutationOptions = > = (props) => { const {data, params} = props ?? {}; - return oppdaterDigisosSak(data, params, requestOptions); + return oppdaterDigisosSak(data, params, fetchOptions); }; return {mutationFn, ...mutationOptions}; @@ -136,16 +151,16 @@ export const getOppdaterDigisosSakMutationOptions = export type OppdaterDigisosSakMutationResult = NonNullable>>; export type OppdaterDigisosSakMutationBody = string; -export type OppdaterDigisosSakMutationError = ErrorType; +export type OppdaterDigisosSakMutationError = unknown; -export const useOppdaterDigisosSak = , TContext = unknown>(options?: { +export const useOppdaterDigisosSak = (options?: { mutation?: UseMutationOptions< Awaited>, TError, {data: string; params?: OppdaterDigisosSakParams}, TContext >; - request?: SecondParameter; + fetch?: RequestInit; }): UseMutationResult< Awaited>, TError, @@ -156,34 +171,37 @@ export const useOppdaterDigisosSak = , TContext = un return useMutation(mutationOptions); }; -export const getInnsynsfil = ( - digisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance({url: `/api/v1/digisosapi/${digisosId}/innsynsfil`, method: "GET", signal}, options); +export const getGetInnsynsfilUrl = (digisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/digisosapi/${digisosId}/innsynsfil`; +}; + +export const getInnsynsfil = async (digisosId: string, options?: RequestInit): Promise => { + const res = await fetch(getGetInnsynsfilUrl(digisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as string; }; export const getGetInnsynsfilQueryKey = (digisosId: string) => { - return [`/api/v1/digisosapi/${digisosId}/innsynsfil`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/digisosapi/${digisosId}/innsynsfil`] as const; }; -export const getGetInnsynsfilQueryOptions = < - TData = Awaited>, - TError = ErrorType, ->( +export const getGetInnsynsfilQueryOptions = >, TError = unknown>( digisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetInnsynsfilQueryKey(digisosId); const queryFn: QueryFunction>> = ({signal}) => - getInnsynsfil(digisosId, requestOptions, signal); + getInnsynsfil(digisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!digisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -193,15 +211,39 @@ export const getGetInnsynsfilQueryOptions = < }; export type GetInnsynsfilQueryResult = NonNullable>>; -export type GetInnsynsfilQueryError = ErrorType; +export type GetInnsynsfilQueryError = unknown; -export const useGetInnsynsfil = >, TError = ErrorType>( +export function useGetInnsynsfil>, TError = unknown>( + digisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useGetInnsynsfil>, TError = unknown>( + digisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useGetInnsynsfil>, TError = unknown>( digisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey}; + +export function useGetInnsynsfil>, TError = unknown>( + digisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getGetInnsynsfilQueryOptions(digisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -209,4 +251,4 @@ export const useGetInnsynsfil = { return http.get("*/api/v1/innsyn/:fiksDigisosId/forelopigSvar", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -33,12 +34,7 @@ export const getHentForelopigSvarStatusMockHandler = ( : overrideResponse : getHentForelopigSvarStatusResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/forelopig-svar-controller/forelopig-svar-controller.ts b/src/generated/forelopig-svar-controller/forelopig-svar-controller.ts index 7fd8c22ea..7eb82370b 100644 --- a/src/generated/forelopig-svar-controller/forelopig-svar-controller.ts +++ b/src/generated/forelopig-svar-controller/forelopig-svar-controller.ts @@ -1,48 +1,58 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useQuery} from "@tanstack/react-query"; -import type {QueryFunction, QueryKey, UseQueryOptions, UseQueryResult} from "@tanstack/react-query"; +import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; import type {ForelopigSvarResponse} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getHentForelopigSvarStatusUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/forelopigSvar`; +}; -export const hentForelopigSvarStatus = ( +export const hentForelopigSvarStatus = async ( fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/forelopigSvar`, method: "GET", signal}, - options - ); + options?: RequestInit +): Promise => { + const res = await fetch(getHentForelopigSvarStatusUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as ForelopigSvarResponse; }; export const getHentForelopigSvarStatusQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/forelopigSvar`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/forelopigSvar`] as const; }; export const getHentForelopigSvarStatusQueryOptions = < TData = Awaited>, - TError = ErrorType, + TError = unknown, >( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentForelopigSvarStatusQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - hentForelopigSvarStatus(fiksDigisosId, requestOptions, signal); + hentForelopigSvarStatus(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -52,18 +62,57 @@ export const getHentForelopigSvarStatusQueryOptions = < }; export type HentForelopigSvarStatusQueryResult = NonNullable>>; -export type HentForelopigSvarStatusQueryError = ErrorType; +export type HentForelopigSvarStatusQueryError = unknown; + +export function useHentForelopigSvarStatus< + TData = Awaited>, + TError = unknown, +>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick< + DefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentForelopigSvarStatus< + TData = Awaited>, + TError = unknown, +>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useHentForelopigSvarStatus< + TData = Awaited>, + TError = unknown, +>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; -export const useHentForelopigSvarStatus = < +export function useHentForelopigSvarStatus< TData = Awaited>, - TError = ErrorType, + TError = unknown, >( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentForelopigSvarStatusQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -71,4 +120,4 @@ export const useHentForelopigSvarStatus = < query.queryKey = queryOptions.queryKey; return query; -}; +} diff --git a/src/generated/hendelse-controller/hendelse-controller.msw.ts b/src/generated/hendelse-controller/hendelse-controller.msw.ts index 4b615c701..7c7a34f75 100644 --- a/src/generated/hendelse-controller/hendelse-controller.msw.ts +++ b/src/generated/hendelse-controller/hendelse-controller.msw.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 @@ -60,6 +60,7 @@ export const getHentHendelserMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/hendelser", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -68,12 +69,7 @@ export const getHentHendelserMockHandler = ( : overrideResponse : getHentHendelserResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/hendelse-controller/hendelse-controller.ts b/src/generated/hendelse-controller/hendelse-controller.ts index 3f6203149..72fa0bcf4 100644 --- a/src/generated/hendelse-controller/hendelse-controller.ts +++ b/src/generated/hendelse-controller/hendelse-controller.ts @@ -1,48 +1,52 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useQuery} from "@tanstack/react-query"; -import type {QueryFunction, QueryKey, UseQueryOptions, UseQueryResult} from "@tanstack/react-query"; +import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; import type {HendelseResponse} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getHentHendelserUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/hendelser`; +}; -export const hentHendelser = ( - fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/hendelser`, method: "GET", signal}, - options - ); +export const hentHendelser = async (fiksDigisosId: string, options?: RequestInit): Promise => { + const res = await fetch(getHentHendelserUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as HendelseResponse[]; }; export const getHentHendelserQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/hendelser`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/hendelser`] as const; }; -export const getHentHendelserQueryOptions = < - TData = Awaited>, - TError = ErrorType, ->( +export const getHentHendelserQueryOptions = >, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentHendelserQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - hentHendelser(fiksDigisosId, requestOptions, signal); + hentHendelser(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -52,15 +56,39 @@ export const getHentHendelserQueryOptions = < }; export type HentHendelserQueryResult = NonNullable>>; -export type HentHendelserQueryError = ErrorType; +export type HentHendelserQueryError = unknown; -export const useHentHendelser = >, TError = ErrorType>( +export function useHentHendelser>, TError = unknown>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentHendelser>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useHentHendelser>, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey}; + +export function useHentHendelser>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentHendelserQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -68,4 +96,4 @@ export const useHentHendelser = { - return http.post("*/api/v1/info/logg", async () => { +export const getPostKlientloggMockHandler = ( + overrideResponse?: void | ((info: Parameters[1]>[0]) => Promise | void) +) => { + return http.post("*/api/v1/info/logg", async (info) => { await delay(1000); - return new HttpResponse(null, { - status: 204, - headers: { - "Content-Type": "application/json", - }, - }); + if (typeof overrideResponse === "function") { + await overrideResponse(info); + } + return new HttpResponse(null, {status: 204}); }); }; export const getInfoControllerMock = () => [getPostKlientloggMockHandler()]; diff --git a/src/generated/info-controller/info-controller.ts b/src/generated/info-controller/info-controller.ts index 5a27e64be..9ce7ae328 100644 --- a/src/generated/info-controller/info-controller.ts +++ b/src/generated/info-controller/info-controller.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 @@ -7,28 +7,33 @@ import {useMutation} from "@tanstack/react-query"; import type {MutationFunction, UseMutationOptions, UseMutationResult} from "@tanstack/react-query"; import type {Logg} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getPostKlientloggUrl = () => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/info/logg`; +}; + +export const postKlientlogg = async (logg: Logg, options?: RequestInit): Promise => { + const res = await fetch(getPostKlientloggUrl(), { + ...options, + method: "POST", + headers: {"Content-Type": "application/json", ...options?.headers}, + body: JSON.stringify(logg), + }); + const data = await res.json(); -export const postKlientlogg = (logg: Logg, options?: SecondParameter) => { - return axiosInstance( - {url: `/api/v1/info/logg`, method: "POST", headers: {"Content-Type": "application/json"}, data: logg}, - options - ); + return data as void; }; -export const getPostKlientloggMutationOptions = , TContext = unknown>(options?: { +export const getPostKlientloggMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, {data: Logg}, TContext>; - request?: SecondParameter; + fetch?: RequestInit; }): UseMutationOptions>, TError, {data: Logg}, TContext> => { - const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + const {mutation: mutationOptions, fetch: fetchOptions} = options ?? {}; const mutationFn: MutationFunction>, {data: Logg}> = (props) => { const {data} = props ?? {}; - return postKlientlogg(data, requestOptions); + return postKlientlogg(data, fetchOptions); }; return {mutationFn, ...mutationOptions}; @@ -36,11 +41,11 @@ export const getPostKlientloggMutationOptions = , TC export type PostKlientloggMutationResult = NonNullable>>; export type PostKlientloggMutationBody = Logg; -export type PostKlientloggMutationError = ErrorType; +export type PostKlientloggMutationError = unknown; -export const usePostKlientlogg = , TContext = unknown>(options?: { +export const usePostKlientlogg = (options?: { mutation?: UseMutationOptions>, TError, {data: Logg}, TContext>; - request?: SecondParameter; + fetch?: RequestInit; }): UseMutationResult>, TError, {data: Logg}, TContext> => { const mutationOptions = getPostKlientloggMutationOptions(options); diff --git a/src/generated/klage-controller/klage-controller.msw.ts b/src/generated/klage-controller/klage-controller.msw.ts index 64fbfdda9..45bb5e937 100644 --- a/src/generated/klage-controller/klage-controller.msw.ts +++ b/src/generated/klage-controller/klage-controller.msw.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 @@ -44,6 +44,7 @@ export const getHentKlagerMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/klage", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -52,12 +53,7 @@ export const getHentKlagerMockHandler = ( : overrideResponse : getHentKlagerResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -67,6 +63,7 @@ export const getSendKlageMockHandler = ( ) => { return http.post("*/api/v1/innsyn/:fiksDigisosId/klage", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -75,12 +72,7 @@ export const getSendKlageMockHandler = ( : overrideResponse : getSendKlageResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/klage-controller/klage-controller.ts b/src/generated/klage-controller/klage-controller.ts index abae731a0..a598f67f3 100644 --- a/src/generated/klage-controller/klage-controller.ts +++ b/src/generated/klage-controller/klage-controller.ts @@ -1,50 +1,55 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useMutation, useQuery} from "@tanstack/react-query"; import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, MutationFunction, QueryFunction, QueryKey, + UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, } from "@tanstack/react-query"; import type {InputKlage, KlageDto, Unit} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getHentKlagerUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/klage`; +}; -export const hentKlager = ( - fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance({url: `/api/v1/innsyn/${fiksDigisosId}/klage`, method: "GET", signal}, options); +export const hentKlager = async (fiksDigisosId: string, options?: RequestInit): Promise => { + const res = await fetch(getHentKlagerUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as KlageDto[]; }; export const getHentKlagerQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/klage`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/klage`] as const; }; -export const getHentKlagerQueryOptions = >, TError = ErrorType>( +export const getHentKlagerQueryOptions = >, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentKlagerQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - hentKlager(fiksDigisosId, requestOptions, signal); + hentKlager(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -54,15 +59,39 @@ export const getHentKlagerQueryOptions = >>; -export type HentKlagerQueryError = ErrorType; +export type HentKlagerQueryError = unknown; + +export function useHentKlager>, TError = unknown>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentKlager>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useHentKlager>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; -export const useHentKlager = >, TError = ErrorType>( +export function useHentKlager>, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentKlagerQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -70,39 +99,43 @@ export const useHentKlager = >, TE query.queryKey = queryOptions.queryKey; return query; +} + +export const getSendKlageUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/klage`; }; -export const sendKlage = ( +export const sendKlage = async ( fiksDigisosId: string, inputKlage: InputKlage, - options?: SecondParameter -) => { - return axiosInstance( - { - url: `/api/v1/innsyn/${fiksDigisosId}/klage`, - method: "POST", - headers: {"Content-Type": "application/json;charset=UTF-8"}, - data: inputKlage, - }, - options - ); + options?: RequestInit +): Promise => { + const res = await fetch(getSendKlageUrl(fiksDigisosId), { + ...options, + method: "POST", + headers: {"Content-Type": "application/json;charset=UTF-8", ...options?.headers}, + body: JSON.stringify(inputKlage), + }); + const data = await res.json(); + + return data as Unit; }; -export const getSendKlageMutationOptions = , TContext = unknown>(options?: { +export const getSendKlageMutationOptions = (options?: { mutation?: UseMutationOptions< Awaited>, TError, {fiksDigisosId: string; data: InputKlage}, TContext >; - request?: SecondParameter; + fetch?: RequestInit; }): UseMutationOptions< Awaited>, TError, {fiksDigisosId: string; data: InputKlage}, TContext > => { - const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + const {mutation: mutationOptions, fetch: fetchOptions} = options ?? {}; const mutationFn: MutationFunction< Awaited>, @@ -110,7 +143,7 @@ export const getSendKlageMutationOptions = , TContex > = (props) => { const {fiksDigisosId, data} = props ?? {}; - return sendKlage(fiksDigisosId, data, requestOptions); + return sendKlage(fiksDigisosId, data, fetchOptions); }; return {mutationFn, ...mutationOptions}; @@ -118,16 +151,16 @@ export const getSendKlageMutationOptions = , TContex export type SendKlageMutationResult = NonNullable>>; export type SendKlageMutationBody = InputKlage; -export type SendKlageMutationError = ErrorType; +export type SendKlageMutationError = unknown; -export const useSendKlage = , TContext = unknown>(options?: { +export const useSendKlage = (options?: { mutation?: UseMutationOptions< Awaited>, TError, {fiksDigisosId: string; data: InputKlage}, TContext >; - request?: SecondParameter; + fetch?: RequestInit; }): UseMutationResult< Awaited>, TError, diff --git a/src/generated/kommune-controller/kommune-controller.msw.ts b/src/generated/kommune-controller/kommune-controller.msw.ts index b8b38a6b8..69b095e89 100644 --- a/src/generated/kommune-controller/kommune-controller.msw.ts +++ b/src/generated/kommune-controller/kommune-controller.msw.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 @@ -25,6 +25,7 @@ export const getHentKommuneInfoMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/kommune", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -33,12 +34,7 @@ export const getHentKommuneInfoMockHandler = ( : overrideResponse : getHentKommuneInfoResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/kommune-controller/kommune-controller.ts b/src/generated/kommune-controller/kommune-controller.ts index 333893616..6f54fe645 100644 --- a/src/generated/kommune-controller/kommune-controller.ts +++ b/src/generated/kommune-controller/kommune-controller.ts @@ -1,48 +1,52 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useQuery} from "@tanstack/react-query"; -import type {QueryFunction, QueryKey, UseQueryOptions, UseQueryResult} from "@tanstack/react-query"; +import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; import type {KommuneResponse} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getHentKommuneInfoUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/kommune`; +}; -export const hentKommuneInfo = ( - fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/kommune`, method: "GET", signal}, - options - ); +export const hentKommuneInfo = async (fiksDigisosId: string, options?: RequestInit): Promise => { + const res = await fetch(getHentKommuneInfoUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as KommuneResponse; }; export const getHentKommuneInfoQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/kommune`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/kommune`] as const; }; -export const getHentKommuneInfoQueryOptions = < - TData = Awaited>, - TError = ErrorType, ->( +export const getHentKommuneInfoQueryOptions = >, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentKommuneInfoQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - hentKommuneInfo(fiksDigisosId, requestOptions, signal); + hentKommuneInfo(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -52,15 +56,42 @@ export const getHentKommuneInfoQueryOptions = < }; export type HentKommuneInfoQueryResult = NonNullable>>; -export type HentKommuneInfoQueryError = ErrorType; +export type HentKommuneInfoQueryError = unknown; -export const useHentKommuneInfo = >, TError = ErrorType>( +export function useHentKommuneInfo>, TError = unknown>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentKommuneInfo>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useHentKommuneInfo>, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey}; + +export function useHentKommuneInfo>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentKommuneInfoQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -68,4 +99,4 @@ export const useHentKommuneInfo = { return http.get("*/api/v1/innsyn/:fiksDigisosId/vilkar", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -160,12 +161,7 @@ export const getGetVilkarMockHandler = ( : overrideResponse : getGetVilkarResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -177,6 +173,7 @@ export const getGetOppgaverMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/oppgaver", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -185,12 +182,7 @@ export const getGetOppgaverMockHandler = ( : overrideResponse : getGetOppgaverResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -202,6 +194,7 @@ export const getGetOppgaveMedIdMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/oppgaver/:oppgaveId", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -210,12 +203,7 @@ export const getGetOppgaveMedIdMockHandler = ( : overrideResponse : getGetOppgaveMedIdResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -225,6 +213,7 @@ export const getGetHarLevertDokumentasjonkravMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/harLeverteDokumentasjonkrav", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -233,12 +222,7 @@ export const getGetHarLevertDokumentasjonkravMockHandler = ( : overrideResponse : getGetHarLevertDokumentasjonkravResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -248,6 +232,7 @@ export const getGetfagsystemHarDokumentasjonkravMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/fagsystemHarDokumentasjonkrav", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -256,12 +241,7 @@ export const getGetfagsystemHarDokumentasjonkravMockHandler = ( : overrideResponse : getGetfagsystemHarDokumentasjonkravResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -275,6 +255,7 @@ export const getGetDokumentasjonkravMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/dokumentasjonkrav", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -283,12 +264,7 @@ export const getGetDokumentasjonkravMockHandler = ( : overrideResponse : getGetDokumentasjonkravResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -302,6 +278,7 @@ export const getGetDokumentasjonkravMedIdMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/dokumentasjonkrav/:dokumentasjonkravId", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -310,12 +287,7 @@ export const getGetDokumentasjonkravMedIdMockHandler = ( : overrideResponse : getGetDokumentasjonkravMedIdResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/oppgave-controller/oppgave-controller.ts b/src/generated/oppgave-controller/oppgave-controller.ts index ebd87d498..83995f46b 100644 --- a/src/generated/oppgave-controller/oppgave-controller.ts +++ b/src/generated/oppgave-controller/oppgave-controller.ts @@ -1,45 +1,52 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useQuery} from "@tanstack/react-query"; -import type {QueryFunction, QueryKey, UseQueryOptions, UseQueryResult} from "@tanstack/react-query"; +import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; import type {DokumentasjonkravResponse, OppgaveResponse, VilkarResponse} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getGetVilkarUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/vilkar`; +}; -export const getVilkar = ( - fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/vilkar`, method: "GET", signal}, - options - ); +export const getVilkar = async (fiksDigisosId: string, options?: RequestInit): Promise => { + const res = await fetch(getGetVilkarUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as VilkarResponse[]; }; export const getGetVilkarQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/vilkar`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/vilkar`] as const; }; -export const getGetVilkarQueryOptions = >, TError = ErrorType>( +export const getGetVilkarQueryOptions = >, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetVilkarQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - getVilkar(fiksDigisosId, requestOptions, signal); + getVilkar(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -49,15 +56,39 @@ export const getGetVilkarQueryOptions = >>; -export type GetVilkarQueryError = ErrorType; +export type GetVilkarQueryError = unknown; -export const useGetVilkar = >, TError = ErrorType>( +export function useGetVilkar>, TError = unknown>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useGetVilkar>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useGetVilkar>, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey}; + +export function useGetVilkar>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getGetVilkarQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -65,39 +96,39 @@ export const useGetVilkar = >, TErr query.queryKey = queryOptions.queryKey; return query; +} + +export const getGetOppgaverUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/oppgaver`; }; -export const getOppgaver = ( - fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/oppgaver`, method: "GET", signal}, - options - ); +export const getOppgaver = async (fiksDigisosId: string, options?: RequestInit): Promise => { + const res = await fetch(getGetOppgaverUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as OppgaveResponse[]; }; export const getGetOppgaverQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/oppgaver`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/oppgaver`] as const; }; -export const getGetOppgaverQueryOptions = < - TData = Awaited>, - TError = ErrorType, ->( +export const getGetOppgaverQueryOptions = >, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetOppgaverQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - getOppgaver(fiksDigisosId, requestOptions, signal); + getOppgaver(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -107,15 +138,39 @@ export const getGetOppgaverQueryOptions = < }; export type GetOppgaverQueryResult = NonNullable>>; -export type GetOppgaverQueryError = ErrorType; +export type GetOppgaverQueryError = unknown; -export const useGetOppgaver = >, TError = ErrorType>( +export function useGetOppgaver>, TError = unknown>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useGetOppgaver>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useGetOppgaver>, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey}; + +export function useGetOppgaver>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getGetOppgaverQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -123,41 +178,44 @@ export const useGetOppgaver = >, query.queryKey = queryOptions.queryKey; return query; +} + +export const getGetOppgaveMedIdUrl = (fiksDigisosId: string, oppgaveId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/oppgaver/${oppgaveId}`; }; -export const getOppgaveMedId = ( +export const getOppgaveMedId = async ( fiksDigisosId: string, oppgaveId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/oppgaver/${oppgaveId}`, method: "GET", signal}, - options - ); + options?: RequestInit +): Promise => { + const res = await fetch(getGetOppgaveMedIdUrl(fiksDigisosId, oppgaveId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as OppgaveResponse[]; }; export const getGetOppgaveMedIdQueryKey = (fiksDigisosId: string, oppgaveId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/oppgaver/${oppgaveId}`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/oppgaver/${oppgaveId}`] as const; }; -export const getGetOppgaveMedIdQueryOptions = < - TData = Awaited>, - TError = ErrorType, ->( +export const getGetOppgaveMedIdQueryOptions = >, TError = unknown>( fiksDigisosId: string, oppgaveId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetOppgaveMedIdQueryKey(fiksDigisosId, oppgaveId); const queryFn: QueryFunction>> = ({signal}) => - getOppgaveMedId(fiksDigisosId, oppgaveId, requestOptions, signal); + getOppgaveMedId(fiksDigisosId, oppgaveId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!(fiksDigisosId && oppgaveId), ...queryOptions} as UseQueryOptions< Awaited>, @@ -167,16 +225,46 @@ export const getGetOppgaveMedIdQueryOptions = < }; export type GetOppgaveMedIdQueryResult = NonNullable>>; -export type GetOppgaveMedIdQueryError = ErrorType; +export type GetOppgaveMedIdQueryError = unknown; + +export function useGetOppgaveMedId>, TError = unknown>( + fiksDigisosId: string, + oppgaveId: string, + options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useGetOppgaveMedId>, TError = unknown>( + fiksDigisosId: string, + oppgaveId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useGetOppgaveMedId>, TError = unknown>( + fiksDigisosId: string, + oppgaveId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; -export const useGetOppgaveMedId = >, TError = ErrorType>( +export function useGetOppgaveMedId>, TError = unknown>( fiksDigisosId: string, oppgaveId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getGetOppgaveMedIdQueryOptions(fiksDigisosId, oppgaveId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -184,39 +272,42 @@ export const useGetOppgaveMedId = { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/harLeverteDokumentasjonkrav`; }; -export const getHarLevertDokumentasjonkrav = ( - fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/harLeverteDokumentasjonkrav`, method: "GET", signal}, - options - ); +export const getHarLevertDokumentasjonkrav = async (fiksDigisosId: string, options?: RequestInit): Promise => { + const res = await fetch(getGetHarLevertDokumentasjonkravUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as boolean; }; export const getGetHarLevertDokumentasjonkravQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/harLeverteDokumentasjonkrav`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/harLeverteDokumentasjonkrav`] as const; }; export const getGetHarLevertDokumentasjonkravQueryOptions = < TData = Awaited>, - TError = ErrorType, + TError = unknown, >( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetHarLevertDokumentasjonkravQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - getHarLevertDokumentasjonkrav(fiksDigisosId, requestOptions, signal); + getHarLevertDokumentasjonkrav(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -228,18 +319,57 @@ export const getGetHarLevertDokumentasjonkravQueryOptions = < export type GetHarLevertDokumentasjonkravQueryResult = NonNullable< Awaited> >; -export type GetHarLevertDokumentasjonkravQueryError = ErrorType; +export type GetHarLevertDokumentasjonkravQueryError = unknown; -export const useGetHarLevertDokumentasjonkrav = < +export function useGetHarLevertDokumentasjonkrav< + TData = Awaited>, + TError = unknown, +>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick< + DefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useGetHarLevertDokumentasjonkrav< TData = Awaited>, - TError = ErrorType, + TError = unknown, +>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useGetHarLevertDokumentasjonkrav< + TData = Awaited>, + TError = unknown, >( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey}; + +export function useGetHarLevertDokumentasjonkrav< + TData = Awaited>, + TError = unknown, +>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getGetHarLevertDokumentasjonkravQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -247,39 +377,45 @@ export const useGetHarLevertDokumentasjonkrav = < query.queryKey = queryOptions.queryKey; return query; +} + +export const getGetfagsystemHarDokumentasjonkravUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/fagsystemHarDokumentasjonkrav`; }; -export const getfagsystemHarDokumentasjonkrav = ( +export const getfagsystemHarDokumentasjonkrav = async ( fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/fagsystemHarDokumentasjonkrav`, method: "GET", signal}, - options - ); + options?: RequestInit +): Promise => { + const res = await fetch(getGetfagsystemHarDokumentasjonkravUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as boolean; }; export const getGetfagsystemHarDokumentasjonkravQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/fagsystemHarDokumentasjonkrav`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/fagsystemHarDokumentasjonkrav`] as const; }; export const getGetfagsystemHarDokumentasjonkravQueryOptions = < TData = Awaited>, - TError = ErrorType, + TError = unknown, >( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetfagsystemHarDokumentasjonkravQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - getfagsystemHarDokumentasjonkrav(fiksDigisosId, requestOptions, signal); + getfagsystemHarDokumentasjonkrav(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -291,18 +427,61 @@ export const getGetfagsystemHarDokumentasjonkravQueryOptions = < export type GetfagsystemHarDokumentasjonkravQueryResult = NonNullable< Awaited> >; -export type GetfagsystemHarDokumentasjonkravQueryError = ErrorType; +export type GetfagsystemHarDokumentasjonkravQueryError = unknown; + +export function useGetfagsystemHarDokumentasjonkrav< + TData = Awaited>, + TError = unknown, +>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick< + DefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useGetfagsystemHarDokumentasjonkrav< + TData = Awaited>, + TError = unknown, +>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + TData + >, + "initialData" + >; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useGetfagsystemHarDokumentasjonkrav< + TData = Awaited>, + TError = unknown, +>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; -export const useGetfagsystemHarDokumentasjonkrav = < +export function useGetfagsystemHarDokumentasjonkrav< TData = Awaited>, - TError = ErrorType, + TError = unknown, >( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getGetfagsystemHarDokumentasjonkravQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -310,39 +489,45 @@ export const useGetfagsystemHarDokumentasjonkrav = < query.queryKey = queryOptions.queryKey; return query; +} + +export const getGetDokumentasjonkravUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/dokumentasjonkrav`; }; -export const getDokumentasjonkrav = ( +export const getDokumentasjonkrav = async ( fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/dokumentasjonkrav`, method: "GET", signal}, - options - ); + options?: RequestInit +): Promise => { + const res = await fetch(getGetDokumentasjonkravUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as DokumentasjonkravResponse[]; }; export const getGetDokumentasjonkravQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/dokumentasjonkrav`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/dokumentasjonkrav`] as const; }; export const getGetDokumentasjonkravQueryOptions = < TData = Awaited>, - TError = ErrorType, + TError = unknown, >( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetDokumentasjonkravQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - getDokumentasjonkrav(fiksDigisosId, requestOptions, signal); + getDokumentasjonkrav(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -352,18 +537,45 @@ export const getGetDokumentasjonkravQueryOptions = < }; export type GetDokumentasjonkravQueryResult = NonNullable>>; -export type GetDokumentasjonkravQueryError = ErrorType; +export type GetDokumentasjonkravQueryError = unknown; -export const useGetDokumentasjonkrav = < - TData = Awaited>, - TError = ErrorType, ->( +export function useGetDokumentasjonkrav>, TError = unknown>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick< + DefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useGetDokumentasjonkrav>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useGetDokumentasjonkrav>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; + +export function useGetDokumentasjonkrav>, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getGetDokumentasjonkravQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -371,41 +583,49 @@ export const useGetDokumentasjonkrav = < query.queryKey = queryOptions.queryKey; return query; +} + +export const getGetDokumentasjonkravMedIdUrl = (fiksDigisosId: string, dokumentasjonkravId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/dokumentasjonkrav/${dokumentasjonkravId}`; }; -export const getDokumentasjonkravMedId = ( +export const getDokumentasjonkravMedId = async ( fiksDigisosId: string, dokumentasjonkravId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/dokumentasjonkrav/${dokumentasjonkravId}`, method: "GET", signal}, - options - ); + options?: RequestInit +): Promise => { + const res = await fetch(getGetDokumentasjonkravMedIdUrl(fiksDigisosId, dokumentasjonkravId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as DokumentasjonkravResponse[]; }; export const getGetDokumentasjonkravMedIdQueryKey = (fiksDigisosId: string, dokumentasjonkravId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/dokumentasjonkrav/${dokumentasjonkravId}`] as const; + return [ + `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/dokumentasjonkrav/${dokumentasjonkravId}`, + ] as const; }; export const getGetDokumentasjonkravMedIdQueryOptions = < TData = Awaited>, - TError = ErrorType, + TError = unknown, >( fiksDigisosId: string, dokumentasjonkravId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetDokumentasjonkravMedIdQueryKey(fiksDigisosId, dokumentasjonkravId); const queryFn: QueryFunction>> = ({signal}) => - getDokumentasjonkravMedId(fiksDigisosId, dokumentasjonkravId, requestOptions, signal); + getDokumentasjonkravMedId(fiksDigisosId, dokumentasjonkravId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!(fiksDigisosId && dokumentasjonkravId), ...queryOptions} as UseQueryOptions< Awaited>, @@ -415,19 +635,61 @@ export const getGetDokumentasjonkravMedIdQueryOptions = < }; export type GetDokumentasjonkravMedIdQueryResult = NonNullable>>; -export type GetDokumentasjonkravMedIdQueryError = ErrorType; +export type GetDokumentasjonkravMedIdQueryError = unknown; -export const useGetDokumentasjonkravMedId = < +export function useGetDokumentasjonkravMedId< TData = Awaited>, - TError = ErrorType, + TError = unknown, +>( + fiksDigisosId: string, + dokumentasjonkravId: string, + options: { + query: Partial>, TError, TData>> & + Pick< + DefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useGetDokumentasjonkravMedId< + TData = Awaited>, + TError = unknown, +>( + fiksDigisosId: string, + dokumentasjonkravId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useGetDokumentasjonkravMedId< + TData = Awaited>, + TError = unknown, +>( + fiksDigisosId: string, + dokumentasjonkravId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; + +export function useGetDokumentasjonkravMedId< + TData = Awaited>, + TError = unknown, >( fiksDigisosId: string, dokumentasjonkravId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getGetDokumentasjonkravMedIdQueryOptions(fiksDigisosId, dokumentasjonkravId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -435,4 +697,4 @@ export const useGetDokumentasjonkravMedId = < query.queryKey = queryOptions.queryKey; return query; -}; +} diff --git a/src/generated/saks-oversikt-controller/saks-oversikt-controller.msw.ts b/src/generated/saks-oversikt-controller/saks-oversikt-controller.msw.ts index fe239b3f9..215674808 100644 --- a/src/generated/saks-oversikt-controller/saks-oversikt-controller.msw.ts +++ b/src/generated/saks-oversikt-controller/saks-oversikt-controller.msw.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 @@ -38,6 +38,7 @@ export const getHentSaksDetaljerMockHandler = ( ) => { return http.get("*/api/v1/innsyn/saksDetaljer", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -46,12 +47,7 @@ export const getHentSaksDetaljerMockHandler = ( : overrideResponse : getHentSaksDetaljerResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -63,6 +59,7 @@ export const getHentAlleSakerMockHandler = ( ) => { return http.get("*/api/v1/innsyn/saker", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -71,12 +68,7 @@ export const getHentAlleSakerMockHandler = ( : overrideResponse : getHentAlleSakerResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/saks-oversikt-controller/saks-oversikt-controller.ts b/src/generated/saks-oversikt-controller/saks-oversikt-controller.ts index cffc8b3a2..20e92f363 100644 --- a/src/generated/saks-oversikt-controller/saks-oversikt-controller.ts +++ b/src/generated/saks-oversikt-controller/saks-oversikt-controller.ts @@ -1,48 +1,65 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useQuery} from "@tanstack/react-query"; -import type {QueryFunction, QueryKey, UseQueryOptions, UseQueryResult} from "@tanstack/react-query"; +import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; import type {HentSaksDetaljerParams, SaksDetaljerResponse, SaksListeResponse} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getHentSaksDetaljerUrl = (params: HentSaksDetaljerParams) => { + const normalizedParams = new URLSearchParams(); -export const hentSaksDetaljer = ( + Object.entries(params || {}).forEach(([key, value]) => { + if (value !== undefined) { + normalizedParams.append(key, value === null ? "null" : value.toString()); + } + }); + + return normalizedParams.size + ? `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/saksDetaljer?${normalizedParams.toString()}` + : `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/saksDetaljer`; +}; + +export const hentSaksDetaljer = async ( params: HentSaksDetaljerParams, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/saksDetaljer`, method: "GET", params, signal}, - options - ); + options?: RequestInit +): Promise => { + const res = await fetch(getHentSaksDetaljerUrl(params), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as SaksDetaljerResponse; }; export const getHentSaksDetaljerQueryKey = (params: HentSaksDetaljerParams) => { - return [`/api/v1/innsyn/saksDetaljer`, ...(params ? [params] : [])] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/saksDetaljer`, ...(params ? [params] : [])] as const; }; -export const getHentSaksDetaljerQueryOptions = < - TData = Awaited>, - TError = ErrorType, ->( +export const getHentSaksDetaljerQueryOptions = >, TError = unknown>( params: HentSaksDetaljerParams, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentSaksDetaljerQueryKey(params); const queryFn: QueryFunction>> = ({signal}) => - hentSaksDetaljer(params, requestOptions, signal); + hentSaksDetaljer(params, {signal, ...fetchOptions}); return {queryKey, queryFn, ...queryOptions} as UseQueryOptions< Awaited>, @@ -52,15 +69,42 @@ export const getHentSaksDetaljerQueryOptions = < }; export type HentSaksDetaljerQueryResult = NonNullable>>; -export type HentSaksDetaljerQueryError = ErrorType; +export type HentSaksDetaljerQueryError = unknown; + +export function useHentSaksDetaljer>, TError = unknown>( + params: HentSaksDetaljerParams, + options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentSaksDetaljer>, TError = unknown>( + params: HentSaksDetaljerParams, + options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useHentSaksDetaljer>, TError = unknown>( + params: HentSaksDetaljerParams, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; -export const useHentSaksDetaljer = >, TError = ErrorType>( +export function useHentSaksDetaljer>, TError = unknown>( params: HentSaksDetaljerParams, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentSaksDetaljerQueryOptions(params, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -68,29 +112,39 @@ export const useHentSaksDetaljer = { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/saker`; }; -export const hentAlleSaker = (options?: SecondParameter, signal?: AbortSignal) => { - return axiosInstance({url: `/api/v1/innsyn/saker`, method: "GET", signal}, options); +export const hentAlleSaker = async (options?: RequestInit): Promise => { + const res = await fetch(getHentAlleSakerUrl(), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as SaksListeResponse[]; }; export const getHentAlleSakerQueryKey = () => { - return [`/api/v1/innsyn/saker`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/saker`] as const; }; export const getHentAlleSakerQueryOptions = < TData = Awaited>, - TError = ErrorType, + TError = unknown, >(options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; }) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentAlleSakerQueryKey(); const queryFn: QueryFunction>> = ({signal}) => - hentAlleSaker(requestOptions, signal); + hentAlleSaker({signal, ...fetchOptions}); return {queryKey, queryFn, ...queryOptions} as UseQueryOptions< Awaited>, @@ -100,15 +154,27 @@ export const getHentAlleSakerQueryOptions = < }; export type HentAlleSakerQueryResult = NonNullable>>; -export type HentAlleSakerQueryError = ErrorType; +export type HentAlleSakerQueryError = unknown; + +export function useHentAlleSaker>, TError = unknown>(options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; +}): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentAlleSaker>, TError = unknown>(options?: { + query?: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey}; +export function useHentAlleSaker>, TError = unknown>(options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey}; -export const useHentAlleSaker = < - TData = Awaited>, - TError = ErrorType, ->(options?: { +export function useHentAlleSaker>, TError = unknown>(options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; -}): UseQueryResult & {queryKey: QueryKey} => { + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentAlleSakerQueryOptions(options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -116,4 +182,4 @@ export const useHentAlleSaker = < query.queryKey = queryOptions.queryKey; return query; -}; +} diff --git a/src/generated/saks-status-controller/saks-status-controller.msw.ts b/src/generated/saks-status-controller/saks-status-controller.msw.ts index eacbd4704..dc8135376 100644 --- a/src/generated/saks-status-controller/saks-status-controller.msw.ts +++ b/src/generated/saks-status-controller/saks-status-controller.msw.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 @@ -41,6 +41,7 @@ export const getHentSaksStatuserMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/saksStatus", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -49,12 +50,7 @@ export const getHentSaksStatuserMockHandler = ( : overrideResponse : getHentSaksStatuserResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/saks-status-controller/saks-status-controller.ts b/src/generated/saks-status-controller/saks-status-controller.ts index cd4bf2dfb..18f665eac 100644 --- a/src/generated/saks-status-controller/saks-status-controller.ts +++ b/src/generated/saks-status-controller/saks-status-controller.ts @@ -1,48 +1,52 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useQuery} from "@tanstack/react-query"; -import type {QueryFunction, QueryKey, UseQueryOptions, UseQueryResult} from "@tanstack/react-query"; +import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; import type {SaksStatusResponse} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getHentSaksStatuserUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/saksStatus`; +}; -export const hentSaksStatuser = ( - fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/saksStatus`, method: "GET", signal}, - options - ); +export const hentSaksStatuser = async (fiksDigisosId: string, options?: RequestInit): Promise => { + const res = await fetch(getHentSaksStatuserUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as SaksStatusResponse[]; }; export const getHentSaksStatuserQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/saksStatus`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/saksStatus`] as const; }; -export const getHentSaksStatuserQueryOptions = < - TData = Awaited>, - TError = ErrorType, ->( +export const getHentSaksStatuserQueryOptions = >, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentSaksStatuserQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - hentSaksStatuser(fiksDigisosId, requestOptions, signal); + hentSaksStatuser(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -52,15 +56,42 @@ export const getHentSaksStatuserQueryOptions = < }; export type HentSaksStatuserQueryResult = NonNullable>>; -export type HentSaksStatuserQueryError = ErrorType; +export type HentSaksStatuserQueryError = unknown; -export const useHentSaksStatuser = >, TError = ErrorType>( +export function useHentSaksStatuser>, TError = unknown>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentSaksStatuser>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useHentSaksStatuser>, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey}; + +export function useHentSaksStatuser>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentSaksStatuserQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -68,4 +99,4 @@ export const useHentSaksStatuser = { return http.get("*/api/v1/innsyn/harSoknaderMedInnsyn", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -22,12 +23,7 @@ export const getHarSoknaderMedInnsynMockHandler = ( : overrideResponse : getHarSoknaderMedInnsynResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/soknad-med-innsyn-controller/soknad-med-innsyn-controller.ts b/src/generated/soknad-med-innsyn-controller/soknad-med-innsyn-controller.ts index 9512f7f65..ddad89924 100644 --- a/src/generated/soknad-med-innsyn-controller/soknad-med-innsyn-controller.ts +++ b/src/generated/soknad-med-innsyn-controller/soknad-med-innsyn-controller.ts @@ -1,37 +1,51 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useQuery} from "@tanstack/react-query"; -import type {QueryFunction, QueryKey, UseQueryOptions, UseQueryResult} from "@tanstack/react-query"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; +import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; -type SecondParameter any> = Parameters[1]; +export const getHarSoknaderMedInnsynUrl = () => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/harSoknaderMedInnsyn`; +}; + +export const harSoknaderMedInnsyn = async (options?: RequestInit): Promise => { + const res = await fetch(getHarSoknaderMedInnsynUrl(), { + ...options, + method: "GET", + }); + const data = await res.json(); -export const harSoknaderMedInnsyn = (options?: SecondParameter, signal?: AbortSignal) => { - return axiosInstance({url: `/api/v1/innsyn/harSoknaderMedInnsyn`, method: "GET", signal}, options); + return data as boolean; }; export const getHarSoknaderMedInnsynQueryKey = () => { - return [`/api/v1/innsyn/harSoknaderMedInnsyn`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/harSoknaderMedInnsyn`] as const; }; export const getHarSoknaderMedInnsynQueryOptions = < TData = Awaited>, - TError = ErrorType, + TError = unknown, >(options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; }) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHarSoknaderMedInnsynQueryKey(); const queryFn: QueryFunction>> = ({signal}) => - harSoknaderMedInnsyn(requestOptions, signal); + harSoknaderMedInnsyn({signal, ...fetchOptions}); return {queryKey, queryFn, ...queryOptions} as UseQueryOptions< Awaited>, @@ -41,15 +55,42 @@ export const getHarSoknaderMedInnsynQueryOptions = < }; export type HarSoknaderMedInnsynQueryResult = NonNullable>>; -export type HarSoknaderMedInnsynQueryError = ErrorType; +export type HarSoknaderMedInnsynQueryError = unknown; + +export function useHarSoknaderMedInnsyn< + TData = Awaited>, + TError = unknown, +>(options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; +}): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHarSoknaderMedInnsyn< + TData = Awaited>, + TError = unknown, +>(options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey}; +export function useHarSoknaderMedInnsyn< + TData = Awaited>, + TError = unknown, +>(options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey}; -export const useHarSoknaderMedInnsyn = < +export function useHarSoknaderMedInnsyn< TData = Awaited>, - TError = ErrorType, + TError = unknown, >(options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; -}): UseQueryResult & {queryKey: QueryKey} => { + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHarSoknaderMedInnsynQueryOptions(options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -57,4 +98,4 @@ export const useHarSoknaderMedInnsyn = < query.queryKey = queryOptions.queryKey; return query; -}; +} diff --git a/src/generated/soknads-status-controller/soknads-status-controller.msw.ts b/src/generated/soknads-status-controller/soknads-status-controller.msw.ts index 4f763b7e7..2e42fca06 100644 --- a/src/generated/soknads-status-controller/soknads-status-controller.msw.ts +++ b/src/generated/soknads-status-controller/soknads-status-controller.msw.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 @@ -69,6 +69,7 @@ export const getHentSoknadsStatusMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/soknadsStatus", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -77,12 +78,7 @@ export const getHentSoknadsStatusMockHandler = ( : overrideResponse : getHentSoknadsStatusResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/soknads-status-controller/soknads-status-controller.ts b/src/generated/soknads-status-controller/soknads-status-controller.ts index e2495336d..848c081fc 100644 --- a/src/generated/soknads-status-controller/soknads-status-controller.ts +++ b/src/generated/soknads-status-controller/soknads-status-controller.ts @@ -1,48 +1,58 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useQuery} from "@tanstack/react-query"; -import type {QueryFunction, QueryKey, UseQueryOptions, UseQueryResult} from "@tanstack/react-query"; +import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; import type {SoknadsStatusResponse} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getHentSoknadsStatusUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/soknadsStatus`; +}; -export const hentSoknadsStatus = ( +export const hentSoknadsStatus = async ( fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/soknadsStatus`, method: "GET", signal}, - options - ); + options?: RequestInit +): Promise => { + const res = await fetch(getHentSoknadsStatusUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as SoknadsStatusResponse; }; export const getHentSoknadsStatusQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/soknadsStatus`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/soknadsStatus`] as const; }; export const getHentSoknadsStatusQueryOptions = < TData = Awaited>, - TError = ErrorType, + TError = unknown, >( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentSoknadsStatusQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - hentSoknadsStatus(fiksDigisosId, requestOptions, signal); + hentSoknadsStatus(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -52,18 +62,45 @@ export const getHentSoknadsStatusQueryOptions = < }; export type HentSoknadsStatusQueryResult = NonNullable>>; -export type HentSoknadsStatusQueryError = ErrorType; +export type HentSoknadsStatusQueryError = unknown; -export const useHentSoknadsStatus = < - TData = Awaited>, - TError = ErrorType, ->( +export function useHentSoknadsStatus>, TError = unknown>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick< + DefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentSoknadsStatus>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useHentSoknadsStatus>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; + +export function useHentSoknadsStatus>, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentSoknadsStatusQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -71,4 +108,4 @@ export const useHentSoknadsStatus = < query.queryKey = queryOptions.queryKey; return query; -}; +} diff --git a/src/generated/tilgang-controller/tilgang-controller.msw.ts b/src/generated/tilgang-controller/tilgang-controller.msw.ts index 14c3f55d8..2d6303e6f 100644 --- a/src/generated/tilgang-controller/tilgang-controller.msw.ts +++ b/src/generated/tilgang-controller/tilgang-controller.msw.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 @@ -21,6 +21,7 @@ export const getHarTilgangMockHandler = ( ) => { return http.get("*/api/v1/innsyn/tilgang", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -29,12 +30,7 @@ export const getHarTilgangMockHandler = ( : overrideResponse : getHarTilgangResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/tilgang-controller/tilgang-controller.ts b/src/generated/tilgang-controller/tilgang-controller.ts index f06edd448..64cd7e944 100644 --- a/src/generated/tilgang-controller/tilgang-controller.ts +++ b/src/generated/tilgang-controller/tilgang-controller.ts @@ -1,38 +1,49 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useQuery} from "@tanstack/react-query"; -import type {QueryFunction, QueryKey, UseQueryOptions, UseQueryResult} from "@tanstack/react-query"; +import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; import type {TilgangResponse} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getHarTilgangUrl = () => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/tilgang`; +}; + +export const harTilgang = async (options?: RequestInit): Promise => { + const res = await fetch(getHarTilgangUrl(), { + ...options, + method: "GET", + }); + const data = await res.json(); -export const harTilgang = (options?: SecondParameter, signal?: AbortSignal) => { - return axiosInstance({url: `/api/v1/innsyn/tilgang`, method: "GET", signal}, options); + return data as TilgangResponse; }; export const getHarTilgangQueryKey = () => { - return [`/api/v1/innsyn/tilgang`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/tilgang`] as const; }; -export const getHarTilgangQueryOptions = < - TData = Awaited>, - TError = ErrorType, ->(options?: { +export const getHarTilgangQueryOptions = >, TError = unknown>(options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; }) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHarTilgangQueryKey(); const queryFn: QueryFunction>> = ({signal}) => - harTilgang(requestOptions, signal); + harTilgang({signal, ...fetchOptions}); return {queryKey, queryFn, ...queryOptions} as UseQueryOptions< Awaited>, @@ -42,12 +53,27 @@ export const getHarTilgangQueryOptions = < }; export type HarTilgangQueryResult = NonNullable>>; -export type HarTilgangQueryError = ErrorType; +export type HarTilgangQueryError = unknown; -export const useHarTilgang = >, TError = ErrorType>(options?: { +export function useHarTilgang>, TError = unknown>(options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; +}): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHarTilgang>, TError = unknown>(options?: { + query?: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey}; +export function useHarTilgang>, TError = unknown>(options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; -}): UseQueryResult & {queryKey: QueryKey} => { + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey}; + +export function useHarTilgang>, TError = unknown>(options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHarTilgangQueryOptions(options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -55,4 +81,4 @@ export const useHarTilgang = >, TE query.queryKey = queryOptions.queryKey; return query; -}; +} diff --git a/src/generated/utbetalinger-controller/utbetalinger-controller.msw.ts b/src/generated/utbetalinger-controller/utbetalinger-controller.msw.ts index 5aa0217aa..d01f1b853 100644 --- a/src/generated/utbetalinger-controller/utbetalinger-controller.msw.ts +++ b/src/generated/utbetalinger-controller/utbetalinger-controller.msw.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 @@ -78,6 +78,7 @@ export const getHentUtbetalingerMockHandler = ( ) => { return http.get("*/api/v1/innsyn/utbetalinger", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -86,12 +87,7 @@ export const getHentUtbetalingerMockHandler = ( : overrideResponse : getHentUtbetalingerResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -105,6 +101,7 @@ export const getHentTidligereUtbetalingerMockHandler = ( ) => { return http.get("*/api/v1/innsyn/tidligere", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -113,12 +110,7 @@ export const getHentTidligereUtbetalingerMockHandler = ( : overrideResponse : getHentTidligereUtbetalingerResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -132,6 +124,7 @@ export const getHentNyeUtbetalingerMockHandler = ( ) => { return http.get("*/api/v1/innsyn/nye", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -140,12 +133,7 @@ export const getHentNyeUtbetalingerMockHandler = ( : overrideResponse : getHentNyeUtbetalingerResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/utbetalinger-controller/utbetalinger-controller.ts b/src/generated/utbetalinger-controller/utbetalinger-controller.ts index 67a6f823e..941e1d1eb 100644 --- a/src/generated/utbetalinger-controller/utbetalinger-controller.ts +++ b/src/generated/utbetalinger-controller/utbetalinger-controller.ts @@ -1,48 +1,65 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useQuery} from "@tanstack/react-query"; -import type {QueryFunction, QueryKey, UseQueryOptions, UseQueryResult} from "@tanstack/react-query"; +import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult, +} from "@tanstack/react-query"; import type {HentUtbetalingerParams, NyeOgTidligereUtbetalingerResponse, UtbetalingerResponse} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getHentUtbetalingerUrl = (params?: HentUtbetalingerParams) => { + const normalizedParams = new URLSearchParams(); -export const hentUtbetalinger = ( + Object.entries(params || {}).forEach(([key, value]) => { + if (value !== undefined) { + normalizedParams.append(key, value === null ? "null" : value.toString()); + } + }); + + return normalizedParams.size + ? `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/utbetalinger?${normalizedParams.toString()}` + : `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/utbetalinger`; +}; + +export const hentUtbetalinger = async ( params?: HentUtbetalingerParams, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/utbetalinger`, method: "GET", params, signal}, - options - ); + options?: RequestInit +): Promise => { + const res = await fetch(getHentUtbetalingerUrl(params), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as UtbetalingerResponse[]; }; export const getHentUtbetalingerQueryKey = (params?: HentUtbetalingerParams) => { - return [`/api/v1/innsyn/utbetalinger`, ...(params ? [params] : [])] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/utbetalinger`, ...(params ? [params] : [])] as const; }; -export const getHentUtbetalingerQueryOptions = < - TData = Awaited>, - TError = ErrorType, ->( +export const getHentUtbetalingerQueryOptions = >, TError = unknown>( params?: HentUtbetalingerParams, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentUtbetalingerQueryKey(params); const queryFn: QueryFunction>> = ({signal}) => - hentUtbetalinger(params, requestOptions, signal); + hentUtbetalinger(params, {signal, ...fetchOptions}); return {queryKey, queryFn, ...queryOptions} as UseQueryOptions< Awaited>, @@ -52,15 +69,42 @@ export const getHentUtbetalingerQueryOptions = < }; export type HentUtbetalingerQueryResult = NonNullable>>; -export type HentUtbetalingerQueryError = ErrorType; +export type HentUtbetalingerQueryError = unknown; + +export function useHentUtbetalinger>, TError = unknown>( + params: undefined | HentUtbetalingerParams, + options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentUtbetalinger>, TError = unknown>( + params?: HentUtbetalingerParams, + options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useHentUtbetalinger>, TError = unknown>( + params?: HentUtbetalingerParams, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; -export const useHentUtbetalinger = >, TError = ErrorType>( +export function useHentUtbetalinger>, TError = unknown>( params?: HentUtbetalingerParams, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentUtbetalingerQueryOptions(params, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -68,32 +112,41 @@ export const useHentUtbetalinger = { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/tidligere`; }; -export const hentTidligereUtbetalinger = (options?: SecondParameter, signal?: AbortSignal) => { - return axiosInstance( - {url: `/api/v1/innsyn/tidligere`, method: "GET", signal}, - options - ); +export const hentTidligereUtbetalinger = async ( + options?: RequestInit +): Promise => { + const res = await fetch(getHentTidligereUtbetalingerUrl(), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as NyeOgTidligereUtbetalingerResponse[]; }; export const getHentTidligereUtbetalingerQueryKey = () => { - return [`/api/v1/innsyn/tidligere`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/tidligere`] as const; }; export const getHentTidligereUtbetalingerQueryOptions = < TData = Awaited>, - TError = ErrorType, + TError = unknown, >(options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; }) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentTidligereUtbetalingerQueryKey(); const queryFn: QueryFunction>> = ({signal}) => - hentTidligereUtbetalinger(requestOptions, signal); + hentTidligereUtbetalinger({signal, ...fetchOptions}); return {queryKey, queryFn, ...queryOptions} as UseQueryOptions< Awaited>, @@ -103,15 +156,45 @@ export const getHentTidligereUtbetalingerQueryOptions = < }; export type HentTidligereUtbetalingerQueryResult = NonNullable>>; -export type HentTidligereUtbetalingerQueryError = ErrorType; +export type HentTidligereUtbetalingerQueryError = unknown; -export const useHentTidligereUtbetalinger = < +export function useHentTidligereUtbetalinger< TData = Awaited>, - TError = ErrorType, + TError = unknown, +>(options: { + query: Partial>, TError, TData>> & + Pick< + DefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; +}): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentTidligereUtbetalinger< + TData = Awaited>, + TError = unknown, +>(options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey}; +export function useHentTidligereUtbetalinger< + TData = Awaited>, + TError = unknown, +>(options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey}; + +export function useHentTidligereUtbetalinger< + TData = Awaited>, + TError = unknown, >(options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; -}): UseQueryResult & {queryKey: QueryKey} => { + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentTidligereUtbetalingerQueryOptions(options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -119,32 +202,39 @@ export const useHentTidligereUtbetalinger = < query.queryKey = queryOptions.queryKey; return query; +} + +export const getHentNyeUtbetalingerUrl = () => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/nye`; }; -export const hentNyeUtbetalinger = (options?: SecondParameter, signal?: AbortSignal) => { - return axiosInstance( - {url: `/api/v1/innsyn/nye`, method: "GET", signal}, - options - ); +export const hentNyeUtbetalinger = async (options?: RequestInit): Promise => { + const res = await fetch(getHentNyeUtbetalingerUrl(), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as NyeOgTidligereUtbetalingerResponse[]; }; export const getHentNyeUtbetalingerQueryKey = () => { - return [`/api/v1/innsyn/nye`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/nye`] as const; }; export const getHentNyeUtbetalingerQueryOptions = < TData = Awaited>, - TError = ErrorType, + TError = unknown, >(options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; }) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentNyeUtbetalingerQueryKey(); const queryFn: QueryFunction>> = ({signal}) => - hentNyeUtbetalinger(requestOptions, signal); + hentNyeUtbetalinger({signal, ...fetchOptions}); return {queryKey, queryFn, ...queryOptions} as UseQueryOptions< Awaited>, @@ -154,15 +244,42 @@ export const getHentNyeUtbetalingerQueryOptions = < }; export type HentNyeUtbetalingerQueryResult = NonNullable>>; -export type HentNyeUtbetalingerQueryError = ErrorType; +export type HentNyeUtbetalingerQueryError = unknown; -export const useHentNyeUtbetalinger = < +export function useHentNyeUtbetalinger< + TData = Awaited>, + TError = unknown, +>(options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; +}): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentNyeUtbetalinger< TData = Awaited>, - TError = ErrorType, + TError = unknown, +>(options?: { + query?: Partial>, TError, TData>> & + Pick< + UndefinedInitialDataOptions>, TError, TData>, + "initialData" + >; + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey}; +export function useHentNyeUtbetalinger< + TData = Awaited>, + TError = unknown, >(options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; -}): UseQueryResult & {queryKey: QueryKey} => { + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey}; + +export function useHentNyeUtbetalinger< + TData = Awaited>, + TError = unknown, +>(options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; +}): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentNyeUtbetalingerQueryOptions(options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -170,4 +287,4 @@ export const useHentNyeUtbetalinger = < query.queryKey = queryOptions.queryKey; return query; -}; +} diff --git a/src/generated/vedlegg-controller/vedlegg-controller.msw.ts b/src/generated/vedlegg-controller/vedlegg-controller.msw.ts index a05b49e49..967b91a7a 100644 --- a/src/generated/vedlegg-controller/vedlegg-controller.msw.ts +++ b/src/generated/vedlegg-controller/vedlegg-controller.msw.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 @@ -48,6 +48,7 @@ export const getHentVedleggMockHandler = ( ) => { return http.get("*/api/v1/innsyn/:fiksDigisosId/vedlegg", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -56,12 +57,7 @@ export const getHentVedleggMockHandler = ( : overrideResponse : getHentVedleggResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; @@ -75,6 +71,7 @@ export const getSendVedleggMockHandler = ( ) => { return http.post("*/api/v1/innsyn/:fiksDigisosId/vedlegg", async (info) => { await delay(1000); + return new HttpResponse( JSON.stringify( overrideResponse !== undefined @@ -83,12 +80,7 @@ export const getSendVedleggMockHandler = ( : overrideResponse : getSendVedleggResponseMock() ), - { - status: 200, - headers: { - "Content-Type": "application/json", - }, - } + {status: 200, headers: {"Content-Type": "application/json"}} ); }); }; diff --git a/src/generated/vedlegg-controller/vedlegg-controller.ts b/src/generated/vedlegg-controller/vedlegg-controller.ts index 1d2983690..a4ac79c08 100644 --- a/src/generated/vedlegg-controller/vedlegg-controller.ts +++ b/src/generated/vedlegg-controller/vedlegg-controller.ts @@ -1,56 +1,55 @@ /** - * Generated by orval v6.31.0 🍺 + * Generated by orval v7.2.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import {useMutation, useQuery} from "@tanstack/react-query"; import type { + DefinedInitialDataOptions, + DefinedUseQueryResult, MutationFunction, QueryFunction, QueryKey, + UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, } from "@tanstack/react-query"; import type {OppgaveOpplastingResponse, SendVedleggBody, VedleggResponse} from ".././model"; -import {axiosInstance} from "../../axios-instance"; -import type {ErrorType} from "../../axios-instance"; -type SecondParameter any> = Parameters[1]; +export const getHentVedleggUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/vedlegg`; +}; -export const hentVedlegg = ( - fiksDigisosId: string, - options?: SecondParameter, - signal?: AbortSignal -) => { - return axiosInstance( - {url: `/api/v1/innsyn/${fiksDigisosId}/vedlegg`, method: "GET", signal}, - options - ); +export const hentVedlegg = async (fiksDigisosId: string, options?: RequestInit): Promise => { + const res = await fetch(getHentVedleggUrl(fiksDigisosId), { + ...options, + method: "GET", + }); + const data = await res.json(); + + return data as VedleggResponse[]; }; export const getHentVedleggQueryKey = (fiksDigisosId: string) => { - return [`/api/v1/innsyn/${fiksDigisosId}/vedlegg`] as const; + return [`/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/vedlegg`] as const; }; -export const getHentVedleggQueryOptions = < - TData = Awaited>, - TError = ErrorType, ->( +export const getHentVedleggQueryOptions = >, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } ) => { - const {query: queryOptions, request: requestOptions} = options ?? {}; + const {query: queryOptions, fetch: fetchOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getHentVedleggQueryKey(fiksDigisosId); const queryFn: QueryFunction>> = ({signal}) => - hentVedlegg(fiksDigisosId, requestOptions, signal); + hentVedlegg(fiksDigisosId, {signal, ...fetchOptions}); return {queryKey, queryFn, enabled: !!fiksDigisosId, ...queryOptions} as UseQueryOptions< Awaited>, @@ -60,15 +59,39 @@ export const getHentVedleggQueryOptions = < }; export type HentVedleggQueryResult = NonNullable>>; -export type HentVedleggQueryError = ErrorType; +export type HentVedleggQueryError = unknown; -export const useHentVedlegg = >, TError = ErrorType>( +export function useHentVedlegg>, TError = unknown>( + fiksDigisosId: string, + options: { + query: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): DefinedUseQueryResult & {queryKey: QueryKey}; +export function useHentVedlegg>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>> & + Pick>, TError, TData>, "initialData">; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey}; +export function useHentVedlegg>, TError = unknown>( fiksDigisosId: string, options?: { query?: Partial>, TError, TData>>; - request?: SecondParameter; + fetch?: RequestInit; } -): UseQueryResult & {queryKey: QueryKey} => { +): UseQueryResult & {queryKey: QueryKey}; + +export function useHentVedlegg>, TError = unknown>( + fiksDigisosId: string, + options?: { + query?: Partial>, TError, TData>>; + fetch?: RequestInit; + } +): UseQueryResult & {queryKey: QueryKey} { const queryOptions = getHentVedleggQueryOptions(fiksDigisosId, options); const query = useQuery(queryOptions) as UseQueryResult & {queryKey: QueryKey}; @@ -76,42 +99,45 @@ export const useHentVedlegg = >, query.queryKey = queryOptions.queryKey; return query; +} + +export const getSendVedleggUrl = (fiksDigisosId: string) => { + return `/sosialhjelp/innsyn/api/innsyn-api/api/v1/innsyn/${fiksDigisosId}/vedlegg`; }; -export const sendVedlegg = ( +export const sendVedlegg = async ( fiksDigisosId: string, sendVedleggBody: SendVedleggBody, - options?: SecondParameter -) => { + options?: RequestInit +): Promise => { const formData = new FormData(); sendVedleggBody.files.forEach((value) => formData.append("files", value)); - return axiosInstance( - { - url: `/api/v1/innsyn/${fiksDigisosId}/vedlegg`, - method: "POST", - headers: {"Content-Type": "multipart/form-data"}, - data: formData, - }, - options - ); + const res = await fetch(getSendVedleggUrl(fiksDigisosId), { + ...options, + method: "POST", + body: formData, + }); + const data = await res.json(); + + return data as OppgaveOpplastingResponse[]; }; -export const getSendVedleggMutationOptions = , TContext = unknown>(options?: { +export const getSendVedleggMutationOptions = (options?: { mutation?: UseMutationOptions< Awaited>, TError, {fiksDigisosId: string; data: SendVedleggBody}, TContext >; - request?: SecondParameter; + fetch?: RequestInit; }): UseMutationOptions< Awaited>, TError, {fiksDigisosId: string; data: SendVedleggBody}, TContext > => { - const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + const {mutation: mutationOptions, fetch: fetchOptions} = options ?? {}; const mutationFn: MutationFunction< Awaited>, @@ -119,7 +145,7 @@ export const getSendVedleggMutationOptions = , TCont > = (props) => { const {fiksDigisosId, data} = props ?? {}; - return sendVedlegg(fiksDigisosId, data, requestOptions); + return sendVedlegg(fiksDigisosId, data, fetchOptions); }; return {mutationFn, ...mutationOptions}; @@ -127,16 +153,16 @@ export const getSendVedleggMutationOptions = , TCont export type SendVedleggMutationResult = NonNullable>>; export type SendVedleggMutationBody = SendVedleggBody; -export type SendVedleggMutationError = ErrorType; +export type SendVedleggMutationError = unknown; -export const useSendVedlegg = , TContext = unknown>(options?: { +export const useSendVedlegg = (options?: { mutation?: UseMutationOptions< Awaited>, TError, {fiksDigisosId: string; data: SendVedleggBody}, TContext >; - request?: SecondParameter; + fetch?: RequestInit; }): UseMutationResult< Awaited>, TError, diff --git a/src/middleware.ts b/src/middleware.ts index b8b39a5a7..0d1238d74 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -13,52 +13,66 @@ interface AzureAdAuthenticationError { export async function middleware(request: NextRequest) { const pathname = request.nextUrl.pathname; + if (!pathname.includes("api/internal")) { + console.log("Detta er middleware"); + console.log("hva skjer hera ", pathname); + console.log("her ere no cookies: ", request.cookies); + console.log("Ere no auth header a?", request.headers.get("Authorization")); + } // Ikke gjør noe med requests til /api eller statiske filer if (pathname.startsWith("/_next") || pathname.includes("/api") || PUBLIC_FILE.test(pathname)) { return; } - // Reroute ved kall til /link. Brukes for redirect fra login-api - if (pathname.startsWith("/link")) { - const searchParams = request.nextUrl.searchParams; - if (!searchParams.has("goto")) { - throw new Error("redirect mangler goto-parameter"); - } - return NextResponse.redirect(new URL(searchParams.get("goto")!, process.env.NEXT_PUBLIC_INNSYN_ORIGIN)); - } - // Sett språk basert på decorator-language cookien - const decoratorLocale = request.cookies.get("decorator-language")?.value ?? "nb"; - if (decoratorLocale !== request.nextUrl.locale) { - if (request.nextUrl.locale !== "nb") { - const next = NextResponse.next(); - next.cookies.set("decorator-language", request.nextUrl.locale); - return next; - } - const url = new URL( - `${process.env.NEXT_PUBLIC_INNSYN_ORIGIN}${process.env.NEXT_PUBLIC_BASE_PATH}/${ - decoratorLocale === "nb" ? "" : decoratorLocale - }${pathname.replace("/sosialhjelp/innsyn", "")}` - ); - return NextResponse.redirect(url); - } + // const decoratorLocale = request.cookies.get("decorator-language")?.value ?? "nb"; + // if (decoratorLocale !== request.nextUrl.locale) { + // if (request.nextUrl.locale !== "nb") { + // const next = NextResponse.next(); + // next.cookies.set("decorator-language", request.nextUrl.locale); + // return next; + // } + // const url = new URL( + // `${process.env.NEXT_PUBLIC_INNSYN_ORIGIN}${process.env.NEXT_PUBLIC_BASE_PATH}/${ + // decoratorLocale === "nb" ? "" : decoratorLocale + // }${pathname.replace("/sosialhjelp/innsyn", "")}` + // ); + // return NextResponse.redirect(url); + // } - // Router bruker til login hvis vi får 401 - try { - const harTilgangResponse = await fetch(process.env.NEXT_INNSYN_API_BASE_URL + "/api/v1/innsyn/tilgang", { - headers: new Headers(request.headers), - credentials: "include", - }); - if (harTilgangResponse.status === 401) { - const json: AzureAdAuthenticationError = await harTilgangResponse.json(); - const queryDivider = json.loginUrl.includes("?") ? "&" : "?"; + // Router bruker til login hvis vi får 401. Dette gjelder bare for auth gjennom mock-alt. I prod/preprod gjelder dette for "vanlig" innlogging på login.nav.no + if (["mock", "local"].includes(process.env.NEXT_PUBLIC_RUNTIME_ENVIRONMENT!)) { + // Reroute ved kall til /link. Brukes for redirect fra login-api + if (pathname.startsWith("/link")) { + const searchParams = request.nextUrl.searchParams; + if (!searchParams.has("goto")) { + throw new Error("redirect mangler goto-parameter"); + } + return NextResponse.redirect(new URL(searchParams.get("goto")!, process.env.NEXT_PUBLIC_INNSYN_ORIGIN)); + } + try { + const harTilgangResponse = await fetch(process.env.NEXT_INNSYN_API_BASE_URL + "/api/v1/innsyn/tilgang", { + headers: new Headers({ + ...request.headers, + Authorization: `Bearer ${request.cookies.get("localhost-idtoken")?.value}`, + }), + }); + if (harTilgangResponse.status === 401) { + const json: AzureAdAuthenticationError = await harTilgangResponse.json(); + const queryDivider = json.loginUrl.includes("?") ? "&" : "?"; - const redirectUrl = getRedirect(json.loginUrl, pathname, process.env.NEXT_PUBLIC_INNSYN_ORIGIN!, json.id); - return NextResponse.redirect(json.loginUrl + queryDivider + redirectUrl); + const redirectUrl = getRedirect( + json.loginUrl, + pathname, + process.env.NEXT_PUBLIC_INNSYN_ORIGIN!, + json.id + ); + return NextResponse.redirect(json.loginUrl + queryDivider + redirectUrl); + } + } catch (e) { + logger.warn("Feil i middleware fetch, sender bruker til 500", e); + return NextResponse.redirect(process.env.NEXT_PUBLIC_INNSYN_ORIGIN + "/sosialhjelp/innsyn/500"); } - } catch (e) { - logger.warn("Feil i middleware fetch, sender bruker til 500", e); - return NextResponse.redirect(process.env.NEXT_PUBLIC_INNSYN_ORIGIN + "/sosialhjelp/innsyn/500"); } } diff --git a/src/pages/[id]/status.tsx b/src/pages/[id]/status.tsx index 421582cbb..ead3fb2c6 100644 --- a/src/pages/[id]/status.tsx +++ b/src/pages/[id]/status.tsx @@ -9,7 +9,6 @@ import {useHentSoknadsStatus} from "../../generated/soknads-status-controller/so import {useHentForelopigSvarStatus} from "../../generated/forelopig-svar-controller/forelopig-svar-controller"; import React, {useEffect, useState} from "react"; import {logAmplitudeEvent} from "../../utils/amplitude"; -import {HttpStatusCode} from "axios"; import {LoadingResourcesFailedAlert} from "../../innsyn/LoadingResourcesFailedAlert"; import {ApplicationSpinner} from "../../components/applicationSpinner/ApplicationSpinner"; import DriftsmeldingAlertstripe from "../../components/driftsmelding/Driftsmelding"; @@ -85,8 +84,6 @@ const SaksStatusView: NextPage = () => { } }, [dataErKlare, oppgaver?.length, forelopigSvar?.harMottattForelopigSvar, saksStatuser, soknadsStatus?.status]); - const mustLogin: boolean = saksStatuserError?.status === HttpStatusCode.Unauthorized; - const sakErPaaklagbar = soknadsStatus?.status !== SoknadsStatusResponseStatus.BEHANDLES_IKKE && (!saksStatuser || @@ -101,46 +98,40 @@ const SaksStatusView: NextPage = () => { - {mustLogin && } - - {!mustLogin && ( - <> - - - {soknadsStatus?.isBroken && ( - - {t("soknaderUtenVedlegg.statusside")} - - )} - - - - - - - {erPaInnsyn && } - {kommune != null && kommune.erInnsynDeaktivert && ( - <> - - - {t("vedlegg.tittel")} - - - - - - - )} - {sakErPaaklagbar && } - {(kommune == null || !kommune.erInnsynDeaktivert) && ( - } - vedleggChildren={} - /> - )} - - + + + {soknadsStatus?.isBroken && ( + + {t("soknaderUtenVedlegg.statusside")} + )} + + + + + + + {erPaInnsyn && } + {kommune != null && kommune.erInnsynDeaktivert && ( + <> + + + {t("vedlegg.tittel")} + + + + + + + )} + {sakErPaaklagbar && } + {(kommune == null || !kommune.erInnsynDeaktivert) && ( + } + vedleggChildren={} + /> + )} + ); }; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index fd60065ef..1cb49a508 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -29,7 +29,6 @@ configureLogger({ logBrukerDefaultLanguage(Cookies.get("decorator-language")); const App = ({Component, pageProps}: AppProps<{toggles: IToggle[]}>): React.JSX.Element => { - const {i18n} = useTranslation(); const router = useRouter(); const [queryHas403, setQueryHas403] = useState(false); onLanguageSelect(async (option) => { diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx index 1766be3f9..0f8c6ac1a 100644 --- a/src/pages/_document.tsx +++ b/src/pages/_document.tsx @@ -19,6 +19,7 @@ const decoratorParams = (ctx: DocumentContext): DecoratorFetchProps => ({ chatbot: false, shareScreen: false, utilsBackground: "white", + redirectToUrl: process.env.NEXT_PUBLIC_INNSYN_API_REDIRECT_TO_URL || undefined, logoutUrl: process.env.NEXT_PUBLIC_INNSYN_API_SINGLE_LOGOUT_URL || undefined, availableLanguages: [ { diff --git a/src/pages/api/innsyn-api/[...slug].ts b/src/pages/api/innsyn-api/[...slug].ts new file mode 100644 index 000000000..67eb99633 --- /dev/null +++ b/src/pages/api/innsyn-api/[...slug].ts @@ -0,0 +1,52 @@ +import type {NextApiRequest, NextApiResponse} from "next"; +import {proxyApiRouteRequest} from "@navikt/next-api-proxy"; +import {getToken} from "@navikt/oasis"; + +const handler = async (req: NextApiRequest, res: NextApiResponse) => { + const {slug, ...params} = req.query; + console.log("hallo i luken"); + let token = getToken(req); + + if (["local", "mock"].includes(process.env.NEXT_PUBLIC_RUNTIME_ENVIRONMENT ?? "")) { + // Kommer herifra lokalt/i mock-miljø + const tokenCookie = req.cookies["localhost-idtoken"]; + if (tokenCookie) { + token = tokenCookie; + } + } + if (!token) { + return res.redirect("/oauth2/login"); + } + if (!slug) { + res.status(400).json({message: "Manglende path"}); + return; + } + const queryParams = Object.entries(params); + const queryString = queryParams + .map(([key, value]) => `${key}=${Array.isArray(value) ? value.join(",") : value}`) + .join("&"); + const path = + "/sosialhjelp/innsyn-api/" + + (Array.isArray(slug) ? slug.join("/") : slug) + + (queryString !== "" ? `?${queryString}` : ""); + console.log("proxyer request til", path); + await proxyApiRouteRequest({ + req, + res, + bearerToken: token, + hostname: process.env.NEXT_INNSYN_API_HOSTNAME ?? "", + path, + https: false, + port: process.env.NEXT_PUBLIG_RUNTIME_ENVIRONMENT === "local" ? 8080 : undefined, + }); + console.log("statuscode etter proxy ", res.statusCode); +}; + +export const config = { + api: { + bodyParser: false, + externalResolver: true, + }, +}; + +export default handler; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 9465f0c5c..39a0e5cb6 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -21,10 +21,9 @@ const Saksoversikt: NextPage = () => { useUpdateBreadcrumbs(() => []); const {data: saker, isLoading, error} = useHentAlleSaker(); - return ( - {(isLoading || error?.status === 401) && } + {isLoading && } {!isLoading && ( <> {error && ( diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 000000000..13953a4b4 --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "incremental": true, + "module": "esnext", + "esModuleInterop": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve" + }, + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx" + ], + "exclude": [ + "node_modules" + ] +} diff --git a/wonderwall/preprod/idportenclient.yml b/wonderwall/preprod/idportenclient.yml new file mode 100644 index 000000000..b32c6d62a --- /dev/null +++ b/wonderwall/preprod/idportenclient.yml @@ -0,0 +1,21 @@ +apiVersion: nais.io/v1 +kind: IDPortenClient +metadata: + labels: + team: teamdigisos + name: idporten-innsyn + namespace: teamdigisos +spec: + accessTokenLifetime: 3600 + clientURI: https://www.nav.no/okonomisk-sosialhjelp + frontchannelLogoutURI: https://www.ekstern.dev.nav.no/sosialhjelp/innsyn/oauth2/logout/frontchannel + integrationType: api_klient + postLogoutRedirectURIs: + - https://www.ekstern.dev.nav.no/sosialhjelp/innsyn/oauth2/logout/callback + redirectURIs: + - https://www.ekstern.dev.nav.no/sosialhjelp/innsyn/oauth2/callback + scopes: + - openid + - ks:fiks + secretName: idporten-innsyn + sessionLifetime: 21600 diff --git a/wonderwall/preprod/wonderwall.yml b/wonderwall/preprod/wonderwall.yml new file mode 100644 index 000000000..9d6e36c90 --- /dev/null +++ b/wonderwall/preprod/wonderwall.yml @@ -0,0 +1,69 @@ +apiVersion: "nais.io/v1alpha1" +kind: "Application" +metadata: + name: wonderwall-innsyn + namespace: teamdigisos + labels: + team: teamdigisos +spec: + image: europe-north1-docker.pkg.dev/nais-io/nais/images/wonderwall:latest + port: 8080 + ingresses: + - "https://www.ekstern.dev.nav.no/sosialhjelp/innsyn" + accessPolicy: + outbound: + external: + - host: test.idporten.no + rules: + - application: sosialhjelp-innsyn + resources: + limits: + cpu: "2" + memory: 256Mi + requests: + cpu: "20m" + memory: 50Mi + redis: + - access: readwrite + instance: wonderwall + liveness: + initialDelay: 20 + path: /sosialhjelp/innsyn/oauth2/ping + readiness: + initialDelay: 20 + path: /sosialhjelp/innsyn/oauth2/ping + replicas: + min: 1 + max: 2 + envFrom: + - secret: idporten-innsyn + - secret: wonderwall-redis + env: + - name: WONDERWALL_AUTO_LOGIN + value: "true" + - name: WONDERWALL_OPENID_PROVIDER + value: idporten + - name: WONDERWALL_OPENID_SCOPES + value: ks:fiks + - name: WONDERWALL_INGRESS + value: https://www.ekstern.dev.nav.no/sosialhjelp/innsyn + - name: WONDERWALL_UPSTREAM_HOST + value: sosialhjelp-innsyn:80 + - name: WONDERWALL_BIND_ADDRESS + value: 0.0.0.0:8080 + - name: WONDERWALL_COOKIE_PREFIX + value: "sosialhjelp.innsyn.wonderwall" + - name: WONDERWALL_METRICS_BIND_ADDRESS + value: 0.0.0.0:7565 + - name: WONDERWALL_SHUTDOWN_GRACEFUL_PERIOD + value: 30s + - name: WONDERWALL_SHUTDOWN_WAIT_BEFORE_PERIOD + value: 7s + - name: WONDERWALL_LOG_LEVEL + value: debug + - name: WONDERWALL_REDIS_URI + value: $(REDIS_URI_WONDERWALL) + - name: WONDERWALL_REDIS_USERNAME + value: $(REDIS_USERNAME_WONDERWALL) + - name: WONDERWALL_REDIS_PASSWORD + value: $(REDIS_PASSWORD_WONDERWALL) diff --git a/wonderwall/prod/idportenclient.yml b/wonderwall/prod/idportenclient.yml new file mode 100644 index 000000000..152b8b130 --- /dev/null +++ b/wonderwall/prod/idportenclient.yml @@ -0,0 +1,22 @@ +apiVersion: nais.io/v1 +kind: IDPortenClient +metadata: + labels: + team: teamdigisos + name: idporten-soknad + namespace: teamdigisos +spec: + accessTokenLifetime: 3600 + clientURI: https://www.nav.no/okonomisk-sosialhjelp + frontchannelLogoutURI: https://www.ansatt.nav.no/sosialhjelp/soknad/oauth2/logout/frontchannel + integrationType: api_klient + postLogoutRedirectURIs: + - https://www.ansatt.nav.no/sosialhjelp/soknad/oauth2/logout/callback + redirectURIs: + - https://www.ansatt.nav.no/sosialhjelp/soknad/oauth2/callback + scopes: + - openid + - ks:fiks + - husbanken:minbostotte + secretName: idporten-soknad + sessionLifetime: 21600 \ No newline at end of file diff --git a/wonderwall/prod/wonderwall.yml b/wonderwall/prod/wonderwall.yml new file mode 100644 index 000000000..4d8d0124b --- /dev/null +++ b/wonderwall/prod/wonderwall.yml @@ -0,0 +1,67 @@ +apiVersion: "nais.io/v1alpha1" +kind: "Application" +metadata: + name: wonderwall-soknad + namespace: teamdigisos + labels: + team: teamdigisos +spec: + image: europe-north1-docker.pkg.dev/nais-io/nais/images/wonderwall:latest + port: 8080 + ingresses: + - "https://www.ansatt.nav.no/sosialhjelp/soknad" + accessPolicy: + outbound: + external: + - host: idporten.no + rules: + - application: sosialhjelp-soknad + resources: + limits: + cpu: "2" + memory: 256Mi + requests: + cpu: "20m" + memory: 50Mi + redis: + - access: readwrite + instance: wonderwall + liveness: + initialDelay: 20 + path: /sosialhjelp/soknad/oauth2/ping + readiness: + initialDelay: 20 + path: /sosialhjelp/soknad/oauth2/ping + replicas: + min: 1 + max: 2 + envFrom: + - secret: idporten-soknad + - secret: wonderwall-redis + env: + - name: WONDERWALL_AUTO_LOGIN + value: "true" + - name: WONDERWALL_OPENID_PROVIDER + value: idporten + - name: WONDERWALL_OPENID_SCOPES + value: ks:fiks,husbanken:minbostotte + - name: WONDERWALL_INGRESS + value: https://www.ansatt.nav.no/sosialhjelp/soknad + - name: WONDERWALL_UPSTREAM_HOST + value: sosialhjelp-soknad:80 + - name: WONDERWALL_BIND_ADDRESS + value: 0.0.0.0:8080 + - name: WONDERWALL_METRICS_BIND_ADDRESS + value: 0.0.0.0:7565 + - name: WONDERWALL_SHUTDOWN_GRACEFUL_PERIOD + value: 30s + - name: WONDERWALL_SHUTDOWN_WAIT_BEFORE_PERIOD + value: 7s + - name: WONDERWALL_LOG_LEVEL + value: debug + - name: WONDERWALL_REDIS_URI + value: $(REDIS_URI_WONDERWALL) + - name: WONDERWALL_REDIS_USERNAME + value: $(REDIS_USERNAME_WONDERWALL) + - name: WONDERWALL_REDIS_PASSWORD + value: $(REDIS_PASSWORD_WONDERWALL) \ No newline at end of file