{"_id":"@anephenix/fastify-resource","_rev":"16-08e7462bbd7ab278cf8bb96e39e26aff","name":"@anephenix/fastify-resource","dist-tags":{"latest":"0.0.15"},"versions":{"0.0.1":{"name":"@anephenix/fastify-resource","version":"0.0.1","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.1","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"dist":{"shasum":"68d0696f5b2a65f89edd58b63700eadf3e60a6b6","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.1.tgz","fileCount":18,"integrity":"sha512-OUfelDuy6Ago0baVb9X6Ypd/gpV4PuszyBr7gf6lf/DARICflWHeSFRUabuglJi1TyhvwOa8Y1jJ0VOyNm71aQ==","signatures":[{"sig":"MEUCIQDgaQ0hoM3glILiQv7uN4mI/RutkEI2G4kLRtuJOCHLpAIgWbmhzSMaM6VBZQYK6CqxTAC/jro8ZOX5Gt0GZK/RiCo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76358,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLcNsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpX0xAAlSXyU4IMf1GOlwooFhNgaTHKxA9UBPLuSNU6KuRgtQu5qAl1\r\ngCJkepCQ4dpNSR1goiaT40ZNEt/t3hIxPcd5FSnxPUK4u8YoRGYQoSeF+leZ\r\np5TtdQ4c1wShlNh4BzBL+mxMAMxaPP9i3ocfZkwpjtyrRx0+Y0Ihq0CH1tK0\r\nHlWj0u1lzfOAY9lT20jBGG6n9VOPnLmDrbEg+3apgpoqKh5DYzZ+KTtN+mjw\r\nQi4JkE8nzhwRd04XMzeACWC0KoZxExx/R+X1YaqTjB1DRR/CoskA4GOf/cNL\r\nZw7BpShpbCkQIdJRgbbiPZwK6ZXx5DTpN8tn1FTuhpa+SMi6+C0duhZZjqbr\r\nIl5bfAbvsFJ/ZEkNnJzeApFdpOlbaevGSDw/mg6DSevyKVLVCo7Lj2tYy3AC\r\nQThoTUy723KDsu1XKPdPRBAYKmOj6blVthVdbrg/zS489qwFef9Tkua2bny5\r\nKFfkuAcITPAO+O8U3qKVzEim7uExZ+DoG8uYjlMinN0GIMXoOf1vGkW584GC\r\nNlfcyQGBy9/g5Ib7nHTryYcv0DpGlk4pVjxqoDIEObkImcjO+bV/3Ln6sRBM\r\n9IzJqcwxN/1hPWzHU8BABpyij2BxKi30XzRwDTxigp8nsO7EJBJgzHc8Tbt3\r\ndZL+I3O/W2CiR8kSY5EK9U4jXFpTHQ79bfI=\r\n=k3JD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","module":"dist/fastify-resource.esm.js","engines":{"node":">=12"},"gitHead":"4b6cbfcc1c81c3270186380a5c980a1f8c0f5ef8","scripts":{"lint":"tsdx lint --fix","size":"size-limit","test":"tsdx test --collectCoverage","build":"tsdx build --target node","start":"tsdx watch --target node","analyze":"size-limit --why","prepare":"tsdx build --target node"},"typings":"dist/index.d.ts","_npmUser":{"name":"paulbjensen","email":"paulbjensen@gmail.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/fastify-resource.cjs.production.min.js","limit":"10 KB"},{"path":"dist/fastify-resource.esm.js","limit":"10 KB"}],"_npmVersion":"7.10.0","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"16.0.0","dependencies":{"pluralize":"^8.0.0","lodash.snakecase":"^4.1.1"},"_hasShrinkwrap":false,"devDependencies":{"tsdx":"^0.14.1","husky":"^7.0.4","size-limit":"^7.0.8","@types/jest":"^25.2.3","npm-upgrade":"^3.1.0","@size-limit/preset-small-lib":"^7.0.8"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.1_1647166316741_0.5271479812226432","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@anephenix/fastify-resource","version":"0.0.2","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.2","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"dist":{"shasum":"d2d0fa7ee601768995ec1a35cc43def734535fda","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.2.tgz","fileCount":7,"integrity":"sha512-Svie+Btey0b2E0myGCcohLjUOzDhZd/DbjxejgtAdBkoLamsLYKD8mxdE2ljtCXak11zyETJwxc/iiqbKnRZnw==","signatures":[{"sig":"MEUCIGaPaGOoYdCwD0SKtY9XjbFS8rGVS84eeKviHRg8WRx2AiEAh/3FoBQeGYpzjicTGvLIGV4Og960cmHy0ax5OCuMax8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26476},"main":"dist/index.js","module":"dist/fastify-resource.esm.js","engines":{"node":">=12"},"gitHead":"9686e98bde8028e73e6808ee91f813651fe793ec","scripts":{"lint":"eslint src test","size":"size-limit","test":"cross-env NODE_ENV=test npx mocha --require ts-node/register --extensions ts,tsx test/src/* --test","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx nyc --reporter=lcov npm t","start":"tsdx watch --target node","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prettier":"prettier src test --write","check-prettier":"prettier src test --check","update-changelog":"npx ts-node scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"typings":"dist/index.d.ts","_npmUser":{"name":"paulbjensen","email":"paulbjensen@gmail.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/index.js","limit":"10 KB"}],"_npmVersion":"10.9.0","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"22.12.0","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^17.1.0","husky":"^9.1.6","mocha":"^11.0.1","eslint":"^9.14.0","globals":"^15.12.0","ts-node":"^10.9.2","prettier":"3.4.2","cross-env":"^7.0.3","@eslint/js":"^9.14.0","size-limit":"^11.1.5","typescript":"^5.7.2","@types/mocha":"^10.0.9","@types/pluralize":"^0.0.33","typescript-eslint":"^8.13.0","@size-limit/esbuild":"^11.1.6","mocha-lcov-reporter":"^1.3.0","@size-limit/esbuild-why":"^11.1.6","@size-limit/preset-small-lib":"^11.1.5"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.2_1737063811761_0.37815027529748235","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@anephenix/fastify-resource","version":"0.0.3","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.3","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"dist":{"shasum":"18a6148e26df58256c4e324bae5a953f96997c87","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.3.tgz","fileCount":7,"integrity":"sha512-9/a9mqkg8uBxeZ8N4j6/kyPixKS9lix1ZormJkHxJL9xbqjqp5+0D3IRcaFWnq3wBKmQcRGAud4AFzeI/lD4Dg==","signatures":[{"sig":"MEUCICnJIVUq2bS2y1qyNBLW8VCndL7ckbzUH9yZjz9hL3llAiEA3w9iMOBJ5Rdv575uzW9Oyxl5sH84TQ0oyGEuir0sIEw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26620},"main":"dist/index.js","module":"dist/fastify-resource.esm.js","engines":{"node":">=12"},"gitHead":"f4fc8dc81953737dc24fef96fd8f8e11dca9ea80","scripts":{"lint":"eslint src test","size":"size-limit","test":"cross-env NODE_ENV=test npx mocha --require ts-node/register --extensions ts,tsx test/src/* --test","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx nyc --reporter=lcov npm t","start":"tsdx watch --target node","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prettier":"prettier src test --write","check-prettier":"prettier src test --check","update-changelog":"npx ts-node scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"typings":"dist/index.d.ts","_npmUser":{"name":"paulbjensen","email":"paulbjensen@gmail.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/*.js","limit":"10 KB"}],"_npmVersion":"10.9.2","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"22.13.1","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^17.1.0","husky":"^9.1.6","mocha":"^11.0.1","eslint":"^9.14.0","globals":"^15.12.0","ts-node":"^10.9.2","prettier":"3.5.0","cross-env":"^7.0.3","@eslint/js":"^9.14.0","size-limit":"^11.1.5","typescript":"^5.7.2","@types/mocha":"^10.0.9","@types/pluralize":"^0.0.33","typescript-eslint":"^8.13.0","@size-limit/esbuild":"^11.1.6","mocha-lcov-reporter":"^1.3.0","@size-limit/esbuild-why":"^11.1.6","@size-limit/preset-small-lib":"^11.1.5"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.3_1739619918637_0.46223978379114694","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@anephenix/fastify-resource","version":"0.0.4","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.4","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"dist":{"shasum":"fb6e44b7afd5922f32e672dc0bf32bbcb2bf098b","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.4.tgz","fileCount":7,"integrity":"sha512-pKGzZMxIcREH1QsmOHkwoSH2U7iu0NBvFJCBrIyswyPJRSxHjV+WWhMxM1upA3Gur87x+bBQQD2vXRk0XnorTA==","signatures":[{"sig":"MEYCIQDSuTnm5kFqzBW8BIQZREYwPDUTJUMukOw3gbsIy1G6lgIhAM2k03HlI39d0a3ST+x5zSgeGnQFiyaNQYNkfzS35DdY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26619},"main":"dist/index.js","module":"dist/fastify-resource.esm.js","engines":{"node":">=12"},"gitHead":"d4d18cba116584470076791cef32bd0015c475e4","scripts":{"lint":"eslint src test","size":"size-limit","test":"cross-env NODE_ENV=test npx mocha --require ts-node/register --extensions ts,tsx test/src/* --test","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx nyc --reporter=lcov npm t","start":"tsdx watch --target node","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prettier":"prettier src test --write","check-prettier":"prettier src test --check","update-changelog":"npx ts-node scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"typings":"dist/index.d.ts","_npmUser":{"name":"paulbjensen","email":"paulbjensen@gmail.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/*.js","limit":"10 KB"}],"_npmVersion":"10.9.2","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"22.14.0","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^17.1.0","husky":"^9.1.6","mocha":"^11.0.1","eslint":"^9.14.0","globals":"^16.0.0","ts-node":"^10.9.2","prettier":"3.5.3","cross-env":"^7.0.3","@eslint/js":"^9.14.0","size-limit":"^11.1.5","typescript":"^5.7.2","@types/mocha":"^10.0.9","@types/pluralize":"^0.0.33","typescript-eslint":"^8.13.0","@size-limit/esbuild":"^11.1.6","mocha-lcov-reporter":"^1.3.0","@size-limit/esbuild-why":"^11.1.6","@size-limit/preset-small-lib":"^11.1.5"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.4_1741642236262_0.6698678159611571","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@anephenix/fastify-resource","version":"0.0.5","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.5","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"dist":{"shasum":"3149addaa52289482b032522b3fda82d22866232","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.5.tgz","fileCount":7,"integrity":"sha512-dZcnfatyhNz/g6b7F+z4tubFlNMjnC7kfaKaW49gtPUsdktf6fTWKTHsG8PGWZOq2z82YeUFTQDYQXxiUPOV6A==","signatures":[{"sig":"MEUCIQDGUL5zNcs/5WfOYa4zlr9Z43JFHOjkVEMvoJlQdwaJGQIgfth10ufcLKZL6akO+BA6ZRmtSVfoU3tU3j77bjq7fR4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26619},"main":"dist/index.js","module":"dist/fastify-resource.esm.js","engines":{"node":">=12"},"gitHead":"0ce5cb744b5e7347d7a02a2ccac82cffd4f26184","scripts":{"lint":"eslint src test","size":"size-limit","test":"cross-env NODE_ENV=test npx mocha --require ts-node/register --extensions ts,tsx test/src/* --test","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx nyc --reporter=lcov npm t","start":"tsdx watch --target node","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prettier":"prettier src test --write","check-prettier":"prettier src test --check","update-changelog":"npx ts-node scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"typings":"dist/index.d.ts","_npmUser":{"name":"paulbjensen","email":"paulbjensen@gmail.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/*.js","limit":"10 KB"}],"_npmVersion":"10.9.2","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"22.14.0","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^17.1.0","husky":"^9.1.6","mocha":"^11.0.1","eslint":"^9.14.0","globals":"^16.0.0","ts-node":"^10.9.2","prettier":"3.5.3","cross-env":"^7.0.3","@eslint/js":"^9.14.0","size-limit":"^11.1.5","typescript":"^5.7.2","@types/mocha":"^10.0.9","@types/pluralize":"^0.0.33","typescript-eslint":"^8.13.0","@size-limit/esbuild":"^11.1.6","mocha-lcov-reporter":"^1.3.0","@size-limit/esbuild-why":"^11.1.6","@size-limit/preset-small-lib":"^11.1.5"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.5_1744116486273_0.7751042413311902","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@anephenix/fastify-resource","version":"0.0.6","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.6","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"dist":{"shasum":"f2f052a0532c34605c587b6523895026f85393ba","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.6.tgz","fileCount":11,"integrity":"sha512-9E5Zj2TQrhxvRwutOQeI8UoOoA6MO9eJMM0JcgTXA53NTzQsDGv3chgWnEGZGRHe5JhY8rabTNDnuMDYKNB9Hg==","signatures":[{"sig":"MEUCIQD1jucnK7NJx3jqNe45YVCPKhbYbzJhMCVVsY47/Xo4CQIgNdbBo/hd09eCFCWFxQfyEMY6zyd4HuBU2QaMqefO960=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50332},"main":"dist/index.js","module":"dist/fastify-resource.esm.js","engines":{"node":">=12"},"gitHead":"61d383b8a7ecfdcc9ef43f7928b7a5cb75440635","scripts":{"lint":"eslint src test","size":"size-limit","test":"cross-env NODE_ENV=test npx mocha --require ts-node/register --extensions ts,tsx test/src/* --test","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx nyc --reporter=lcov npm t","start":"tsdx watch --target node","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prettier":"prettier src test --write","test:e2e":"cross-env NODE_ENV=test npx mocha --require ts-node/register --extensions ts,tsx test/e2e/integration.test.ts --test","check-prettier":"prettier src test --check","update-changelog":"npx ts-node scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"typings":"dist/index.d.ts","_npmUser":{"name":"paulbjensen","email":"paulbjensen@gmail.com"},"prettier":{"semi":true,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/*.js","limit":"11 KB"}],"_npmVersion":"10.9.2","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"22.15.0","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0","fastify-plugin":"^5.0.1"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^17.1.0","knex":"^3.1.0","husky":"^9.1.6","mocha":"^11.0.1","eslint":"^9.14.0","globals":"^16.0.0","sqlite3":"^5.1.7","ts-node":"^10.9.2","prettier":"3.5.3","cross-env":"^7.0.3","objection":"^3.1.5","@eslint/js":"^9.14.0","size-limit":"^11.1.5","typescript":"^5.7.2","@types/mocha":"^10.0.9","@types/pluralize":"^0.0.33","typescript-eslint":"^8.13.0","@size-limit/esbuild":"^11.1.6","mocha-lcov-reporter":"^1.3.0","@size-limit/esbuild-why":"^11.1.6","@size-limit/preset-small-lib":"^11.1.5"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.6_1748019556999_0.45586477343345444","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@anephenix/fastify-resource","version":"0.0.7","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.7","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"dist":{"shasum":"823f3b9a7593f32849d153889bd80ad62c28c58e","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.7.tgz","fileCount":13,"integrity":"sha512-nbMIX3jcfuolq1Bn/PUyl+42Y50WBpiBYC/y8UBdZr23gMEN0/mgP1qGwmrtASejoL/Ui6glahqCD6ZEFgkZXg==","signatures":[{"sig":"MEUCIQDo2hE4op+AVSL1JW29WaXsCnN3NHaQqSde1MNDZqxF/gIgAvKbe/10amyUCfbrfImHyeoQI06q+Q8KFjWXqfsPlwQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":41381},"main":"dist/index.js","type":"module","module":"dist/fastify-resource.esm.js","engines":{"node":">=12"},"gitHead":"51ccb95c6df9d95f3943c2a1bf61472a72127045","scripts":{"lint":"npx @biomejs/biome check --write src test scripts","size":"size-limit","test":"cross-env NODE_ENV=test npx vitest test --run","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx vitest test --run --coverage","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","update-changelog":"node --experimental-strip-types scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"typings":"dist/index.d.ts","_npmUser":{"name":"paulbjensen","email":"paulbjensen@gmail.com"},"size-limit":[{"path":"dist/*.js","limit":"11 KB"}],"_npmVersion":"10.9.2","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"22.17.0","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0","fastify-plugin":"^5.0.1"},"_hasShrinkwrap":false,"devDependencies":{"knex":"^3.1.0","husky":"^9.1.6","vitest":"^3.2.4","globals":"^16.0.0","sqlite3":"^5.1.7","cross-env":"^7.0.3","objection":"^3.1.5","size-limit":"^11.1.5","typescript":"^5.7.2","@biomejs/biome":"2.1.1","@types/pluralize":"^0.0.33","@size-limit/esbuild":"^11.1.6","@vitest/coverage-v8":"^3.2.4","@size-limit/esbuild-why":"^11.1.6","@size-limit/preset-small-lib":"^11.1.5"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.7_1752783301632_0.6777206174325634","host":"s3://npm-registry-packages-npm-production"}},"0.0.8":{"name":"@anephenix/fastify-resource","version":"0.0.8","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.8","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"dist":{"shasum":"f5f925c641fc58308da98160eb86e70695f5190e","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.8.tgz","fileCount":14,"integrity":"sha512-DKHBvcfOsU4QuffuYL4Msn4JCG9l8tT7BA4hx0oDUrtMDOMmYpO62a3ptEgo24UYj27ggyX1b7cW/Cu6kK8X7A==","signatures":[{"sig":"MEQCIBxHnmPDIF7FlS/M2Tj3JiJO2qC5QNaC1KEt5OyZoj+3AiBjVDdBHVt3jB4qp7trC737bZf050Ou0xgf8NQHdhngiw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29164},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=12"},"exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"6ef18ebd36f804458cd9a6d6c3d1e07089e61326","scripts":{"lint":"npx @biomejs/biome check --write src test scripts","size":"size-limit","test":"cross-env NODE_ENV=test npx vitest test --run","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx vitest test --run --coverage","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prepare":"husky","lint:package":"npx publint","update-changelog":"node --experimental-strip-types scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"_npmUser":{"name":"paulbjensen","email":"paulbjensen@gmail.com"},"size-limit":[{"path":"dist/*.js","limit":"11 KB"}],"_npmVersion":"10.9.3","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"22.20.0","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0","fastify-plugin":"^5.0.1"},"_hasShrinkwrap":false,"devDependencies":{"knex":"^3.1.0","husky":"^9.1.6","vitest":"^3.2.4","globals":"^16.0.0","publint":"^0.3.14","sqlite3":"^5.1.7","cross-env":"^10.0.0","objection":"^3.1.5","size-limit":"^11.1.5","typescript":"^5.7.2","@types/node":"^24.7.0","@biomejs/biome":"2.2.5","@types/pluralize":"^0.0.33","@size-limit/esbuild":"^11.1.6","@vitest/coverage-v8":"^3.2.4","@size-limit/esbuild-why":"^11.1.6","@size-limit/preset-small-lib":"^11.1.5"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.8_1759952281805_0.04815062321296404","host":"s3://npm-registry-packages-npm-production"}},"0.0.9":{"name":"@anephenix/fastify-resource","version":"0.0.9","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.9","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"dist":{"shasum":"bd5f4c1a306525656236ed4fe416a9e598a23bdc","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.9.tgz","fileCount":14,"integrity":"sha512-4fE2jiYzL0Uqt9aOj2GaHOaa2Wuzkk7SiskUL/mJt6C+2bIgYintayN5fvRhVEQIxRDjjdjVoKitbPkVsPB6AQ==","signatures":[{"sig":"MEUCIQCBdShrg+LjhJwCD9V3Fl/+OEs+3T0P24eesQJuqwRkcQIgdCh5wfh0BCxAL6UbOUpcia4ZKxwD2HeEQc5yAQ1+SUU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30295},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=12"},"exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"d677781c76a6d9dd331a8cb020f36187ca611e00","scripts":{"lint":"npx @biomejs/biome check --write src test scripts","size":"size-limit","test":"cross-env NODE_ENV=test npx vitest test --run","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx vitest test --run --coverage","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prepare":"husky","lint:package":"npx publint","update-changelog":"node --experimental-strip-types scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"_npmUser":{"name":"paulbjensen","email":"paulbjensen@gmail.com"},"size-limit":[{"path":"dist/*.js","limit":"11 KB"}],"_npmVersion":"10.9.3","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"22.20.0","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0","fastify-plugin":"^5.0.1"},"_hasShrinkwrap":false,"devDependencies":{"knex":"^3.1.0","husky":"^9.1.6","vitest":"^3.2.4","globals":"^16.0.0","publint":"^0.3.14","sqlite3":"^5.1.7","cross-env":"^10.0.0","objection":"^3.1.5","size-limit":"^11.1.5","typescript":"^5.7.2","@types/node":"^24.7.0","@biomejs/biome":"2.2.5","@types/pluralize":"^0.0.33","@size-limit/esbuild":"^11.1.6","@vitest/coverage-v8":"^3.2.4","@size-limit/esbuild-why":"^11.1.6","@size-limit/preset-small-lib":"^11.1.5"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.9_1760517573121_0.16573870637257393","host":"s3://npm-registry-packages-npm-production"}},"0.0.10":{"name":"@anephenix/fastify-resource","version":"0.0.10","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.10","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"dist":{"shasum":"a9c4cd5d5de9ea63ecee840515768f82569bbeba","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.10.tgz","fileCount":14,"integrity":"sha512-SMaQdTYUVIGkzPTJJAc16zsBvMj6G45Go+CZMt6ITtt3ORgpjxPl/dmOre2uUMshJTCSYopkN3uiINS1ItiyyA==","signatures":[{"sig":"MEYCIQDWrEFthnZH/NU5UpeRwmP3vjE+OzNC8GA85XTsu3tk1wIhALoEH1mhB+Br8N8R0ydQBMiOP2ODIOqgRUPLXM+UAkVn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30296},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=12"},"exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"87af23bda60a553d4824ab6f0f4bc073d8f6b702","scripts":{"lint":"npx @biomejs/biome check --write src test scripts","size":"size-limit","test":"cross-env NODE_ENV=test npx vitest test --run","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx vitest test --run --coverage","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prepare":"husky","lint:package":"npx publint","update-changelog":"node --experimental-strip-types scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"_npmUser":{"name":"paulbjensen","email":"paulbjensen@gmail.com"},"size-limit":[{"path":"dist/*.js","limit":"11 KB"}],"_npmVersion":"10.9.4","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"22.21.1","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0","fastify-plugin":"^5.0.1"},"_hasShrinkwrap":false,"devDependencies":{"knex":"^3.1.0","husky":"^9.1.6","vitest":"^4.0.4","globals":"^16.0.0","publint":"^0.3.14","sqlite3":"^5.1.7","cross-env":"^10.0.0","objection":"^3.1.5","size-limit":"^12.0.0","typescript":"^5.7.2","@types/node":"^24.7.0","@biomejs/biome":"2.3.7","@types/pluralize":"^0.0.33","@size-limit/esbuild":"^12.0.0","@vitest/coverage-v8":"^4.0.4","@size-limit/esbuild-why":"^12.0.0","@size-limit/preset-small-lib":"^12.0.0"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.10_1764781337310_0.7968382258578812","host":"s3://npm-registry-packages-npm-production"}},"0.0.11":{"name":"@anephenix/fastify-resource","version":"0.0.11","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.11","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"homepage":"https://github.com/anephenix/fastify-resource","bugs":{"url":"https://github.com/anephenix/fastify-resource/issues"},"dist":{"shasum":"4144223177171e6546949a7fa6b78e1d0e6a076a","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.11.tgz","fileCount":14,"integrity":"sha512-9NaHZlwV0QtJXkgNnbCVKTP2dv18x80uRC+nFHf7Glo3rnx9WRsUCQFVgFbHUIbV2Q0PvFzgqCZ2Pg5RZl2R+w==","signatures":[{"sig":"MEUCIQCNPj7qKAywbptUYAjbYJqfpeVR2qAv91AC5we/vGta7gIgC4yi+3u0DoT7isJ/6dHFl0hhrt/vBW+dvYsItr1rErg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@anephenix%2ffastify-resource@0.0.11","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":30552},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=12"},"exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"4af7cc28a4949cfcf1f211479f6dcbe13637eea8","scripts":{"lint":"npx @biomejs/biome check --write src test scripts","size":"size-limit","test":"cross-env NODE_ENV=test npx vitest test --run","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx vitest test --run --coverage","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prepare":"husky","lint:package":"npx publint","update-changelog":"node --experimental-strip-types scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a479e019-f6f8-40f5-b2d4-9054194b5a15"}},"repository":{"url":"git+https://github.com/anephenix/fastify-resource.git","type":"git"},"size-limit":[{"path":"dist/*.js","limit":"11 KB"}],"_npmVersion":"11.6.2","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"24.12.0","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0","fastify-plugin":"^5.0.1"},"_hasShrinkwrap":false,"devDependencies":{"knex":"^3.1.0","husky":"^9.1.6","vitest":"^4.0.4","globals":"^16.0.0","publint":"^0.3.14","sqlite3":"^5.1.7","cross-env":"^10.0.0","objection":"^3.1.5","size-limit":"^12.0.0","typescript":"^5.7.2","@types/node":"^25.0.2","@biomejs/biome":"2.3.10","@types/pluralize":"^0.0.33","@size-limit/esbuild":"^12.0.0","@vitest/coverage-v8":"^4.0.4","@size-limit/esbuild-why":"^12.0.0","@size-limit/preset-small-lib":"^12.0.0"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.11_1767556718657_0.8987471795715063","host":"s3://npm-registry-packages-npm-production"}},"0.0.12":{"name":"@anephenix/fastify-resource","version":"0.0.12","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.12","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"homepage":"https://github.com/anephenix/fastify-resource","bugs":{"url":"https://github.com/anephenix/fastify-resource/issues"},"dist":{"shasum":"d0d71095c045096f0d6bab1b73d235f460bca80f","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.12.tgz","fileCount":14,"integrity":"sha512-mxhDE5RO5u34hmmMBpv4vHOCfUDFJLiHxB8aEYjYUxV52t9Gu9jKb8sLDyw3Y27xmeRqtx2KTEjYhs/oF8X+XA==","signatures":[{"sig":"MEQCIA+bTGRt1zf+Z2Zwdu+XyTzSmxlq+HpYmJgAowx/LaxrAiAsV9SkfQBJLhyXIqlObuEOXK3RGHGMmsm1f56jggotcw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@anephenix%2ffastify-resource@0.0.12","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":30552},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=12"},"exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"25360924612f54ae4294f5b1ca6081277541eb18","scripts":{"lint":"npx @biomejs/biome check --write src test scripts","size":"size-limit","test":"cross-env NODE_ENV=test npx vitest test --run","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx vitest test --run --coverage","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prepare":"husky","lint:package":"npx publint","update-changelog":"node --experimental-strip-types scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a479e019-f6f8-40f5-b2d4-9054194b5a15"}},"repository":{"url":"git+https://github.com/anephenix/fastify-resource.git","type":"git"},"size-limit":[{"path":"dist/*.js","limit":"11 KB"}],"_npmVersion":"11.11.0","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"24.14.1","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0","fastify-plugin":"^5.0.1"},"_hasShrinkwrap":false,"devDependencies":{"knex":"^3.1.0","husky":"^9.1.6","vitest":"^4.0.4","globals":"^17.0.0","publint":"^0.3.14","sqlite3":"^6.0.1","cross-env":"^10.0.0","objection":"^3.1.5","size-limit":"^12.0.0","typescript":"^6.0.2","@types/node":"^25.0.2","@biomejs/biome":"2.4.10","@types/pluralize":"^0.0.33","@size-limit/esbuild":"^12.0.0","@vitest/coverage-v8":"^4.0.4","@size-limit/esbuild-why":"^12.0.0","@size-limit/preset-small-lib":"^12.0.0"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.12_1775596558996_0.9279217960081887","host":"s3://npm-registry-packages-npm-production"}},"0.0.13":{"name":"@anephenix/fastify-resource","version":"0.0.13","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.13","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"homepage":"https://github.com/anephenix/fastify-resource","bugs":{"url":"https://github.com/anephenix/fastify-resource/issues"},"dist":{"shasum":"19049380384d5687c756c1dde110d779470af9f5","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.13.tgz","fileCount":14,"integrity":"sha512-fUI9JO0hIQevZCBEEn9mzNeQhyA8HrspAbtzAWRG9HHtvjYNJGGLEFExGBoUJiL3O4Ym84zFDDjJ7/Jxf/f9yQ==","signatures":[{"sig":"MEUCIQD2tMvUYWlTdVX4pv08RWo8VM0q2b/tG1jFI3dgOzxwsgIgCW55p59dzwi4bJRef3CwekBAEZpxFCim0hTbYoGG9FQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@anephenix%2ffastify-resource@0.0.13","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":35000},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=12"},"exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"b2fffea056ef3a28fe2f8efebfba74e8410f0ab9","scripts":{"lint":"npx @biomejs/biome check --write src test scripts","size":"size-limit","test":"cross-env NODE_ENV=test npx vitest test --run","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx vitest test --run --coverage","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prepare":"husky","lint:package":"npx publint","update-changelog":"node --experimental-strip-types scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a479e019-f6f8-40f5-b2d4-9054194b5a15"}},"repository":{"url":"git+https://github.com/anephenix/fastify-resource.git","type":"git"},"size-limit":[{"path":"dist/*.js","limit":"11 KB"}],"_npmVersion":"11.17.0","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"24.19.0","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0","fastify-plugin":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"knex":"^3.1.0","husky":"^9.1.6","vitest":"^4.0.4","globals":"^17.0.0","publint":"^0.3.14","sqlite3":"^6.0.1","cross-env":"^10.0.0","objection":"^3.1.5","size-limit":"^13.0.1","typescript":"^7.0.2","@types/node":"^26.0.0","@biomejs/biome":"2.5.9","@types/pluralize":"^0.0.33","@size-limit/esbuild":"^13.0.1","@vitest/coverage-v8":"^4.0.4","@size-limit/esbuild-why":"^13.0.1","@size-limit/preset-small-lib":"^13.0.1"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.13_1788067517351_0.478592805826598","host":"s3://npm-registry-packages-npm-production"}},"0.0.14":{"name":"@anephenix/fastify-resource","version":"0.0.14","keywords":["fastify","objection"],"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","_id":"@anephenix/fastify-resource@0.0.14","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"homepage":"https://github.com/anephenix/fastify-resource","bugs":{"url":"https://github.com/anephenix/fastify-resource/issues"},"bin":{"fastify-resource":"dist/cli.js"},"dist":{"shasum":"38aee3b6d3aa626cfa0fada56910cdda5b51ef89","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.14.tgz","fileCount":22,"integrity":"sha512-SUhwZAO9DUGs3GVCbglgF1z+gEwCF0IgJeEWzd5chXiMfbcsvURjjBHn7xjE0/0tnPzDFsKQujdFDsFZcOYkiA==","signatures":[{"sig":"MEUCIGt33L+eZ2GMQM8nhMNO0D71gQqLdX8M5DRqynuBqsxNAiEAvrrMw0eiWnEWR+p4S3gUSj1LPaoba1yJe7p9BmapB7I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@anephenix%2ffastify-resource@0.0.14","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":54662},"type":"module","types":"./dist/index.d.ts","engines":{"node":">=12"},"exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"3eca619b0ce6f0cc661a1c532c76a455db1d723c","scripts":{"lint":"npx @biomejs/biome check --write src test scripts","size":"size-limit","test":"cross-env NODE_ENV=test npx vitest test --run","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx vitest test --run --coverage","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prepare":"husky","lint:package":"npx publint","update-changelog":"node --experimental-strip-types scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a479e019-f6f8-40f5-b2d4-9054194b5a15"}},"repository":{"url":"git+https://github.com/anephenix/fastify-resource.git","type":"git"},"size-limit":[{"name":"index","path":"dist/index.js","limit":"11 KB"},{"name":"cli","path":"dist/cli.js","limit":"15 KB","ignore":["node:fs","node:path"]}],"_npmVersion":"11.17.0","description":"A way for generating resources using fastify and objection","directories":{},"_nodeVersion":"24.19.0","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0","fastify-plugin":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"knex":"^3.1.0","husky":"^9.1.6","vitest":"^4.0.4","globals":"^17.0.0","publint":"^0.3.14","sqlite3":"^6.0.1","cross-env":"^10.0.0","objection":"^3.1.5","size-limit":"^13.0.1","typescript":"^7.0.2","@types/node":"^26.0.0","@biomejs/biome":"2.5.11","@types/pluralize":"^0.0.33","@size-limit/esbuild":"^13.0.1","@vitest/coverage-v8":"^4.0.4","@size-limit/esbuild-why":"^13.0.1","@size-limit/preset-small-lib":"^13.0.1"},"_npmOperationalInternal":{"tmp":"tmp/fastify-resource_0.0.14_1788204460604_0.991806564557135","host":"s3://npm-registry-packages-npm-production"}},"0.0.15":{"_id":"@anephenix/fastify-resource@0.0.15","bin":{"fastify-resource":"dist/cli.js"},"bugs":{"url":"https://github.com/anephenix/fastify-resource/issues"},"dist":{"shasum":"5202577c8046916ecdc774feac24fb0fe8ea1d43","tarball":"https://registry.npmjs.org/@anephenix/fastify-resource/-/fastify-resource-0.0.15.tgz","fileCount":22,"integrity":"sha512-QTx+h/4flVBZbhRSsgSdax7QKCYReHUnHj5czCOiEY4FFa2+nkrGOzDfNd6X9XgxGJjcoTipwSgBglfZYvyl8g==","signatures":[{"sig":"MEQCIAJKCKu39SAAFuO9nkiiqHyk3bbNaa15reX0iDL3uaVmAiA/bltvVjBnB43U9r0iWGPz/zQwQooim7/ZtQOlHXXZcw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAZZIdAUKDTLl8PdxE/0JeiJCG7VyPbS2HqKPpeE8KoaAiAEE6a/SudOq8MDsgDAG3l2JpUBMK1M7oT1WDXYZfKnFg=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@anephenix%2ffastify-resource@0.0.15","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":59275},"name":"@anephenix/fastify-resource","type":"module","types":"./dist/index.d.ts","author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"engines":{"node":">=12"},"exports":{".":{"import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"f48e379552c4edf9e745e3647ed3683b0c6a90e2","license":"MIT","scripts":{"lint":"npx @biomejs/biome check --write src test scripts","size":"size-limit","test":"cross-env NODE_ENV=test npx vitest test --run","build":"tsc --project tsconfig.json","cover":"cross-env NODE_ENV=test npx vitest test --run --coverage","watch":"tsc --project tsconfig.json --watch","analyze":"size-limit --why","prepare":"husky","lint:package":"npx publint","update-changelog":"node --experimental-strip-types scripts/update-changelog.ts","prepare-patch-release":"npm run update-changelog && git add CHANGELOG.md && git commit -m \"Updated changelog\" && npm version patch","publish-patch-release":"npm run prepare-patch-release && git push origin main && git push --tags"},"version":"0.0.15","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a479e019-f6f8-40f5-b2d4-9054194b5a15"}},"homepage":"https://github.com/anephenix/fastify-resource","keywords":["fastify","objection"],"repository":{"url":"git+https://github.com/anephenix/fastify-resource.git","type":"git"},"size-limit":[{"name":"index","path":"dist/index.js","limit":"11 KB"},{"name":"cli","path":"dist/cli.js","limit":"15 KB","ignore":["node:fs","node:path"]}],"_npmVersion":"11.19.0","description":"A way for generating resources using fastify and objection","directories":{},"maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"_nodeVersion":"24.21.0","dependencies":{"fastify":"^5.1.0","pluralize":"^8.0.0","fastify-plugin":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"knex":"^3.1.0","husky":"^9.1.6","vitest":"^5.0.0","globals":"^17.0.0","publint":"^0.3.14","sqlite3":"^6.0.1","cross-env":"^10.0.0","objection":"^3.1.5","size-limit":"^14.0.0","typescript":"^7.0.2","@types/node":"^26.0.0","@biomejs/biome":"2.5.13","@types/pluralize":"^0.0.33","@size-limit/esbuild":"^14.0.0","@vitest/coverage-v8":"^5.0.0","@size-limit/esbuild-why":"^14.0.0","@size-limit/preset-small-lib":"^14.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fastify-resource_0.0.15_1790500762717_0.7371716386038689"}}},"time":{"created":"2022-03-13T10:11:56.671Z","modified":"2026-09-27T09:19:23.187Z","0.0.1":"2022-03-13T10:11:56.920Z","0.0.2":"2025-01-16T21:43:31.950Z","0.0.3":"2025-02-15T11:45:18.844Z","0.0.4":"2025-03-10T21:30:36.424Z","0.0.5":"2025-04-08T12:48:06.460Z","0.0.6":"2025-05-23T16:59:17.215Z","0.0.7":"2025-07-17T20:15:01.871Z","0.0.8":"2025-10-08T19:38:02.056Z","0.0.9":"2025-10-15T08:39:33.356Z","0.0.10":"2025-12-03T17:02:17.497Z","0.0.11":"2026-01-04T19:58:38.818Z","0.0.12":"2026-04-07T21:15:59.144Z","0.0.13":"2026-08-30T05:25:17.473Z","0.0.14":"2026-08-31T19:27:40.764Z","0.0.15":"2026-09-27T09:19:22.797Z"},"bugs":{"url":"https://github.com/anephenix/fastify-resource/issues"},"author":{"name":"Paul Jensen","email":"paul@anephenix.com"},"license":"MIT","homepage":"https://github.com/anephenix/fastify-resource","keywords":["fastify","objection"],"repository":{"url":"git+https://github.com/anephenix/fastify-resource.git","type":"git"},"description":"A way for generating resources using fastify and objection","maintainers":[{"name":"paulbjensen","email":"paulbjensen@gmail.com"}],"readme":"# Fastify Resource\n\nA way of creating API routes in Fastify with Objection.js models.\n\n[![npm version](https://badge.fury.io/js/@anephenix%2Ffastify-resource.svg)](https://badge.fury.io/js/@anephenix%2Ffastify-resource) [![Node.js CI](https://github.com/anephenix/fastify-resource/actions/workflows/node.js.yml/badge.svg)](https://github.com/anephenix/fastify-resource/actions/workflows/node.js.yml) [![Socket Badge](https://socket.dev/api/badge/npm/package/@anephenix/fastify-resource)](https://socket.dev/npm/package/@anephenix/fastify-resource)\n\n## Dependencies\n\n- Node.js\n- Fastify\n- Objection.js for models\n\n## Install\n\n```shell\nnpm i @anephenix/fastify-resource\n```\n\n## Why use fastify-resource?\n\nWhen writing code for an API, you may find yourself generating RESTful routes\nfor Objection.js models that support CRUD operations (Create/Read/Update/\nDelete), and it could end up looking like this:\n\n```typescript\nimport fastify from 'fastify';\nimport Person from './models/Person';\n\nconst app = fastify({ logger: false });\n\n// GET /people\napp.get('/people', async (req, rep) => {\n  try {\n    const data = await Person.query();\n    return data;\n  } catch (error) {\n    rep.statusCode(400);\n    return error.message;\n  }\n});\n\n// POST /people\napp.post('/people', async (req, rep) => {\n  try {\n    const people = await Person.query().insert(req.body);\n    rep.statusCode(201);\n    return people;\n  } catch (error) {\n    rep.statusCode(400);\n    return error.message;\n  }\n});\n\n// GET /people/:id\napp.get('/people/:id', async (req, rep) => {\n  try {\n    const person = await Person.query().findById(req.params.id);\n    if (person) return person;\n    if (!person) {\n      res.statusCode(404);\n      return 'Not found';\n    }\n  } catch (error) {\n    rep.statusCode(400);\n    return error.message;\n  }\n});\n\n// PATCH /people/:id\napp.patch('/people/:id', async (req, rep) => {\n  try {\n    const person = await Person.query().patchAndFetchById(\n      req.params.id,\n      req.body\n    );\n    if (person) return person;\n    if (!person) {\n      res.statusCode(404);\n      return 'Not found';\n    }\n  } catch (error) {\n    rep.statusCode(400);\n    return error.message;\n  }\n});\n\n// DELETE /people/:id\napp.delete('/people/:id', async (req, rep) => {\n  try {\n    await Person.query().deleteById(req.params.id);\n    return req.params.id;\n  } catch (error) {\n    rep.statusCode(400);\n    return error.message;\n  }\n});\n```\n\nTo save you from having to write all that code, this library works as a \nfastify plugin to enable you to do the same thing, but with just these \nlines of code:\n\n```typescript\nimport fastify from 'fastify'\nimport Person from './models/Person';\nimport fastifyResource from '@anephenix/fastify-resource';\n\nconst app = fastify({ logger: false });\napp.register(fastifyResource, {\n  model: Person,\n  resourceList: 'person',\n});\n```\n\nThis will automatically generate and register the following RESTful routes:\n\n```\nGET       /people\nPOST      /people\nGET       /people/:id\nPATCH     /people/:id\nDELETE    /people/:id\n```\n\nIt will also:\n\n- Automatically generate code functions for each of those endpoints in memory\n- Those code function then call the Objection.model to perform database operations.\n\nThe result being that in a few lines of code you have implemented CRUD for \nyour resource.\n\n### Adding a preHandler\n\nIf you want to run Fastify pre-handlers before each generated route (for example to apply auth or add headers), pass a `preHandler` function or array in the plugin options:\n\n```typescript\n/*\n  A simple example to demonstrate a preHandler function that\n  could run before the route's handler function is called\n*/\nconst ensureAuth = async (request, reply) => {\n  if (!request.headers.authorization) {\n    reply.code(401);\n    throw new Error(\"Unauthorized\");\n  }\n};\n\napp.register(fastifyResource, {\n  model: Person,\n  resourceList: 'person',\n  preHandler: ensureAuth,\n});\n```\n\nYou can also supply an array of pre-handlers:\n\n```typescript\napp.register(fastifyResource, {\n  model: Person,\n  resourceList: 'person',\n  preHandler: [ensureAuth, otherHook],\n});\n```\n\n### Supporting request headers\n\nRequest headers often carry two different kinds of information: something to\nauthenticate/authorize against (like a Bearer token), and something to scope\na query by (like a tenant id, or a user id resolved from that token). These\nare handled in two different ways.\n\n**Rejecting unauthorized requests** is done with `preHandler`, as shown\nabove - check the header and throw/reply before the route handler runs:\n\n```typescript\nconst ensureAuth = async (request, reply) => {\n  if (!request.headers.authorization) {\n    reply.code(401);\n    throw new Error(\"Unauthorized\");\n  }\n};\n\napp.register(fastifyResource, {\n  model: Person,\n  resourceList: 'person',\n  preHandler: ensureAuth,\n});\n```\n\n**Getting header values into the service/model layer** (so a query can be\nscoped by them) is done with the `headerParams` option. It's a mapping of\nrequest header name to the key that value should be assigned under in the\n`params` object passed to the service, and from there to the model action or\nyour `customModelAction`:\n\n```typescript\napp.register(fastifyResource, {\n  model: Person,\n  resourceList: 'person',\n  preHandler: ensureAuth,\n  headerParams: {\n    'x-tenant-id': 'tenantId',\n  },\n});\n```\n\nWith this in place, a request like `GET /people` with an `x-tenant-id: acme`\nheader results in the service being called with `{ tenantId: 'acme' }`\nmerged into its params, which a `customModelAction` (see below) can use to\nscope the query.\n\nOnly headers you explicitly name are extracted - request headers are never\npassed through wholesale. Header-derived values are also merged in last, so\na client can't override one (e.g. `tenantId`) by supplying a same-named\nfield in the request body or URL.\n\n### Supporting params/body transformation\n\nSometimes the params a controller assembles from the URL, request body and\n`headerParams` aren't quite what the service/model layer should receive - a\npassword needs hashing before it's stored, a field needs renaming, or a\nvalue needs to be derived. The `paramsTransform` option lets you supply a\nfunction that maps/transforms those params before they're sent to the\nservice:\n\n```typescript\nimport bcrypt from 'bcrypt';\n\napp.register(fastifyResource, {\n  model: Person,\n  resourceList: 'person',\n  paramsTransform: async (params, action) => {\n    if ((action === 'create' || action === 'update') && params.password) {\n      return { ...params, password: await bcrypt.hash(params.password as string, 10) };\n    }\n    return params;\n  },\n});\n```\n\n`paramsTransform` runs for every generated action - the 5 built-in CRUD\nactions and any `customActions` - receiving the fully assembled params (so\nit sees `headerParams`-derived values too) and the action's name (`index`,\n`create`, `get`, `update`, `delete`, or a custom action's `name`), so it can\nbranch on which action is running. It's awaited, so returning a `Promise`\n(as above) is supported. Whatever it returns is what's sent to the service,\nand from there to the model action or your `customModelAction`.\n\n### Supporting schema validation\n\nFastify validates requests (and can serialize responses) using a JSON\n[schema](https://fastify.dev/docs/latest/Reference/Validation-and-Serialization/)\nattached to a route. `fastify-resource` lets you supply one of these schemas\nper generated action - `index`, `create`, `get`, `update` and `delete` - via\nthe `schema` option:\n\n```typescript\napp.register(fastifyResource, {\n  model: Person,\n  resourceList: 'person',\n  schema: {\n    create: {\n      body: {\n        type: 'object',\n        required: ['firstName'],\n        properties: {\n          firstName: { type: 'string' },\n          lastName: { type: 'string' },\n        },\n      },\n    },\n    update: {\n      body: {\n        type: 'object',\n        properties: { firstName: { type: 'string' } },\n      },\n    },\n    index: {\n      querystring: {\n        type: 'object',\n        properties: { limit: { type: 'integer' } },\n      },\n    },\n    get: {\n      response: {\n        200: {\n          type: 'object',\n          properties: { id: { type: 'number' }, firstName: { type: 'string' } },\n        },\n      },\n    },\n  },\n});\n```\n\nEach action's schema can use any of Fastify's route-level schema keys -\n`body`, `querystring`, `params`, `headers` and `response` - since `index` maps\nto `GET /people`, `create` to `POST /people`, and `get`/`update`/`delete` to\nthe `/people/:id` member route. A `schema` entry is merged into the same\nroute options object as `preHandler`, so the two can be used together.\n\nRequest validation happens inside Fastify before your resource's generated\nhandler runs, so a failing request gets Fastify's own `400` response and\nnever reaches the model/service layer. A `response` schema is used for\nserialization - properties not listed are dropped from the output, which is\nuseful for hiding columns (e.g. foreign keys) that the model action returns.\n\nFor **nested resources** (see below), the member route URL contains one\n`:xxx_id` parameter per ancestor resource plus a final `:id` - a `params`\nschema should account for all of them, not just `id`.\n\nInstance-wide validation concerns - swapping out Ajv via\n`setValidatorCompiler`, customizing error output via\n`setSchemaErrorFormatter`/`setErrorHandler`, or sharing schemas with\n`addSchema`/`$ref` - are configured on the Fastify instance itself (`app`),\nthe same way you would for any other Fastify route, since `fastify-resource`\nis a standard Fastify plugin.\n\n### Creating nested routes\n\nAny REST API tends to implement a hierarchy of resources. Let's say for example\nthere are 2 models - Post and Comment. A post has many comments, and we want to\ncreate an API that models that relationship (fetch comments for a post). \n\nWe might want our comments API routes to be nested under the posts API routes.\n\nThe library can do that:\n\n```typescript\nimport fastify from 'fastify'\nimport Post from './models/Post';\nimport fastifyResource from '@anephenix/fastify-resource';\n\nconst app = fastify({ logger: false });\napp.register(fastifyResource, {\n  model: Post,\n  resourceList: ['post', 'comment'],\n});\n```\n\nThis will make the following API routes available on the fastify instance:\n\n```\nGET     /posts\nPOST    /posts\nGET     /posts/:id\nPATCH   /posts/:id\nDELETE  /posts/:id\n\nGET     /posts/:post_id/comments\nPOST    /posts/:post_id/comments\nGET     /posts/:post_id/comments/:id\nPATCH   /posts/:post_id/comments/:id\nDELETE  /posts/:post_id/comments/:id\n```\n\nYou can have many levels of nested resources in your code, it is not limited\nto any number (we just showed 2 resources in order to demonstrate the example).\n\n#### Referential integrity\n\nFor a nested resource (with the default service - i.e. no `serviceOptions.type:\n\"relatedQuery\"` or `customModelAction`), `update` and `delete` are scoped to\nthe ancestor id(s) in the URL, not just the resource's own `id`. This means\n`PATCH /posts/1/comments/2` will fail with a 400 (rather than silently\nsucceeding) if comment `2` doesn't actually belong to post `1` - so one\ntenant/parent's URL can't be used to mutate or delete another's nested\nrecord.\n\nThis scoping requires the leaf model to have a real column matching each\nancestor's `:xxx_id` param name (e.g. `post_id` on the `Comment` model,\nexactly as shown in the schema-validation guidance above). For 3+ levels of\nnesting, that means the leaf table needs a column for *every* ancestor in\nthe chain, not just its immediate parent - if it only has a `post_id`\ncolumn but the resource is nested 3 levels deep (e.g.\n`/blogs/:blog_id/posts/:post_id/comments/:id`), the `blog_id` scoping will\nfail because there's no `blog_id` column on the comments table to filter\non. If you need that, either denormalize the ancestor id(s) onto the leaf\ntable, or use the `relatedQuery` service option (see below), which scopes\nthrough the model's `relationMappings` instead of raw columns and already\nenforces the same referential integrity guarantee.\n\nIf you supply a `customModelAction`, this scoping is not applied\nautomatically - you're responsible for enforcing it yourself in that\nfunction.\n\n### Support for self-referential resources\n\nThere might be a case where you use the same database table for a type of Model \nthat contains nested resources that are the same thing, such as:\n\n- A Category model that has many sub-categories\n- A Person model that has many children\n- A Group that has many sub-groups\n\nIt is possible to setup the self-referential resource to perform queries using \nthe `relationMappings` part of the ORM model:\n\nLete's say that you have a model `Person` with a `relationMappings` for \nchildren that looks like this:\n\n```typescript\nimport { Model } from \"objection\";\nimport { appDB } from \"../../knexConnections\";\nimport Possession from \"./Possession\";\n\nModel.knex(appDB);\n\n// Person model\nclass Person extends Model {\n\tfirstName: unknown;\n\n\tstatic get tableName() {\n\t\treturn \"persons\";\n\t}\n\n\tstatic get relationMappings() {\n\t\treturn {\n\t\t\tchildren: {\n\t\t\t\trelation: Model.HasManyRelation,\n\t\t\t\tmodelClass: Person,\n\t\t\t\tjoin: {\n\t\t\t\t\tfrom: \"persons.id\",\n\t\t\t\t\tto: \"persons.parentId\",\n\t\t\t\t},\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport default Person;\n```\n\nAnd say you want to setup a REST API route set for these routes:\n\n```\nGET     /people/:person_id/children\nPOST    /people/:person_id/children\nGET     /people/:person_id/children/:id\nPATCH   /people/:person_id/children/:id\nDELETE  /people/:person_id/children/:id\n```\n\nThen you can achieve that by passing these properties in the `serviceOptions` \nsection:\n\n```typescript\n\tapp.register(fastifyResource, {\n\t\tmodel: Person,\n\t\tresourceList: [\"person\", \"child\"],\n\t\tserviceOptions: {\n\t\t\ttype: \"relatedQuery\", // Pass this value to tell Fastify Resource to look for the related query\n\t\t\trelatedQuery: \"children\", // The property in the `relationMappings` definition for the nested resource\n\t\t\tprimaryKey: \"person_id\", // The parameter passed by the controller to the service for scoping the model\n\t\t},\n\t});\n```\n\n### Support for custom model actions\n\nIf you find that the ORM queries that the service generator uses do not match \nyour needs, and that you need to write custom model queries, then there is a \nway to override it and to provide your own custom model action function to \nthe service generator.\n\nYou can generate a custom model action like this:\n\n```typescript\n/*\n  Define a custom model action that will handle the queries for:\n\n  - getAll\n  - get\n  - create\n  - update\n  - delete\n*/\nimport type { Model } from 'objection';\n\nconst customModelAction = async (action: string, model: Model, params: Params) => {\n  const relatedQuery = 'children';\n  const primaryKey = 'person_id';\n  const primaryId = params[primaryKey];\n  const paramsToInsert = objectWithoutKey(params, primaryKey);\n  const paramsToUpdate = objectWithoutKey(\n    objectWithoutKey(paramsToInsert, \"id\"),\n    primaryKey,\n  );\n\n  switch (action) {\n    case \"getAll\":\n      return await model.relatedQuery(relatedQuery).for(primaryId);\n    case \"get\":\n      return await model\n        .relatedQuery(relatedQuery)\n        .for(primaryId)\n        .where(\"id\", params.id)\n        .first();\n    case \"create\":\n      return await model\n        .relatedQuery(relatedQuery)\n        .for(primaryId)\n        .insert(paramsToInsert);\n    case \"update\":\n      return await model\n        .relatedQuery(relatedQuery)\n        .for(primaryId)\n        .patchAndFetchById(params.id, paramsToUpdate);\n    case \"delete\": {\n      const deletedCount = await model\n        .relatedQuery(relatedQuery)\n        .for(primaryId)\n        .delete()\n        .where(\"id\", params.id);\n      if (deletedCount === 0) {\n        throw new Error(`Record with id ${params.id} not found`);\n      }\n      return params.id;\n    }\n    default:\n      throw new Error(`Unknown action: ${action}`);\n  }\n};\n\n// And then pass that custom model action in the serviceOptions section:\napp.register(fastifyResource, {\n  model: Person,\n  resourceList: [\"person\", \"child\"],\n  serviceOptions: {\n    customModelAction\n  },\n});\n```\n\nThe service will then use the `customModelAction` function when it comes to \nperforming the queries for the service.\n\n### Support for custom API routes and actions\n\nThe 5 generated CRUD routes won't cover every use case - sometimes you need\na route that triggers an action rather than reading/writing a single\nresource, e.g. bulk-archiving a list of resources via\n`POST /people/archive`, or a member action like `POST /people/:id/deactivate`.\nThe `customActions` option lets you declare extra routes like this, backed\nby their own controller/service actions, alongside the standard CRUD ones.\n\nEach entry in `customActions` needs:\n\n- `name` - used as the key for the generated controller/service function,\n  as the route's `action` (so it can also be targeted by `schema`, see\n  above), and as the `action` argument passed to `customModelAction`.\n- `method` - the HTTP method for the route (`get`, `post`, `patch` or\n  `delete`).\n- `path` - the path segment (no leading slash) appended after the\n  resource's URL, e.g. `\"archive\"`.\n- `scope` - `\"collection\"` appends `path` after the collection URL (e.g.\n  `/people/archive`), `\"member\"` appends it after the member URL (e.g.\n  `/people/:id/archive`). Using a scope rather than a hand-written URL means\n  nested/self-referential resources - whose URLs already contain generated\n  `:xxx_id` params - don't need to be accounted for manually.\n- `successCode` (optional) - HTTP status code to set on success; defaults\n  to `200`.\n- `includeBody` (optional) - whether the request body should be merged into\n  the params sent to the service, alongside `params`/`headerParams`;\n  defaults to `true` for `post`/`patch`, `false` otherwise.\n\n```typescript\nimport type { Model, ModelClass } from 'objection';\nimport fastifyResource, { modelAction } from '@anephenix/fastify-resource';\nimport Person from './models/Person';\n\n/*\n  A customModelAction can handle a mix of custom actions and the standard\n  CRUD ones - anything it doesn't recognise can be delegated back to the\n  library's own `modelAction`, which is exported for this purpose.\n*/\nconst archivePeople = async (\n  action: string,\n  model: ModelClass<Model>,\n  params: Params,\n) => {\n  if (action === 'archive') {\n    const { ids } = params as { ids: number[] };\n    await model.query().whereIn('id', ids).patch({ archived: true });\n    return await model.query().whereIn('id', ids);\n  }\n  return await modelAction(action, model, params);\n};\n\napp.register(fastifyResource, {\n  model: Person,\n  resourceList: 'person',\n  serviceOptions: {\n    customModelAction: archivePeople,\n  },\n  customActions: [\n    { name: 'archive', method: 'post', path: 'archive', scope: 'collection' },\n  ],\n});\n```\n\nThis registers `POST /people/archive` in addition to the usual 5 routes.\nA request like `POST /people/archive` with a body of `{ \"ids\": [1, 2, 3] }`\ncalls `archivePeople(\"archive\", Person, { ids: [1, 2, 3] })`, and the\nresult is returned as the response body with a `200` status.\n\nA member-scoped action works the same way, but the route also carries the\n`:id` (and any ancestor `:xxx_id`) params through to `params`:\n\n```typescript\ncustomActions: [\n  { name: 'deactivate', method: 'post', path: 'deactivate', scope: 'member' },\n],\n```\n\nregisters `POST /people/:id/deactivate`, calling the service (and from\nthere `customModelAction`) with `{ id, ...body }`.\n\n`preHandler` and `headerParams` apply to custom action routes the same way\nthey do to the generated CRUD ones. `schema` also works the same way -\njust key the schema entry by the custom action's `name` instead of one of\n`index`/`create`/`get`/`update`/`delete`.\n\n### Generating scaffold files with the CLI\n\nIf you want to fully own a resource's code instead of using the generated\nplugin, the package ships a `generate` CLI that scaffolds plain\nfastify + Objection.js files for it - a model, a service, a controller and a\nroutes file, wired together with the same try/catch + status-code pattern\nshown at the top of this README. **These generated files have no dependency\non fastify-resource** - they're a starting point for the \"custom strategy\",\nnot an alternative way of registering the plugin.\n\n```shell\nnpx @anephenix/fastify-resource generate application\n```\n\nThis creates:\n\n```\nsrc/models/Application.ts\nsrc/services/application.ts\nsrc/controllers/application.ts\nsrc/routes/application.ts\nsrc/index.ts\n```\n\nThe resource name is singularized and can be given in any casing\n(`application`, `Applications`, `blog_post`, `blogPost` all work) - it's\nused as-is for the model's class name, and pluralized for the route URLs\nand the model's `tableName`.\n\nOptions:\n\n- `--output <dir>` - directory to generate the files under (default: `src`)\n- `--force` - overwrite an existing model/service/controller/routes file for\n  that resource. `index.ts` is never overwritten (it may already register\n  other resources) - if one already exists, the CLI prints the two lines\n  needed to wire up the new resource's routes instead.\n\n### Tests\n\n```shell\nnpm t\n```\n\n### License and Credits\n\n&copy;2026 Anephenix Ltd. All Rights Reserved.\n","readmeFilename":"README.md"}