{"_id":"@dengzhaofun/egg-wechat-all","_rev":"1-30b71e8bcb7605600a607c2cde94885c","name":"@dengzhaofun/egg-wechat-all","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.4":{"name":"@dengzhaofun/egg-wechat-all","version":"0.1.4","description":"wechat support for egg","eggPlugin":{"name":"wechatAll","dependencies":["redis"]},"keywords":["egg","eggPlugin","egg-plugin","egg-wechat","wechat","wechat-api","wechat-oauth","wechat-payment"],"dependencies":{"co-wechat":"^2.3.0","co-wechat-api":"^3.8.1","co-wechat-oauth":"^2.0.1","co-wechat-payment":"^0.2.0","egg-redis":"^2.2.0"},"devDependencies":{"autod":"^3.0.1","autod-egg":"^1.1.0","egg":"^2.14.1","egg-bin":"^4.9.0","egg-ci":"^1.10.0","egg-mock":"^3.20.1","eslint":"^5.9.0","eslint-config-egg":"^7.1.0","webstorm-disable-index":"^1.2.0"},"engines":{"node":">=8.0.0"},"scripts":{"test":"npm run lint -- --fix && egg-bin pkgfiles && npm run test-local","test-local":"egg-bin test","cov":"egg-bin cov","lint":"eslint .","ci":"egg-bin pkgfiles --check && npm run lint && npm run cov","pkgfiles":"egg-bin pkgfiles","autod":"autod"},"ci":{"version":"8, 9"},"repository":{"type":"git","url":"git+https://github.com/qdechochen/egg-wechat-all.git"},"bugs":{"url":"https://github.com/qdechochen/egg-wechat-all/issues"},"homepage":"https://github.com/qdechochen/egg-wechat-all","author":{"name":"qdechochen"},"license":"MIT","gitHead":"76f4dc9175876e341cafadd316f2059fc86ddb5c","_id":"@dengzhaofun/egg-wechat-all@0.1.4","_npmVersion":"6.4.1","_nodeVersion":"11.0.0","_npmUser":{"name":"dengzhaofun","email":"3328638734@qq.com"},"maintainers":[{"name":"dengzhaofun","email":"3328638734@qq.com"}],"dist":{"integrity":"sha512-9gSaEMoK+ohoj4hey5GkSkulr+DMNnxBFncy7qSVlX4Uv+T4L3oULSVP073tGZxTjzcQyQupsO+xII48znBGKg==","shasum":"dd6841b00ffac1dd12f5aa3e9cdf0da11fa37f19","tarball":"https://registry.npmjs.org/@dengzhaofun/egg-wechat-all/-/egg-wechat-all-0.1.4.tgz","fileCount":9,"unpackedSize":13158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCP1VCRA9TVsSAnZWagAAIn0P/i8in3wcBd9NADadjGdg\nGJ73eIA2JKXeLzvdqPKxUprhcSp3zDlwC53kY2t/BVv2F0sKrm+XlcK5H9Kn\nFYFdzm0KpnZd+cWU0JKQIajfqp3u+K4+vlNPcMhSune0I1sHhi/lYTxcFg4j\nw83lYpf77YYDZTd/+VQZ0/0XvqM+wSs80k5nuHuNFD4PSEmsH7/u+0Av1uhc\nUFeNZNlVadRcPzh/wUh/1U2yJQyCiF7bCz9yPLJLHa03afFAxUbLs9F1sUEy\n48+dDpf7AQGqmR68SonBNi6PLLFPP1GVum2KMxegdyrk5JbmQF4jU2jyOxJC\nk8fZTAjdnt1ueQEIQgqwNj0NZbbQTx/8OuxCHasdgJWCf4WKhgAkFs+E82Kx\niPdVcZCEWp55yi46DmTK9kdEzxJxoP3HNjzMZaQhyh6XhNnIsJvmKD56Uyl4\nwIHzsChO1jGS1YpZOgqBmdgNqmLXeUZAf+ZusDY0NzhFTGUl9m4V4yUHHw41\ncIyoC2ACXB8s+bp8NSqzF6lEc1bOjsk6EQvFPJ/DllDizVPBRUiV/jkb0dQa\nSILd3qENaGsDHbndIznMp/I3bUs5xzNLZfUF+dy3n5fv7AHrhb82yrGUN1fw\ngceVQs5M1u0NUy98+eQtLsfgIGqRVj1oh3I2acUhYG/8gs5VooTu3YouXB99\nGxXi\r\n=5JxJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSN6Th6UaUR8odyL1YT+U+JvvYfqUYKZwfiNSxUeT+tAIge9GzB1MwYZmX7yodj9aVOQS/Jt6JeBl1w5tJYD1uLr4="}]},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-wechat-all_0.1.4_1544093012567_0.3179259586636609"},"_hasShrinkwrap":false}},"time":{"created":"2018-12-06T10:43:32.399Z","0.1.4":"2018-12-06T10:43:32.703Z","modified":"2022-04-05T03:44:55.676Z"},"maintainers":[{"name":"dengzhaofun","email":"3328638734@qq.com"}],"description":"wechat support for egg","homepage":"https://github.com/qdechochen/egg-wechat-all","keywords":["egg","eggPlugin","egg-plugin","egg-wechat","wechat","wechat-api","wechat-oauth","wechat-payment"],"repository":{"type":"git","url":"git+https://github.com/qdechochen/egg-wechat-all.git"},"author":{"name":"qdechochen"},"bugs":{"url":"https://github.com/qdechochen/egg-wechat-all/issues"},"license":"MIT","readme":"# egg-wechat-all\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/egg-wechat-all.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/egg-wechat-all\n[travis-image]: https://img.shields.io/travis/eggjs/egg-wechat-all.svg?style=flat-square\n[travis-url]: https://travis-ci.org/eggjs/egg-wechat-all\n[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-wechat-all.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/eggjs/egg-wechat-all?branch=master\n[david-image]: https://img.shields.io/david/eggjs/egg-wechat-all.svg?style=flat-square\n[david-url]: https://david-dm.org/eggjs/egg-wechat-all\n[snyk-image]: https://snyk.io/test/npm/egg-wechat-all/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/egg-wechat-all\n[download-image]: https://img.shields.io/npm/dm/egg-wechat-all.svg?style=flat-square\n[download-url]: https://npmjs.org/package/egg-wechat-all\n\n<!--\nDescription here.\n-->\n\n## Install\n\n```bash\n$ npm i egg-wechat-all --save\n```\n\n## Usage\n\n```js\n// {app_root}/config/plugin.js\nexports.wechatAll = {\n  enable: true,\n  package: 'egg-wechat-all',\n};\n\n```\n[egg-redis](https://www.npmjs.com/package/egg-redis) is required.\n\n## Configuration\n\n```js\n// {app_root}/config/config.default.js\nexports.wechatAll = {\n  appid: '',\n  appsecret: '',\n  token: '',\n  encodingAESKey: '',\n  payment: {\n    partnerKey: '',\n    mchId: '',\n    notifyUrl: '',\n    pfx: '',\n  },\n  modules: {\n    message: true,  // enable or disable co-wechat\n    api: true,  // enable or disable co-wechat-api\n    oauth: true,  // enable or disable co-wechat-oauth\n    payment: true,  // enable or disable co-wechat-payment\n  },\n;\n```\n\nsee [config/config.default.js](config/config.default.js) for more details.\n\n## How\n\n```js\napp.wechat.messageMiddleware //co-wechat middleware\napp.wechat.api  // co-wechat-api\napp.wechat.oauth  // co-wechat-oauth\napp.wechat.payment  // co-wechat-payment\n```\n\nFor more details, please refer to the following links.\n\n[co-wechat] (https://github.com/node-webot/co-wechat)\n\n[co-wechat-api] (https://github.com/node-webot/co-wechat-api)\n\n[co-wechat-oauth] (https://github.com/node-webot/co-wechat-oauth)\n\n[co-wechat-payment] (https://github.com/perzy/co-wechat-payment)\n\n## Example\n\n```js\n'use strict';\nconst Controller = require('egg').Controller;\n\nmodule.exports = app => {\n  class WechatController extends Controller {\n    async oauth() {\n      const token = await app.wechat.oauth.getAccessToken(this.ctx.query.code);\n      this.ctx.body = JSON.stringify({\n        query: this.ctx.query,\n        token,\n        user: await app.wechat.api.getUser(token.data.openid),\n      }, 2, 2);\n    }\n  }\n\n  WechatController.prototype.index = app.wechat.messageMiddleware(async (message, ctx) => {\n    ctx.app.wechat.api.sendNews(message.FromUserName, [{\n      title: 'OAuth test',\n      description: 'Please tap this message to start oauth test',\n      url: app.wechat.oauth.getAuthorizeURL('[URL(Route to WechatController.oauth)]', 'MY_STATE', 'snsapi_userinfo'),\n      picurl: '[PIC_URL]',\n    }]);\n    return `Received your message: ${message.Content}`;\n  });\n\n  return WechatController;\n};\n\n\n```\n\n## Questions & Suggestions\n\nPlease open an issue [here](https://github.com/qdechochen/egg-wechat-all/issues).\n\n## License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md"}