{"_id":"@aligames/maga-open","_rev":"10-a146bba4bd5c0c29f3c2d80cba5590bb","name":"@aligames/maga-open","description":"maga sdk for gameopen protocol","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"@aligames/maga-open","version":"0.1.0","description":"maga sdk for gameopen protocol","dependencies":{"agentkeepalive":"^3.1.0","debug":"^2.6.6","is-type-of":"^1.0.0","md5":"^2.2.1","urllib":"^2.22.0"},"devDependencies":{"@ali/ci":"^3.4.0","assert-extends":"^1.0.1","autod":"^2.8.0","beautify-benchmark":"^0.2.4","benchmark":"^2.1.4","egg-bin":"^3.3.2","eslint":"^3.19.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","webstorm-disable-index":"^1.1.2"},"main":"lib/index.js","engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","benchmark":"node benchmark/protocol.js","pkgfiles":"egg-bin pkgfiles"},"ci":{"version":"6, 7"},"repository":{"type":"git","url":""},"author":{"name":"TZ","email":"liuyong.ly3@alibaba-inc.com"},"license":"MIT","gitHead":"3e678ab8abb939a3cce84b37dde0809a7f247019","_id":"@aligames/maga-open@0.1.0","_shasum":"390aac14ab8ca91c976dd60a72e39870eb4c17da","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"390aac14ab8ca91c976dd60a72e39870eb4c17da","tarball":"https://registry.npmjs.org/@aligames/maga-open/-/maga-open-0.1.0.tgz","integrity":"sha512-ZieR0H+k6I5+krVexewGBE3aVEQP7sEIPH+NaJBYTti1lSbuPG4c/RoCHOlAUHUh30ozTZyTm3XEpWPp8TuKnA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtZcuworMQC8zL6OsaiFT82ZS+PpUewWu8vSu/bku9VwIgH1bePPnF7miKB8KFVbWfL+edHtimQ+DY37gHSbZcoWg="}]},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/maga-open-0.1.0.tgz_1493888886285_0.9521885665599257"}},"0.2.0":{"name":"@aligames/maga-open","version":"0.2.0","description":"maga sdk for gameopen protocol","dependencies":{"agentkeepalive":"^3.1.0","chalk":"^1.1.3","egg-logger":"^1.6.0","is-type-of":"^1.0.0","md5":"^2.2.1","urllib":"^2.22.0"},"devDependencies":{"@ali/ci":"^3.4.0","assert-extends":"^1.0.1","autod":"^2.8.0","beautify-benchmark":"^0.2.4","benchmark":"^2.1.4","egg-bin":"^3.3.2","eslint":"^3.19.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","webstorm-disable-index":"^1.1.2"},"main":"lib/index.js","engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","benchmark":"node benchmark/protocol.js","pkgfiles":"egg-bin pkgfiles"},"ci":{"version":"6, 7"},"repository":{"type":"git","url":""},"author":{"name":"TZ","email":"liuyong.ly3@alibaba-inc.com"},"license":"MIT","gitHead":"aa7e35a11c1546e54d43c97df4141f15d482d363","_id":"@aligames/maga-open@0.2.0","_shasum":"87aee315c908e198e852bf4733e8cb76a1feb4a9","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"87aee315c908e198e852bf4733e8cb76a1feb4a9","tarball":"https://registry.npmjs.org/@aligames/maga-open/-/maga-open-0.2.0.tgz","integrity":"sha512-Jn7sVIL3uqhVEt4TY6eaFWthR9n2mD1iNOroT5+lKLFtZyEexRtwOlF3r+ZpMFv0FSyp/Ay1lX25nuNF1BJEYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGGPQPfPDJ37IlbcXGnoq6b7Q5C6oZTlSpRjwue0f1kCAiEA0kW9Qpp602ToHfmMAYIdhLAjP+wabt+GWfOIFK7AdIs="}]},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/maga-open-0.2.0.tgz_1493948308123_0.8822279130108654"}},"0.3.0":{"name":"@aligames/maga-open","version":"0.3.0","description":"maga sdk for gameopen protocol","dependencies":{"agentkeepalive":"^3.1.0","chalk":"^1.1.3","co":"^4.6.0","egg-logger":"^1.6.0","is-type-of":"^1.0.0","md5":"^2.2.1","minimist":"^1.2.0","urllib":"^2.22.0"},"devDependencies":{"@ali/ci":"^3.4.0","assert-extends":"^1.0.1","autod":"^2.8.0","beautify-benchmark":"^0.2.4","benchmark":"^2.1.4","egg-bin":"^3.3.2","eslint":"^3.19.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","webstorm-disable-index":"^1.1.2"},"main":"lib/index.js","engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","benchmark":"node test/benchmark/protocol.js","pkgfiles":"egg-bin pkgfiles"},"ci":{"version":"6, 7"},"repository":{"type":"git","url":""},"author":{"name":"TZ","email":"liuyong.ly3@alibaba-inc.com"},"license":"MIT","gitHead":"b87f29d439220d436131f164f5c5ed0738de39f8","_id":"@aligames/maga-open@0.3.0","_shasum":"8f8c58afa3e09de9ec52291f4fbac097ee5186c4","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"8f8c58afa3e09de9ec52291f4fbac097ee5186c4","tarball":"https://registry.npmjs.org/@aligames/maga-open/-/maga-open-0.3.0.tgz","integrity":"sha512-ktcG6a9ctOhO1Qj043Rp/zqIPV5bpkSxXnCM4gGJ5yBNeOt3hsJT2qfo1TumxJc2z5dzpgBQ8OO9gSIzE8s7CQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQc6P1TnGLp5XpUAL2HoBTpoO4VTaqEl8IXw2QfFiRDAiEA2HYfeyutCKJ8NalcyRyI/5BtVTh5c/Z605N3ew+ND0A="}]},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/maga-open-0.3.0.tgz_1493972778324_0.4359185316134244"}},"0.4.0":{"name":"@aligames/maga-open","version":"0.4.0","description":"maga sdk for gameopen protocol","dependencies":{"agentkeepalive":"^3.1.0","chalk":"^1.1.3","co":"^4.6.0","egg-logger":"^1.6.0","is-type-of":"^1.0.0","md5":"^2.2.1","minimist":"^1.2.0","urllib":"^2.22.0"},"devDependencies":{"@ali/ci":"^3.4.0","assert-extends":"^1.0.1","autod":"^2.8.0","beautify-benchmark":"^0.2.4","benchmark":"^2.1.4","egg-bin":"^3.3.2","eslint":"^3.19.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","webstorm-disable-index":"^1.1.2"},"main":"index.js","engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","benchmark":"node test/benchmark/protocol.js","pkgfiles":"egg-bin pkgfiles"},"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+ssh://git@github.com/aliplay-team/maga-client-nodejs-open.git"},"author":{"name":"TZ","email":"liuyong.ly3@alibaba-inc.com"},"license":"MIT","gitHead":"296f18bb5e3e143f8fc5a7fb3d27dceffdf26c74","bugs":{"url":"https://github.com/aliplay-team/maga-client-nodejs-open/issues"},"homepage":"https://github.com/aliplay-team/maga-client-nodejs-open#readme","_id":"@aligames/maga-open@0.4.0","_shasum":"adff153eb7e35477d3915e0cff3a1422e90ec1d7","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"adff153eb7e35477d3915e0cff3a1422e90ec1d7","tarball":"https://registry.npmjs.org/@aligames/maga-open/-/maga-open-0.4.0.tgz","integrity":"sha512-BnccP/Bm0droWqhaTyiX5BIqpC0ZQC6vUkd18JzzLF7C7RoFvTd+ZfbUiEeo94CQTIQTGbqz6JUgPeyhFXjjnw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUSuZPZCzngPnz10R7cB4a6nyaJbI1tzCZ76u4Ax2pYAIgf7qgyfRuoYj1bvcIECamwTuxz1cl7MOFSfJOaJWiNOk="}]},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/maga-open-0.4.0.tgz_1493974214886_0.8365297231357545"}},"0.5.0":{"name":"@aligames/maga-open","version":"0.5.0","description":"maga sdk for gameopen protocol","dependencies":{"agentkeepalive":"^3.1.0","chalk":"^1.1.3","co":"^4.6.0","egg-logger":"^1.6.0","is-type-of":"^1.0.0","md5":"^2.2.1","minimist":"^1.2.0","urllib":"^2.22.0"},"devDependencies":{"@ali/ci":"^3.4.0","assert-extends":"^1.0.1","autod":"^2.8.0","beautify-benchmark":"^0.2.4","benchmark":"^2.1.4","egg-bin":"^3.3.2","eslint":"^3.19.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","webstorm-disable-index":"^1.1.2"},"main":"index.js","bin":{"maga-cli":"bin/maga-cli.js"},"engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","benchmark":"node test/benchmark/protocol.js","pkgfiles":"egg-bin pkgfiles"},"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+ssh://git@github.com/aliplay-team/maga-client-nodejs-open.git"},"author":{"name":"TZ","email":"liuyong.ly3@alibaba-inc.com"},"license":"MIT","gitHead":"296f18bb5e3e143f8fc5a7fb3d27dceffdf26c74","bugs":{"url":"https://github.com/aliplay-team/maga-client-nodejs-open/issues"},"homepage":"https://github.com/aliplay-team/maga-client-nodejs-open#readme","_id":"@aligames/maga-open@0.5.0","_shasum":"7bad8f7ea3ae78af528827c358c77168ff274c70","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"7bad8f7ea3ae78af528827c358c77168ff274c70","tarball":"https://registry.npmjs.org/@aligames/maga-open/-/maga-open-0.5.0.tgz","integrity":"sha512-htEqgRD27d5NF1elQomwNa6k9mvgnrEyzaW0RUp5TkA4lsf+F2nUxzjlyuc9nSv32CeHKzLefSbhDS122W7KPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH16dcNQGgnMrmUnSwUw1VsWy3YT1/5gytiQHWRRmdPaAiBTJagWUgwfET5zlNetS9iUpyCK2RhfCydXC6PnTehJtw=="}]},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/maga-open-0.5.0.tgz_1493975848804_0.3883370612747967"}},"0.6.0":{"name":"@aligames/maga-open","version":"0.6.0","description":"maga sdk for gameopen protocol","dependencies":{"agentkeepalive":"^3.1.0","chalk":"^1.1.3","co":"^4.6.0","egg-logger":"^1.6.0","is-type-of":"^1.0.0","md5":"^2.2.1","minimist":"^1.2.0","urllib":"^2.22.0"},"devDependencies":{"assert-extends":"^1.0.1","autod":"^2.8.0","beautify-benchmark":"^0.2.4","benchmark":"^2.1.4","egg-bin":"^3.3.2","egg-ci":"^1.6.0","eslint":"^3.19.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","webstorm-disable-index":"^1.1.2"},"main":"index.js","bin":{"maga-cli":"bin/maga-cli.js"},"engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","benchmark":"node test/benchmark/protocol.js","pkgfiles":"egg-bin pkgfiles"},"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+ssh://git@github.com/aliplay-team/maga-client-nodejs-open.git"},"homepage":"https://github.com/aliplay-team/maga-client-nodejs-open","author":{"name":"TZ","email":"liuyong.ly3@alibaba-inc.com"},"license":"MIT","gitHead":"45185e9c494f75c0db0f36ea8e6755e1f3df2b42","bugs":{"url":"https://github.com/aliplay-team/maga-client-nodejs-open/issues"},"_id":"@aligames/maga-open@0.6.0","_shasum":"15857bc1f4997d1b222809e951ab5bf9b46a6520","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"15857bc1f4997d1b222809e951ab5bf9b46a6520","tarball":"https://registry.npmjs.org/@aligames/maga-open/-/maga-open-0.6.0.tgz","integrity":"sha512-GdTtTdxdUhDoc9dOK3uQtUDvdP1CuZSlCMkXPE2URTh4rpX8TtoGC8rC6FaaEjr6w/fXogFkEkp5EE+/Ritlmg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD21s6uw7iQVQRHWSsUBuLJSvCCq1mNHMMLSU+eb7NFpwIhAOHTlE7vGEJHI+NDuJSGp46rNRH//6UbUVpm6YCgL70Z"}]},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/maga-open-0.6.0.tgz_1493977660938_0.8812527055852115"}},"0.7.0":{"name":"@aligames/maga-open","version":"0.7.0","description":"maga sdk for gameopen protocol","dependencies":{"agentkeepalive":"^3.1.0","chalk":"^1.1.3","co":"^4.6.0","egg-logger":"^1.6.0","is-type-of":"^1.0.0","md5":"^2.2.1","minimist":"^1.2.0","urllib":"^2.22.0"},"devDependencies":{"autod":"^2.8.0","beautify-benchmark":"^0.2.4","benchmark":"^2.1.4","egg-bin":"^3.3.2","egg-ci":"^1.6.0","eslint":"^3.19.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","webstorm-disable-index":"^1.1.2"},"main":"index.js","bin":{"maga-cli":"bin/maga-cli.js"},"engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","benchmark":"node test/benchmark/protocol.js","pkgfiles":"egg-bin pkgfiles"},"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+ssh://git@github.com/aliplay-team/maga-client-nodejs-open.git"},"homepage":"https://github.com/aliplay-team/maga-client-nodejs-open","author":{"name":"TZ","email":"liuyong.ly3@alibaba-inc.com"},"license":"MIT","gitHead":"9ae1a908da9facbc5b3b95bf27df339677f8fae9","bugs":{"url":"https://github.com/aliplay-team/maga-client-nodejs-open/issues"},"_id":"@aligames/maga-open@0.7.0","_shasum":"ef9575ba3ecd7a6af85b0464b526ebf83d083186","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"ef9575ba3ecd7a6af85b0464b526ebf83d083186","tarball":"https://registry.npmjs.org/@aligames/maga-open/-/maga-open-0.7.0.tgz","integrity":"sha512-+kJM2rbNYFxZUan3VqGZBwHxmvWNCEZJHN71/o2IbL0cz1uJyfXbaPA+iW/VoKvlvtQ4YrdZ4NbMVxA6EHh0nw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXi5fgTLBa8gfJUF4g70U1zmCqbIX9QzrICsKeGsnNTAiB7QHrQIv+A9et6qTJgRPw2FQ26YK+m1iqlCOP46NGRoA=="}]},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/maga-open-0.7.0.tgz_1493978729106_0.5331790137570351"}},"0.8.0":{"name":"@aligames/maga-open","version":"0.8.0","description":"maga sdk for gameopen protocol","dependencies":{"agentkeepalive":"^3.1.0","chalk":"^1.1.3","co":"^4.6.0","egg-logger":"^1.6.0","is-type-of":"^1.0.0","md5":"^2.2.1","minimist":"^1.2.0","urllib":"^2.22.0"},"devDependencies":{"autod":"^2.8.0","beautify-benchmark":"^0.2.4","benchmark":"^2.1.4","egg-bin":"^3.3.2","egg-ci":"^1.6.0","eslint":"^3.19.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","mz-modules":"^1.0.0","webstorm-disable-index":"^1.1.2"},"main":"index.js","bin":{"maga-cli":"bin/maga-cli.js"},"engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","benchmark":"node test/benchmark/protocol.js","pkgfiles":"egg-bin pkgfiles"},"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+ssh://git@github.com/aliplay-team/maga-client-nodejs-open.git"},"homepage":"https://github.com/aliplay-team/maga-client-nodejs-open","author":{"name":"TZ","email":"liuyong.ly3@alibaba-inc.com"},"license":"MIT","gitHead":"5944906d13a833c8b70434a03bafd87d0086b2a0","bugs":{"url":"https://github.com/aliplay-team/maga-client-nodejs-open/issues"},"_id":"@aligames/maga-open@0.8.0","_shasum":"c65649f6b87c145575870f4e8f3862c55696146c","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"c65649f6b87c145575870f4e8f3862c55696146c","tarball":"https://registry.npmjs.org/@aligames/maga-open/-/maga-open-0.8.0.tgz","integrity":"sha512-ajAD1LXSUQQQCF8IPH4Z1vXY6Gb/1qAHd7Nd3SK/IAB1K4JULJ5F1WKwuJ+IkY/2Sxn2T10K4QABRTdXh4DdTg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFrHaACZ1YOl3kv//EXkqhhcQOKNv602v8cSkuEsxaPoAiEA11KVOdIC1x6rjVB8ykQn50YsoiB9ExgdaDYdJzhfYFU="}]},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/maga-open-0.8.0.tgz_1493987972854_0.9393829696346074"}},"1.0.0":{"name":"@aligames/maga-open","version":"1.0.0","description":"maga sdk for gameopen protocol","dependencies":{"agentkeepalive":"^3.1.0","chalk":"^1.1.3","co":"^4.6.0","egg-logger":"^1.6.0","is-type-of":"^1.0.0","md5":"^2.2.1","minimist":"^1.2.0","urllib":"^2.22.0"},"devDependencies":{"autod":"^2.8.0","beautify-benchmark":"^0.2.4","benchmark":"^2.1.4","egg-bin":"^3.3.2","egg-ci":"^1.6.0","eslint":"^3.19.0","eslint-config-egg":"^3.2.0","mm":"^2.1.0","mz-modules":"^1.0.0","webstorm-disable-index":"^1.1.2"},"main":"index.js","bin":{"maga-cli":"bin/maga-cli.js"},"engines":{"node":">=6.0.0"},"scripts":{"autod":"autod","lint":"eslint .","test":"npm run lint -- --fix && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","ci":"npm run lint && npm run cov","benchmark":"node test/benchmark/protocol.js","pkgfiles":"egg-bin pkgfiles"},"ci":{"version":"6, 7"},"repository":{"type":"git","url":"git+ssh://git@github.com/aliplay-team/maga-client-nodejs-open.git"},"homepage":"https://github.com/aliplay-team/maga-client-nodejs-open","author":{"name":"TZ","email":"liuyong.ly3@alibaba-inc.com"},"license":"MIT","gitHead":"548081a7b81824a64d8760b5c786b010ed38c985","bugs":{"url":"https://github.com/aliplay-team/maga-client-nodejs-open/issues"},"_id":"@aligames/maga-open@1.0.0","_shasum":"f2c384f44898beaa345e25d9c7d193636f9ad0ae","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"atian25","email":"atian25@qq.com"},"dist":{"shasum":"f2c384f44898beaa345e25d9c7d193636f9ad0ae","tarball":"https://registry.npmjs.org/@aligames/maga-open/-/maga-open-1.0.0.tgz","integrity":"sha512-uQNjVR+aLsd93ZYTxZAngC/9JQlAoY3v6X3SlyCzvCRaGh5GhEqAtCu1x7T8K28uIZ62EELNFtqoDronMs+Bnw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHrvtQGPEkq7GIdB0bq7IRyq5xOe5B+s4J0nh/FUsIoPAiB0d6vz4Vm2DV6961+AtP7ig3VJIXWwDxZaYeHlYgVIBg=="}]},"maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/maga-open-1.0.0.tgz_1494214504338_0.8072553232777864"}}},"readme":"# @aligames/maga-open\n\n阿里游戏 API 网关 - Node.js SDK\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![NPM download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/@aligames/maga-open.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/@aligames/maga-open\n[travis-image]: https://img.shields.io/travis/aliplay-team/maga-client-nodejs-open.svg?style=flat-square\n[travis-url]: https://travis-ci.org/aliplay-team/maga-client-nodejs-open\n[codecov-image]: https://codecov.io/gh/aliplay-team/maga-client-nodejs-open/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/aliplay-team/maga-client-nodejs-open/maga-open\n[david-image]: https://img.shields.io/david/aliplay-team/maga-client-nodejs-open.svg?style=flat-square\n[david-url]: https://david-dm.org/aliplay-team/maga-client-nodejs-open\n[snyk-image]: https://snyk.io/test/npm/@aligames/maga-open/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/@aligames/maga-open\n[download-image]: https://img.shields.io/npm/dm/@aligames/maga-open.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@aligames/maga-open\n\n提供了 API 的请求封装、摘要签名、响应解释、消息监听等功能，使用 SDK 可以轻松完成 API 的调用，API 结果的获取。\n\n## 安装依赖\n\n仅支持 Node.js 6.x 以上版本。\n\n```bash\nnpm i @aligames/maga-open --save\n```\n\n## 使用方法\n\n### 作为消费者，发起请求\n\n- 通过 `new Sdk.Client({ key, secret })` 进行初始化，需要提供 `key`，`secret` 配置。\n- 使用 `yield client.request({ service, data, options })` 来封包，发送请求给服务端，以及解析服务端返回数据。\n\n```js\nconst Sdk = require('@aligames/maga-open');\nconst client = new Sdk.Client({\n  key: '<your_app_key>',\n  secret: '<your_app_secret>',\n  // host: 'http://',\n  // level: 'INFO',\n  // timeout: 5000, // 超时时间，默认为 5000ms\n  // required: true, // 遇到错误时，直接抛错还是返回错误对象，便于组合请求，默认为 true - 抛错\n  // prefix: 'MAGA',\n  // logfile: 'path/to/log/file',\n  // logger: my_custom_logger,\n});\n\nconst result = yield client.request({\n  // API 名称，必须用 / 开头\n  service: '/api/xxx',\n  // 请求的数据体\n  data: {\n    uid: 'tz',\n  },\n});\n\n// 返回的对象中，包含 { id, data, state, headers }\nconsole.log(result.data);\n```\n\n并发组合请求：\n\n```js\nconst result = yield {\n  api1: client.request({ service: '/api/xxx', data: { uid: 'tz' } }),\n  api2: client.request({ service: '/api/yyy' }),\n};\n\nconst data = {};\nObject.keys(result).forEach(key => data[key] = result[key].data);\n\n// 返回的对象中，包含 { api1: {}, api2: {} }\nconsole.log(result.api1.data);\n\n// 提取出所有 data\nconsole.log(data);\n```\n\n错误处理：\n\n```js\ntry {\n  const result = yield client.request({\n    service: '/api/xxx',\n    data: {\n      uid: 'tz',\n    },\n  });\n} catch (err) {\n  // { message, code, data }\n  console.error(err);\n}\n```\n\n对特定请求配置：\n\n```js\nconst config = {\n  // API 名称，必须用 / 开头\n  service: '/api/xxx',\n  // 请求的数据体\n  data: {\n    uid: 'tz',\n  },\n};\n\nconst result = yield client.request(config, {\n  timeout: 100000,\n  required: false,\n});\n\n// api1 是关键请求，失败了则整个失败，而 api2 请失败时，不会报错，此时 result.api2 是 error 对象\nconst combo = yield {\n  api1: client.request({ service: '/api/xxx', data: { uid: 'tz' } }),\n  api2: client.request({ service: '/api/yyy' }, { required: false }),\n};\n```\n\n### 作为服务提供方，提供接口服务\n\n- 通过 `new Sdk.Server({ keystore })` 进行初始化，需要提供 `keystore` 配置。\n- 使用 `server.decode({ meta, payload })` 解析客户端传递过来的请求体，解析出错会抛错，请注意 `try catch` 处理。\n- 使用 `server.response({ result, id, code, msg })` 对响应数据进行封包，返回 `{ meta, payload }` 供开发者使用，前者用于配置 headers，后者是 buffer 直接返回给对端。\n\n```js\nconst Sdk = require('@aligames/maga-open');\nconst server = new Sdk.Server({\n  // 允许访问的 app key 和 secret 值对\n  keystore: {\n    '<your_app_key>': '<your_app_secret>',\n  },\n  // level: 'INFO',\n  // prefix: 'MAGA SERVER',\n  // logfile: 'path/to/log/file',\n  // logger: my_custom_logger,\n});\n\n// 获取客户端发送的请求对象，需传递 headers 和 req body buffer，进行解码，解析出错会抛错，请注意 `try catch` 处理。\nconst body = server.decode({ meta: ctx.headers, payload: rawBody });\n\n// 进行业务逻辑处理，如查询数据库\nconst result = { uid: 'tz', from: 'server' };\n\ntry {\n  // 对返回结果进行封包\n  const { meta, payload } = server.response({ id: id || Date.now(), code, msg, result });\n\n  // 返回 headers\n  ctx.set(meta);\n\n  // 返回请求体，buffer\n  ctx.body = payload;\n\n} catch (err) {\n  // 需要自己处理报错后的返回\n  ctx.status = err.code;\n  ctx.body = err;\n}\n```\n\n### 调试\n\n我们给开发者提供了 cli 命令，用于本地发起请求。\n\n```bash\n$ maga-cli request --key=<key> --secret=<secret> <payload json string>\n$ maga-cli encode --key=<key> --secret=<secret>  <payload json string>\n$ maga-cli decode --key=<key> --secret=<secret>  <payload base64 string>\n```\n\n示例：\n\n```bash\n$ node ./node_modules/.bin/maga-cli --key=ngclient#2dcd --secret=wqjx0iXcRw2uEXdmjlruzw003 --host=\"http://localhost:7001\" request '{\"service\":\"/api/csbiz.account.findUserById?ver=1.0.0\",\"data\":{\"uid\":\"tz\"}}'\n\n$ node bin/maga-cli.js --key=ngclient#2dcd --secret=wqjx0iXcRw2uEXdmjlruzw003 --host=\"http://100.84.254.233:7001\" decode 'Rn+Cek0ATDXYJvkDxgiJ20+wRP4XdvFKcp4XXePyj+R83W9H+yct6LEIzrlP9cw6tohaF1a1AhcXnayIv+TfY18Kr7uJ8v9mdDBx1Efc3BUtDS3LJzW3BBhXBYeQ5C0B'\n```\n\n### 质量\n\n我们的类库严格遵循 [Semver 版本规则](http://semver.org/lang/zh-CN/)，故强烈建议开发者通过 `^` 的方式引入，即:\n\n```json\n{\n  \"dependencies\": {\n    \"@aligames/maga-open\": \"^1.0.0\"\n  }\n}\n```\n\n单元测试覆盖率：\n\n```bash\n=============================== Coverage summary ===============================\nStatements   : 100% ( 190/190 )\nBranches     : 100% ( 80/80 )\nFunctions    : 100% ( 19/19 )\nLines        : 100% ( 188/188 )\n================================================================================\n```\n\n### 服务端开发\n\n参见示例： https://github.com/aliplay-team/maga-client-nodejs-open-example\n\n推荐使用我们开源的『企业级的 Node.js Web 基础框架』 - eggjs\n- 官方地址：https://eggjs.org/\n- 介绍：https://zhuanlan.zhihu.com/p/25860846\n\n## 反馈\n\n- 联系接口同学\n- 或提交 [Issue](https://github.com/aliplay-team/maga-client-nodejs-open/issues)\n","maintainers":[{"name":"atian25","email":"atian25@qq.com"}],"time":{"modified":"2022-06-12T14:31:18.236Z","created":"2017-05-04T09:08:08.737Z","0.1.0":"2017-05-04T09:08:08.737Z","0.2.0":"2017-05-05T01:38:30.580Z","0.3.0":"2017-05-05T08:26:18.604Z","0.4.0":"2017-05-05T08:50:17.541Z","0.5.0":"2017-05-05T09:17:29.175Z","0.6.0":"2017-05-05T09:47:41.203Z","0.7.0":"2017-05-05T10:05:29.352Z","0.8.0":"2017-05-05T12:39:33.148Z","1.0.0":"2017-05-08T03:35:06.239Z"},"repository":{"type":"git","url":"git+ssh://git@github.com/aliplay-team/maga-client-nodejs-open.git"},"author":{"name":"TZ","email":"liuyong.ly3@alibaba-inc.com"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/aliplay-team/maga-client-nodejs-open","bugs":{"url":"https://github.com/aliplay-team/maga-client-nodejs-open/issues"}}