{"_id":"@axolo/egg-tencent-cloud","_rev":"1-558588204c8e8eb9fbbca9a90cd72ce9","name":"@axolo/egg-tencent-cloud","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@axolo/egg-tencent-cloud","version":"0.0.1","description":"Tencent Cloud SDK 4.x plugin for Egg.js.","eggPlugin":{"name":"tencentCloud"},"keywords":["egg","eggPlugin","egg-plugin","egg-tencent-cloud","egg-tencent-cloud-cloud","tencent cloud","tencent cloud cloud"],"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"},"dependencies":{"tencentcloud-sdk-nodejs":"^4.0.95"},"devDependencies":{"autod":"^3.1.1","autod-egg":"^1.1.0","egg":"^2.29.3","egg-bin":"^4.15.0","egg-ci":"^1.18.0","egg-mock":"^4.1.0","eslint":"^7.24.0","eslint-config-egg":"^9.0.0"},"engines":{"node":">=14.0.0"},"ci":{"version":"8, 10"},"repository":{"type":"git","url":"git+https://github.com/axolo/egg-tencent-cloud.git"},"bugs":{"url":"https://github.com/axolo/egg-tencent-cloud/issues"},"homepage":"https://github.com/axolo/egg-tencent-cloud#readme","author":{"name":"Yueming Fang"},"license":"MIT","gitHead":"076e710f60d25d97b4eb9450e9629d58be2d4ecd","_id":"@axolo/egg-tencent-cloud@0.0.1","_nodeVersion":"15.10.0","_npmVersion":"7.5.3","dist":{"integrity":"sha512-ECm84qfLgwKiv5WavWDU7t7Amg3+9Gaxf94VS9Pq57kLjfimXZTgUA0T2/q8XxHdYIAuP9ccBpWZ1ndAZR8GJA==","shasum":"90bd0d396db051ad43d40b0468232ad9f55fa12c","tarball":"https://registry.npmjs.org/@axolo/egg-tencent-cloud/-/egg-tencent-cloud-0.0.1.tgz","fileCount":7,"unpackedSize":10013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeAGpCRA9TVsSAnZWagAAswwP/jx6+SSZnE9XEyJC0d5F\n2aILo9pMq3UtSknisXS3iRAR991qDcoh5OGgN99Q8o/F+lRNBG2MlF0jWE9r\nKHiYTZNDhNgTx0sHc2eM1U0MWhEBO2vNSR3p6ByDno29lNDBKHk5H9278hXU\nuH2KVhEVjEYQp5OFr4pYErLoifRY0tff5g9lfArXIG+tpvXFlSh17iG7rUZe\nAF4cDPMT66vkXyVoAfT/M4F9yjeUfHl+x/Mm1ckXHJMsuhQQgt+yWldsnmNf\nMGdvPREW9rFBmuM3JsILADAT0echLp8CDMeWe8ypwExNT/k4gMBe8Xl3Dtgv\nbHmG96ONuAUR+BWYKxS3P2wUu8XjALDY+7GORa3iR9yZTZgojpx6IaYm9CL3\nYLPjrFkMRo/VirJsMsKpwR7xWjQyUm+KsRo2kDFt1i93GtOIJqJ0207o9NrV\ngf83JUBSJ7sDYxKTXuxVkfs/ng7B+ATUI1u7InxKuNI2n2Q+fCfGxClNRhJC\nrWJIbBo0Z2/H2nfdHayp8vbB2eA4YGV6rbzCEWXFHQGW5ss7WrVSvdR0UUgq\ncfrJCBw20zGsCDUzpodHw6ntijrCpkwHyy2L6SpQS2MPHCnT50YjNLUIPrLD\nKCoOrW2nL9pXIwQuEZMlXS6hpEUHst8EgOzUQk48w+9CvKi/Vx4pe8RvlqmJ\nFsg3\r\n=duxH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0RrQNUhHn3ujm0wDt+Kv4Sya9/Wv7e+QTuKSXkWiJOwIhAI6pZJv/t1lGT7UKdSnKLbe/psD4MbHJ+3pnw4TbCkXn"}]},"_npmUser":{"name":"axolo","email":"zergdo@gmail.com"},"directories":{},"maintainers":[{"name":"axolo","email":"zergdo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/egg-tencent-cloud_0.0.1_1618477480909_0.8925272461794884"},"_hasShrinkwrap":false}},"time":{"created":"2021-04-15T09:04:40.826Z","0.0.1":"2021-04-15T09:04:41.067Z","modified":"2022-04-04T17:12:45.543Z"},"maintainers":[{"name":"axolo","email":"zergdo@gmail.com"}],"description":"Tencent Cloud SDK 4.x plugin for Egg.js.","homepage":"https://github.com/axolo/egg-tencent-cloud#readme","keywords":["egg","eggPlugin","egg-plugin","egg-tencent-cloud","egg-tencent-cloud-cloud","tencent cloud","tencent cloud cloud"],"repository":{"type":"git","url":"git+https://github.com/axolo/egg-tencent-cloud.git"},"author":{"name":"Yueming Fang"},"bugs":{"url":"https://github.com/axolo/egg-tencent-cloud/issues"},"license":"MIT","readme":"# egg-tencent-cloud\n\n[Tencent Cloud SDK] 4.x plugin for Egg.js.\n\n## Install\n\n```bash\nnpm i @axolo/egg-tencent-cloud --save\n```\n\n## Usage\n\n```js\n// {app_root}/config/plugin.js\nexports.tencentCloud = {\n  enable: true,\n  package: '@axolo/egg-tencent-cloud',\n};\n```\n\n## Configuration\n\nsee [config/config.default.js](config/config.default.js) for more detail.\nfor example:\n\n```js\n// {app_root}/config/config.default.js\nexports.tencentCloud = {\n  client: {\n    // tencentCloud, // tencentcloud-sdk-nodejs user-defined\n    // region: 'ap-guangzhou',\n    // reqMethod: 'POST',\n    // reqTimeout: 60,\n    // signMethod: 'HmacSHA256',\n    secretId: 'SECRET_ID',\n    secretKey: 'SECRETK_EY',\n    model: 'sms',\n    version: 'v20190711',\n    action: 'SendStatusStatistics',\n    params: {\n      SmsSdkAppid: 'SMS_SDK_APPID',\n      Limit: 0,\n      Offset: 0,\n    },\n};\n```\n\n## API\n\n### client\n\nthe member of Tencent Cloud SDK Model client.\nusage like:\n\n```js\n'use strict';\n\nconst Controller = require('egg').Controller;\n\nclass TencentCloudController extends Controller {\n  async index() {\n    const { app, ctx } = this;\n    const smsCount = app.tencentCloud.get('smsCount');\n    const result = await smsCount.client.SmsPackagesStatistics({\n      ...smsCount.options.params,\n      Limit: 10,\n    });\n    ctx.body = result;\n  }\n}\n\nmodule.exports = TencentCloudController;\n```\n\n### action(params)\n\n> params\n\n| params |  type  |            description             |\n| ------ | ------ | ---------------------------------- |\n| params | object | params of Tencent Cloud SDK Action |\n\n> return\n\na `Promise` of Tencent Cloud SDK Model client Action response.\n\n## Example\n\n```js\n'use strict';\n\nconst dayjs = require('dayjs');\nconst Controller = require('egg').Controller;\n\nclass TencentCloudController extends Controller {\n  async index() {\n    const { app, ctx } = this;\n    const smsCount = app.tencentCloud.get('smsCount');\n    const now = dayjs();\n    const lastMonth = now.subtract(1, 'months');\n    const StartDateTime = lastMonth.format('YYYYMMDDhh');\n    const EndDataTime = now.format('YYYYMMDDhh');\n    const result = await smsCount.action({ StartDateTime, EndDataTime });\n    ctx.body = result;\n  }\n}\n\nmodule.exports = TencentCloudController;\n```\n\n## Questions & Suggestions\n\nPlease open an issue [here](https://github.com/axolo/egg-tencent-cloud/issues).\n\n## License\n\n[MIT](LICENSE)\n\n[Tencent Cloud SDK]: https://cloud.tencent.com/document/sdk/Node.js\n","readmeFilename":"README.md"}