{"_id":"@axonsdev/hateoas-siren","name":"@axonsdev/hateoas-siren","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@axonsdev/hateoas-siren","version":"0.1.0","license":"MPL-2.0","author":{"email":"nprin@axons.fr"},"type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"sideEffects":false,"publishConfig":{"access":"public"},"dependencies":{"@axonsdev/hateoas-core":"^0.1.0"},"scripts":{"build":"tsc -b tsconfig.json"},"_id":"@axonsdev/hateoas-siren@0.1.0","description":"Siren media type support for `@axonsdev/hateoas-core`.","_integrity":"sha512-jlAnIyxChUjWpy+Ncfi1eMSrmCigMXw4TY6sKeAuan3vKQSS+lbjvx5vx0NldvykkpbLPz35N1pXDNqDH13/hA==","_resolved":"/tmp/96a8b5f24a4a307e02418db72b574ce1/axonsdev-hateoas-siren-0.1.0.tgz","_from":"file:axonsdev-hateoas-siren-0.1.0.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-jlAnIyxChUjWpy+Ncfi1eMSrmCigMXw4TY6sKeAuan3vKQSS+lbjvx5vx0NldvykkpbLPz35N1pXDNqDH13/hA==","shasum":"e734fe40281504191d3a5d365171f04e614c89a5","tarball":"https://registry.npmjs.org/@axonsdev/hateoas-siren/-/hateoas-siren-0.1.0.tgz","fileCount":9,"unpackedSize":22518,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCe3xT8n0lEh7HCZk6XGvbm1srKr2VXNd+mRbEbxyXHuQIgITJksZtL4WI4k/DdrZZ6ax/jdaK7I/aaIqixsogiMqA="}]},"_npmUser":{"name":"axonsdev","email":"nprin@axons.fr"},"directories":{},"maintainers":[{"name":"axonsdev","email":"nprin@axons.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hateoas-siren_0.1.0_1777393223953_0.12033852211336282"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-28T16:20:23.888Z","0.1.0":"2026-04-28T16:20:24.084Z","modified":"2026-04-28T16:20:24.832Z"},"maintainers":[{"name":"axonsdev","email":"nprin@axons.fr"}],"description":"Siren media type support for `@axonsdev/hateoas-core`.","author":{"email":"nprin@axons.fr"},"license":"MPL-2.0","readme":"# @axonsdev/hateoas-siren\n\nSiren media type support for `@axonsdev/hateoas-core`.\n\nThis package defines Siren TypeScript types and a parser that converts Siren entities into the core normalized hypermedia model.\n\n## Responsibilities\n\n- Define Siren entity, link, action, field, and embedded entity types.\n- Parse Siren responses into `HypermediaResourceModel`.\n- Preserve the original Siren response in `raw`.\n- Expose the Siren media type constant.\n\n## Main Exports\n\n```ts\nSIREN_MEDIA_TYPE\nSirenParser\nsirenParser()\nSirenEntity\nSirenEmbeddedEntity\nSirenAction\nSirenField\nSirenLink\n```\n\n## Media Type\n\n```txt\napplication/vnd.siren+json\n```\n\nThe parser supports content types that include this media type.\n\n## Basic Usage\n\n```ts\nimport { createHateoasClient } from '@axonsdev/hateoas-core';\nimport { fetchTransport } from '@axonsdev/hateoas-fetch';\nimport { sirenParser } from '@axonsdev/hateoas-siren';\n\nconst client = createHateoasClient({\n  transport: fetchTransport({ baseUrl: 'http://localhost:3000' }),\n  parsers: [sirenParser()],\n});\n```\n\n## Mapping\n\nSiren maps into the core model like this:\n\n```txt\nSiren class      -> resource.classes\nSiren properties -> resource.properties\nSiren links      -> resource.links\nSiren actions    -> resource.actions\nSiren entities   -> resource.entities\nOriginal body    -> resource.raw\n```\n\nAction fields are mapped into `HypermediaField`:\n\n```txt\nname\ntype\ntitle\nvalue\nrequired\noptions\n```\n\nThe `value` field is useful for generic edit forms, where the API can provide the current value directly in the action descriptor.\n\n## Embedded Entities\n\nSiren embedded entities become `HypermediaEmbeddedEntity` values.\n\nEmbedded entities are normalized recursively, including their own:\n\n```txt\nrel\nclasses\nproperties\nlinks\nactions\nentities\nraw\n```\n\n## Extending\n\nIf the API uses a different hypermedia format, implement `HypermediaParser` in a different package and register that parser with the core client.\n\nThis package should remain focused only on Siren.\n","readmeFilename":"README.md","_rev":"1-993479a7e2494d4a7962bc8b17a64e54"}