diff --git a/driftsmelding-api.json b/driftsmelding-api.json deleted file mode 100644 index 68f17ec79..000000000 --- a/driftsmelding-api.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "openapi": "3.0.0", - "info": {"title": "Sosialhjelp driftsmeldinger", "version": "1.0"}, - "servers": [{"url": "/sosialhjelp/driftsmeldinger", "description": "next-js"}], - "paths": { - "/api/status": { - "get": { - "description": "Hent liste med aktive driftsmeldinger", - "parameters": [ - { - "in": "query", - "name": "audience", - "schema": {"type": "string", "enum": ["soknad", "innsyn", "modia"]}, - "required": true, - "description": "Publikum for driftsmeldinger" - } - ], - "responses": { - "200": { - "description": "En liste av aktive driftsmeldinger", - "content": { - "application/json": { - "schema": {"type": "array", "items": {"$ref": "#/components/schemas/Driftsmelding"}} - } - } - }, - "400": {"description": "Ugyldig eller manglende målgruppeparameter"} - } - } - } - }, - "components": { - "schemas": { - "Driftsmelding": { - "type": "object", - "required": [ - "id", - "text", - "severity", - "createdAt", - "visibleInSoknad", - "visibleInInnsyn", - "visibleInModia" - ], - "properties": { - "id": {"type": "integer"}, - "severity": {"$ref": "#/components/schemas/Severity"}, - "text": { - "description": "Teksten som skal vises i driftsmeldingen, i Markdown-format", - "type": "string" - }, - "createdAt": {"type": "string", "format": "date-time"}, - "expiresAt": { - "type": "string", - "format": "date-time", - "description": "Driftsmeldingen utløper (blir usynlig) etter dato" - }, - "publishedAt": { - "type": "string", - "format": "date-time", - "description": "Driftsmeldingen blir først synlig etter dato" - }, - "visibleInSoknad": {"description": "Driftsmeldingen skal vises i søknad", "type": "boolean"}, - "visibleInInnsyn": {"description": "Driftsmeldingen skal vises i innsyn", "type": "boolean"}, - "visibleInModia": {"description": "Driftsmeldingen skal vises i modia", "type": "boolean"} - }, - "example": { - "id": 1, - "severity": "info", - "text": "Dette er en driftsmelding", - "createdAt": "2021-09-01T12:00:00Z", - "expiresAt": "2022-09-01T12:00:00Z", - "visibleInSoknad": true, - "visibleInInnsyn": true, - "visibleInModia": true - } - }, - "Severity": { - "description": "Hvordan driftsmeldingen skal vises; samsvarer med Aksel sin Alert-komponent", - "type": "string", - "enum": ["info", "success", "error", "warning"], - "example": "info" - } - } - }, - "tags": [] -} diff --git a/orval.config.ts b/orval.config.ts index 18b9d769a..5b25dd99d 100644 --- a/orval.config.ts +++ b/orval.config.ts @@ -84,25 +84,6 @@ export default defineConfig({ afterAllFilesWrite: "prettier --write", }, }, - driftsmeldinger: { - input: "./driftsmelding-api.json", - output: { - baseUrl: "https://fakePlaceholder/", // blir overstyrt i driftsmeldingFetch.ts - mode: "single", - target: "src/generated/driftsmelding.ts", - client: "fetch", - mock: false, - override: { - mutator: { - path: "src/lib/driftsmeldingFetch.ts", - name: "driftsmeldingFetch", - }, - }, - }, - hooks: { - afterAllFilesWrite: "prettier --write", - }, - }, }); /** diff --git a/package.json b/package.json index d2abbb981..aa0d52a11 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,6 @@ "prepare": "husky", "checkUpdates": "npx npm-check-updates -u", "fetch-api": "curl -o ./soknad-api-old.json http://localhost:8181/sosialhjelp/soknad-api/v3/api-docs/old && prettier --write soknad-api-old.json && curl -o ./soknad-api-new.json http://localhost:8181/sosialhjelp/soknad-api/v3/api-docs/new && prettier --write soknad-api-new.json", - "fetch-driftsmelding-api": "curl -o ./driftsmelding-api.json http://localhost:3005/sosialhjelp/driftsmeldinger/api/api-doc && prettier --write driftsmelding-api.json", "orval": "rm -rf ./src/generated & orval --prettier", "lint": "eslint" },