{"_id":"@dodi-smart/nuki-graphql-api","_rev":"3-5c0c76167d239942e8f11a9e6900a524","name":"@dodi-smart/nuki-graphql-api","dist-tags":{"latest":"1.2.0"},"versions":{"1.1.0":{"name":"@dodi-smart/nuki-graphql-api","version":"1.1.0","description":"Nuki GraphQL API","license":"MIT","keywords":["nuki","smartlocks","graphql","api","nhost","hasura","dodi","bridge"],"author":{"name":"Asen Lekov"},"homepage":"https://dodi.li","bugs":{"url":"https://github.com/dodi-smart/nuki-graphql-api/issues"},"repository":{"type":"git","url":"git+https://github.com/dodi-smart/nuki-graphql-api.git"},"main":"dist/index.js","types":"dist/index.d.ts","source":"src/index.ts","publishConfig":{"access":"public"},"dependencies":{"@pothos/core":"^3.27.0","abort-controller":"3.0.0","form-data":"4.0.0","graphql":"16.6.0","graphql-scalars":"^1.20.1","graphql-yoga":"^3.7.0","jsonwebtoken":"^8.5.1","node-fetch":"2.6.7","winston":"^3.8.2"},"devDependencies":{"@trivago/prettier-plugin-sort-imports":"^3.4.0","@types/jsonwebtoken":"^8.5.9","@types/node":"^18.14.2","@types/node-fetch":"2.6.2","@typescript-eslint/eslint-plugin":"^5.53.0","@typescript-eslint/parser":"^5.53.0","dotenv":"^16.0.3","eslint":"^8.35.0","eslint-plugin-import":"^2.27.5","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^6.1.1","eslint-plugin-simple-import-sort":"^8.0.0","npm-run-all":"^4.1.5","openapi-typescript-codegen":"^0.23.0","prettier":"^2.8.4","ts-node-dev":"^2.0.0","typescript":"^4.9.5"},"resolutions":{"graphql":"16.6.0"},"packageManager":"pnpm@7.21.0","engines":{"node":">=14 <=18","pnpm":">=7.21.0"},"scripts":{"preinstall":"npx only-allow pnpm","dev":"NODE_ENV=development ts-node-dev -r dotenv/config dev/server.ts","build":"tsc","prettier":"prettier --check src/","prettier:fix":"prettier --write src/","lint":"eslint . --ext .ts,.tsx","lint:fix":"eslint . --ext .ts,.tsx --fix","openapi:generate":"openapi -c node -o src/api -i nuki.yaml --name NukiClient","verify":"run-p prettier lint","verify:fix":"run-p prettier:fix lint:fix"},"_id":"@dodi-smart/nuki-graphql-api@1.1.0","_integrity":"sha512-TghvUio5LuJv0GBHOmsOBQowLlRzqtnABcbw4zR9tNpwnpcQ63Y/cDa7FW4mjE2sGQ2w69UlCeqMbbgNNiJySA==","_resolved":"/private/var/folders/1h/lb_36jjd5y14bft3nwbr0w480000gn/T/219ecfa6f03015cf696ff2f58fa58092/dodi-smart-nuki-graphql-api-1.0.0.tgz","_from":"file:dodi-smart-nuki-graphql-api-1.0.0.tgz","_nodeVersion":"18.12.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-TghvUio5LuJv0GBHOmsOBQowLlRzqtnABcbw4zR9tNpwnpcQ63Y/cDa7FW4mjE2sGQ2w69UlCeqMbbgNNiJySA==","shasum":"696695d04f171c77ad959eede07a43c597557d0b","tarball":"https://registry.npmjs.org/@dodi-smart/nuki-graphql-api/-/nuki-graphql-api-1.1.0.tgz","fileCount":823,"unpackedSize":602002,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3aikBRVw33AojXbZs49zolgaU8qY1BjHAyJ4BMR1+ngIgW26MMJtDEFItSR2KwxMW9X2iEpgE0bANUKH7XvxpHBU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/NKtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSKA//UH+23F9S7WO9goy36Bl/pPonZqLDuZmHMNv3IQyuiN4TzzWP\r\nZPldncte36H9ezJL9EmrLc7MBMs3TfsMmhcQOVSSGyRp/FC8J7fzUkOoFGC4\r\nIG/pcKN5W5AUYEJTBV04KXeCQPZGtiOvigLBKD+BGT8cN/ZDiHAdc0DN1XIu\r\nDLePMtMmdpB36uvdUCEUtFMQJ7d1yVqFzIyhnNG0rNj4UHNodG8Hscb5VIcD\r\n7+qFn9A+SouqlQ7weK0c79MI3yq/doJudvaPpPPw17M8vmwKgJJ3FjxNYUcc\r\nmsk4ZOlIU8igySH277qcmdBXDLhnqSwK8Nj8tR0yQc3lagoSzTnBUn9hUrRG\r\nSbIjgfXK3Pbg74mfpy3esd+5xMiV10nXZl1sRT03DouAo3U3m+z+O38F8cbM\r\n/KAnYQcXGUJFmJ9NTNkg+BVd9ciHCQbVaKXXl3oKWDX/V2VFOcOOoidj14bI\r\nJO3Pnnzg1GYKOQpPn6+lU5956MhiBywOrXHHj/22S/q6xyczcN0p8CC+lto4\r\n2IxqSAYhst56ior9z1Ge9xKKHQck7dBEJW0qXhCGZdDbG0Tma1rAUECkKog5\r\nqCxVMdWxHxjGp35qWHcjSAsrKFst5fnWFYGH1dwbtwuJNQHk6QdtyiMy7k+A\r\nhBRxLs7fuBdJ+ADI0JcRkhwzy3r//XJeFf8=\r\n=LbQu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vokela","email":"asenlekoff@gmail.com"},"directories":{},"maintainers":[{"name":"vokela","email":"asenlekoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nuki-graphql-api_1.1.0_1677513389505_0.4090692650748968"},"_hasShrinkwrap":false},"1.1.1":{"name":"@dodi-smart/nuki-graphql-api","version":"1.1.1","description":"Nuki GraphQL API","license":"MIT","keywords":["nuki","smartlocks","graphql","api","nhost","hasura","dodi","bridge"],"author":{"name":"Asen Lekov"},"homepage":"https://dodi.li","bugs":{"url":"https://github.com/dodi-smart/nuki-graphql-api/issues"},"repository":{"type":"git","url":"git+https://github.com/dodi-smart/nuki-graphql-api.git"},"main":"dist/index.js","types":"dist/index.d.ts","source":"src/index.ts","publishConfig":{"access":"public"},"dependencies":{"@pothos/core":"^3.27.1","abort-controller":"3.0.0","form-data":"4.0.0","graphql":"16.6.0","graphql-scalars":"^1.20.1","graphql-yoga":"^3.7.2","jsonwebtoken":"^8.5.1","node-fetch":"2.6.7","winston":"^3.8.2"},"devDependencies":{"@trivago/prettier-plugin-sort-imports":"^3.4.0","@types/jsonwebtoken":"^8.5.9","@types/node":"^18.14.6","@types/node-fetch":"2.6.2","@typescript-eslint/eslint-plugin":"^5.54.1","@typescript-eslint/parser":"^5.54.1","dotenv":"^16.0.3","eslint":"^8.35.0","eslint-plugin-import":"^2.27.5","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^6.1.1","eslint-plugin-simple-import-sort":"^8.0.0","npm-run-all":"^4.1.5","openapi-typescript-codegen":"^0.23.0","prettier":"^2.8.4","ts-node-dev":"^2.0.0","typescript":"^4.9.5"},"resolutions":{"graphql":"16.6.0"},"packageManager":"pnpm@7.21.0","engines":{"node":">=14 <=18","pnpm":">=7.21.0"},"scripts":{"preinstall":"npx only-allow pnpm","dev":"NODE_ENV=development ts-node-dev -r dotenv/config dev/server.ts","build":"tsc","prettier":"prettier --check src/","prettier:fix":"prettier --write src/","lint":"eslint . --ext .ts,.tsx","lint:fix":"eslint . --ext .ts,.tsx --fix","openapi:generate":"openapi -c node -o src/api -i nuki.yaml --name NukiClient","verify":"run-p prettier lint","verify:fix":"run-p prettier:fix lint:fix"},"_id":"@dodi-smart/nuki-graphql-api@1.1.1","_integrity":"sha512-c2Az0KSRIausXEW/TskBn6UNsOHQhwrFFi7XJczrMldgCOQdZCcW7Ynb/cOYI5O/6UucqLTmri+5AFWPTx6L8Q==","_resolved":"/private/var/folders/1h/lb_36jjd5y14bft3nwbr0w480000gn/T/43fddfba0232a5912c40070d1a786fe7/dodi-smart-nuki-graphql-api-1.1.0.tgz","_from":"file:dodi-smart-nuki-graphql-api-1.1.0.tgz","_nodeVersion":"18.12.1","_npmVersion":"9.6.0","dist":{"integrity":"sha512-c2Az0KSRIausXEW/TskBn6UNsOHQhwrFFi7XJczrMldgCOQdZCcW7Ynb/cOYI5O/6UucqLTmri+5AFWPTx6L8Q==","shasum":"ccd23115dd1e9c6151198f75474851e083fff7b2","tarball":"https://registry.npmjs.org/@dodi-smart/nuki-graphql-api/-/nuki-graphql-api-1.1.1.tgz","fileCount":823,"unpackedSize":602011,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHtZ8hctC7kVSlm4Oc5NqRaAYQqmuTC9Agn1qRBANgUoAiEA96d/kqDrQcD0ZJbwZ2nJPtzNeVrv6sHDodXuDNkdrR4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCH2nACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYUw/+PfwPX/SeUz74n5zZh89MX0V6Z8Hu8PJUJIWTn3SwGeigX46M\r\nbH+QBfft76B2LXam8wKn3zDr80jidShHeFIGPShMym9dYgrdhboG8X/tettl\r\nIkKxFcaLBVXNXI3PpbdRFn3NJ9544JivtHHJNX3yvmYktogrJUvbZb0uGPoO\r\nbTymonxQMzVYtjZKjBZcjIf6iJrFUwOSVZqOkNBFONFq7qwtG/mglJ/ZMKUd\r\nskGkn9IAaR9YoearzmOWDP3XXAEw20FOKpPVUZeKfW3NeZgKKID90T9BQ1Vl\r\nwS0Bqx6gvgBSeVj6d/nFGqReXRSsXLX6nT0ICU+5C9LJF/YTiU45HuudM7PS\r\nq6rRrFvSRgtdEhtCvIDBZ3HUOyW39CwxHryJ+I3s9/kDVzrrAmVl+afDxsiB\r\nFRTpcXaL8Je0VM2sxAjQGsXk+Rbysqua8r5qXiaobjMl6uI8NO0yD+LRYC5L\r\njWi+cEDGzG9I0JGbEZ+72IQZa+2C7RDvtFtC86tIDWyXblEJ5GgDAep1zK+y\r\nV0BS5HErgrvCtbj2eI/AUGBgZQvJizlkQ0BXVMMNjRPNibAXHaqs5ElNpV9Z\r\nWvje37MCWV1kBu/DXyck1JxKb0z+JmPGwC6aJLZT1SibN3UeHoOlouhjUKJ5\r\nuTrlB29i4VfuKyTCe26TgAaM9c3Sgn7wMcs=\r\n=F42M\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vokela","email":"asenlekoff@gmail.com"},"directories":{},"maintainers":[{"name":"vokela","email":"asenlekoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nuki-graphql-api_1.1.1_1678278055025_0.1836707027722766"},"_hasShrinkwrap":false},"1.1.2":{"name":"@dodi-smart/nuki-graphql-api","version":"1.1.2","description":"Nuki GraphQL API","license":"MIT","keywords":["nuki","smartlocks","graphql","api","nhost","hasura","dodi","bridge"],"author":{"name":"Asen Lekov"},"homepage":"https://dodi.li","bugs":{"url":"https://github.com/dodi-smart/nuki-graphql-api/issues"},"repository":{"type":"git","url":"git+https://github.com/dodi-smart/nuki-graphql-api.git"},"main":"dist/index.js","types":"dist/index.d.ts","source":"src/index.ts","publishConfig":{"access":"public"},"dependencies":{"@pothos/core":"^3.27.1","abort-controller":"3.0.0","form-data":"4.0.0","graphql":"16.6.0","graphql-scalars":"^1.20.1","graphql-yoga":"^3.7.2","jsonwebtoken":"^8.5.1","node-fetch":"2.6.7","winston":"^3.8.2"},"devDependencies":{"@trivago/prettier-plugin-sort-imports":"^3.4.0","@types/jsonwebtoken":"^8.5.9","@types/node":"^18.14.6","@types/node-fetch":"2.6.2","@typescript-eslint/eslint-plugin":"^5.54.1","@typescript-eslint/parser":"^5.54.1","dotenv":"^16.0.3","eslint":"^8.35.0","eslint-plugin-import":"^2.27.5","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^6.1.1","eslint-plugin-simple-import-sort":"^8.0.0","npm-run-all":"^4.1.5","openapi-typescript-codegen":"^0.23.0","prettier":"^2.8.4","ts-node-dev":"^2.0.0","typescript":"^4.9.5"},"resolutions":{"graphql":"16.6.0"},"packageManager":"pnpm@7.21.0","engines":{"node":">=14 <=18","pnpm":">=7.21.0"},"scripts":{"preinstall":"npx only-allow pnpm","dev":"NODE_ENV=development ts-node-dev -r dotenv/config dev/server.ts","build":"tsc","prettier":"prettier --check src/","prettier:fix":"prettier --write src/","lint":"eslint . --ext .ts,.tsx","lint:fix":"eslint . --ext .ts,.tsx --fix","openapi:generate":"openapi -c node -o src/api -i nuki.yaml --name NukiClient","verify":"run-p prettier lint","verify:fix":"run-p prettier:fix lint:fix"},"_id":"@dodi-smart/nuki-graphql-api@1.1.2","_integrity":"sha512-eaYwRkxGbUtgvg0Thy+wmlllucGxfh4cddZjIN+UBWDbmGy8A/7giYjhPpyUIPvnBZZByM+YVW1MvX5BmlcdPw==","_resolved":"/private/var/folders/1h/lb_36jjd5y14bft3nwbr0w480000gn/T/6cbda066389b2ce72a125199a2afbcd2/dodi-smart-nuki-graphql-api-1.1.1.tgz","_from":"file:dodi-smart-nuki-graphql-api-1.1.1.tgz","_nodeVersion":"18.12.1","_npmVersion":"9.6.0","dist":{"integrity":"sha512-eaYwRkxGbUtgvg0Thy+wmlllucGxfh4cddZjIN+UBWDbmGy8A/7giYjhPpyUIPvnBZZByM+YVW1MvX5BmlcdPw==","shasum":"13fb2e3d02b99ec5d7f7840bf59371d4e620e701","tarball":"https://registry.npmjs.org/@dodi-smart/nuki-graphql-api/-/nuki-graphql-api-1.1.2.tgz","fileCount":823,"unpackedSize":602059,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGe1xDKKCU+boz6m9cVbDYmLfnVWDq7pd65bhM1wWcdKAiEAiyz5+hTisDOYsCIunV8JGynX2UKDfBM7lH28hN6MB3g="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCjNtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3Ww/+LRq1GEzo7igNugcOdRsTHhXswYGiD6AgG1EJTFmVYdkuGQiw\r\nSlrqHeXc5bA89/tDcYAeAR8pyXvc3uIp5i7OsR2ajnnnowYTYkuSpxtLgfrO\r\nQ0N7A8SeIL+z9BEKS4aQ2dRF+3tij4gdG/cizvazAi6V6LLcmYwGkZODN7Ck\r\nPnJgT1Hx/2tZvAeOjZacq92Xfs07X2djLQsR5gRrwdjxkA4P4juneR3NcDaa\r\nNmocW7tz5Z4ppDBs2LDnhyFXfV9s8Nr/H1IEIIZr86myQSuhjKVnsF8SqP9o\r\nwiAqQpseofdpHrhmkw3WDJbePadg5Yd5SQPb2RzdeRd6Ptnc/9j3I9TBWa+3\r\n9hJc3RWE7SErMuSiVqixghSeyAT5qDAG/nSVPqj0xHh3J5dlZlbxe/TvD3oh\r\nJbqA98qSzFXDzuZCfedbN1aRlnJ3uNYh0dq+a4MUXCrBM8F2zdceQAY+ovHk\r\nkDi35N+GFydrxSFTCmYWxtQlnwIQBZUBE1oopQzQ2NroOlBjMJrutmbokCR4\r\nBRSPZtI960LntEQkRhieJKCnsaCWfYM3THLMplb7idhRC0IV0PYrKOalYIs2\r\nN3j1LsA/2FYX1ZYECb35vD3Qndh+187SGPBVVCuurFLl7I/K4QeglMbioVNu\r\nQ6Dz3mOxd9PSxdo/BkW9KCnRstlEHpn9ETs=\r\n=yggr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vokela","email":"asenlekoff@gmail.com"},"directories":{},"maintainers":[{"name":"vokela","email":"asenlekoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nuki-graphql-api_1.1.2_1678390124961_0.30206739617477885"},"_hasShrinkwrap":false},"1.2.0":{"name":"@dodi-smart/nuki-graphql-api","version":"1.2.0","description":"Nuki GraphQL API","license":"MIT","keywords":["nuki","smartlocks","graphql","api","nhost","hasura","dodi","bridge"],"author":{"name":"Asen Lekov"},"homepage":"https://dodi.li","bugs":{"url":"https://github.com/dodi-smart/nuki-graphql-api/issues"},"repository":{"type":"git","url":"git+https://github.com/dodi-smart/nuki-graphql-api.git"},"main":"dist/index.js","types":"dist/index.d.ts","source":"src/index.ts","publishConfig":{"access":"public"},"dependencies":{"@pothos/core":"^3.29.0","abort-controller":"3.0.0","form-data":"4.0.0","graphql":"16.6.0","graphql-scalars":"^1.21.3","graphql-yoga":"^3.9.0","jsonwebtoken":"^8.5.1","node-fetch":"2.6.7","winston":"^3.8.2"},"devDependencies":{"@trivago/prettier-plugin-sort-imports":"^3.4.0","@types/express":"^4.17.17","@types/jsonwebtoken":"^8.5.9","@types/node":"^18.15.11","@types/node-fetch":"2.6.2","@typescript-eslint/eslint-plugin":"^5.58.0","@typescript-eslint/parser":"^5.58.0","dotenv":"^16.0.3","eslint":"^8.38.0","eslint-plugin-import":"^2.27.5","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^6.1.1","eslint-plugin-simple-import-sort":"^8.0.0","express":"^4.18.2","npm-run-all":"^4.1.5","openapi-typescript-codegen":"^0.23.0","prettier":"^2.8.7","ts-node-dev":"^2.0.0","typescript":"^4.9.5"},"resolutions":{"graphql":"16.6.0"},"packageManager":"pnpm@7.21.0","engines":{"node":">=14 <=18","pnpm":">=7.21.0"},"scripts":{"preinstall":"npx only-allow pnpm","dev":"NODE_ENV=development ts-node-dev -r dotenv/config dev/server.ts","build":"tsc","prettier":"prettier --check src/","prettier:fix":"prettier --write src/","lint":"eslint . --ext .ts,.tsx","lint:fix":"eslint . --ext .ts,.tsx --fix","openapi:generate":"openapi -c node -o src/api -i nuki.yaml --name NukiClient","verify":"run-p prettier lint","verify:fix":"run-p prettier:fix lint:fix"},"_id":"@dodi-smart/nuki-graphql-api@1.2.0","_integrity":"sha512-bAv4YTRGCvTZZiOOfd0zg6C/xSR30NN078ER9tQtQYprS08b8Gem5iMCExfVgmyechjtZErqjAAAo6F3avpI+A==","_resolved":"/private/var/folders/1h/lb_36jjd5y14bft3nwbr0w480000gn/T/4930287992737f825ab5f1a0f1986382/dodi-smart-nuki-graphql-api-1.1.2.tgz","_from":"file:dodi-smart-nuki-graphql-api-1.1.2.tgz","_nodeVersion":"18.12.1","_npmVersion":"9.6.4","dist":{"integrity":"sha512-bAv4YTRGCvTZZiOOfd0zg6C/xSR30NN078ER9tQtQYprS08b8Gem5iMCExfVgmyechjtZErqjAAAo6F3avpI+A==","shasum":"eb645c29584e382996abaeb88453ec897eacb016","tarball":"https://registry.npmjs.org/@dodi-smart/nuki-graphql-api/-/nuki-graphql-api-1.2.0.tgz","fileCount":831,"unpackedSize":625895,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3svQg1m/HFMaCMKnEMb/lcRCbs2BA300F71+AGbw/YAIhAMeBGYwHf/e45HBpi7zwHLVpYhxYpjIha3LoO3nC+nTj"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOwuRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq5uQ/7BoiYDOc0JtnTEO5nXtXJ+EeAQA3GmbvLEPM6ZjRlqMLyPueY\r\ncfsfRqzfG5Y4w6Xlm4awhdQ6T5f5NZ0w3S7U8L+VClecqBQ0qI9rK547F9k+\r\no4OPDA3skBDwmjGHddNFULBqFT5dyi8E6JfDGc8HaxJpc9o38iU5SXynus75\r\nNfHHSlENjzD/56WEtGXfnfeXNd/opPX4AQOzUF4Kw+xo5fgHQBya5LTOPGc+\r\nR/7ME1E7xs3c4Zlp4WPMkyFE2cNDkatbqO8AGEKeo6V9Q5VLwaVq7mUdyNMo\r\n/59cmyeH2m8SZ4Pmvh9ZE8p+O+TQNzbNMJ0xHqrGl6bcKhiC5wf7UQOu++pp\r\nSwCIHpzGTHYDiTmtaF9S6vC3vdPXhbK/ftzdA5OcSCUqwyTO8MjkcVIPDoid\r\nwPIcme46uSIshY+Ys1iopv8K0H+bjJeM605pAFPaa6DpdMQo4rUSC/hU4bll\r\nfMCDHssiqBOq+7rfimX0RwRY9iEVSwomp7e3kiEERb6vjJ3QRpUDyL5cArS0\r\ncz7TPQnGVnXfVpdrGCSg4ft6j1z3mlph1bwvtAfwOAa051rvf7sG3jze5Cq5\r\nLzX+fmG9fMZMJOhbopmQaT6b1UgAN8csw/mcnfkoMuNbaNmG731ehLQdFFhz\r\ncXhj63Qt0g9SuVsR3gR1n3r3eWAtCJPut+A=\r\n=PaP5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"vokela","email":"asenlekoff@gmail.com"},"directories":{},"maintainers":[{"name":"vokela","email":"asenlekoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nuki-graphql-api_1.2.0_1681591185339_0.00254266983709317"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-27T15:56:29.421Z","1.1.0":"2023-02-27T15:56:29.698Z","modified":"2023-04-15T20:39:45.662Z","1.1.1":"2023-03-08T12:20:55.241Z","1.1.2":"2023-03-09T19:28:45.290Z","1.2.0":"2023-04-15T20:39:45.521Z"},"maintainers":[{"name":"vokela","email":"asenlekoff@gmail.com"}],"description":"Nuki GraphQL API","homepage":"https://dodi.li","keywords":["nuki","smartlocks","graphql","api","nhost","hasura","dodi","bridge"],"repository":{"type":"git","url":"git+https://github.com/dodi-smart/nuki-graphql-api.git"},"author":{"name":"Asen Lekov"},"bugs":{"url":"https://github.com/dodi-smart/nuki-graphql-api/issues"},"license":"MIT","readme":"<p align=\"center\">\n  <img alt=\"nuki\" src=\"https://assets.ifttt.com/images/channels/1521185749/icons/on_color_large.png\" height=\"128px\">\n</p>\n\n<h1 align=\"center\">Nuki GraphQL API</h1>\n<h2 align=\"center\">@dodi-smart/nuki-graphql-api</h2>\n\n<p align=\"center\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/v/@dodi-smart/nuki-graphql-api\">\n  <img alt=\"npm\" src=\"https://img.shields.io/npm/dm/@dodi-smart/nuki-graphql-api\">\n  <img alt=\"NPM\" src=\"https://img.shields.io/npm/l/@dodi-smart/nuki-graphql-api\">\n</p>\n\nThis package creates a Nuki GraphQL API, allowing for interaction with data at Nuki.\n**It is unofficial Nuki GraphQL API generated based on Nuki's Swagger OpenAPI specification,\nmainly configured to be used as Hasura Remote Schema.**\n\nHere's an example of how to use the Nuki GraphQL API to get a list of smart locks of the configured Nuki user:\n\n```graphql\nquery MyLocks {\n  nuki {\n    smartlocks {\n      name\n      smartlockId\n      state {\n        batteryCharge\n        state\n      }\n      firmwareVersion\n      hardwareVersion\n    }\n  }\n}\n```\n\nIt's recommended to add the Nuki GraphQL API as a [Remote Schema](https://hasura.io/docs/latest/remote-schemas/index/) in Hasura and connect data from your database with data in Nuki. By doing so, it's possible to request data from your database and Nuki in a single GraphQL query.\n\nHere's an example of how to use the Nuki GraphQL API to get a list of smart locks for a specific Nuki user. Note that the user data is fetched from your database and the Nuki user data is fetched trough the Nuki API:\n\n```graphql\nquery UsersLocks {\n  users {\n    id\n    displayName\n    nukies {\n      # Remote schema relation in users table\n      name\n      smartlockId\n      state {\n        batteryCharge\n        state\n      }\n      firmwareVersion\n      hardwareVersion\n    }\n  }\n}\n```\n\n## Supported APIs\n\nAPIs can be added upon request. PRs are welcome of course!\n\nhttps://api.nuki.io\n\n| Api                 | Supported | Comment                                   |\n| ------------------- | :-------: | ----------------------------------------- |\n| Account             |    🟠     |                                           |\n| AccountSubscription |    🔴     |                                           |\n| AccountUser         |    🔴     |                                           |\n| Address             |    🔴     |                                           |\n| AddressReservation  |    🔴     |                                           |\n| AddressToken        |    🔴     |                                           |\n| AdvancedApi         |    🟠     |                                           |\n| ApiKey              |    🔴     |                                           |\n| Company             |    🔴     |                                           |\n| Notification        |    🔴     |                                           |\n| Opener              |    🔴     |                                           |\n| Service             |    🔴     |                                           |\n| Smartlock           |    🟠     |                                           |\n| SmartlockAuth       |    🔴     |                                           |\n| SmartlockLog        |    🟢     | Available nested inside `smartlock` query |\n| Subscription        |    🔴     |                                          |\n\n🟢 - Supported\n🟠 - Partial\n🔴 - Not supported\n\n## Getting Started\n\nInstall the package:\n\n```\npnpm add @dodi-smart/nuki-graphql-api\n```\n\n### Setup serverless function\n\nCreate a new [Serverless Function](https://docs.nhost.io/serverless-functions): `functions/graphql/nuki.ts`:\n\n```ts\nimport { createNukiGraphQLServer } from '@dodi-smart/nuki-graphql-api'\n\nconst server = createNukiGraphQLServer({\n  graphiql: true,\n  graphqlEndpoint: '/graphql/nuki',\n  healthCheckEndpoint: '/graphql/nuki/health',\n  provideAuth(context) {\n    return {\n      // Should provide authentication\n    }\n  },\n  onUpdateSession(context, auth) {\n    // Handle session update\n  }\n})\n\nexport default server\n```\n\n### Configure Nuki Web\n\nGo to [Nuki Web](https://web.nuki.io/#/pages/web-api) and obtain OAuth2 API key and secret.\nClick on `Generate API token`, give the token name and check the scopes you want to use. Click save and copy the token value.\n\n- Add `NUKI_CLIENT_ID` as an environment variable.\n- Add `NUKI_CLIENT_SECERT` as an environment variable.\n- Add `NUKI_API_KEY` as an environment variable.\n\nIf you're using Nhost, add `NUKI_CLIENT_ID`, `NUKI_CLIENT_SECERT` and `NUKI_API_KEY` to `.env.development` like this:\n\n```ini\nNUKI_CLIENT_ID=6EYY••••\nNUKI_CLIENT_SECERT=BPum••••\nNUKI_API_KEY=59f6d••••\n```\n\nAnd add the production key values to environment variables in the Nhost dashboard.\n\n### Start Nhost\n\n```sh\nnhost up\n```\n\nLearn more about the [Nhost CLI](https://docs.nhost.io/cli).\n\n### Test\n\nTest the Nuki GraphQL API in the browser:\n\nhttps://local.functions.nhost.run/v1/graphql/nuki\n\n### Remote Schema\n\nAdd the Nuki GraphQL API as a Remote Schema in Hasura.\n\n**URL**\n\n```\n{{NHOST_FUNCTIONS_URL}}/graphql/nuki\n```\n\n**Headers**\n\n```\nx-nhost-webhook-secret: NHOST_WEBHOOK_SECRET (From env var)\n```\n\n> The `NHOST_WEBHOOK_SECRET` is used to verify that the request is coming from Nhost. The environment variable is a [system environment variable](/platform/environment-variables#system-environment-variables) and is always available.\n\n## Authentication\n\nYou have several options to authentication your users agains Nuki using this library. All of them depends on the usecase:\n\n**Single user usecase (easy to setup)**\n\nWhen the system should work with the locks of a single user (administrator). Permissions and access to the locks are granted to others users via the administrator\nor using Hasura user roles.\n\n**Multi user usecase (advanced)**\n\nWhen system work with locks of multiple users. Each user can authenticate against Nuki using their own credentials via OAuth 2.0.\nThis usecase can be used for multi tenant apps for example.\n\n### How to choose\n\n| Use case    | Using API_KEY (easy) | OAuth 2.0 (advanced) | OAuth 2.0 + ApiKeyToken (advanced) |\n| ----------- | :------------------: | :------------------: | :--------------------------------: |\n| Single user |          🟢          |          🟠          |                 🟠                 |\n| Multi user  |          🔴          |          🟠          |                 🟢                 |\n\n🟢 - Preferable way\n🟠 - Supported\n🔴 - Not supported\n\n### Using API_KEY\n\nGo to [Nuki Web](https://web.nuki.io/#/pages/web-api) and click on API on side navigation\n\nClick on `Generate API token`, give the token name and check the scopes you want to use. Click save and copy the token value.\n`ApiKeyToken` is long-living token and does not require refresh.\n\n- Add `NUKI_API_KEY` as an environment variable.\n\nIf you're using Nhost, add `NUKI_API_KEY` to `.env.development` like this:\n\n```ini\nNUKI_API_KEY=59f6d••••\n```\n\nAnd add the production key values to environment variables in the Nhost dashboard.\n\n#### (Optional) Modify Remote Schema\n\nIf you need to pass the API key from Hasura instead of having it as environment variable, then:\n\nAdd to the Hasura Remote Schema the API Key\n\n```\nx-nuki-api-key: NUKI_API_KEY (From env var)\n```\n\nThe environment variable is a [system environment variable](/platform/environment-variables#system-environment-variables) and is always available.\n\n#### Configure the Nuki GraphQL API\n\n```ts\nimport { createNukiGraphQLServer } from '@dodi-smart/nuki-graphql-api'\n\nconst server = createNukiGraphQLServer({\n  graphqlEndpoint: '/graphql/nuki',\n  healthCheckEndpoint: '/graphql/nuki/health',\n  provideAuth(context) {\n    const { request } = context\n    return {\n      // Is enough to pass just the accessToken\n      accessToken: request.headers.get('x-nuki-api-key')\n    }\n  },\n  onUpdateSession(context, auth) {\n    // Can be empty as NUKI_API_KEY are long-living tokens\n  }\n})\n\nexport default server\n```\n\n### OAuth 2.0\n\nGo to [Nuki Web](https://web.nuki.io/#/pages/web-api) and click on API on side navigation\n\nPoint OAuth2 Redirect URL to a Nhost serverless function:\n\n```\nhttps://local.functions.nhost.run/v1/callback/nuki\n```\n\n#### Use callback helper function to get session\n\nCreate a new [Serverless Function](https://docs.nhost.io/serverless-functions): `functions/callback/nuki.ts`:\n\n```ts\nimport { createNukiOAuthCallback } from '@dodi-smart/nuki-graphql-api'\n\nconst handler = (req, res) => {\n  const {userId, accessToken, refreshToken} = createNukiOAuthCallback(req, res)\n  await gqlSDK.updateUserNukiAuth({\n    id: userId,\n    accessToken,\n    refreshToken\n  })\n}\n\nexport default handler\n```\n\n#### Configure the Nuki GraphQL API\n\n```ts\nimport { createNukiGraphQLServer } from '@dodi-smart/nuki-graphql-api'\n\nconst server = createNukiGraphQLServer({\n  graphqlEndpoint: '/graphql/nuki',\n  healthCheckEndpoint: '/graphql/nuki/health',\n  provideAuth(context) {\n    const { userClaims } = context\n\n    const { user } = await gqlSDK.getUser({\n      id: userId\n    })\n\n    return {\n      // Example if nuki creds are saved in user's metadata, can differ\n      accessToken: user.metadata.nukiAccessToken,\n      refreshToken: user.metadata.nukiRefreshToken,\n    }\n  },\n  onUpdateSession(context, auth) {\n    const { userClaims } = context\n    const { accessToken, refreshToken } = auth\n\n    await gqlSDK.updateUserNukiAuth({\n      id: userId,\n      accessToken,\n      refreshToken\n    })\n  }\n})\n\nexport default server\n```\n\n### OAuth 2.0 + ApiKeyToken creation\n\nThis is very similar to previous option with the different that after first login,\nan `ApiKeyToken` is automatically created and can be used instead of refreshing user session.\n`ApiKeyToken` is long-living token and does not require refresh or anything.\n\nGo to [Nuki Web](https://web.nuki.io/#/pages/web-api) and click on API on side navigation\n\nPoint OAuth2 Redirect URL to a Nhost serverless function:\n\n```\nhttps://local.functions.nhost.run/v1/callback/nuki\n```\n\n#### (Optional) Enable key creation via env\n\nApi key creation can be enabled via environment variable or via code. If you like to use env variable follow the steps below,\nskip the section and check how to enable it via the function code.\n\n- Add `NUKI_API_KEY_CREATE` as an environment variable.\n\nIf you're using Nhost, add `NUKI_API_KEY_CREATE` to `.env.development` like this:\n\n```ini\nNUKI_API_KEY_CREATE=true\n```\n\n#### Create API token using the callback\n\nCreate a new [Serverless Function](https://docs.nhost.io/serverless-functions): `functions/callback/nuki.ts`:\n\n```ts\nimport { createNukiOAuthCallback } from '@dodi-smart/nuki-graphql-api'\n\nconst handler = (req, res) => {\n  const {userId, apiKeyToken} = createNukiOAuthCallback(req, res, true)\n  await gqlSDK.updateUserNukiAuth({\n    id: userId,\n    apiKey: apiKeyToken\n  })\n}\n\nexport default handler\n```\n\n#### Configure the Nuki GraphQL API\n\n```ts\nimport { createNukiGraphQLServer } from '@dodi-smart/nuki-graphql-api'\n\nconst server = createNukiGraphQLServer({\n  graphqlEndpoint: '/graphql/nuki',\n  healthCheckEndpoint: '/graphql/nuki/health',\n  provideAuth(context) {\n    const { userClaims } = context\n\n    const { user } = await gqlSDK.getUser({\n      id: userId\n    })\n\n    return {\n      // Example if nukiApiKey is saved in user's metadata, can differ\n      accessToken: user.metadata.nukiApiKey,\n    }\n  },\n  onUpdateSession(context, auth) {\n    // Can be empty as API Keys are long-living tokens\n  }\n})\n\nexport default server\n```\n\n## Permissions\n\nHere's a minimal example without any custom permissions. Only requests using the `x-hasura-admin-secret` header will work:\n\n```ts\nimport { createNukiGraphQLServer } from '@dodi-smart/nuki-graphql-api'\n\nconst server = createNukiGraphQLServer({\n  graphqlEndpoint: '/graphql/nuki',\n  healthCheckEndpoint: '/graphql/nuki/health',\n  provideAuth(context) {\n    /* ... */\n  },\n  onUpdateSession(context, auth) {\n    /* ... */\n  }\n})\n\nexport default server\n```\n\nFor more granular permissions, you can pass an `isAllowed` function to the `createNukiGraphQLServer`. The `isAllowed` function takes a [`context`](#context) as parameter and runs every time the GraphQL server makes a request to Nuki to get or modify data for a specific Nuki user.\n\nHere is an example of an `isAllowed` function:\n\n```ts\nimport { createNukiGraphQLServer } from '@dodi-smart/nuki-graphql-api';\n\nconst isAllowed = (context: Context) => {\n  const { isAdmin, userClaims } = context\n\n  // allow all requests if they have a valid `x-hasura-admin-secret`\n  if (isAdmin) {\n    return true\n  }\n\n  // get user id\n  const userId = userClaims['x-hasura-user-id']\n\n  // check if the user is signed in\n  if (!userId) {\n    return false\n  }\n\n  // get more user information from the database\n  const { user } = await gqlSDK.getUser({\n    id: userId\n  })\n\n  if (!user) {\n    return false\n  }\n\n  // other checks\n}\n\nconst server = createNukiGraphQLServer({\n  graphqlEndpoint: '/graphql/nuki',\n  healthCheckEndpoint: '/graphql/nuki/health',\n  isAllowed,\n  provideAuth(context) {\n    /* ... */\n  },\n  onUpdateSession(context, auth) {\n    /* ... */\n  }\n});\n\nexport default server;\n```\n\n### Context\n\nThe `context` object contains:\n\n- `userClaims` - verified JWT claims from the user's access token.\n- `isAdmin` - `true` if the request was made using a valid `x-hasura-admin-secret` header.\n- `request` - [Fetch API Request object](https://developer.mozilla.org/en-US/docs/Web/API/Request) that represents the incoming HTTP request in platform-independent way. It can be useful for accessing headers to authenticate a user\n- `query` - the DocumentNode that was parsed from the GraphQL query string\n- `operationName` - the operation name selected from the incoming query\n- `variables` - the variables that were defined in the query\n- `extensions` - the extensions that were received from the client\n\nRead more about the [default context from GraphQL Yoga](https://www.the-guild.dev/graphql/yoga-server/docs/features/context#default-context).\n","readmeFilename":"README.md"}