{"_id":"@arbeidstilsynet/meldinger-data","_rev":"6-48ef3b9cd82ebfe2d81759fa2548ee77","name":"@arbeidstilsynet/meldinger-data","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@arbeidstilsynet/meldinger-data","version":"0.0.1","author":{"name":"Arbeidstilsynet"},"license":"MIT","_id":"@arbeidstilsynet/meldinger-data@0.0.1","maintainers":[{"name":"at_gagt","email":"grunde.thorheim@arbeidstilsynet.no"},{"name":"karoljd","email":"karol.jerzy.debik@arbeidstilsynet.no"},{"name":"atroberthtollefsen","email":"roberth.tollefsen@arbeidstilsynet.no"},{"name":"at-npm-admin","email":"npm-admin@arbeidstilsynet.no"}],"homepage":"https://github.com/Arbeidstilsynet/meldinger#readme","bugs":{"url":"https://github.com/Arbeidstilsynet/meldinger/issues"},"dist":{"shasum":"adf32bd3f7381a947dc5357c8e53505868827ef5","tarball":"https://registry.npmjs.org/@arbeidstilsynet/meldinger-data/-/meldinger-data-0.0.1.tgz","fileCount":4,"integrity":"sha512-54JCRLqBOGsXYbv7E0tO4wPYePjSFW5WNnQZkpI/7n9QGwS/Tiu/gmtNlpdYZFKODd/tRQCWZq454xd4ka7feQ==","signatures":[{"sig":"MEQCIBFj3zW0Tmb2JhqOn0kg3uioWXM9mcFzZ9wsCqxYWlOQAiBzk/3266bgMvVrI27tuV/taB5Y65T3OxWDU9Kwoxfb6Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14846},"types":"./types.d.ts","exports":{".":{"types":"./types.d.ts"}},"gitHead":"900173dce0b164ae2c0c5b2325f0f8547173630d","_npmUser":{"name":"at_gagt","email":"grunde.thorheim@arbeidstilsynet.no"},"repository":{"url":"git+https://github.com/Arbeidstilsynet/meldinger.git","type":"git","directory":"data/npm_publish"},"_npmVersion":"11.6.1","description":"TypeScript types for the Meldinger Data API from Arbeidstilsynet, generated from its OpenAPI specification.","directories":{},"_nodeVersion":"24.11.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/meldinger-data_0.0.1_1781189179645_0.9346085489772324","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@arbeidstilsynet/meldinger-data","version":"0.0.2","author":{"name":"Arbeidstilsynet"},"license":"MIT","_id":"@arbeidstilsynet/meldinger-data@0.0.2","maintainers":[{"name":"at_gagt","email":"grunde.thorheim@arbeidstilsynet.no"},{"name":"karoljd","email":"karol.jerzy.debik@arbeidstilsynet.no"},{"name":"atroberthtollefsen","email":"roberth.tollefsen@arbeidstilsynet.no"},{"name":"at-npm-admin","email":"npm-admin@arbeidstilsynet.no"}],"homepage":"https://github.com/Arbeidstilsynet/meldinger#readme","bugs":{"url":"https://github.com/Arbeidstilsynet/meldinger/issues"},"dist":{"shasum":"5d97314d68e1e801d8690e6459d108f9d148921b","tarball":"https://registry.npmjs.org/@arbeidstilsynet/meldinger-data/-/meldinger-data-0.0.2.tgz","fileCount":4,"integrity":"sha512-XgnFfZEHsgzvCJETCnhTOYAgiJ+4dBV49keXT47UqBUrG4pibFtClD0JvdXdQ8EEY6FVRxV0lUidzVMoB3sMkw==","signatures":[{"sig":"MEUCIQDydsbjAJfW424PgvIAG2EzIMqMD3/TbdWaBtN+gy0qugIgVZ2HnOwSL6IpI3vh5gNatZ/iF71APFKsY5nyBRtXkpY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14846},"types":"./types.d.ts","exports":{".":{"types":"./types.d.ts"}},"gitHead":"3ebaf5b1ad06bfe72d14ad71b705ca5e0bd0988b","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d09a047e-028b-480f-b9da-8a2ce7d520ef"}},"repository":{"url":"git+https://github.com/Arbeidstilsynet/meldinger.git","type":"git","directory":"data/npm_publish"},"_npmVersion":"11.13.0","description":"TypeScript types for the Meldinger Data API from Arbeidstilsynet, generated from its OpenAPI specification.","directories":{},"_nodeVersion":"24.16.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/meldinger-data_0.0.2_1781249504293_0.6065714916103009","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@arbeidstilsynet/meldinger-data","version":"0.0.3","author":{"name":"Arbeidstilsynet"},"license":"MIT","_id":"@arbeidstilsynet/meldinger-data@0.0.3","maintainers":[{"name":"at_gagt","email":"grunde.thorheim@arbeidstilsynet.no"},{"name":"karoljd","email":"karol.jerzy.debik@arbeidstilsynet.no"},{"name":"atroberthtollefsen","email":"roberth.tollefsen@arbeidstilsynet.no"},{"name":"at-npm-admin","email":"npm-admin@arbeidstilsynet.no"}],"homepage":"https://github.com/Arbeidstilsynet/meldinger#readme","bugs":{"url":"https://github.com/Arbeidstilsynet/meldinger/issues"},"dist":{"shasum":"af59e4aa6205209b412f86dbcff3f9a681b16912","tarball":"https://registry.npmjs.org/@arbeidstilsynet/meldinger-data/-/meldinger-data-0.0.3.tgz","fileCount":4,"integrity":"sha512-gQfKb8qrbvyE+G2lR+LbiMPKmVR6dNVkHiC1cqNExTBNQYWBB50epVA2goXBGNexaNqqWSnObQwk2Y70ehd2zA==","signatures":[{"sig":"MEQCIHU+cmWa2G/DcXtZfESvgn+yfGL67xKT8PdbB2RKqwV7AiBOIuylXL85I78dstVE/oLBOZIcW/U0q2iawjII4nbZ2w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14846},"types":"./types.d.ts","exports":{".":{"types":"./types.d.ts"}},"gitHead":"6b010ada47188db017f42a392dd56ee6cb83dd47","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d09a047e-028b-480f-b9da-8a2ce7d520ef"}},"repository":{"url":"git+https://github.com/Arbeidstilsynet/meldinger.git","type":"git","directory":"data/npm_publish"},"_npmVersion":"11.13.0","description":"TypeScript types for the Meldinger Data API from Arbeidstilsynet, generated from its OpenAPI specification.","directories":{},"_nodeVersion":"24.16.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/meldinger-data_0.0.3_1781249884237_0.8196460248728947","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@arbeidstilsynet/meldinger-data","version":"0.0.4","description":"TypeScript types for the Meldinger Data API from Arbeidstilsynet, generated from its OpenAPI specification.","license":"MIT","author":{"name":"Arbeidstilsynet"},"repository":{"type":"git","url":"git+https://github.com/Arbeidstilsynet/meldinger.git","directory":"data/npm_publish"},"types":"./types.d.ts","exports":{".":{"types":"./types.d.ts"}},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"gitHead":"c359eab5c4d628a16d3c753d68dc87de81a13731","_id":"@arbeidstilsynet/meldinger-data@0.0.4","bugs":{"url":"https://github.com/Arbeidstilsynet/meldinger/issues"},"homepage":"https://github.com/Arbeidstilsynet/meldinger#readme","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-2NpiTE8gDg4qUblmiG/o8UsLHOWl01zkv1Bv55itPOpfUvcrjF7Hrd0RQsGo5QP8vHGkkcaE1bi0q8cipbVnqg==","shasum":"7701ef1ee5bebe24d7b14868904afa8bcd652b3a","tarball":"https://registry.npmjs.org/@arbeidstilsynet/meldinger-data/-/meldinger-data-0.0.4.tgz","fileCount":4,"unpackedSize":14947,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH8ywYCf5ka/cWZrtQ4SYBdR+Jji7mqD/JWO/Lal//AMAiAyJ4w+ovZuWwTfJM7gV2mEk88UjggwH1n/a9PnVTNJAw=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d09a047e-028b-480f-b9da-8a2ce7d520ef"}},"directories":{},"maintainers":[{"name":"at-bgp","email":"bjornar.groholt.prytz@arbeidstilsynet.no"},{"name":"at_gagt","email":"grunde.thorheim@arbeidstilsynet.no"},{"name":"karoljd","email":"karol.jerzy.debik@arbeidstilsynet.no"},{"name":"at-npm-admin","email":"npm-admin@arbeidstilsynet.no"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/meldinger-data_0.0.4_1786461505306_0.5340045808976595"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-11T14:46:19.448Z","modified":"2026-08-11T15:18:25.693Z","0.0.1":"2026-06-11T14:46:19.765Z","0.0.2":"2026-06-12T07:31:44.413Z","0.0.3":"2026-06-12T07:38:04.372Z","0.0.4":"2026-08-11T15:18:25.443Z"},"bugs":{"url":"https://github.com/Arbeidstilsynet/meldinger/issues"},"author":{"name":"Arbeidstilsynet"},"license":"MIT","homepage":"https://github.com/Arbeidstilsynet/meldinger#readme","repository":{"type":"git","url":"git+https://github.com/Arbeidstilsynet/meldinger.git","directory":"data/npm_publish"},"description":"TypeScript types for the Meldinger Data API from Arbeidstilsynet, generated from its OpenAPI specification.","maintainers":[{"name":"at-bgp","email":"bjornar.groholt.prytz@arbeidstilsynet.no"},{"name":"at_gagt","email":"grunde.thorheim@arbeidstilsynet.no"},{"name":"karoljd","email":"karol.jerzy.debik@arbeidstilsynet.no"},{"name":"at-npm-admin","email":"npm-admin@arbeidstilsynet.no"}],"readme":"# @arbeidstilsynet/meldinger-data\n\nTypeScript types for the Arbeidstilsynet **data** API, generated from its OpenAPI\nspecification. This package ships **types only** — there is no runtime code — so it\nadds nothing to your bundle.\n\nUse it together with [`openapi-fetch`](https://openapi-ts.dev/openapi-fetch/) to get a\nfully type-safe HTTP client: request paths, query parameters, request bodies and\nresponses are all checked against the live API contract.\n\n## Installation\n\n```sh\nnpm install @arbeidstilsynet/meldinger-data openapi-fetch\n# or\npnpm add @arbeidstilsynet/meldinger-data openapi-fetch\n```\n\n> The package version is bumped whenever the API contract (`openApi.json`) changes,\n> so a new version means the types may have changed.\n\n## What's exported\n\nThe generated module exposes the standard `openapi-typescript` shapes:\n\n- `paths` — every endpoint, keyed by URL, with its methods, params and responses.\n- `components` — reusable schemas (DTOs), under `components[\"schemas\"]`.\n- `operations` — operations keyed by `operationId`.\n\n## Creating a client\n\n```ts\nimport createClient from \"openapi-fetch\";\nimport type { paths } from \"@arbeidstilsynet/meldinger-data\";\n\nexport const client = createClient<paths>({\n  baseUrl: \"/api/data\",\n});\n```\n\n## Pulling out schema types\n\nAlias the schemas you use so they read nicely in your code:\n\n```ts\nimport type { components } from \"@arbeidstilsynet/meldinger-data\";\n\nexport type Melding = components[\"schemas\"][\"Melding\"];\nexport type FilterRequest = components[\"schemas\"][\"FilterRequest\"];\nexport type PaginationResponseOfMelding =\n  components[\"schemas\"][\"PaginationResponseOfMelding\"];\n```\n\n## Usage examples\n\nThese mirror how the types are consumed inside the Arbeidstilsynet frontends.\n\n### A first request\n\nA minimal `meldinger` search — fetch the first page from a given date:\n\n```ts\nconst { data, error } = await client.POST(\"/data/meldinger/search\", {\n  params: {\n    query: {\n      from: new Date(\"2024-01-01\").toISOString(),\n      page: 1,\n      pageSize: 20,\n    },\n  },\n  body: {\n    domain: \"forhandsmelding\",\n  },\n});\n\nif (error) throw new Error(JSON.stringify(error));\nconsole.log(data?.data);\n```\n\n### A typed, reusable search function\n\nThe search endpoint is the main entry point. Its `FilterRequest` body drives all\nfiltering — by domain, address, time range, free-text search, and more:\n\n```ts\nimport type { components } from \"@arbeidstilsynet/meldinger-data\";\n\ntype FilterRequest = components[\"schemas\"][\"FilterRequest\"];\ntype PaginationResponseOfMelding =\n  components[\"schemas\"][\"PaginationResponseOfMelding\"];\n\nexport async function searchMeldinger(\n  from: Date,\n  page: number,\n  pageSize: number,\n  body: FilterRequest,\n  to?: Date,\n): Promise<PaginationResponseOfMelding> {\n  const { data, error } = await client.POST(\"/data/meldinger/search\", {\n    params: {\n      query: {\n        from: from.toISOString(),\n        ...(to && { to: to.toISOString() }),\n        page,\n        pageSize,\n      },\n    },\n    body,\n  });\n\n  if (error) {\n    throw new Error(`Failed to search meldinger: ${JSON.stringify(error)}`);\n  }\n  if (!data) {\n    throw new Error(\"Failed to search meldinger: empty response\");\n  }\n  return data;\n}\n```\n\nBecause `FilterRequest` is a generated type, your editor autocompletes every available\nfilter and flags invalid combinations at compile time. Changing the API contract (and\nupdating this package) surfaces breaking changes the same way.\n\n## License\n\nInternal Arbeidstilsynet package. See the repository for details.\n","readmeFilename":"README.md"}