{"_id":"@aquilacms/storefront-data-hooks","_rev":"9-c411b743befa931abf8edbae45840899","name":"@aquilacms/storefront-data-hooks","dist-tags":{"latest":"1.0.8"},"versions":{"1.0.0":{"name":"@aquilacms/storefront-data-hooks","version":"1.0.0","description":"Next.js Commerce Framework","main":"index.js","scripts":{"clean":"rimraf *.js *.d.ts api cart commerce products scripts wishlist","clean:install":"rimraf node_modules yarn.lock && yarn install","build":"npm run clean && tsc && cp src/schema.d.ts schema.d.ts","lint":"eslint . --quiet --ext .js,.ts,.tsx","lint:fix":"eslint . --quiet --fix --ext .js,.ts,.tsx"},"repository":{"type":"git","url":"git+https://github.com/aquilacms/storefront-data-hooks.git"},"keywords":["nextjs","commerce"],"author":"","license":"MIT","bugs":{"url":"https://github.com/aquilacms/storefront-data-hooks/issues"},"homepage":"https://github.com/aquilacms/storefront-data-hooks#readme","dependencies":{"@vercel/fetch":"6.1.0","cookie":"0.4.1","js-cookie":"2.2.1","lodash.debounce":"4.0.8","swr":"0.3.11"},"devDependencies":{"@manifoldco/swagger-to-ts":"^2.1.0","@types/cookie":"^0.4.0","@types/js-cookie":"^2.2.6","@types/lodash.debounce":"^4.0.6","@types/node":"^14.14.20","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.12.0","@typescript-eslint/parser":"^4.12.0","eslint":"^7.17.0","husky":"^4.3.7","lint-staged":"^10.5.3","next":"^10.0.4","rimraf":"^3.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,tsx}":["eslint --fix"]},"gitHead":"43fa5d9e963744b573270c5467d1250400b0fa12","_id":"@aquilacms/storefront-data-hooks@1.0.0","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NADYornc0OR6ipGedYtk+vP6bAxhi4C8nI/k2xUNaBnNe6aStRJc9fvJmGqua6xu7zuIxw1w7o5M2YDyGv6I7g==","shasum":"d0564509ab0f742594ec540121c209dfc645ff13","tarball":"https://registry.npmjs.org/@aquilacms/storefront-data-hooks/-/storefront-data-hooks-1.0.0.tgz","fileCount":175,"unpackedSize":514009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/kasCRA9TVsSAnZWagAA0+gP/3TyB+gcHWQVBkdXemVR\nUeTRk/Lanqo5B3yrus0gqw6v4e3Ss07LTXX80L7y3RUfWUQMinEmWNZzLiF+\n0Hl7ZpCRdiM5Hri6xLTPQ5hx7C2SyKjbmUSEZnuvJuy4hdzNv9xToWRikljb\nSylUYeuVNs0orAY73w6OKOmXf9eZNgTIiEVJwxko/7aa77zjlLRFfIT4wpEK\nfRbEaND/pRcrnY+xE5eITv9gD4n6laDi9f8hzCkIXHBjSchy88R367VUkq4K\npHbX6YXJRdUNuB9krSpKuXbJldcfP0ayOjcoNSDONNQ1KCfHD7cmEqqBxqni\nJutLHDI5wxCXYctBEd2vfi36teihDPabLUP1x/zGb3S/CYF9bR7xMcBrAxKW\nM7J2y1Bh+UOm7U2uWW9sJ9jTcqIbU8V8ux0niwfseprzGKmfmxTUyp5ReHsW\no+tO+fKmrxofWQQ3/VhegQxCCoxcwcfsr3CEte79yI9+vIhyn6mroEjQMSxj\nFuFONx+OSgJmVt0TzvgHZitgOULkEkRazB3Niik/doJ4EaTMS9/O5c6o6Hsm\nNDlx6cTjicAVLmrKp3m9u2Cn73vrhd3miwXl29CalTy77v6vXwivNDz0KhV3\nHXUdW3DqOMqtIWFEvzCecqaEVgpVwkxIVHFtQQSxxEIG1mmhlpJFueOgzJll\nfwft\r\n=1LJL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDw5mSIZdPb1y4F1Xw6Ahm2vWgSGC/qL4ZkEcMmMaOdgAIhAN7UyWo2uGCSk2AyL2DUA2340pmQLacppeyfYQGYIMiV"}]},"_npmUser":{"name":"nextsourcia","email":"contact@nextsourcia.com"},"directories":{},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storefront-data-hooks_1.0.0_1610499756060_0.18761749440857267"},"_hasShrinkwrap":false},"1.0.1":{"name":"@aquilacms/storefront-data-hooks","version":"1.0.1","description":"Next.js Commerce Framework","main":"index.js","scripts":{"clean":"rimraf *.js *.d.ts api cart commerce products scripts wishlist","clean:install":"rimraf node_modules yarn.lock && yarn install","build":"npm run clean && tsc && cp src/schema.d.ts schema.d.ts","lint":"eslint . --quiet --ext .js,.ts,.tsx","lint:fix":"eslint . --quiet --fix --ext .js,.ts,.tsx"},"repository":{"type":"git","url":"git+https://github.com/aquilacms/storefront-data-hooks.git"},"keywords":["nextjs","commerce"],"author":"","license":"MIT","bugs":{"url":"https://github.com/aquilacms/storefront-data-hooks/issues"},"homepage":"https://github.com/aquilacms/storefront-data-hooks#readme","dependencies":{"@vercel/fetch":"6.1.0","cookie":"0.4.1","js-cookie":"2.2.1","lodash.debounce":"4.0.8","swr":"0.3.11"},"devDependencies":{"@manifoldco/swagger-to-ts":"^2.1.0","@types/cookie":"^0.4.0","@types/js-cookie":"^2.2.6","@types/lodash.debounce":"^4.0.6","@types/node":"^14.14.20","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.12.0","@typescript-eslint/parser":"^4.12.0","eslint":"^7.17.0","husky":"^4.3.7","lint-staged":"^10.5.3","next":"^10.0.4","rimraf":"^3.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,tsx}":["eslint --fix"]},"gitHead":"e195f0bf8016a0a91e5eb258abfb44fde10fa1a9","_id":"@aquilacms/storefront-data-hooks@1.0.1","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-enputNAnte5k7nfEOjMjP5bUqNY9/M0Sehi8if+j6EnQPk5/sM3GrSngrJ7BOFtD9BGzlzXTp4AmOd5eSFU/lQ==","shasum":"d7a1d5cb47a7b16d855d9312b7821451d914f8c3","tarball":"https://registry.npmjs.org/@aquilacms/storefront-data-hooks/-/storefront-data-hooks-1.0.1.tgz","fileCount":175,"unpackedSize":513584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/r5vCRA9TVsSAnZWagAACwIQAJw3j1HQpnQim6amZNeH\nrmfqN5Shhjsyu2VTpq/ts9Y02GT/frqjDPmSrmjWAqk/A7fTWrTBvKtNkC4+\nggiyxgXCf4rvDFiuKZ/Toy1LSuRFutJt11wbr82r5FFEUV0JOIRgAaWKNjcQ\ntesG/nYuAvMlLnccKZU+VRd+aOyp+g89MXo/dLssk1MqpckUuxQeOdH/Z44G\n1mbd2F7JohkqYIWLIIGfjdQNJAj0mFzwT8tbBfc1tAN4jRXCanJhNB3gwHJT\nGG8O13nVQvTTwJ7qh1nefpWlKNUz1ct6EUDDX8BP+aLAtKSgFfk7aBEP0vxR\nR7FfIhHf++VdECxgoBxQFO3QHJXHjAhFpzvQZxoxinVfGx7702kZvS6zHsx8\nSRQsVl+BWYpU+gWLmiu0JFdtQdWu+sxDVpY6eIbWyPY3Tb48kpv7fsizNlcn\nRqprm0gldCalH4CzHV9/1EXZ7uT9bhIVk7Rkyy516kYWo1rrVN7Q8EDPo4MI\nObcjhz9Hl+fXlvSJwxlp91MsSjgKnoB+orm3cPE0GM722d1YHLxd1Q9R6U2E\nz4UB6ra9KijFVKnZL24ie27coroyUuWluFu536624m2THs7sPkicWwlmkWfJ\nKhYOMuRLGuub+cFTh61WgRBL2f2r2/lfoMA7gktbX28ulV5dpA9ZiY0ppTSr\nUvqn\r\n=/g+C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF/nCAt2qx1WKVOErl1WNjQGSHKis6HK7BBVyc/OfjK+AiEAweYhuawBLatmfO66hZZ1odpvVC+lHHz0n/D5inUpGpM="}]},"_npmUser":{"name":"nextsourcia","email":"contact@nextsourcia.com"},"directories":{},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storefront-data-hooks_1.0.1_1610530414772_0.3534907160265681"},"_hasShrinkwrap":false},"1.0.2":{"name":"@aquilacms/storefront-data-hooks","version":"1.0.2","description":"Next.js Commerce Framework","main":"index.js","scripts":{"clean":"rimraf *.js *.d.ts api cart commerce products scripts wishlist","clean:install":"rimraf node_modules yarn.lock && yarn install","build":"npm run clean && tsc && cp src/schema.d.ts schema.d.ts","lint":"eslint . --quiet --ext .js,.ts,.tsx","lint:fix":"eslint . --quiet --fix --ext .js,.ts,.tsx"},"repository":{"type":"git","url":"git+https://github.com/aquilacms/storefront-data-hooks.git"},"keywords":["nextjs","commerce"],"author":{},"license":"MIT","bugs":{"url":"https://github.com/aquilacms/storefront-data-hooks/issues"},"homepage":"https://github.com/aquilacms/storefront-data-hooks#readme","dependencies":{"@vercel/fetch":"6.1.0","cookie":"0.4.1","js-cookie":"2.2.1","lodash.debounce":"4.0.8","swr":"0.3.11"},"devDependencies":{"@manifoldco/swagger-to-ts":"^2.1.0","@types/cookie":"^0.4.0","@types/js-cookie":"^2.2.6","@types/lodash.debounce":"^4.0.6","@types/node":"^14.14.20","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.12.0","@typescript-eslint/parser":"^4.12.0","eslint":"^7.17.0","husky":"^4.3.7","lint-staged":"^10.5.3","next":"^10.0.4","rimraf":"^3.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,tsx}":["eslint --fix"]},"_id":"@aquilacms/storefront-data-hooks@1.0.2","dist":{"shasum":"38a36b26dbf06db93750ecb0d27d3e567d07516b","integrity":"sha512-27IJFZwi24jbtDxqf82jRgxEFA/1j5Vgy3pkypa02e1jk9Goy7ESdsHsmRCjk1+VJ3EGtM2Ap5dDU6wK4Oa9sw==","tarball":"https://registry.npmjs.org/@aquilacms/storefront-data-hooks/-/storefront-data-hooks-1.0.2.tgz","fileCount":199,"unpackedSize":513653,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/sgbCRA9TVsSAnZWagAAxN4QAJBcb/kJFTmiGiazQhlx\nxxb34au++cmsjTgF0xaw9AngTEp9YH5ghdOiF9lD4ih5AIO/7ljBNYRYyhYm\nstzLGcjaEFW8YfMMTTpqmrqYrlgEQcU0HQRRsYmGOMH6VX+8EDpTt5aM3vDJ\nH7sO/TkSonQgQr4/VJErA71Kn5KJVkE52hyUz/tMlkAArO8zy2Cid0T1nrVO\nDDrMDfSTzlTmh2yLrEwdsYfLPsXrc6Xrfk8mcA3GXBMvyWdVaUKtaZVco6Cb\ntSMIS/3haznBE2p3FecUCrSYdPuOFNvCUlr1QbotFpp2/4FRLPTpfe5cu/Hx\nmCfkjhlruf/duWmTVmqbYs4iOiKLGdEyl7k2okBqAChFdVaTmF0GeWJS3BDO\niT+gMh3C+hxYiLN9OzfByilr8wlfTxfJuIyBsULa4JvZcH3NeviLovhxDBQg\n7owKExxGrHsd/Y/+C3b20uca4SvXeuJ5WHgCaEE1kGjO/F95VgVwYjzth1Ht\nTlCebxZC40aPxjxvQ4QfioqBWDVCnrNaz1yenUcCzJoSQua10UpUhOEw67eU\nZf6XZQYts0hx7XFZpVd/UtrsA6I9lJALdrFq35PMHEU0fBLsPcUIHHA9cfAg\n9RTuKtKQPXNP2VlIgBa0j0DNpJaS145Y4k6A1dqvEaOxNh8SLvJdmVAvSwHF\n60iA\r\n=Conl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKHPEdbpIJ/ueVhIv8p+sJRo2svWwLhjWrEj80Q2aTmAIhANAU1xUmMbvPAs4jX6aClngaAs2gwlRid6T08luk/hYQ"}]},"_npmUser":{"name":"nextsourcia","email":"contact@nextsourcia.com"},"directories":{},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storefront-data-hooks_1.0.2_1610532891296_0.49408292394047293"},"_hasShrinkwrap":false},"1.0.3":{"name":"@aquilacms/storefront-data-hooks","version":"1.0.3","description":"Next.js Commerce Framework","main":"index.js","scripts":{"clean":"rimraf *.js *.d.ts api cart commerce products scripts wishlist","clean:install":"rimraf node_modules yarn.lock && yarn install","build":"npm run clean && tsc && cp src/schema.d.ts schema.d.ts","lint":"eslint . --quiet --ext .js,.ts,.tsx","lint:fix":"eslint . --quiet --fix --ext .js,.ts,.tsx"},"repository":{"type":"git","url":"git+https://github.com/aquilacms/storefront-data-hooks.git"},"keywords":["nextjs","commerce"],"author":{},"license":"MIT","bugs":{"url":"https://github.com/aquilacms/storefront-data-hooks/issues"},"homepage":"https://github.com/aquilacms/storefront-data-hooks#readme","dependencies":{"@vercel/fetch":"6.1.0","cookie":"0.4.1","js-cookie":"2.2.1","lodash.debounce":"4.0.8","swr":"0.3.11"},"devDependencies":{"@manifoldco/swagger-to-ts":"^2.1.0","@types/cookie":"^0.4.0","@types/js-cookie":"^2.2.6","@types/lodash.debounce":"^4.0.6","@types/node":"^14.14.20","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.12.0","@typescript-eslint/parser":"^4.12.0","eslint":"^7.17.0","husky":"^4.3.7","lint-staged":"^10.5.3","next":"^10.0.4","rimraf":"^3.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,tsx}":["eslint --fix"]},"_id":"@aquilacms/storefront-data-hooks@1.0.3","dist":{"shasum":"5710a8233d31b8c7272c4387af9363212307ad5e","integrity":"sha512-e8TfWUNCuNzDT4xagKl79AtArvIdeS+cHNw/6yEST81MJP4QQn/qfr4Ik6zxw8JaU/aXK1miHVtB64OB13Lzxg==","tarball":"https://registry.npmjs.org/@aquilacms/storefront-data-hooks/-/storefront-data-hooks-1.0.3.tgz","fileCount":199,"unpackedSize":513653,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/svjCRA9TVsSAnZWagAAMyMP+QHVZ1PsbS8dqzX3OBCh\nPaLqOLsd9NvhBfKyQbCO/UBdwPO6HcbF2bLSQKqRcKn/VEBkvHEbsz5mkIkD\nAt4VpV5v63zw/NYz1rUh0NA6E/G7KiJnexCnDBK0F+B05gweaBOHVcdocWMe\nhUXllyKMvyjHVfECWp7BLoqdYJJeBHpx6jgV/qDjbjXden3LtxNC2atRAXJ4\nO/9aQUcxtLgiZAyRYcxJC8r2oGntM/DaHvvMVKRGjGimj0xzUdi78tRMeWxp\niZokOQ+gxHG5k4Xpklt5U7oUlmPJRWo5k/dIIqUzGtGLEIzh65GGaDMHPsWm\nm4o9UMcDS98SZ9lcSVWeDHY2iHtnTZHoegE5abcA+7FUMhMplRZJDfa7mGSV\nfZybuynkWI25PfDBERX3ULmcpj1yeGbppVVZ+toBOiO5KL69UO4CwA1eQSbN\nKwF63YQp1yW1gI0yjvynmqEjPeu71mYuipe4901/1wcaLu7jGSigYCWjxnXX\n8pRQaiSjmx6NzNUFu6UfgiW112YjPudlzCM34goH5n/mvmr8iua55k3S3Hi4\nLbufZ76IGdyMuMhr6IvKOjoVhtkBX4DCdfZxMSzdgpDsMF1raEoMV2EkRdL1\nweRTOSVwya28Y4+2PBUmxJdBYq/bw1IcSDtUoZlBdgJ/xIGhgq87/1lFTImf\nriWT\r\n=rmEK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICbEQ8fZfpQuNwo6vLPpkPiE3Q+7HEPK21ccpAY27lPKAiBrXTALV+q4wpORCbKX1dVQ3rtKrtFjdyjbU2/h9uTvDA=="}]},"_npmUser":{"name":"nextsourcia","email":"contact@nextsourcia.com"},"directories":{},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storefront-data-hooks_1.0.3_1610533858541_0.5556870673085672"},"_hasShrinkwrap":false},"1.0.4":{"name":"@aquilacms/storefront-data-hooks","version":"1.0.4","description":"Next.js Commerce Framework","main":"index.js","scripts":{"clean":"rimraf *.js *.d.ts api cart commerce products scripts wishlist","clean:install":"rimraf node_modules yarn.lock && yarn install","build":"npm run clean && tsc && cp src/schema.d.ts schema.d.ts","lint":"eslint . --quiet --ext .js,.ts,.tsx","lint:fix":"eslint . --quiet --fix --ext .js,.ts,.tsx"},"repository":{"type":"git","url":"git+https://github.com/aquilacms/storefront-data-hooks.git"},"keywords":["nextjs","commerce"],"author":{},"license":"MIT","bugs":{"url":"https://github.com/aquilacms/storefront-data-hooks/issues"},"homepage":"https://github.com/aquilacms/storefront-data-hooks#readme","dependencies":{"@vercel/fetch":"6.1.0","cookie":"0.4.1","js-cookie":"2.2.1","lodash.debounce":"4.0.8","swr":"0.3.11"},"devDependencies":{"@manifoldco/swagger-to-ts":"^2.1.0","@types/cookie":"^0.4.0","@types/js-cookie":"^2.2.6","@types/lodash.debounce":"^4.0.6","@types/node":"^14.14.20","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.12.0","@typescript-eslint/parser":"^4.12.0","eslint":"^7.17.0","husky":"^4.3.7","lint-staged":"^10.5.3","next":"^10.0.4","rimraf":"^3.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,tsx}":["eslint --fix"]},"_id":"@aquilacms/storefront-data-hooks@1.0.4","dist":{"shasum":"cf42889664b311d75ef8f7bbece4c042d2d1bc57","integrity":"sha512-1ebtl+GZ16wVCb64oT6SkWeA/Kziq/i/Wh4n7cc1Q2i3PUQzdclwa/pD1x2RbqYsE9VYIcEpQigwqGTr3rojBQ==","tarball":"https://registry.npmjs.org/@aquilacms/storefront-data-hooks/-/storefront-data-hooks-1.0.4.tgz","fileCount":199,"unpackedSize":514164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/xAkCRA9TVsSAnZWagAAF3kP+gNl02hrPxd51McczEXt\nfVrlIz6hxoyNtoa5/MXzcBT/saLkjVJg4oZcCfPeJ+z4dWQTR71SfoY/1JJM\nHYj36AkdXIwZaHgEEk/sueW76ubOva+H+PYfh162C66VzOG+HUU6K7CSr8er\nNcx4NxQy2sEZSfF/6ItcMn4yFfgklKCQTL8Wq5MnSl1Mq004VZLE7jBQzlIy\n/TCJvkG2hzhfpoHCQeocNDKehgCsZZWPmIncTVASQwj8Z7leaACm5IXgu1zk\nyqAp45KtBFvHDxwGXJjev6HXzqa2HLFPDZ5XKI3/h+pWoKHgQRCgBFBB6Yph\ncEifiI8B6GZkCAgI/oJMGLuqmzUm3fr+oqnlp+prSfmVqVUpoFgjwKXn2mDu\nyQ2ojwR9jAnfyJQjW2nb7yOarcvNi8V096cHY7z4v5WHp10u/s9Bq8arRQTU\nfOb7+/kvHJEztshpIzkRsl6A5lBcAUj63MVYPFEclg6nRVwO9pU3Gn9YjGK1\nm9XrkJ6cokZnq04YJUhUr7+4Fe1lKgwJ8CEeYIfPxgK4imhalXP0pghmNCw7\nYkPXvs303+UV+bD+6wMcLUxiRanboje+eZfO0+PTB+LtRKfnx8AY0gzfmt4+\nvSbZ6E3sCfOWcK4FyjmLOfBesbjVPK3PhwX0b+82lFSfGE6RmdSROHFj3uJN\nKI0n\r\n=M8Ja\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGJOm8tDvhT0p8C/K3WopEk9rIhjyiujz3sJwYi3yEdeAiEA+1lKX4Y1T93e3npGFYTW80HyHHVEoClJ+9p5ccZLcD0="}]},"_npmUser":{"name":"nextsourcia","email":"contact@nextsourcia.com"},"directories":{},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storefront-data-hooks_1.0.4_1610551332464_0.4072556333053714"},"_hasShrinkwrap":false},"1.0.5":{"name":"@aquilacms/storefront-data-hooks","version":"1.0.5","description":"Next.js Commerce Framework","main":"index.js","scripts":{"clean":"rimraf *.js *.d.ts api cart commerce products scripts wishlist","clean:install":"rimraf node_modules yarn.lock && yarn install","build":"npm run clean && tsc && cp src/schema.d.ts schema.d.ts","lint":"eslint . --quiet --ext .js,.ts,.tsx","lint:fix":"eslint . --quiet --fix --ext .js,.ts,.tsx"},"repository":{"type":"git","url":"git+https://github.com/aquilacms/storefront-data-hooks.git"},"keywords":["nextjs","commerce"],"author":{},"license":"MIT","bugs":{"url":"https://github.com/aquilacms/storefront-data-hooks/issues"},"homepage":"https://github.com/aquilacms/storefront-data-hooks#readme","dependencies":{"@vercel/fetch":"6.1.0","cookie":"0.4.1","js-cookie":"2.2.1","lodash.debounce":"4.0.8","swr":"0.3.11"},"devDependencies":{"@manifoldco/swagger-to-ts":"^2.1.0","@types/cookie":"^0.4.0","@types/js-cookie":"^2.2.6","@types/lodash.debounce":"^4.0.6","@types/node":"^14.14.20","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.12.0","@typescript-eslint/parser":"^4.12.0","eslint":"^7.17.0","husky":"^4.3.7","lint-staged":"^10.5.3","next":"^10.0.4","rimraf":"^3.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,tsx}":["eslint --fix"]},"_id":"@aquilacms/storefront-data-hooks@1.0.5","dist":{"shasum":"59c15ebaed336834ef685d9f1a1752af07777237","integrity":"sha512-TuXrL49gwIyOcWAX7FHCdtJbfyf/80eoSRAOjA6cwtf1cnCgAlYE9t+FlnatjvcQKq+sdSJJRgTKwoqzcCxvMA==","tarball":"https://registry.npmjs.org/@aquilacms/storefront-data-hooks/-/storefront-data-hooks-1.0.5.tgz","fileCount":199,"unpackedSize":513973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgACDwCRA9TVsSAnZWagAAOxcQAIvONzyeZQX47oW+HSRx\nBGItf6BdkFQPAXCYk58D/7N8n+YekLLO6aQn3isdXkG35GcqQXBiVS4UD79d\nVtjOM2hz8HqOGQLbzBSBCQpqHpQHAZJbQV+a6cK9BTt6wgoHriQwfJFUcZhR\nj0YPBQtE35ZaBjrRWCxwIGGxJ4HVVo2LnTpAFZjETj19ZmWz/ijFlwcicHte\nZLm3VY1twy38RQNhcSlhfKwp+ISw5MA4lmpoERNT94XB7PFfM6nZ1Udyo75p\nFYJMKhMNH3GTg8Ihr8nHleYHiIpPoVNUCcmrnL6IJIUUIDR1Cr9q+Qxo1HgO\ng5Q9QNplXGdWH7dB3k1YuMD/cwWNajoghU8tYhU5LRpbt3uUVmppgU28o5L1\nt8RAEbFfQJ/7uazW81Nt3gUTLHPW/gaSjo/51M5iHyIUw4qjxwY1JD3u76Hh\ng4s/dsU6I+6K5Qqi82O5nlhaeb4ZOPwbqxEE4fe3ak4xTa8Ojb/AZaMAo0Cz\nEtWDFpVOLN2BclKOPnLpR4oP5GW0B2+ztyzGtBR2Wrq2i48vQ1z487LuxmWp\nCX2KO3C47eyq9l0gD4yW7uWkN0uzuHF2h6XzQBHKWSIgnzf8Njo8FqmMNV7d\npyYeRDXp4inN5mQFcOKhSpzupay2jNXXv3/ZwL+vFRUKUnjYhKOqaizvzmzF\nFNVi\r\n=0o6d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICh6Oi+xeLYu/e3rhZMWB5CfxgOSamMtmPVyCAM3Rxd1AiBvqkc0Z/TIDmCaa92S+ldyXAsImhuH5RWeQJ/Ne6JYrA=="}]},"_npmUser":{"name":"nextsourcia","email":"contact@nextsourcia.com"},"directories":{},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storefront-data-hooks_1.0.5_1610621167964_0.30874825183826293"},"_hasShrinkwrap":false},"1.0.6":{"name":"@aquilacms/storefront-data-hooks","version":"1.0.6","description":"Next.js Commerce Framework","main":"index.js","scripts":{"clean":"rimraf *.js *.d.ts api cart commerce products scripts wishlist","clean:install":"rimraf node_modules yarn.lock && yarn install","build":"npm run clean && tsc && cp src/schema.d.ts schema.d.ts","lint":"eslint . --quiet --ext .js,.ts,.tsx","lint:fix":"eslint . --quiet --fix --ext .js,.ts,.tsx"},"repository":{"type":"git","url":"git+https://github.com/aquilacms/storefront-data-hooks.git"},"keywords":["nextjs","commerce"],"author":{},"license":"MIT","bugs":{"url":"https://github.com/aquilacms/storefront-data-hooks/issues"},"homepage":"https://github.com/aquilacms/storefront-data-hooks#readme","dependencies":{"@vercel/fetch":"6.1.0","cookie":"0.4.1","js-cookie":"2.2.1","lodash.debounce":"4.0.8","swr":"0.3.11"},"devDependencies":{"@manifoldco/swagger-to-ts":"^2.1.0","@types/cookie":"^0.4.0","@types/js-cookie":"^2.2.6","@types/lodash.debounce":"^4.0.6","@types/node":"^14.14.20","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.12.0","@typescript-eslint/parser":"^4.12.0","eslint":"^7.17.0","husky":"^4.3.7","lint-staged":"^10.5.3","next":"^10.0.4","rimraf":"^3.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,tsx}":["eslint --fix"]},"_id":"@aquilacms/storefront-data-hooks@1.0.6","dist":{"shasum":"3a7af605dd830d5e05e73fc581f93316d2dbb20e","integrity":"sha512-Ir/8etS3aApU9Omtqsce4npcsg6HDqE8/hTErhV7mz/x7PH4UQHxkpn4+9Yx1G7B2P7CIl5ZZ5ia2O+jKH5Ijw==","tarball":"https://registry.npmjs.org/@aquilacms/storefront-data-hooks/-/storefront-data-hooks-1.0.6.tgz","fileCount":199,"unpackedSize":514446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgACGlCRA9TVsSAnZWagAAaqYP/1lR1SvL0OsST+58D4AT\nG+QDq52pDD6NQijFMJS0duV9IjIPe7SzB2IMA6uddn0r5Lr7p3l6wM0tuQVt\nbdLZwt2Xx3+CJ/d754n+L4LoCTTUb1opkNwwbvz8O011lPiok1DZFERdIYwy\nv6HXFVu3E1V+SmozdOjEiY6wOr3IVvPRxBZw88zz6HFHPNb+Wcn7APGotcvU\nXBmil+zfkYd68LrRcdJ3YfnpSgA1bwAJdb8LL7p/rAjVihbgjRMbNIvIeMkp\nVhGOCuNMZla9Hr56Jt0be2dhRo8SUbbaa+enTPUUExsaVnJvYCR+egK53ibG\nvXVkqhEmRDEwMloBheQaGaOPKlWui11dx2ilXOQdLLWKi4x0Uqih3TYxJc5z\nBX/+iI/dCiU/IiUZUsNuQaFwmi9hkKW0BOvUtTsNnFnOCa+0eoqiUM0yjM7e\nqWRD8h6s41QA3524UYPXJ1Z1L89xdO7B9j1+Lb8OwkN9KBKe/AWfgHIA8EBQ\nLYMPQBcRTRS4kHVXqkRw8nFAIQfJ37tIwOQgqlTWIV25KMJZLooFOboKq97H\nIRUIE/6Mi/XoVvlNRZZ8edT4bgW86xLxFuTZGEOeROVwI//sQUbOz8/4Zq6n\nT96yXAB4JrF2VqKU6zSv2BUXJ86zSziuGncbU/9xZHDjigJRMJsURA4AP6h6\nCtvG\r\n=gebW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBsp9LeBiL6uiS2KNXysOcvkeM4e8XSy8x6H7M4tyk2bAiACgwAVRVhmv4bXFifz+Rkgud/PG9RNvWNEcmWYDlG5KQ=="}]},"_npmUser":{"name":"nextsourcia","email":"contact@nextsourcia.com"},"directories":{},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storefront-data-hooks_1.0.6_1610621348995_0.09542436049642022"},"_hasShrinkwrap":false},"1.0.7":{"name":"@aquilacms/storefront-data-hooks","version":"1.0.7","description":"Next.js Commerce Framework","main":"index.js","scripts":{"clean":"rimraf *.js *.d.ts api cart commerce products scripts wishlist","clean:install":"rimraf node_modules yarn.lock && yarn install","build":"npm run clean && tsc && cp src/schema.d.ts schema.d.ts","lint":"eslint . --quiet --ext .js,.ts,.tsx","lint:fix":"eslint . --quiet --fix --ext .js,.ts,.tsx"},"repository":{"type":"git","url":"git+https://github.com/aquilacms/storefront-data-hooks.git"},"keywords":["nextjs","commerce"],"author":{},"license":"MIT","bugs":{"url":"https://github.com/aquilacms/storefront-data-hooks/issues"},"homepage":"https://github.com/aquilacms/storefront-data-hooks#readme","dependencies":{"@vercel/fetch":"6.1.0","cookie":"0.4.1","js-cookie":"2.2.1","lodash.debounce":"4.0.8","swr":"0.3.11"},"devDependencies":{"@manifoldco/swagger-to-ts":"^2.1.0","@types/cookie":"^0.4.0","@types/js-cookie":"^2.2.6","@types/lodash.debounce":"^4.0.6","@types/node":"^14.14.20","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.12.0","@typescript-eslint/parser":"^4.12.0","eslint":"^7.17.0","husky":"^4.3.7","lint-staged":"^10.5.3","next":"^10.0.4","rimraf":"^3.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,tsx}":["eslint --fix"]},"_id":"@aquilacms/storefront-data-hooks@1.0.7","dist":{"shasum":"d3662d594b3cde84f2022d09c60e769b4cc87367","integrity":"sha512-yM9A1yiaJ3do+bPZVGI7qQUnOuz+KcqH5tqLZwPcQqjZQPIpEKxnyip7321lfKZIQT3jq5bpEZUYRpeY6ftJWw==","tarball":"https://registry.npmjs.org/@aquilacms/storefront-data-hooks/-/storefront-data-hooks-1.0.7.tgz","fileCount":199,"unpackedSize":514781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgACQ/CRA9TVsSAnZWagAALFcP/A8kl5HI9mRhlTlfdcW/\nH6VDUBm0baEsK8AuhOa6PM2o5vk5YO++jxMm4P8PPxMkZ55Lhr+eZFvLUqEm\nKEcmfFUdvlxemeR2HGLDIWkjkCLCkwHCuos5doo0UJxKbSoUetupbXFHTeWj\nq+zW19u7w9vxXzEarHeZjj9aLnUQhNMJj7pr9TvekA6c8ET+pOUkA9oXXOBI\n7r1KpwON4W8UX+e+0U5WGeZ+JHw/wfKuiWcCFKawrxNTDQ5bCp76P3YxF1KN\nzATMvIi23yXHvE9PA4Bnvkmddgv3tUk/kflZvfXzYdT1AppMSu73+eGpoakg\nPh/kiNhpgQfUXzkuBVRZbZbv3+5vJVI8KD+TlvifnCN96XoxkKb++62tcsS8\n5zwQWNMz/UPj112I9QC38IoDgXO66T0BTF9isp/UAqpr4uLdw4BPtkK+pnmZ\ndg4bUX8aQ56yZPGgLb3Y1LHZCYko69ZDqeGjD6neFmzhGpLhmtLs9+B8iAau\nfzeFGx+eKtK0bvYKIA+pHvMfQFlqVst3O2zlMCOPfGBxMdCTxAXVoxdIRdrX\nO6AGbpdgbSrlzMAt6vFioBAA0PiRuWqUlJzw2Dkok51v8F7Og6oz5kys+ISw\nEIGEdqpVFj9BMDZta341WADJGYmmddEXN/Kb0emQWmJiWiVncn3yNL/9hdcj\nP7jA\r\n=LLj7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEzjK/IROWMgMjjahSdM/rsTTgBOTSCPfhEiUzRC+hNdAiEA+r7pWf75VbjBovJV2e4ppwyZtalfa79GmSadLvPKPsc="}]},"_npmUser":{"name":"nextsourcia","email":"contact@nextsourcia.com"},"directories":{},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storefront-data-hooks_1.0.7_1610622014835_0.048296661439469535"},"_hasShrinkwrap":false},"1.0.8":{"name":"@aquilacms/storefront-data-hooks","version":"1.0.8","description":"Next.js Commerce Framework","main":"index.js","scripts":{"clean":"rimraf *.js *.d.ts api cart commerce products scripts wishlist","clean:install":"rimraf node_modules yarn.lock && yarn install","build":"npm run clean && tsc && cp src/schema.d.ts schema.d.ts","lint":"eslint . --quiet --ext .js,.ts,.tsx","lint:fix":"eslint . --quiet --fix --ext .js,.ts,.tsx"},"repository":{"type":"git","url":"git+https://github.com/aquilacms/storefront-data-hooks.git"},"keywords":["nextjs","commerce"],"author":{},"license":"MIT","bugs":{"url":"https://github.com/aquilacms/storefront-data-hooks/issues"},"homepage":"https://github.com/aquilacms/storefront-data-hooks#readme","dependencies":{"@vercel/fetch":"6.1.0","cookie":"0.4.1","js-cookie":"2.2.1","lodash.debounce":"4.0.8","swr":"0.3.11"},"devDependencies":{"@manifoldco/swagger-to-ts":"^2.1.0","@types/cookie":"^0.4.0","@types/js-cookie":"^2.2.6","@types/lodash.debounce":"^4.0.6","@types/node":"^14.14.20","@types/react":"^17.0.0","@typescript-eslint/eslint-plugin":"^4.12.0","@typescript-eslint/parser":"^4.12.0","eslint":"^7.17.0","husky":"^4.3.7","lint-staged":"^10.5.3","next":"^10.0.4","rimraf":"^3.0.2","typescript":"^4.1.3"},"peerDependencies":{"react":">=17"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,tsx}":["eslint --fix"]},"_id":"@aquilacms/storefront-data-hooks@1.0.8","dist":{"shasum":"26ecd03c113fdf87cf154efbe8e02493330bec76","integrity":"sha512-6nxkEefAUFhgie/YEThX0bzJShzrwry15chlxuENov/K/eQFBSJQWQ9/9bY+TLrdvep2cfE+to2cIOh+STMZ4A==","tarball":"https://registry.npmjs.org/@aquilacms/storefront-data-hooks/-/storefront-data-hooks-1.0.8.tgz","fileCount":207,"unpackedSize":521117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBf5HCRA9TVsSAnZWagAAwOIP/iKG05Z3OjXErLDxzIDd\nqU+jzIuOm4k4EUAM2ah5RA7i4XmJo0s7TLsIEOPKskr0qMjSde0GoIhUue8N\n1AdQVvsa/rmciBeRGOm+59ibR8ofMsWM/QxKl0QQQ5szpJ5GTZbd6WsP+i4o\nUBYbVYJiKKjMKEJ2SCUXgpYopXr5JJQGXbCQcyUE8BAwNwhtNIdrubBjvnlc\nuXWr/ODQ89W5sJJ+8ePaw8s4rhTzBBPZ/m5pDIZj5y3bWL1Ckv24GungGfEr\n0UCka8E89xcBqJWt4kJFhOgqxxDWipOGH3Tbsbl1EXb68DCgU+++Hh0TTyfJ\nLQAnopoMkXl+861Mrfa4UXl8lENmtniYuqTPGuUErgb7W9CjltCU+MkURKB8\nlc2noosm0iRJYLOGh87BeuY2RgC4UfH1lMlE4GDNzGDNlSs6A3SGQAEi4B6T\nj9sUliNSvgub97XI3P9iggGvbGtSkV7Ac3gsn4GEyoGC0eCjFoUM1mGkZf5j\nXsP9SzEeJiNQvx9vHKRdd1z2+/D+AmCAlFMLzcz5FcqNXzj/MRoWn8lbZsd9\nOveu77BwfiAVAfc/s1kRqhM88vLofvHMIglearcISZiLtbLao/pstMlL5Iwo\nC1mp5TxH7QJWc0NPwKF8bfi9RUSjIzbVTY8EJTxJhZdgfY71KRIiXUtG8oQt\nvd01\r\n=lAoI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvwWc4ecgIv1ygbKjE5a7LPg8MWQvAL1P9PhPGncm8fQIhANKt6or2S0UQhzOaEzdXGVt+g8Td4V02AmQJbjD+NmY/"}]},"_npmUser":{"name":"nextsourcia","email":"contact@nextsourcia.com"},"directories":{},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storefront-data-hooks_1.0.8_1611005510902_0.3861218452535484"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-13T01:02:35.854Z","1.0.0":"2021-01-13T01:02:36.227Z","modified":"2022-04-04T15:14:07.831Z","1.0.1":"2021-01-13T09:33:34.915Z","1.0.2":"2021-01-13T10:14:51.477Z","1.0.3":"2021-01-13T10:30:58.819Z","1.0.4":"2021-01-13T15:22:12.652Z","1.0.5":"2021-01-14T10:46:08.211Z","1.0.6":"2021-01-14T10:49:09.178Z","1.0.7":"2021-01-14T11:00:14.984Z","1.0.8":"2021-01-18T21:31:51.018Z"},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"description":"Next.js Commerce Framework","homepage":"https://github.com/aquilacms/storefront-data-hooks#readme","keywords":["nextjs","commerce"],"repository":{"type":"git","url":"git+https://github.com/aquilacms/storefront-data-hooks.git"},"bugs":{"url":"https://github.com/aquilacms/storefront-data-hooks/issues"},"license":"MIT","readme":"# Next.js Commerce Framework\n\nThis repository serves as a model to build your own hooks for [Next.js Commerce](https://nextjs.org/commerce). We encourage contributors and teams to build their own hooks under a separate package with the corresponding configuration. An example of using this repository as a seed are the hooks we built with [BigCommerce](https://github.com/bigcommerce/storefront-data-hooks).\n\n## Folder Structure\n\nThe root folder contains an `index.tsx` file with the CommerceProvider to set up the right commerce context. Additional components needed to run the framework need to be there.\n\n`src` contains all the handlers used by the whole framework. The rest of the folders in the root file are named by functionality, e.g cart, auth, wishlist and are the API of the framework. Therefore, most of the work should be done in the `src` folder. Otherwise, it could affect the usage of the framework altering its functionality and possibly adding unexpected output.\n\n## Commerce API\n\n### CommerceProvider\n\nThe main configuration provider that creates the Commerce context. Used by all Commerce hooks. Every provider may define its own defaults.\n\n```jsx\nimport { CommerceProvider } from \"@commerce-framework\";\n\nconst App = ({ locale = \"en-US\", children }) => (\n  <CommerceProvider locale={locale}>{children}</CommerceProvider>\n);\n```\n\n- `locale:` Locale to use for i18n. This is **required**.\n- `cartCookie:` Name of the cookie that saves the cart id. This is **optional**.\n- `fetcher:` Global fetcher function that will be used for every API call to a GraphQL or REST endpoint in the browser, it's in charge of error management on network errors. Usage of this config is **optional**.\n\n> **CommerceProvider** should not re-render unless a prop changes, and the only prop that's expected to change in most apps is `locale`.\n\n### useCommerce()\n\nReturns the configs (including defaults) that are defined in the nearest `CommerceProvider`.\n\n```jsx\nimport { useCommerce } from \"@commerce-framework/hooks\";\n\nconst commerce = useCommerce();\n```\n\nMay be useful if you want to create another `CommerceProvider` and extend its options.\n\n### useCustomer\n\nReturns the logged-in customer and its data.\n\n```jsx\nimport { useCustomer } from \"@commerce-framework/hooks\";\n\nconst customer = useCustomer();\nconst { data, error, loading } = customer;\n\nif (error) return <p>There was an error: {error.message}</p>;\nif (loading) return <p>Loading...</p>;\n\nreturn <Page customer={data} />;\n```\n\nThe customer is revalidated by operations executed by `useLogin`, `useSignup` and `useLogout`.\n\n### useLogin Hook\n\nReturns a function that allows a visitor to login into its customer account.\n\n```jsx\nimport { useLogin } from \"@commerce-framework/hooks\";\n\nconst LoginView = () => {\n  const login = useLogin();\n\n  const handleLogin = async () => {\n    await login({\n      email,\n      password,\n    });\n  };\n\n  return <form onSubmit={handleLogin}>{children}</form>;\n};\n```\n\n### useLogout\n\nReturns a function that allows the current customer to log out.\n\n```jsx\nimport { useLogout } from \"@commerce-framework/hooks\";\n\nconst LogoutLink = () => {\n  const logout = useLogout();\n  return <a onClick={() => logout()}>Logout</a>;\n};\n```\n\n### useSignup\n\nReturns a function that allows a visitor to sign up into the store.\nThe signup operation returns `null`.\n\n```jsx\nimport { useSignup } from \"@commerce-framework/hooks\";\n\nconst SignupView = () => {\n  const signup = useSignup();\n\n  const handleSignup = async () => {\n    await signup({\n      email,\n      firstName,\n      lastName,\n      password,\n    });\n  };\n\n  return <form onSubmit={handleSignup}>{children}</form>;\n};\n```\n\n### usePrice\n\nFormats an amount--usually the price of a product-- into an internationalized string. It uses the current locale.\n\n```jsx\nimport { usePrice } from \"@commerce-framework/hooks\";\n\nconst { price, basePrice, discount } = usePrice({\n  amount: 100,\n  baseAmount: 50,\n  currencyCode: \"USD\",\n});\n```\n\n`usePrice` receives an object with:\n\n- `amount:` A valid number, usually the sale price of a product. This is **required**.\n- `baseAmount:` A valid number, usually the listed price of a product. If it's higher than `amount` then the product is on sale and `usePrice` will return the discounted percentage. This is **optional**.\n- `currencyCode:` The currency code to use. This is **required**.\n\n`usePrice` returns an object with:\n\n- `price:` The formatted price of a product.\n- `basePrice:` The formatted base price of the product. Only present if `baseAmount` is set.\n- `discount:` The discounted percentage. Only present if `baseAmount` is set.\n\n## Cart Hooks\n\n### useCart\n\nReturns the current cart data.\n\n```jsx\nimport { useCart } from \"@commerce-framework/hooks\";\n\nconst { data, error, isEmpty, loading } = useCart();\n```\n\n### useAddItem\n\nReturns a function that when called adds a new item to the current cart.\nThe `addItem` operation returns the updated cart.\n\n```jsx\nimport { useAddItem } from \"@commerce-framework/hooks\";\n\nconst AddToCartButton = ({ productId, variantId }) => {\n  const addItem = useAddItem();\n\n  const addToCart = async () => {\n    await addItem({\n      productId,\n      variantId,\n    });\n  };\n\n  return <button onClick={addToCart}>Add To Cart</button>;\n};\n```\n\n### useUpdateItem\n\nReturns a function to update an item of the current cart.\n\n```jsx\nconst updateItem = useUpdateItem();\n\nawait updateItem({\n  id,\n  productId,\n  variantId,\n  quantity,\n});\n\n// You can optionally send the item to the hook:\nconst updateItem = useUpdateItem(item);\n\n// And now only the quantity is required\nawait updateItem({\n  quantity,\n});\n```\n\n### useRemoveItem\n\nReturns a function that when called removes an item from the current cart.\n\n```jsx\nconst removeItem = useRemoveItem();\n\nawait removeItem({\n  id,\n});\n```\n\nThe `removeItem` operation returns the updated cart.\n\nThe cart is deleted if the last remaining item is removed.\n\n## Wishlist Hooks\n\n### useWishlist\n\nReturns the current wishlist of the logged in user.\n\n```jsx\nimport { useWishlist } from \"@commerce-framework/hooks\";\n\nconst { data } = useWishlist();\n```\n\n## WIP\n\n- getItem\n- getAllItems\n- useSearch\n\n## Handling errors and loading states\n\nData fetching looks like `useCart` and `useCustomer` return props to handle errors and loading states. For example, using the `useCommerce` hook:\n\n```jsx\nconst customer = useCustomer();\nconst { data, error, loading } = customer;\n\nif (error) return <p>There was an error: {error.message}</p>;\nif (loading) return <p>Loading...</p>;\n\nreturn <Page customer={data} />;\n```\n\nAnd using the `useCart` hook:\n\n```jsx\nconst cart = useCart();\nconst { data, error, loading, isEmpty } = cart;\n\nif (error) return <p>There was an error: {error.message}</p>;\nif (loading) return <p>Loading...</p>;\nif (isEmpty) return <p>The cart is currently empty</p>;\n\nreturn <Page cart={data} />;\n```\n\nHooks that execute user actions are async operations, you can track the loading state and errors using state hooks and try...catch. For example:\n\n```jsx\nfunction LoginButton({ data }) {\n  const login = useLogin();\n\n  const [loading, setLoading] = useState(false);\n  const [errorMsg, setErrorMsg] = useState(false);\n  const handleClick = async () => {\n    // We're about to run the action, so set the state to loading\n    setLoading(true);\n    // Reset the error message if it failed before\n    setErrorMsg(\"\");\n\n    try {\n      await login({\n        email: data.email,\n        password: data.password,\n      });\n    } catch (error) {\n      // Handle error codes specific for the `login` action\n      if (error.code === \"invalid_credentials\") {\n        setErrorMsg(\n          \"Cannot find an account that matches the provided credentials\"\n        );\n      } else {\n        setErrorMsg(error.message);\n      }\n    } finally {\n      setLoading(false);\n    }\n  };\n\n  return (\n    <div>\n      <button onClick={handleClick} disabled={loading}>\n        Add to Cart\n      </button>\n      {errorMsg && <p>{errorMsg}</p>}\n    </div>\n  );\n}\n```\n\nError codes depend on the hook that is being used. In this case `invalid_credentials` is used by `useLogin`.\n\nAll commerce related errors are an instance of `CommerceError`.\n\n## Extending UI Hooks\n\nAll hooks that involve a fetch operation can be extended with a custom fetcher function. For example, if we wanted to extend the `useCart` hook:\n\n```jsx\nimport useCartHook, { fetcher } from \"commerce-lib/cart/use-cart\";\n\nconst useCart = useCartHook.extend(\n  (options, input, fetch) => {\n    // Do something different\n    return fetcher(options, input, fetch);\n  },\n  {\n    // Optionally change the default SWR options\n    revalidateOnFocus: true,\n  }\n);\n\n// Then in your component, using your new hook works in the same way\nconst { data, error, isEmpty, updating } = useCart();\n```\n\nThe `extend` method is available for all hooks with fetch operations, it receives a fetcher function as the first parameter and SWR options as the second parameter if the hook uses SWR. `extend` returns a new hook that works exactly as the hook it's extending from.\n\nThe fetcher function receives the following arguments:\n\n- `options:` This is an object that may have a `query` (if the hook is using GraphQL), a `url`, and a `method`.\n- `input:` An object with the data that's required to execute the operation.\n- `fetch:` The fetch function that is set by the `CommerceProvider`.\n\n\n","readmeFilename":"README.md","author":{}}