{"_id":"@adobe/helix-vulcain-filters","_rev":"120-7ec6e253f2d86cc80b470b76a536b531","name":"@adobe/helix-vulcain-filters","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@adobe/helix-vulcain-filters","version":"1.0.0","author":"","license":"Apache-2.0","_id":"@adobe/helix-vulcain-filters@1.0.0","maintainers":[{"name":"msavin99","email":"savin.mircea@gmail.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"msagolj","email":"msagolj@adobe.com"},{"name":"richardhand","email":"pid90611@adobe.com"},{"name":"jckautzmann","email":"jkautzma@adobe.com"},{"name":"andreea_dracea","email":"andreeadracea@yahoo.com"},{"name":"bpauli","email":"mail@bpauli.de"},{"name":"vladbailescu","email":"vlad@bailescu.ro"},{"name":"mfrisbey","email":"mark_f79@hotmail.com"},{"name":"himar","email":"himar@adobe.com"},{"name":"bbythewa","email":"bbythewa@adobe.com"},{"name":"sanketra","email":"sanketra@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"fmeschbe","email":"fmeschbe@adobe.com"},{"name":"jianliao79","email":"jian.liao@gmail.com"},{"name":"ibaratz","email":"ibaratz@adobe.com"},{"name":"conyu","email":"conyu@adobe.com"},{"name":"alexkli","email":"alexander@klimetschek.de"},{"name":"meryllblanchet","email":"meryll@adobeio.com"},{"name":"moritzraho","email":"raho.mr@gmail.com"},{"name":"justinedelson","email":"justin@justinedelson.com"},{"name":"icaraps","email":"icaraps@hotmail.com"},{"name":"dkstevekwak","email":"steveguac@gmail.com"},{"name":"ashryan","email":"sayhi@ashryan.io"},{"name":"korra","email":"npmjs.karo@cupdev.net"},{"name":"praschetan","email":"cprasad@adobe.com"},{"name":"nporter-adbe","email":"nporter@adobe.com"},{"name":"aaronius","email":"aaron@aaronhardy.com"},{"name":"hirenoble","email":"hirenanandshah@outlook.com"},{"name":"benjamind","email":"ben@delarre.net"},{"name":"yoshikinoko","email":"yoshikinoko@gmail.com"},{"name":"goya","email":"brettrudd@gmail.com"},{"name":"rofe","email":"npm@rofe.com"},{"name":"alexmirea","email":"alexandru.daniel.mirea@gmail.com"},{"name":"purplecabbage","email":"purplecabbage@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"kerrishotts","email":"kerrishotts@gmail.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"},{"name":"macdonst","email":"simon.macdonald@gmail.com"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"abhinavsaraswat","email":"absarasw@adobe.com"},{"name":"aemsites","email":"meyer@adobe.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"jfkhoury","email":"jfkhoury@gmail.com"},{"name":"jileesh","email":"jileeshsathyan@gmail.com"},{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"asteed","email":"andrewsteed@gmail.com"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"adobe-activation","email":"Engineering-Admins@adobe.com"},{"name":"target-admin","email":"ciocanu@adobe.com"},{"name":"adobe-behance","email":"sedunn@adobe.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"filmaj","email":"maj.fil@gmail.com"}],"homepage":"https://github.com/adobe/helix-vulcain-filters#readme","bugs":{"url":"https://github.com/adobe/helix-vulcain-filters/issues"},"dist":{"shasum":"ec04138450cc3d69f40be2bd006fdf63cc28a22c","tarball":"https://registry.npmjs.org/@adobe/helix-vulcain-filters/-/helix-vulcain-filters-1.0.0.tgz","fileCount":22,"integrity":"sha512-UkBQ2ePP5DgI50JUFSoT3hV+oW/MUI1BKQWDOw3s7IvxvD9D763odAFglrnGFOnjtje6BmWvGM1frOSeRI6VxA==","signatures":[{"sig":"MEYCIQDZTVdtnf4WjYKCwUyl2lWqTkvXe5TvGP8YrJei1BKWOQIhAJ7XwfT4dG3/jFyr0+yMJ/Cy0QDvtwz0ke9lJVyki9Nw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":39865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1v8CCRA9TVsSAnZWagAAc+AP/3GEgpQVYAXUwGe7hZPd\nfaReHthmHauOec9FZK98kqsRFx5YMtHYs9jodirx1w305fW9vYRnDqubE4vV\n+HR//9bVOPKyiL56TD2d1ooryIY9cBTwBQfDUGKSowZbwLjSPsOCT4Z6sIWF\nC8wzeGGDe39NdSSoemOvNAxYIVq8rBIDg5eFB46fFGRQkXUdNsEi6iCTSCTp\nYJ+K0vJl9fJGMFcC2+pp9vmHG40MNuiyye8riL0mDHtF4UglfD1Ab6lZVysG\nOM7cWaGTZRYTW5682fpCQd0IrWKMOmqjx2mXdqRnnyI/uf/omFjaXzeVGvwL\nS84sQMrt6mVQLXVUg+3b5ewat5Qq+x1gY+YfjT67e1kFl+fZRPLZLfTeE918\n1qk6zjk5YiNWw8Eq/AjU1EnXcZBy9I3s4gGamy062Gbwc+wdMdOgeHoYP/VS\nKMQ+bRj50zlYCE6eT7yf/3k22+ZgzEVwh7PSh/n0h7qTRhutIVVacurDLrN5\nNpuR9AZhgBhBPwU8UbI93ihhXdkRy/0ldraD6edQggW1zKWP2FG8i2VixsTl\nRtvnkF9ZkzLQX4kvA+Gr34/Ez7zc7RaCoEzhitZWzhvnA3avlJt7NnTgHQ8m\n6hisSmNciU5M+2L5Kd3ZHBQN4jYb4F0dTSXoTdYtk3urfNeieSS2MprEBsPf\nXxD5\r\n=y8Kw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/index.js","config":{"ghooks":{"pre-commit":"npx lint-staged"},"commitizen":{"path":"node_modules/cz-conventional-changelog"}},"gitHead":"b6857fdff55b82817321e8bfd0e64637c81e074d","scripts":{"docs":"npx jsdoc2md -c .jsdoc.json --files 'src/*.js'  > docs/API.md","lint":"eslint .","test":" nyc --reporter=text --reporter=lcov --check-coverage --branches 100 --statements 100 --lines 100 mocha","commit":"git-cz","test-ci":"nyc --reporter=text --reporter=lcov --check-coverage --branches 100 --statements 100 --lines 100 mocha --reporter xunit --reporter-options output=./junit/test-results.xml && codecov","semantic-release":"semantic-release"},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/helix-vulcain-filters.git","type":"git"},"_npmVersion":"6.12.0","description":"Vulcain-like fields filters for OpenWhisk web actions","directories":{},"lint-staged":{"*.js":"eslint"},"_nodeVersion":"8.16.2","dependencies":{"traverse":"^0.6.6","json-pointer":"^0.6.0"},"_hasShrinkwrap":false,"devDependencies":{"ajv":"6.10.2","nyc":"14.1.1","mocha":"6.2.2","eslint":"6.5.1","lodash":"4.17.15","codecov":"3.6.1","istanbul":"1.1.0-alpha.1","commitizen":"4.0.3","lint-staged":"9.4.2","semantic-release":"15.13.27","jsdoc-to-markdown":"5.0.2","eslint-plugin-header":"3.0.0","eslint-plugin-import":"2.18.2","junit-report-builder":"1.3.3","@semantic-release/git":"7.0.16","@semantic-release/npm":"5.2.0","@semantic-release/github":"5.5.4","cz-conventional-changelog":"3.0.2","@adobe/eslint-config-helix":"1.1.0","@semantic-release/changelog":"3.0.4","@semantic-release/commit-analyzer":"6.3.0","@semantic-release/release-notes-generator":"7.3.0"},"_npmOperationalInternal":{"tmp":"tmp/helix-vulcain-filters_1.0.0_1573602881248_0.22775089612919475","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-11-12T23:54:41.247Z","modified":"2026-10-01T01:33:41.540Z","1.0.0":"2019-11-12T23:54:41.363Z"},"bugs":{"url":"https://github.com/adobe/helix-vulcain-filters/issues"},"license":"Apache-2.0","homepage":"https://github.com/adobe/helix-vulcain-filters#readme","repository":{"url":"git+https://github.com/adobe/helix-vulcain-filters.git","type":"git"},"description":"Vulcain-like fields filters for OpenWhisk web actions","maintainers":[{"email":"mabecker@adobe.com","name":"marbec"},{"email":"tripod@bocanegra.ch","name":"tripod"},{"email":"garthdb@gmail.com","name":"garthdb"},{"email":"lazdnet@gmail.com","name":"lazd"},{"email":"grp-opensourceoffice@adobe.com","name":"adobe-admin"},{"email":"patrickfulton@gmail.com","name":"patrickfulton"},{"email":"lars@trieloff.net","name":"trieloff"},{"email":"krisnye@gmail.com","name":"krisnye"},{"email":"dcpfsdk@adobe.com","name":"dcpfsdk"},{"email":"natebaldwindesign@gmail.com","name":"natebaldwin"},{"email":"devongovett@gmail.com","name":"devongovett"},{"email":"danniintheus@gmail.com","name":"aspro83"},{"email":"symanovi@adobe.com","name":"symanovi"},{"email":"dominique.pfister@gmail.com","name":"dpfister"},{"email":"sg@adobe.com","name":"stefan-guggisberg"},{"email":"npm@rofe.com","name":"rofe"},{"email":"kptdobe@gmail.com","name":"kptdobe"},{"email":"halls@adobe.com","name":"adobehalls"},{"email":"bradjohn@adobe.com","name":"fullcolorcoder"},{"email":"djaeggi@adobe.com","name":"djaeggi"},{"email":"dylandepass@gmail.com","name":"dylandepass"},{"email":"mhaack@adobe.com","name":"mhaack"},{"email":"amol@adobe.com","name":"amol-anand"},{"email":"stopp@adobe.com","name":"stopp-adobe"},{"email":"namarora@adobe.com","name":"namarora"},{"email":"doten@adobe.com","name":"doten"},{"email":"schmidt@adobe.com","name":"duh_schmidt"},{"email":"astha.bhargava23@gmail.com","name":"asthabh23"},{"email":"aljoseph@adobe.com","name":"aljoseph"},{"email":"zouhir.dahbi@outlook.com","name":"zdahbi"},{"email":"tuicu@adobe.com","name":"tuicu"},{"email":"fmeschbe@adobe.com","name":"fmeschbe"}],"readme":"# Helix Vulcain Filters\n\n> Vulcain-like fields filters for OpenWhisk web actions\n\n## Status\n[![codecov](https://img.shields.io/codecov/c/github/adobe/helix-vulcain-filters.svg)](https://codecov.io/gh/adobe/helix-vulcain-filters)\n[![CircleCI](https://img.shields.io/circleci/project/github/adobe/helix-vulcain-filters.svg)](https://circleci.com/gh/adobe/helix-vulcain-filters)\n[![GitHub license](https://img.shields.io/github/license/adobe/helix-vulcain-filters.svg)](https://github.com/adobe/helix-vulcain-filters/blob/master/LICENSE.txt)\n[![GitHub issues](https://img.shields.io/github/issues/adobe/helix-vulcain-filters.svg)](https://github.com/adobe/helix-vulcain-filters/issues)\n[![LGTM Code Quality Grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/adobe/helix-vulcain-filters.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/adobe/helix-vulcain-filters)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n## Background\n\n[Vulcain](https://github.com/dunglas/vulcain) is a protocol using HTTP/2 Server Push to create fast and idiomatic client-driven REST APIs. It uses a combination of the `Fields` and `Preload` request headers to enable clients to restrict the fields they want to get in a JSON response (`Fields`) and request server pushes for linked hypermedia resources (`Preload`).\n\nThe Vulcain repository linked above contains a reference implementation and describes the spec. **Helix Vulcain Filters** is an implementation of the spec that is not re-using any code of the reference implementation to make it usable in a serverless environment using Apache OpenWhisk and Fastly.\n\n### Architecture\n\n**Helix Vulcain Filters** provides two wrapper functions that implement key parts of the Vulcain protocol. \n\nThe `wrapFields` function takes an existing OpenWhisk `main` function and returns a new function that implements the `Fields` header-based filtering of JSON responses.\n\nThe `wrapPreload` function takes an existing OpenWhisk `main` function and returns a new function that implements the `Preload` header-based pushing of related resources. The `wrapPreload` function does that by adding a `Link` header with a `rel=preload` value for every resource that should be pushed. It relies on Fastly to [perfom the actual HTTP2 server push](https://docs.fastly.com/en/guides/http2-server-push).\n\n## Installation\n\n```bash\n$ npm install -S @adobe/helix-vulcain-filters\n```\n\n## Usage\n\nAdd this to your main function:\n\n```javascript\nconst { wrapFields, wrapPreload } = require('@adobe/helix-vulcain-filters');\n\nfunction main(params) {\n    return {\n        statusCode: 200,\n        body: {\n            hello: params.name || world,\n            more: '/foo.json'\n        }\n    }\n}\n\nmodule.exports.main = wrapFields(wrapPreload(main));\n```\n\nThe wrappers only operate on:\n\n- web actions\n- that have JSON responses\n- when either the `Preload` or `Fields` headers are set\n\nNote: as usual in OpenWhisk, the headers are case-insensitive.\n\n## Development\n\n### Build\n\n```bash\n$ npm install\n```\n\n### Test\n\n```bash\n$ npm test\n```\n\n### Lint\n\n```bash\n$ npm run lint\n```\n","readmeFilename":"README.md"}