{"_id":"siwe-recap","_rev":"1-1ab5085efc0b0ae6f266941c879b2e10","name":"siwe-recap","dist-tags":{"alpha":"0.0.2-alpha.0","latest":"0.0.1-alpha.0"},"versions":{"0.0.1-alpha.0":{"name":"siwe-recap","version":"0.0.1-alpha.0","description":"A Typescript implementation of EIP-5573 utilities","main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","license":"MIT","author":{"name":"Spruce Systems Inc."},"scripts":{"build:cjs":"esbuild --bundle --target=es2019 --format=cjs --outfile=dist/index.cjs src/index.ts","build:esm":"esbuild --bundle --target=es2019 --format=esm --outfile=dist/index.mjs src/index.ts","build:types":"dts-bundle-generator --out-file=dist/index.d.ts src/index.ts","clean":"rm -rf dist","compile":"run-s clean build:*","format":"prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"","lint":"eslint --ext .js,.ts .","test":"run-s test:*","test:lib":"cross-env NODE_OPTIONS=--experimental-vm-modules jest"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"jest":{"preset":"ts-jest/presets/default-esm","globals":{"ts-jest":{"useESM":true}},"verbose":true,"testTimeout":30000,"testMatch":["**/*.test.[jt]s?(x)"],"moduleFileExtensions":["js","json","ts"],"moduleNameMapper":{"^(\\.{1,2}/.*)\\.js$":"$1"}},"devDependencies":{"@types/jest":"^29.5.0","@typescript-eslint/eslint-plugin":"^5.23.0","@typescript-eslint/parser":"^5.23.0","cross-env":"^7.0.3","dts-bundle-generator":"^8.0.1","esbuild":"^0.17.17","eslint":"^8.38.0","eslint-config-prettier":"^8.5.0","ethers":"^5.5.1","jest":"^29.5.0","npm-run-all":"^4.1.5","prettier":"^2.8.7","ts-jest":"^29.1.0","typescript":"^5.0.2"},"dependencies":{"canonicalize":"^2.0.0","multiformats":"^11.0.2","siwe":"^2.0.5"},"peerDependencies":{"ethers":"^5.5.1"},"type":"module","gitHead":"99fe7d0f4feb2bfbb5779976427bf5e1414ae45c","_id":"siwe-recap@0.0.1-alpha.0","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-dDOF3m/maLBVRlk3yj5P67ayO+/xup9vjXFIHrbZAQNZ8hrSpYMWg4pkUQx1D/EVSPvH4znfBZvRX27TERKwvQ==","shasum":"a9421e55c9bd4788d96b89a4e65aabb26515bf4c","tarball":"https://registry.npmjs.org/siwe-recap/-/siwe-recap-0.0.1-alpha.0.tgz","fileCount":16,"unpackedSize":103102,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF9vZa/sk2qWKsFdjloQsU1c/lLARr1cdP8Nb1iu4Dd1AiB+N6dNR2aG/NMgpa1mlcdqI8IdFlQ3dLJ+f7BYqdYsLg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkRpQQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoS4A//VS0DNiQIVoMR6dXi0qQpo1TyLJZgLyG6hzAD0ca6H0rKUaGy\r\nQFyou+1167kPihIqvhu0YccsYsreiGG/zHXenFOTjXhmUlS8Ir5N9MOYGMks\r\n/1rpjICi8xYH0bhRAZrj6KIt5TxIemvSgsMZqdOZuqN0OvjScqElVB8uzddR\r\nzjI269NUijTIJ0SV/M+qRpiS/4xFG1wTKRV+ufXxZ9o7EbMjqQl15QZW2dTa\r\nSTVZGghPVixmNjQeQlmOsAf+klYHnb+Pcu9JFcS+PRKd9hiWwXXIK+Nvow9X\r\n4gwSB6kjP2Y6Mx0sYU+lvsSahgiuSpZwUgOrMOZG4psh1ss0Vk/Ds+N4+zH6\r\nU10KIXM0ivXIG1nHSXQBamgiW81vKCJq+QIx18roopr3HZB/IMw4g1XtR9oC\r\nrCgH4gWYEL1YnPhKEfKjJBw5DF1pTF86yv8b2w5Q1xJBaFDQg71IyxqtV4dM\r\neRCcPW8blDV6STVrTF0UmbwDJ85eFT07l0fBut3ttPv8A4nNVllEnG3JxdSu\r\n/CodPm92Xf0WJ8AO7XZJRx2o/nB6qayqEqS9isI3fUP3lZuNhKaZT05qJdko\r\nV/XO3WLPChw0tzFLCnBYnMHUmgF+m3avnyyMIe5OtFqzEU5p+Zzf/7IROYDK\r\n/e5bnmeaSAUPsPdzgGTen9BTCPXRsu/U6Ow=\r\n=G1uj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"chunningham","email":"c.a.cunningham6@gmail.com"},"directories":{},"maintainers":[{"name":"chunningham","email":"c.a.cunningham6@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/siwe-recap_0.0.1-alpha.0_1682347024559_0.4433894829075884"},"_hasShrinkwrap":false},"0.0.2-alpha.0":{"name":"siwe-recap","version":"0.0.2-alpha.0","description":"A Typescript implementation of EIP-5573 utilities","main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","license":"MIT","author":{"name":"Spruce Systems Inc."},"scripts":{"build:cjs":"esbuild --bundle --target=es2019 --format=cjs --outfile=dist/index.cjs src/index.ts","build:esm":"esbuild --bundle --target=es2019 --format=esm --outfile=dist/index.mjs src/index.ts","build:types":"dts-bundle-generator --out-file=dist/index.d.ts src/index.ts","clean":"rm -rf dist","compile":"run-s clean build:*","format":"prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"","lint":"eslint --ext .js,.ts .","test":"run-s test:*","test:lib":"cross-env NODE_OPTIONS=--experimental-vm-modules jest"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"jest":{"preset":"ts-jest/presets/default-esm","globals":{"ts-jest":{"useESM":true}},"verbose":true,"testTimeout":30000,"testMatch":["**/*.test.[jt]s?(x)"],"moduleFileExtensions":["js","json","ts"],"moduleNameMapper":{"^(\\.{1,2}/.*)\\.js$":"$1"}},"devDependencies":{"@types/jest":"^29.5.0","@typescript-eslint/eslint-plugin":"^5.23.0","@typescript-eslint/parser":"^5.23.0","cross-env":"^7.0.3","dts-bundle-generator":"^8.0.1","esbuild":"^0.17.17","eslint":"^8.38.0","eslint-config-prettier":"^8.5.0","ethers":"^5.5.1","jest":"^29.5.0","npm-run-all":"^4.1.5","prettier":"^2.8.7","ts-jest":"^29.1.0","typescript":"^5.0.2"},"dependencies":{"canonicalize":"^2.0.0","multiformats":"^11.0.2","siwe":"^2.1.4"},"peerDependencies":{"ethers":"^5.5.1"},"type":"module","readme":"# ReCap\n\nA Typescript implementation of [ERC-5573 ReCap](https://eips.ethereum.org/EIPS/eip-5573), enabling applications to express [UCAN-style object capabilities](https://github.com/ucan-wg/spec) using [Sign In With Ethereum](https://eips.ethereum.org/EIPS/eip-4361).\n\n## Installation\n\nReCap can be installed via `npm`:\n\n```sh\nnpm -i siwe-recap\n```\n\n`yarn`:\n\n```sh\nyarn add siwe-recap\n```\n\nor `package.json` entry:\n\n```json\n{\n  \"dependencies\": {\n    \"siwe-recap\": \"0.0.2-alpha.0\"\n  }\n}\n```\n\n## Usage\n\nReCaps are designed to be used in conjunction with SIWE. They can be initialized and built as follows:\n\n```typescript\nimport { Recap } from 'siwe-recap';\n\nconst recap = new Recap();\n\nrecap.addAttenuation('https://example.com/my/resource', 'crud', 'read');\nrecap.addAttenuation('https://example.com/my/resource', 'crud', 'update', {\n  maxTimes: 5,\n});\nrecap.addProof('bagaaierasords4njcts6vs7qvdjfcvgnume4hqohf65zsfguprqphs3icwea');\n\nconsole.log(recap.attenuations);\n// {\n//   \"https://example.com/my/resource\": {\n//     \"crud/read\": [{}],\n//     \"crud/update\": [{ maxTimes: 5 }]\n//   }\n// }\n```\n\nThey can also be applied to or extracted from SIWE messages:\n\n```typescript\nimport { SiweMessage } from 'siwe';\nimport { Recap } from 'siwe-recap';\n\nconst siwe = new SiweMessage( ... );\n\n// we can extract the recap while verifying that the statement in `siwe` matches\n// the recap listed in `siwe`s resource list\nconst recap = Recap.extract_and_verify(siwe);\n\n//\nrecap.addAttenuation('https://example.com/my/resource', 'crud', 'read');\n\n// the new change will be merged into the existing recap in `siwe`\nrecap.add_to_siwe_messate(siwe);\n```\n\n## Compilation\n\nIn order to generate the ECMAScript, CommonJS and TypeScript declaration files, run `yarn compile`.\n\n## Disclaimer\n\nThis package is still ALPHA software, bugs may exist and APIs may change in future. This library for has not yet undergone a formal security audit. We welcome continued feedback on the usability, architecture, and security of this implementation.\n","readmeFilename":"README.md","gitHead":"558df9f77dc8e7a84d031fe48d49f7b620f97a56","_id":"siwe-recap@0.0.2-alpha.0","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-xqFUnvrACWW/Q4s5HQ02avg8IyH2RcgkUzfvN4scYaaHErotLVtTGDZkSS0sn/oNK4MXRt83lTqredsvXgt8iA==","shasum":"75a0902c10a8ba5b4471f40e4eafb0afb2f8db59","tarball":"https://registry.npmjs.org/siwe-recap/-/siwe-recap-0.0.2-alpha.0.tgz","fileCount":16,"unpackedSize":118169,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDf6XGoPRoL24nh4QWr1kGS0OPG3NdpADEl4ixlKRmUSwIhAIX/qYbwvgR5Q2DwQLrpWgt9OnOPII4W5dxdSaKwJBk4"}]},"_npmUser":{"name":"chunningham","email":"c.a.cunningham6@gmail.com"},"directories":{},"maintainers":[{"name":"chunningham","email":"c.a.cunningham6@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/siwe-recap_0.0.2-alpha.0_1683626051392_0.8309448738326946"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-24T14:37:04.559Z","0.0.1-alpha.0":"2023-04-24T14:37:04.693Z","modified":"2023-05-09T09:54:11.673Z","0.0.2-alpha.0":"2023-05-09T09:54:11.571Z"},"maintainers":[{"name":"chunningham","email":"c.a.cunningham6@gmail.com"}],"description":"A Typescript implementation of EIP-5573 utilities","author":{"name":"Spruce Systems Inc."},"license":"MIT","readme":"","readmeFilename":""}