{"_id":"@fleekhq/browser-rpc","_rev":"25-c21802ec4b671e34ffe4560bfa2c316c","name":"@fleekhq/browser-rpc","dist-tags":{"latest":"2.0.3"},"versions":{"1.0.0":{"name":"@fleekhq/browser-rpc","version":"1.0.0","keywords":["package","typescript"],"author":{"name":"Guillermo Puente","email":"guillermo@fleek.co"},"license":"MIT","_id":"@fleekhq/browser-rpc@1.0.0","maintainers":[{"name":"gpuente","email":"guillermo.ps09@gmail.com"},{"name":"vojtechatfleek","email":"vojtech@fleek.co"},{"name":"perfectmak","email":"damiperfect@gmail.com"},{"name":"jsonsivar","email":"jsonsivar@gmail.com"},{"name":"janisonfleek","email":"janison@terminal.co"},{"name":"giankotarola12","email":"g.otarolarobledo@gmail.com"},{"name":"terminalsystemsinc","email":"support@terminal.co"},{"name":"samuelea","email":"batonenbois@gmail.com"}],"homepage":"https://github.com/FleekHQ/browser-rpc#readme","bugs":{"url":"https://github.com/FleekHQ/browser-rpc/issues"},"dist":{"shasum":"560d0071702452ed89c7427673346bbcecd1a345","tarball":"https://registry.npmjs.org/@fleekhq/browser-rpc/-/browser-rpc-1.0.0.tgz","fileCount":27,"integrity":"sha512-7r6uBDHuiDU1BgI2lGJLO0rHwtjH5L1/U6V8WOECKqp0C6by/nWpkZc7jV2HdqhD7Re0vHgXra0/mxi0KE2U3g==","signatures":[{"sig":"MEUCIQD1zUzgZbivgYW9+W3X4cdVYXqmjwcByL6Se7AcbPWb6AIgGi0T3B8OvT9Sy15OMK6iKzQY3JQxZLAta4sT83HWqcE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":42068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggdTMCRA9TVsSAnZWagAA4z4P/2htRo51GnCqkX2olCyk\n5I4jnfpiZgjLmGuMV+s6yMkDvzNzd2t560c+KDpm0Uj1lHE2HCl34M3nusHv\n/rZNxRg29v48XUWmGppA1cqTFZ3vKMx+CrqJtP80o7RlCvkEgGcJKERcsJA+\nhL5qRr61erGdSKgeuBa1GZ1kHAlr5kA+yXJt17wi2OfGcN7NkTOShzG95sQm\nuKx0cWmFFm38mKpgMdCJjYmUNs551+lOWWB63jiS1rFRMFwWdfpIgYy7r0xo\ntZSEjMioZ14ni9EtddF5UTuEiem02dpAU/5kCpBJm/ZD8CXtAB1JbZILs1bG\n24yDrE+6QHHNBsnSVqLL/IdNsgQjxUUljgJGzach5lfH/hp9F2YQw1Y0R9jr\nRk5QKC9A0LKIeMNtSSgxMTM2CgA5THACXYplPFGmG89b0bmABuD+XTeT58RP\nFWtaouchBjinNbaEzZ7zIEhny0wLkLd8R2Uxuet98jO6fjrqE5AV3nzSb1RK\ncD34Ihd82CkYu8C8pW/m/pKaMLUgR3AUJ+RLiOSJQ0+rOgS5v7ztEjjartWw\n+4/MJWCMLUR5ztVcYh+rgNtwEkP37cCs/pRVqkwDWohqSqYX2PHWKXwKV1iQ\nSh8++2M3W0qU0u6ywJ2HjIBpTpdAwtJ+G2mdzWAkudAuJlBDCED+vWoWlRH/\nEJjo\r\n=VqYE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/esm/index.js","gitHead":"45840874ae9fb9129d37eb715c3cc1bead2b970b","scripts":{"lint":"eslint --ext .js,.ts ./src/**","test":"jest","build":"npm run clean && npm-run-all --parallel build:** && node ./scripts/add-package.js","clean":"rimraf ./dist","lint:fix":"npm run lint -- --fix","build:cjs":"tsc --module commonjs --target es2015 --outDir ./dist","build:esm":"tsc --module es2015 --target es5 --outDir ./dist/esm -d false","prepublishOnly":"npm run build"},"_npmUser":{"name":"terminalsystemsinc","email":"support@terminal.co"},"repository":{"url":"git+https://github.com/FleekHQ/browser-rpc.git","type":"git"},"_npmVersion":"6.14.12","description":"This library allows you exchange messages beetween BrowserRPC instances using window.postMessage API. You can call remote procedures as promises.","directories":{},"jsnext:main":"dist/esm/index.js","sideEffects":false,"_nodeVersion":"14.16.1","dependencies":{"uuid":"^8.3.2","fastest-validator":"^1.10.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^3.1.0","eslint":"^7.24.0","rimraf":"^3.0.0","ts-jest":"^26.5.5","typescript":"^4.2.4","@babel/core":"^7.13.16","@types/jest":"^26.0.22","@types/uuid":"^8.3.0","lint-staged":"^9.5.0","npm-run-all":"^4.1.5","babel-loader":"^8.2.2","react-test-renderer":"^17.0.2","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.22.1","@typescript-eslint/parser":"^4.22.0","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.22.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/browser-rpc_1.0.0_1619121355726_0.23834065832458728","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@fleekhq/browser-rpc","version":"2.0.0","keywords":["package","typescript"],"author":{"name":"Guillermo Puente","email":"guillermo@fleek.co"},"license":"MIT","_id":"@fleekhq/browser-rpc@2.0.0","maintainers":[{"name":"gpuente","email":"guillermo.ps09@gmail.com"},{"name":"vojtechatfleek","email":"vojtech@fleek.co"},{"name":"perfectmak","email":"damiperfect@gmail.com"},{"name":"jsonsivar","email":"jsonsivar@gmail.com"},{"name":"janisonfleek","email":"janison@terminal.co"},{"name":"giankotarola12","email":"g.otarolarobledo@gmail.com"},{"name":"terminalsystemsinc","email":"support@terminal.co"},{"name":"samuelea","email":"batonenbois@gmail.com"}],"homepage":"https://github.com/FleekHQ/browser-rpc#readme","bugs":{"url":"https://github.com/FleekHQ/browser-rpc/issues"},"dist":{"shasum":"3f5e46386af69f5727ae0176c5e27f6bf8678896","tarball":"https://registry.npmjs.org/@fleekhq/browser-rpc/-/browser-rpc-2.0.0.tgz","fileCount":43,"integrity":"sha512-4N6Xpw/0tcVOG3IFS35jVadHu05sl/c9lQCIcLCfDjxuXq4qhs+G07okMmYvQSSNukC5rNrm/MKZmlMtU1c/tw==","signatures":[{"sig":"MEUCIQDa4IDESQJWeOfcRSh/RrNxLPgpZcYhD9L/4x/OvEgS8QIgId6KQlGlSBarv8Kb2amt+RAs+367YZmP6VOfzB7PIHU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkZCJCRA9TVsSAnZWagAACBQQAIuSYSEm09P47J5wtQAv\n+K3vLktPftgVFR4MRyz63fZlIUZ72PKX5PshBHeXc/LHzcH8Cw9QYGoH6DSN\njbkQo7AlgBXD4k7WKu5lvLhrg+x2IxIV2BxzsqlJ+1Dzdz7rccOfv9RePA/N\n5E7azX9oujuhrocdtVpOTAufEhzcZNdXj3ZcowAiydPxXzCz69xRa4dVkqLm\nAM8Z2CF+aO7PrVkeYkfHLya/8JhPj2B06C1+qbSoGvF48lKy/4yNDpmg8Vv5\npNljz2xT8QKtHhcjjmtuzYLOcYsg8sl9Wq0e+bC4JozLhf4TXf9zEqTu5Zji\neKR9paZkURjQxw3VEV4WR3acS+X24Hoy6fdY4+MZCmdUtlHCT/+KR9wUkOKX\ndQUbP4tIv0nQZ//xAm8wKSEVPkf4S6JN6KkmnAxIr8nlUrHnvMuss5JrVGcv\n7H7hfNChtEiJjpK91eIcz7spQf5jIWj3ADtrFC8aUfDjnsfyb6GDLZcIWDEy\npCZTJ0FF6sts/QYxAboXPZnA6XkEnI/eAWHr26pa9+7Pn9BqjnOwph8aL+4S\nVT0GESHTD2MesXYSXZFP6oQXwk+pDH3NMghdHWnzZFDHDL6xvcS+7JZsB/3r\n9RNHd7zpApBHEbBCmjfoSP3SsrkmDg7ScGPgOU/8Z7fVt6OOxs+Qd4yUtiJD\nEf4z\r\n=/vPZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/esm/index.js","gitHead":"f97a3b8f180add5704fa2a1eb9fcd4e4a6e02599","scripts":{"lint":"eslint --ext .js,.ts ./src/**","test":"jest","build":"npm run clean && npm-run-all --parallel build:** && node ./scripts/add-package.js","clean":"rimraf ./dist","lint:fix":"npm run lint -- --fix","build:cjs":"tsc --module commonjs --target es2015 --outDir ./dist","build:esm":"tsc --module es2015 --target es5 --outDir ./dist/esm -d false","prepublishOnly":"npm run build"},"_npmUser":{"name":"terminalsystemsinc","email":"support@terminal.co"},"repository":{"url":"git+https://github.com/FleekHQ/browser-rpc.git","type":"git"},"_npmVersion":"6.14.12","description":"This library allows you exchange messages beetween BrowserRPC instances using window.postMessage API. You can call remote procedures as promises.","directories":{},"jsnext:main":"dist/esm/index.js","sideEffects":false,"_nodeVersion":"14.16.1","dependencies":{"joi":"^17.4.0","uuid":"^8.3.2","extensionizer":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^3.1.0","eslint":"^7.24.0","rimraf":"^3.0.0","ts-jest":"^26.5.5","typescript":"^4.2.4","@babel/core":"^7.13.16","@types/jest":"^26.0.22","@types/uuid":"^8.3.0","lint-staged":"^9.5.0","npm-run-all":"^4.1.5","babel-loader":"^8.2.2","@types/chrome":"^0.0.135","react-test-renderer":"^17.0.2","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.22.1","@typescript-eslint/parser":"^4.22.0","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.22.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/browser-rpc_2.0.0_1620152457253_0.796149273847081","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"@fleekhq/browser-rpc","version":"2.0.1","keywords":["package","typescript"],"author":{"name":"Guillermo Puente","email":"guillermo@fleek.co"},"license":"MIT","_id":"@fleekhq/browser-rpc@2.0.1","maintainers":[{"name":"gpuente","email":"guillermo.ps09@gmail.com"},{"name":"vojtechatfleek","email":"vojtech@fleek.co"},{"name":"perfectmak","email":"damiperfect@gmail.com"},{"name":"jsonsivar","email":"jsonsivar@gmail.com"},{"name":"janisonfleek","email":"janison@terminal.co"},{"name":"giankotarola12","email":"g.otarolarobledo@gmail.com"},{"name":"terminalsystemsinc","email":"support@terminal.co"},{"name":"samuelea","email":"batonenbois@gmail.com"}],"homepage":"https://github.com/FleekHQ/browser-rpc#readme","bugs":{"url":"https://github.com/FleekHQ/browser-rpc/issues"},"dist":{"shasum":"6d1dceb8fb2f735a825beca40ad10e9f7c081500","tarball":"https://registry.npmjs.org/@fleekhq/browser-rpc/-/browser-rpc-2.0.1.tgz","fileCount":43,"integrity":"sha512-JTKq4174/yyZj54HJbqr2Nsgyy8/vS2LMWUCV+jD7GxLMFlI+cnx8fxDX3a8p63kDFJBIG5SoPQjqXn6Awngjw==","signatures":[{"sig":"MEQCIHrSiNUKUW4CD2kZUAgX11UGMKndIB+UXF4/yH+E5Ag/AiAJ4MU5J4cEg7GPq3XQbTHEp4mZ4Rc1OJtFegxLewiJiw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87773,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnWxGCRA9TVsSAnZWagAAyhYQAJ17F+kO7VwutCcPUXBO\nQ8JxKrktGaWj73VCbpEWMM+spr0B4rKLFYTLrnJv8eTllig/cb3kElAgcUz2\nEzHv6blnwByq6R6CUVoTEf6xOXL54hcddyFBh0iPS7272LKLeJxvOxATDCwx\n4aczXXYw+Du6QSgFrBXlyom6m/nd59DcpFPCQNXyR6/tlzhyC7eA9/SuChpH\nNHocbDq344S4DomRCtT4fmrrmbhrISEtVtwyXORms497/sEBxy7162sFwwA/\nl7F+EblwsfeVfYJicByrn/Q0KidjbfAjXJMEUpop551+bHGlGMWUz6GrpY5A\ncjNH57bJ928kMetsaJvqDLqzmQVDsMZuK5LGumwbTJDttiUcJVkZ+jGsXZY7\n9yPKg0Sf0R508ICrN4PfeU1nsA4EQuINrMiBvNXbkps/NWUG/0bMO6QTImFl\nd3rzoh63X10rxn2zUfSnR8o8oFxk7lssAMCUUcO1bY88U9ZxptUwJhlW0jkL\nzuvfANunNkIEQX9lfCGc17WCXDuwRH51VPfB0ydyidPy37osa200k5rhduTH\n13eflyMNXCk7liQ3xep23Tl3QeyHxlfA7JjtvyukuWWUgghwIFRJvk1QsF6H\nHpB3FViv9g11ujIiA0UVxh6VbaJIutNDnjuSqDF1PtMQ446BiRHQasw2xzUL\nwz9M\r\n=Ibsd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/esm/index.js","gitHead":"54add3dd454a17243532ab56e16896d209298ee4","scripts":{"lint":"eslint --ext .js,.ts ./src/**","test":"jest","build":"npm run clean && npm-run-all --parallel build:** && node ./scripts/add-package.js","clean":"rimraf ./dist","lint:fix":"npm run lint -- --fix","build:cjs":"tsc --module commonjs --target es2015 --outDir ./dist","build:esm":"tsc --module es2015 --target es5 --outDir ./dist/esm -d false","prepublishOnly":"npm run build"},"_npmUser":{"name":"terminalsystemsinc","email":"support@terminal.co"},"repository":{"url":"git+https://github.com/FleekHQ/browser-rpc.git","type":"git"},"_npmVersion":"6.14.12","description":"This library allows you exchange messages beetween BrowserRPC instances using window.postMessage API. You can call remote procedures as promises.","directories":{},"jsnext:main":"dist/esm/index.js","sideEffects":false,"_nodeVersion":"14.16.1","dependencies":{"joi":"^17.4.0","uuid":"^8.3.2","extensionizer":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^3.1.0","eslint":"^7.24.0","rimraf":"^3.0.0","ts-jest":"^26.5.5","typescript":"^4.2.4","@babel/core":"^7.13.16","@types/jest":"^26.0.22","@types/uuid":"^8.3.0","lint-staged":"^9.5.0","npm-run-all":"^4.1.5","babel-loader":"^8.2.2","@types/chrome":"^0.0.135","react-test-renderer":"^17.0.2","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.22.1","@typescript-eslint/parser":"^4.22.0","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.22.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/browser-rpc_2.0.1_1620929605621_0.4260218033883725","host":"s3://npm-registry-packages"}},"2.0.2":{"name":"@fleekhq/browser-rpc","version":"2.0.2","keywords":["package","typescript"],"author":{"name":"Guillermo Puente","email":"guillermo@fleek.co"},"license":"MIT","_id":"@fleekhq/browser-rpc@2.0.2","maintainers":[{"name":"gpuente","email":"guillermo.ps09@gmail.com"},{"name":"vojtechatfleek","email":"vojtech@fleek.co"},{"name":"perfectmak","email":"damiperfect@gmail.com"},{"name":"jsonsivar","email":"jsonsivar@gmail.com"},{"name":"janisonfleek","email":"janison@terminal.co"},{"name":"giankotarola12","email":"g.otarolarobledo@gmail.com"},{"name":"terminalsystemsinc","email":"support@terminal.co"},{"name":"samuelea","email":"batonenbois@gmail.com"}],"homepage":"https://github.com/FleekHQ/browser-rpc#readme","bugs":{"url":"https://github.com/FleekHQ/browser-rpc/issues"},"dist":{"shasum":"6621a4e9191d45edb267c987b982132bfc83997e","tarball":"https://registry.npmjs.org/@fleekhq/browser-rpc/-/browser-rpc-2.0.2.tgz","fileCount":43,"integrity":"sha512-JDojYoxGF0WmXVhlkvA8oLWk+aaQhuI65ayzahAz69+cZeYlCOkkxTBICz/s40gJgWV6qvPbLMPxUjaCPSZZ/Q==","signatures":[{"sig":"MEUCIQC0bRctiUsaALGZE6L+YPbYRCG9ZJ2Dp/iX4Q94VOBKBAIgajbVZWXFD8KHKRIj34is2WuscWYtPGAlqM1GJ9W/jrc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnvAOCRA9TVsSAnZWagAAEfwQAIptkBOfWPTU7r0udlK+\nL6gzr2lRBgko8jy207Rnwyy3Z8oZcTic/pDCDa3boIw4QvD4bwf9+EokyVOH\nI9fJKTBEYwjk2ZLR4Gn8PZFBkjjIQbpoDNoCOaH3zXm2SIcaZfzJzNxbl5oX\nL7arvie0+kYbl0nhicI4hRO9qREgBSq/BwoQZluW5uE01ik/si/SJPdfX0ON\nGbpFpzvEW6y0htL6oTfZlBnrFCyv7M5USByORjRy9IYKHVQnO3x+2PTUjety\nrHec7XD1nLikg6hedLcSJqk2jNdfTEcXteZAVNm9jnHJRLqGr4YZNoVZ0gSu\nKQjkhCKg96g8pPnuOcNVsMf4yBUiA2Nab50b4IrsWVY/B70a4FPHSuBBYVxW\nrTFQP/H+WqLkBlIV1ZMB8ZrgNLQ3sFwMnXZTddl9+hbviL/91KH70JL05Fus\nEpj51cCxiWHjHcGW4bwkIw2JJK/As8TbbBzUQlPI71eLPEhyzvtFWT9bWOSn\nBSC5dWiyFd+1DoyElI2hDlwL+XPPT80nuVZWlHZnPKL5uUBqk+J7YDAlGYiw\nxiotnc3UqHy5joAJtdOYp7jAvr6rPhY/23w1gSGzPkvEl6ni7jfOdzodhZ/m\nSC5r/1Mz3X9khHwLVFNRVcqbVwZptqEYIMIZWcTKL4GW+AfXKvNOYp/kam9e\nLXwf\r\n=xmYS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/esm/index.js","gitHead":"e9ec40abf8a89bd5ee6ec549220852b04596c31a","scripts":{"lint":"eslint --ext .js,.ts ./src/**","test":"jest","build":"npm run clean && npm-run-all --parallel build:** && node ./scripts/add-package.js","clean":"rimraf ./dist","lint:fix":"npm run lint -- --fix","build:cjs":"tsc --module commonjs --target es2015 --outDir ./dist","build:esm":"tsc --module es2015 --target es5 --outDir ./dist/esm -d false","prepublishOnly":"npm run build"},"_npmUser":{"name":"terminalsystemsinc","email":"support@terminal.co"},"repository":{"url":"git+https://github.com/FleekHQ/browser-rpc.git","type":"git"},"_npmVersion":"6.14.12","description":"This library allows you exchange messages beetween BrowserRPC instances using window.postMessage API. You can call remote procedures as promises.","directories":{},"jsnext:main":"dist/esm/index.js","sideEffects":false,"_nodeVersion":"14.16.1","dependencies":{"joi":"^17.4.0","uuid":"^8.3.2","extensionizer":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^3.1.0","eslint":"^7.24.0","rimraf":"^3.0.0","ts-jest":"^26.5.5","typescript":"^4.2.4","@babel/core":"^7.13.16","@types/jest":"^26.0.22","@types/uuid":"^8.3.0","lint-staged":"^9.5.0","npm-run-all":"^4.1.5","babel-loader":"^8.2.2","@types/chrome":"^0.0.135","react-test-renderer":"^17.0.2","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.22.1","@typescript-eslint/parser":"^4.22.0","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.22.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/browser-rpc_2.0.2_1621028878037_0.893831371092858","host":"s3://npm-registry-packages"}},"2.0.3":{"name":"@fleekhq/browser-rpc","version":"2.0.3","keywords":["package","typescript"],"author":{"name":"Guillermo Puente","email":"guillermo@fleek.co"},"license":"MIT","_id":"@fleekhq/browser-rpc@2.0.3","maintainers":[{"name":"jsonsivar","email":"jsonsivar@gmail.com"},{"name":"janisonfleek","email":"janison@terminal.co"},{"name":"giankotarola12","email":"g.otarolarobledo@gmail.com"},{"name":"terminalsystemsinc","email":"support@terminal.co"},{"name":"samuelea","email":"batonenbois@gmail.com"},{"name":"perfectmak","email":"damiperfect@gmail.com"},{"name":"vojtechatfleek","email":"vojtech@fleek.co"},{"name":"gpuente","email":"guillermo.ps09@gmail.com"}],"homepage":"https://github.com/FleekHQ/browser-rpc#readme","bugs":{"url":"https://github.com/FleekHQ/browser-rpc/issues"},"dist":{"shasum":"d85e4ebd593aad2f2d8b56bab259e3947f623bfa","tarball":"https://registry.npmjs.org/@fleekhq/browser-rpc/-/browser-rpc-2.0.3.tgz","fileCount":43,"integrity":"sha512-TFj5/kOMoBqNUBp7Kf/ONrkXTVhhLcATlJYiUZmVWi8KRb+wtR2/Osvm0TrBxepUahT3Sv8bDPjMa11hg00iRQ==","signatures":[{"sig":"MEUCIQDw1picCQEHtGxkeMbFXnbo0EdJWUKXYBqaH4X1hxr6HAIgbu4Vtg+LBTthXwtEVy+DOBfvofVT3T9e9ALEd0sa/cA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2HWwCRA9TVsSAnZWagAAO1gQAJYaH7KhgQV+4yAk7TF8\nXwlZsspfTxfyFbY2k4U9WcwTLRyEFWAhKAyWLyfZwdXQzMsID228+/pC1cxS\nxcylgoxU8RaBgE8T4sdXF2K2ECW1KLzsUVaWycMU6dLD6oYCgqUt1WGITihs\n4L4oiP/EvSrtgLUOI3oxNsKOOdGQfJBm/J2r+gXVY46CGRbF08SgNxG/lvP+\n0zwkVeNwicIDau89wCV4sCAIvW8+clU/6YCJ6eJDwdJ0IO6LBFLV1V8N60e1\n23N1BlD+MA+KvXhOe7Pna2YX3N4/Jvl9vY8ypN6de/KbtysYRDkFeno2KnoJ\nYIwFDfNj3igLyndumgqlO86HEYdoQqEQmbJiAcpOyKsW6mKbDvjBN1yT8giI\nfBJcoONDI9vvpZdp9QaWHtN8BAZIgpAxl7WNCT0faPxbxNkRKC/QPshdtomw\n3KKGIjpRFWkxrLnvDYpriUnE3d7iaotoFaWKdRaMFwDkAT2Hb368E3+KT0x3\nkc93g7Fgyt5rZ1awcJeXez77LHeFgP89UIS5B8yYLgS5GjOZIf04Xfj4y8lv\nQvIp8QXAMBoG7Cai4SW14W36ze7ZAhVxnK55EMS10lv0XP/KvhgYV3oWTl5o\ntjPDLfsK9MC9F7gpTKyHbrUXklE4B7Rz6ZQJD/jus+caJoDn/yaHHfgTPhyK\n6KZA\r\n=x3Ho\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/esm/index.js","gitHead":"f9ed1c4adf850ec51adc7679e227b94f5f32d320","scripts":{"lint":"eslint --ext .js,.ts ./src/**","test":"jest","build":"npm run clean && npm-run-all --parallel build:** && node ./scripts/add-package.js","clean":"rimraf ./dist","lint:fix":"npm run lint -- --fix","build:cjs":"tsc --module commonjs --target es2015 --outDir ./dist","build:esm":"tsc --module es2015 --target es5 --outDir ./dist/esm -d false","prepublishOnly":"npm run build"},"_npmUser":{"name":"terminalsystemsinc","email":"support@terminal.co"},"repository":{"url":"git+https://github.com/FleekHQ/browser-rpc.git","type":"git"},"_npmVersion":"6.14.15","description":"This library allows you exchange messages beetween BrowserRPC instances using window.postMessage API. You can call remote procedures as promises.","directories":{},"jsnext:main":"dist/esm/index.js","sideEffects":false,"_nodeVersion":"14.17.6","dependencies":{"joi":"^17.4.0","uuid":"^8.3.2","extensionizer":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^3.1.0","eslint":"^7.24.0","rimraf":"^3.0.0","ts-jest":"^26.5.5","typescript":"^4.2.4","@babel/core":"^7.13.16","@types/jest":"^26.0.22","@types/uuid":"^8.3.0","lint-staged":"^9.5.0","npm-run-all":"^4.1.5","babel-loader":"^8.2.2","@types/chrome":"^0.0.135","react-test-renderer":"^17.0.2","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.22.1","@typescript-eslint/parser":"^4.22.0","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.22.0"},"peerDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/browser-rpc_2.0.3_1632937552853_0.09586463266948453","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-04-22T19:55:55.438Z","modified":"2024-12-26T14:22:29.821Z","1.0.0":"2021-04-22T19:55:55.916Z","2.0.0":"2021-05-04T18:20:57.386Z","2.0.1":"2021-05-13T18:13:25.770Z","2.0.2":"2021-05-14T21:47:58.180Z","2.0.3":"2021-09-29T17:45:53.019Z"},"bugs":{"url":"https://github.com/FleekHQ/browser-rpc/issues"},"author":{"name":"Guillermo Puente","email":"guillermo@fleek.co"},"license":"MIT","homepage":"https://github.com/FleekHQ/browser-rpc#readme","keywords":["package","typescript"],"repository":{"url":"git+https://github.com/FleekHQ/browser-rpc.git","type":"git"},"description":"This library allows you exchange messages beetween BrowserRPC instances using window.postMessage API. You can call remote procedures as promises.","maintainers":[{"email":"helder@fleek.xyz","name":"helderxyz"},{"email":"dev@fleek.xyz","name":"fleek.xyz"},{"email":"Nate@fleek.xyz","name":"natefleek"},{"email":"matthias@fleek.xyz","name":"matthias-wright"}],"readme":"# BrowserRPC\n\nThis library allows you exchange messages beetween BrowserRPC instances using window.postMessage API. You can call remote procedures as promises.\n\n## Installing\n\nUsing npm:\n```bash\n$ npm install @fleekhq/browser-rpc\n```\n\nUsing yarn\n```bash\n$ yarn add @fleekhq/browser-rpc\n```\n\n\n## Usage\n\nRPC requires that you setup a client (who calls remote procedures and wait for responses) and a server (who process the calls and send back the responses).\n\n\nLet's say that your client is going to be placed in your webpage and need to call a remote procedure method called `sum` that receives 2 arguments (2 number values to sum).\n\n```js\nimport { BrowserRPC } from '@fleekhq/browser-rpc';\n\n// Create a new rpc instance\n// the name is the identidfier of this rpc instance. Name is injected as part of the call message to identify who is trying to call the method requested.\n// the target is the name of the rpc server instance that should handle the request\nconst client = new BrowserRPC(window, {\n  name: 'browser-client',\n  target: 'rpc-server',\n  timeout: 10000,\n});\n\n// Before calling any remote method, you have to start the rpc instance. This way, the rpc instance listen for the incoming responses\nclient.start();\n\n// Now you can call the remote procedures using the \"call\" method. Take in mind that \"call\" method returns a promise that resolves to the response sent back by the rpc server or reejects with an error.\nclient\n  .call('sum', [1, 2])\n  .then((result) => {\n    console.log(result);\n  })\n  .catch((error) => {\n    console.error(error);\n  });\n\n\n// Finally, if you don't need to execute more calls, you can stop the rpc client. This method removes the listeners, which means that any incoming response is not going to be catched by the client. If later you need to call another method, you have to \"start\" the client again.\nclient.stop();\n```\n\nWe've already setup the client, now we have to setup the server. The server listen for methods calls, process the calls and send the responses back to the client. Take in mind that the server only process the calls coming from the `target` specified in the initial config object.\n```js\nimport { BrowserRPC } from '@fleekhq/browser-rpc';\n\n// Create a new rpc instance\n// name property is injected as part of the responses messages to identify who processed the response\n// target property specifies who can call methods on this new instance and receive the responses. If a different target try to call methods on this instance, the calls are ignored.\nconst server = new BrowserRPC(window, {\n  name: 'rpc-server',\n  target: 'browser-client',\n});\n\n\n/* In order to process the calls coming from the client, you have to expose \"handlers\".\nHandlers are just functions that receive as first argument a callback and the rest of arguments are defined by you.\nyour handler function has to call the callback once the response is procesed or when an error ocurred. the callback receives as first argumeent an ErrorRes object (please refer to the ErrorRes Type section) type and as second the response (any).\nTo expose a new handler you have to call the \"exposeHandler\" method on your rpc instance and pass a string name (this is the identifier for your handler) and your handler function. You can add as many handlers as you want.\n*/\nserver.exposeHandler('sum', ({ callback, message }, val1, val2) => {\n  console.log(message); // Full message\n  const result = val1 + val2;\n\n  callback(null, result);\n});\n\n\n// Finally, in order to start receiving incoming calls, you have to start your rpc instance.\n// Same as the client, you can stop the server whenever you want.\nserver.start();\n```\n\n\n## API\n\nFor types info please refer to the `types.ts` file: `src/types.ts`\n\n### New BrowserRPC instance:\n\n```js\nnew BrowserRPC(window, config)\n```\n\n- `window`: the window object used by the instance to post messages and add the event listeners.\n- `config`: [object] config required by the instance\n  - `name`: [string] name of the instance. This name is injected in every message emitted by the instance to identify the caller.\n  - `target`: [string] the name of the rpc instance that has to handle the call requests\n  - `timeout?`: [number] timeout for call methods. 0 means no timeout. by default this value is 5000 ms\n  - `handlers?` {[name: string]: Handler} object with handlers functions. object key is taken as the name identifier for the every handler function defined in the object\n\n\n### BrowserRPC.start(): void\nAdd the event listeners required by the instance\n\n### BrowserRPC.stop(): void\nRemove the event listeners and rejects all the pending calls.\n\n### BrowserRPC.exposeHandler(name: string, handler: Handler): void\nAdd a new handler to the instance\n\n### BrowserRPC.removeHandler(name: string): boolean\nRemove a handler by its name\n\n### BrowserRPC.call(handler: string, args: any[], config?: CallConfigObject): Promise<any>\nCall a new remote procedure method. Returns a promise resolving to the response or rejecting with an error.\n\n\n## ErrorRes Type\n\nYour handlers functions receive as first argument a callback function that has to be called with the response (second argument) or with an ErrorRes object as first argument if there is any error.\n\nErrorRes Type:\n```typescript\nexport type ErrorRes = {\n  code: number,\n  message: string,\n  data?: any,\n};\n```\n\nThis error type represents a JSON RPC error object. Please refer to the JSON RPC documentation to get information about error codes, message and data:\n\nhttps://www.jsonrpc.org/specification#error_object\n\n\n# ProxyRPC\n\nThis class is meant to be used on browser extensions content script. It allow proxy all the calls that arn't handled by the instance to the background script controller (see BackgroundController class). Same way, all the responses received from the BackgroundScript controller are redirected to the requester. (This class implements window.postMessage for the communication between webpages and content script, and browser.runtime.port for the cummunication between the content script and the background script).\n\n\n```js\nimport { ProxyRPC } from '@fleekhq/browser-rpc';\n\n// Create a new ProxyRPC instance\n// name property is injected as part of the responses messages to identify who processed the response\n// name property is also usid as the PORT name for the communication with the background script\n// target property specifies who can call methods on this new instance and receive the responses. If a different target try to call methods on this instance, the calls are ignored.\nconst server = new ProxyRPC(window, {\n  name: 'rpc-server',\n  target: 'browser-client',\n});\n\n\nserver.exposeHandler('sum', ({ callback, message }, val1, val2) => {\n  console.log(message); // Full message\n  const result = val1 + val2;\n\n  callback(null, result);\n});\n\nserver.start();\n```\n\nnow if you try to call the method `sum` from your client, you'll receive the response from the ProxyRPC instance, but if you try to call a method not defined into the Proxy, the call is going to be redirected to the background script using `Port` communication in order to be processed. If the method also doesn't exists in the background script controller, the call is rejected with an error.\n\n\n# BackgroundController\n\nThis class implements Port communication between the content script and other resources with access to the Port API. Similar to the BorwserRPC and ProxyRPC, you can expose handlers to process the requests.\n\n\n```js\nimport { BackgroundController } from '@fleekhq/browser-rpc';\n\nconst backgroundController = new BackgroundController({\n  name: 'bg-script',\n  trustedSources: [\n    'rpc-server',\n    'another-port-source',\n  ],\n});\n\nbackgroundController.exposeController('hello', (opts, name) => {\n  const { message, sender, callback } = opts;\n\n  console.log(message); // Full message\n  console.log(sender); // Sender information: port id, port name, port\n\n\n  callback(null, `hello ${name}!!!`);\n});\n\nbackgroundController.exposeController('remoteCall', (opts, myNumber, callId, portId) => {\n  const { callback } = opts;\n\n  callback(null, myNumber);\n  callback(null, myNumber, [{ portId, callId }]);\n});\n\nbackgroundController.start();\n```\n\n\n### BackgroundController.exposeHandler(name: string, handler: ControllerHandler): void\n\nAdd a new handler to the instance\n\n#### handler: (opts, ...args) => void\n- opts (object):\n  - sender: Sender information object\n    - id: port id assigned by the instance\n    - name: port name\n    - port: port\n  - ports: Map with all the ports handled by the instance:  Map<id: number, port>;\n  - message: The full message\n  - callback: callback used to send a response back to the sender port or to another port\n    - err: ErrorRes type if you want to send an error or null if is not required\n    - res: any, the respose that you want to send back to the sender\n    - targetPorts: optional, this is an array of objects with a portId and a callId (message call id). If you want to send a response to a different port, you have to pass this information, otherwise the callback is going to respond directly to the sender\n      - portId: number, the target port id\n      - callId: number | string, the call id\n\n```typescript\n  type HandlerProps = {\n    sender: {\n      id: number,\n      name: string,\n      port: chrome.runtime.Port,\n    },\n    ports: Map<number, chrome.runtime.Port>,\n    message: Message,\n    callback: (\n      err: ErrorRes | null,\n      res: any,\n      targetPorts?: {\n        portId: number,\n        callId: CallID,\n      }[],\n    ) => void,\n  };\n\n  type ControllerHandler = (\n    props: HandlerProps,\n    ...args: any[]\n  ) => void;\n```\n\n\n# PortRPC\n\nSimilar to BrowserRPC, this one is used to send requests to the BackgroundController using Port communication\n\n```js\nimport { PortRPC } from '@fleekhq/browser-rpc';\n\nconst client = new PortRPC({\n  name: 'browser-port-rpc',\n  target: 'bg-script',\n  timeout: 10000,\n});\n\nclient.start();\n\nclient\n  .call('sum', [1, 2])\n  .then((result) => {\n    console.log(result);\n  })\n  .catch((error) => {\n    console.error(error);\n  });\n```\n\n# Full Example\n\nHere is a full implementation of BrowserRPC, ProxyRPC, PortRPC and BackgroundController\n\nwebpage\n```js\n  import { BrowserRPC } from '@fleekhq/browser-rpc';\n\n  const client = new BrowserRPC(window, {\n    name: 'browser-client',\n    target: 'rpc-server',\n    timeout: 10000,\n  });\n\n  client.start();\n\n  // This call is handled directly by ProxyRPC since the handler is definded\n  client\n    .call('sum', [1, 2])\n    .then((result) => {\n      console.log(result); // result: 3. response processed by ProxyRPC handler\n    });\n\n\n  // In this case the method isn't defined on ProxyRPC so the call is redirected to the Background controller\n  client\n    .call('hello', ['Jhon'])\n    .then((result) => {\n      console.log(result); // result: \"hello John!!!\". response processed by BackgroundController handler\n    });\n```\n\ncontent script\n```js\n  import { ProxyRPC } from '@fleekhq/browser-rpc';\n  const server = new ProxyRPC(window, {\n    name: 'rpc-server',\n    target: 'browser-client',\n  });\n\n  server.exposeHandler('sum', ({ callback, message }, val1, val2) => {\n    console.log(message); // Full message\n    const result = val1 + val2;\n\n    callback(null, result);\n  });\n\n  server.start();\n```\n\n\nbackground script\n```js\n  import { BackgroundController } from '@fleekhq/browser-rpc';\n\n  const backgroundController = new BackgroundController({\n    name: 'bg-script',\n    trustedSources: [\n      'rpc-server',\n      'another-port-source',\n    ],\n  });\n\n  backgroundController.exposeController('hello', (opts, name) => {\n    const { message, sender, callback } = opts;\n\n    console.log(message); // Full message\n    console.log(sender); // Sender information: port id, port name, port\n\n\n    callback(null, `hello ${name}!!!`);\n  });\n\n  backgroundController.exposeController('remoteCall', (opts, myNumber, callId, portId) => {\n    const { callback } = opts;\n\n    callback(null, myNumber);\n\n    // here you can use another callID and portID to send a response to a different port if you want\n    callback(null, myNumber, [{ portId, callId }]); \n  });\n\n  backgroundController.start();\n```\n","readmeFilename":"README.md"}