├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.md │ └── config.yml └── workflows │ ├── publish.yml │ └── test.yml ├── .gitignore ├── .gitlab-ci.yml ├── .npmignore ├── LICENSE ├── README-zh_CN.md ├── README.md ├── package-lock.json ├── package.json ├── scripts ├── release.js └── utils.js ├── src ├── GraphqlClient.ts ├── HttpClient.ts ├── TokenProvider.ts ├── encrypt.ts ├── index.ts ├── types.d.ts ├── version.ts └── wxapp-jsencrpt.js ├── tsconfig.json ├── yarn.lock └── 适配不同端环境指引.md /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: For reporting bugs or errors in the authing-wxapp-sdk 4 | title: '' 5 | labels: bug 6 | assignees: liaochangjiang 7 | 8 | --- 9 | 10 | 23 | 24 | - **Version**: 25 | 28 | 29 | - **Platform**: 30 | 33 | 34 | #### Severity: 35 | 43 | 44 | #### Description: 45 | 50 | 51 | #### Steps to reproduce the error: 52 | 55 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Questions 4 | url: https://forum.authing.cn/ 5 | about: For general questions, support requests and discussions 6 | - name: Document 7 | url: https://docs.authing.cn/v2/reference/sdk-for-wxapp.html 8 | about: Authing SDK for 微信小程序 9 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: publish 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | 8 | readyGo: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | container: 13 | image: node:12.14.0 14 | 15 | env: 16 | PUBLISH_OPTS: ${{ github.ref_name == 'master' && '--verbose' || '--verbose --tag=alpha' }} 17 | NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} 18 | 19 | steps: 20 | 21 | - uses: actions/checkout@v2 22 | - uses: actions/setup-node@v2 23 | with: 24 | node-version: 12 25 | registry-url: https://registry.npmjs.org/ 26 | 27 | - name: before scripts 28 | run: | 29 | echo "Current branch: ${{ github.ref_name }}" 30 | echo "Current publish version: ${{ steps.version.outputs.value }}" 31 | 32 | - name: install packages 33 | run: | 34 | npm ci 35 | 36 | - name: build 37 | run: | 38 | npm run build 39 | 40 | - name: publish 41 | run: | 42 | npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN 43 | npm publish $PUBLISH_OPTS --access public 44 | echo "记得同步 taobao 源哦: https://npm.taobao.org/sync/authing-wxapp-sdk 🚀" 45 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: test 5 | 6 | on: [push] 7 | 8 | jobs: 9 | 10 | readyGo: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | 16 | - uses: actions/checkout@v2 17 | - uses: actions/setup-node@v2 18 | with: 19 | node-version: 12 20 | registry-url: https://registry.npmjs.org/ 21 | 22 | - name: run test 23 | run: | 24 | npm install yarn -g 25 | yarn 26 | npm run build 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test 3 | .idea/* 4 | 5 | coverage 6 | .nyc_output 7 | *.log 8 | 9 | dist/ 10 | .env -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | image: node:12.14.0 2 | 3 | stages: 4 | - publish 5 | 6 | before_script: 7 | - mkdir -p ~/.ssh 8 | - touch ~/.ssh/id_rsa 9 | - touch ~/.ssh/config 10 | - chmod 700 ~/.ssh/id_rsa 11 | - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa 12 | - echo "$SSH_CONFIG" > ~/.ssh/config 13 | 14 | - | 15 | case "$CI_COMMIT_REF_NAME" in 16 | "master") 17 | PUBLISH_OPTS="--verbose" 18 | ;; 19 | *) 20 | PUBLISH_OPTS="--verbose --tag=alpha" 21 | ;; 22 | esac 23 | 24 | publish: 25 | stage: publish 26 | when: manual 27 | script: 28 | - npm install --registry https://registry.npm.taobao.org/ 29 | - npm run build 30 | - npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} 31 | - npm publish ${PUBLISH_OPTS} 32 | - echo "记得同步 taobao 源哦: https://npm.taobao.org/sync/authing-wxapp-sdk 🚀" 33 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | tsconfig.json 3 | .editorconfig 4 | coverage 5 | scripts 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Authing 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README-zh_CN.md: -------------------------------------------------------------------------------- 1 | # 此仓库不再维护, 请移步 [authing-js-sdk](https://github.com/authing/authing-js-sdk) 2 | 3 |
4 | 5 |
6 | 7 |
8 | npm version 9 | download 10 | standardjs 11 | License 12 | Node 13 |
14 | 15 |
16 | 17 | 简体中文 | [English](./README.md) 18 | 19 | Authing 小程序 SDK (`authing-wxapp-sdk`) 适用于在微信小程序环境下使用,以 [authing-js-sdk](https://github.com/authing/authing.js) 为基础,对微信小程序环境做了适配。你可以使用 `authing-js-sdk` [AuthenticationClient](https://docs.authing.cn/v2/reference/sdk-for-node/authentication/AuthenticationClient.html) 中的所有方法,如获取、修改用户资料,添加用户自定义字段等。同时专门在小程序环境下使用的 **通过微信授权获取用户手机号**、 **使用微信授权登录**、**使用微信授权的手机号登录** 等方法。 20 | 21 | ## 在 Authing 中配置小程序登录 22 | 23 | 为了在小程序中使用 Authing 小程序 SDK,你需要先在[微信开放平台](https://mp.weixin.qq.com/)申请一个小程序,同时在 [Authing 控制台](https://console.authing.cn/console/userpool)内填入该小程序的配置。 24 | 25 |
26 | 配置小程序登录 27 | 28 | 1. 前先前往[微信开放平台](https://mp.weixin.qq.com/)注册一个微信小程序开发账号 29 | 30 | - **如果你需要获取用户手机号,需要通过微信认证。** 31 | - 将 `core.authing.cn` 加入微信的 **request 合法域名**: 32 | 33 | ![](https://cdn.authing.cn/blog/20201112142753.png) 34 | 35 | 2. 在 [Authing 控制台](https://console.authing.cn/console/userpool)开启微信小程序社会化登录。 36 | 37 | - 获取微信小程序 AppId 和 AppSecret 38 | 39 | ![](https://cdn.authing.cn/blog/20201112143117.png) 40 | 41 | - 前往 [Authing 控制台](https://console.authing.cn/console/userpool) **连接身份源** - **社会化登录** - **小程序内登录**: 42 | 43 | ![](https://cdn.authing.cn/blog/20201112143302.png) 44 | 45 | - 填入小程序 AppId 和 AppSecret,点击保存即可。 46 | 47 | ![](https://cdn.authing.cn/blog/20201112143351.png) 48 | 49 |
50 | 51 | ## 安装 52 | 53 | 从小程序基础库版本 2.2.1 或以上、及开发者工具 1.02.1808300 或以上开始,小程序支持使用 npm 安装第三方包,详情请见: [npm 支持 | 微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/devtools/npm.html) 。 54 | 55 | ### 安装 npm 包 56 | 57 | 使用 npm: 58 | 59 | ``` 60 | npm install authing-wxapp-sdk 61 | ``` 62 | 63 | 使用 yarn: 64 | 65 | ``` 66 | yarn add authing-wxapp-sdk 67 | ``` 68 | 69 | ### 在小程序开发者工具中构建 npm 70 | 71 | 点击开发者工具中的菜单栏:工具 --> 构建 npm: 72 | 73 | 74 | 75 | 勾选 **使用 npm 模块** 选项: 76 | 77 | ![](https://cdn.authing.cn/blog/20201112142118.png) 78 | 79 | ## 初始化 80 | 81 | `AuthenticationClient` 初始化需要传入`AppId` (应用 ID): 82 | 83 | > 你可以在控制台的 **应用** 中查看自己的应用列表。 84 | 85 | ```js 86 | const { AuthenticationClient } = require("authing-wxapp-sdk"); 87 | 88 | const authing = new AuthenticationClient({ 89 | appId: "YOUR_APP_ID", 90 | }); 91 | ``` 92 | 93 | 完整参数列表如下: 94 | 95 | - `appId`: Authing 应用 ID(必填); 96 | - `accessToken`: 通过用户的 token 初始化 SDK(可选,你可以在前端 localStorage 中缓存用户 token,实现记住登录的目的) 。 97 | - `timeout`: 请求超时时间,单位为毫秒,默认为 10000 (10 秒)。 98 | - `onError`: 错误处理函数,你可以用其来全局捕捉 Authing 客户端请求的所有异常。函数定义为: 99 | 100 | ```js 101 | (code: number, message: string, data: any) => void 102 | ``` 103 | 104 | > 完整的错误代码请见[此文档](https://docs.authing.cn/v2/reference/error-code.html)。 105 | 106 | - `host`: Authing 服务器地址。如果你使用的是公有云版本,请忽略请参数。如果你使用的是私有化部署的版本,此参数必填。格式如下: `https://authing-api.mydomain.com`,最后不带 `/`。 107 | 108 | ## 使用方法 109 | 110 | 在用户完成登录之后,SDK 会将用户的 `token` 写入到微信的 Storage 中,后续请求会自动携带 `token` 访问。 111 | 112 | ![](https://cdn.authing.cn/blog/20201112165637.png) 113 | 114 | ```js 115 | const { code } = await wx.login(); 116 | // 无需用户授权 117 | const user = await authing.loginByCode(code); // 成功登录,将 token 写入微信 Storage 118 | 119 | // 登录之后可以进行此操作 120 | await authing.updateProfile((nickname: "Bob")); 121 | ``` 122 | 123 | 后续用户再次打开小程序,如果小程序的 Storage 中保存有用户的 token,访问 authing 的请求将会自动带上该 token。 124 | 125 | ```javascript 126 | // 该请求可以成功,因为该用户出于登录状态。 127 | await authing.updateProfile((nickname: "Mick")); 128 | ``` 129 | 130 | ## API Reference 131 | 132 | > 你可以使用 `authing-js-sdk` [AuthenticationClient](https://docs.authing.cn/v2/reference/sdk-for-node/) 中的所有方法,调用方法和 `authing-js-sdk` 完全一致。 133 | 134 | ### loginByCode 135 | 136 | > 使用微信授权的方式登录。 137 | 138 | - 如果用户第一次在小程序中登录,且用户没有使用和该小程序绑定同一主体的微信应用登录过,将会创建一个新账号。 139 | - 如果用户第一次在小程序中登录,但是该用户使用和该小程序绑定同一主体的微信应用登录过,将会返回对应的微信账号。 140 | 141 | #### 参数 142 | 143 | - `code`: 调用 [wx.login()](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html) 获取的 `code`,不需要用户授权。必填。 144 | - `options`: 选填。 145 | - `options.iv`: `open-type` 为 `getUserInfo` 的[微信 Button 组件](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) 点击事件返回的 `iv`。`iv` 和 `encryptedData` 必须同时传递,Authing Server 会尝试从 `iv` 和 `encryptedData` 中加密出用户资料。第一次需要用户手动授权。选填。 146 | - `options.encryptedData`: `open-type` 为 `getUserInfo` 的[微信 Button 组件](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) 点击事件返回的 `encryptedData`。`iv` 和 `encryptedData` 必须同时传递,Authing Server 会尝试从 `iv` 和 `encryptedData` 中加密出用户资料。第一次需要用户手动授权。选填。 147 | - `options.rawData`: `open-type` 为 `getUserInfo` 的[微信 Button 组件](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) 点击事件返回的 `rawData`。和 `iv` + `encryptedData` 二选一,如果传了 `rawData`, Authing Server 会直接使用该数据作为用户的 profile。第一次需要用户手动授权。选填。 148 | 149 | #### 示例 150 | 151 | 1. 静默授权 152 | 153 | 首次注册的用户的 profile 中的 nickname, avatar 将为空,因为没有获取到用户的头像和昵称。 154 | 155 | ```javascript 156 | const { code } = await wx.login(); 157 | const data = await authing.loginByCode(code); 158 | ``` 159 | 160 | 2. 用户手动授权获取昵称头像 161 | 162 | > 仅第一次需要授权,用户授权之后可以使用 `wx.getUserInfo` 直接获取头像昵称。 163 | 164 | - 第一次请求用户手动授权 165 | 166 | ```html 167 | 170 | ``` 171 | 172 | ```javascript 173 | getUserInfo: async function (e) { 174 | const { code } = await wx.login() 175 | const { rawData } = e.detail 176 | const user = await authing.loginByCode(code, { rawData }) 177 | 178 | // 或者传 iv encryptedData 179 | // const { iv, encryptedData } = e.detail 180 | // const user = await authing.loginByCode(code, { iv, encryptedData }) 181 | 182 | console.log(user) 183 | } 184 | ``` 185 | 186 | - 之后可以通过 `wx.getUserInfo` 自动获取 187 | 188 | ```javascript 189 | const { rawData } = await wx.getUserInfo(); 190 | const user = await authing.loginByCode(code, { rawData }); 191 | // 或者传 iv encryptedData 192 | // const { iv, encryptedData } = e.detail 193 | // const user = await authing.loginByCode(code, { iv, encryptedData }) 194 | ``` 195 | 196 | ### loginByPhone 197 | 198 | > 通过微信手机号授权的方式登录。每次调用都需要用户手动授权。 199 | 200 | - 如果该手机号第一次注册,该会把该手机号与该微信账号绑定(不存在会创建)。 201 | - 如果该手机号之前注册过,将会返回该手机号对应的账号,并且将该手机号与当前微信账号绑定。 202 | 203 | #### 参数 204 | 205 | - `code`: 调用 [wx.login()](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html) 获取的 `code`,不需要用户授权。必填。 206 | - `iv`: `open-type` 为 `getPhoneNumber` 的[微信 Button 组件](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) 点击事件返回的 `iv`。必填. 207 | - `encryptedData`: `open-type` 为 `getPhoneNumber` 的[微信 Button 组件](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) 点击事件返回的 `encryptedData`。必填. 208 | 209 | #### 示例 210 | 211 | ```html 212 | 215 | ``` 216 | 217 | ```javascript 218 | getPhone: async function(e) { 219 | const { code } = await wx.login() 220 | const { iv, encryptedData } = e.detail 221 | const data = await authing.loginByPhone(code, iv, encryptedData) 222 | console.log(data) 223 | } 224 | ``` 225 | 226 | ### getPhone 227 | 228 | > 获取当前用户的手机号(不会使用该手机号注册或绑定账号) 229 | 230 | #### 参数 231 | 232 | - `code`: 调用 [wx.login()](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html) 获取的 `code`,不需要用户授权。必填。 233 | - `iv`: `open-type` 为 `getPhoneNumber` 的[微信 Button 组件](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) 点击事件返回的 `iv`。必填. 234 | - `encryptedData`: `open-type` 为 `getPhoneNumber` 的[微信 Button 组件](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) 点击事件返回的 `encryptedData`。必填. 235 | 236 | #### 示例 237 | 238 | ```html 239 | 242 | ``` 243 | 244 | ```javascript 245 | getPhone: async function(e) { 246 | const { code } = await wx.login() 247 | const { iv, encryptedData } = e.detail 248 | const data = await authing.getPhone(code, iv, encryptedData) 249 | console.log(data) 250 | } 251 | ``` 252 | 253 | 返回的数据示例: 254 | 255 | ```json 256 | { 257 | "countryCode": "86", 258 | "phoneNumber": "176xxxx6754", 259 | "purePhoneNumber": "176xxxx6754", 260 | "openid": "o1p9H4wAgb9uTqpxG5Z1g0pIr3FE", 261 | "unionid": "o0pqE6Fbr5M-exSu_PeL_sjwN44U" 262 | } 263 | ``` 264 | 265 | ### updateAvatar 266 | 267 | > 更新用户头像,该方法会自动调用 `wx.chooseImage` 获取图片并上传到 Authing 的 cdn,仅需一行代码调用。 268 | 269 | #### 示例 270 | 271 | ```javascript 272 | const { photo } = await authing.updateAvatar(); 273 | console.log(photo); 274 | ``` 275 | 276 | ## 最佳实践 277 | 278 | 我们推荐用户第一次使用小程序的时候,使用 `loginByCode` 获取该小程序账号对应的 Authing 账号,如果该账号之前绑定了手机号,就无须再次请求用户授权手机号。如果该账号没有绑定手机号,再调用 `loginByPhone` 方法请求用户授权手机号。 279 | 280 | 用户登录之后,`authing-wxapp-sdk` 会将 `token` 写入小程序的 `Storage`,你可以调用 `authing.checkLoginStatus()` 判断该用户的 token 是否有效,当 token 失效的时候再重新登录。 281 | 282 | ## 错误处理 283 | 284 | 你可以使用 `try catch` 进行错误处理: 285 | 286 | ```js 287 | try { 288 | const user = await authing.loginByEmail("test@example.com", "passw0rd"); 289 | } catch (error) { 290 | console.log(error.code); // 2004 291 | console.log(error.message); // 用户不存在 292 | } 293 | ``` 294 | 295 | > 完整的错误代码请见[此文档](https://docs.authing.cn/v2/reference/error-code.html)。 296 | 297 | 你还可以指定 `onError` 统一捕捉所有 Authing 请求异常,如使用 `wx.showModal` 等微信组件显示错误提示。 298 | 299 | ```js 300 | const authing = new AuthenticationClient({ 301 | userPoolId, 302 | onError: (code, message) => { 303 | wx.showModal({ 304 | content: message, 305 | showCancel: false, 306 | }); 307 | }, 308 | }); 309 | ``` 310 | 311 | ## 参与贡献 312 | - Fork 此仓库 313 | - 创建自己的 git 分支 (git checkout -b my-new-feature) 314 | - 提交你的修改 (git commit -am 'Add some feature') 315 | - 将修改内容推送到远程分支 (git push -u origin my-new-feature) 316 | - 创建一个 Pull Request 317 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This repository no longer maintained, please move to [authing-js-sdk](https://github.com/authing/authing-js-sdk) 2 | 3 |
4 | 5 |
6 | 7 |
8 | npm version 9 | download 10 | standardjs 11 | License 12 | Node 13 |
14 | 15 |
16 | 17 | English | [简体中文](./README-zh_CN.md) 18 | 19 | Authing Miniapp SDK(`authing-wxapp-sdk`) is suitable for use in wechat Miniapp environmen,baseed [authing-js-sdk](https://github.com/authing/authing.js),adapted wechat Miniapp environment。You can use `authing-js-sdk` [AuthenticationClient](https://docs.authing.cn/v2/reference/sdk-for-node/authentication/AuthenticationClient.html) all methods,such as obtaining and modifying user data, adding user-defined fields, etc。For example: **Obtain the user's mobile phone number through wechat authorization**、 **Log in with wechat authorization**、**Log in with the mobile number authorized by wechat**, etc。 20 | 21 | ## Configuring Miniapp login in Authing 22 | 23 | To use the authoring Miniapp SDK in Miniapp,you need to apply for a small program on the[Weixin Official Accounts Platform](https://mp.weixin.qq.com/?lang=en_US&token=),and at the same time [Authing Console](https://console.authing.cn/console/userpool) fill in the configuration of the Miniapp. 24 | 25 |
26 | 27 | Configure Miniapp login 28 | 29 | 1. Go to [Weixin Official Accounts Platform](https://mp.weixin.qq.com/?lang=en_US&token=) first, register a wechat Miniapp development account. 30 | 31 | - **If you need to obtain the user's mobile phone number, you need to pass wechat authentication.** 32 | 33 | - Add `core.authing Cn` to **request legal domain name**: 34 | 35 | ![](https://cdn.authing.cn/blog/20201112142753.png) 36 | 37 | 2. Go to [Authing 控制台](https://console.authing.cn/console/userpool) open wechat Miniapp social login. 38 | 39 | - Get `appId` and `appSecret` of wechat Miniapp 40 | 41 | ![](https://cdn.authing.cn/blog/20201112143117.png) 42 | 43 | - Go to [Authing 控制台](https://console.authing.cn/console/userpool) **Connect identity source** - **Social login** - **Login in Miniapp**: 44 | 45 | ![](https://cdn.authing.cn/blog/20201112143302.png) 46 | 47 | - Fill in the Miniapp `appId` and `appSecret`, and click save. 48 | 49 | ![](https://cdn.authing.cn/blog/20201112143351.png) 50 | 51 |
52 | 53 | ## Install 54 | 55 | Starting from the basic library version 2.2.1 or above and the developer tool 1.02.1808300 or above, the applet supports the installation of third-party packages using NPM. For details, please refer to: [npm support](https://developers.weixin.qq.com/miniprogram/en/dev/devtools/npm.html). 56 | 57 | ### Install NPM package 58 | 59 | Use NPM: 60 | 61 | ``` 62 | npm install authing-wxapp-sdk 63 | ``` 64 | 65 | Use Yarn: 66 | 67 | ``` 68 | yarn add authing-wxapp-sdk 69 | ``` 70 | 71 | ### Building NPM in Miniapp developer tools 72 | 73 | Click the menu bar in the developer tool:Tool --> building npm: 74 | 75 | 76 | 77 | Check the **use NPM module** Option: 78 | 79 | ![](https://cdn.authing.cn/blog/20201112142118.png) 80 | 81 | ## Initialize 82 | 83 | Init `AuthenticationClient` need passing `AppId`: 84 | 85 | > You can view your application list in **applications** on the console. 86 | 87 | ```js 88 | const { AuthenticationClient } = require("authing-wxapp-sdk"); 89 | 90 | const authing = new AuthenticationClient({ 91 | appId: "YOUR_APP_ID", 92 | }); 93 | ``` 94 | 95 | The complete parameter list is as follows: 96 | 97 | - `appId`: Authing APP ID(required); 98 | - `accessToken`: Initialize the SDK through the user's token (optional, you can cache the user's token in the front-end localstorage to realize the purpose of remembering login). 99 | - `timeout`: Request timeout, unit: ms, default: 10000 (10 seconds). 100 | - `onError`: Error handling function, you can use it to catch all exceptions requested by the authoring client globally. The function is defined as: 101 | 102 | ```js 103 | (code: number, message: string, data: any) => void 104 | ``` 105 | 106 | > Refer to for complete error codes [doc](https://docs.authing.cn/v2/reference/error-code.html)。 107 | 108 | - `host`: Authing server。If you are using the public cloud version, please ignore the parameter. This parameter is required if you are using the version of privatized deployment. The format is as follows:: `https://authing-api.mydomain.com`,finally, without `/`. 109 | 110 | ## Usage 111 | 112 | After the user logs in, the SDK will write the user's `token` into the storage of wechat, and subsequent requests will automatically carry the `token` for access. 113 | 114 | ![](https://cdn.authing.cn/blog/20201112165637.png) 115 | 116 | ```js 117 | const { code } = await wx.login(); 118 | // No user authorization required 119 | const user = await authing.loginByCode(code); // 成功登录,将 token 写入微信 Storage 120 | 121 | // You can do this after logging in 122 | await authing.updateProfile((nickname: "Bob")); 123 | ``` 124 | 125 | Subsequently, the user opens the applet again. If the token of the user is saved in the storage of the applet, the request to access authing will automatically carry the token. 126 | 127 | ```javascript 128 | // The request can succeed because the user is logged in. 129 | await authing.updateProfile((nickname: "Mick")); 130 | ``` 131 | 132 | ## API Reference 133 | 134 | > You can use `authing-js-sdk` [AuthenticationClient](https://docs.authing.cn/v2/reference/sdk-for-node/) all methods,the calling method is completely consistent with `Authing JS SDK`. 135 | 136 | ### loginByCode 137 | 138 | > Log in with wechat authorization。 139 | 140 | - If the user logs in the applet for the first time, and the user has not logged in using the wechat application bound to the same subject as the applet, a new account will be created. 141 | - If the user logs in the applet for the first time, but the user has logged in using the wechat application of the same subject bound to the applet, the corresponding wechat account will be returned. 142 | 143 | #### Parameter 144 | 145 | - `code`: Call [wx.login()](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html) get the `code`,no user authorization is required. Required。 146 | - `options`: Optional。 147 | - `options.iv`: `open-type` is `getUserInfo` [Weixin Button Component](https://developers.weixin.qq.com/miniprogram/en/dev/component/button.html) returned `iv`。`iv` and `encryptedData` are required,The Authing server will attempt to encrypt user data from 'iv' and 'encrypteddata'. Manual authorization is required for the first time. Optional. 148 | - `options.encryptedData`: `open-type` is `getUserInfo` [Weixin Button Component](https://developers.weixin.qq.com/miniprogram/en/dev/component/button.html) returned `encryptedData`。`iv` and `encryptedData` are required. The server will attempt to encrypt user data from 'iv' and 'encrypted data'. Manual authorization is required for the first time. Optional. 149 | - `options.rawData`: `open-type` is `getUserInfo` [Weixin Button Component](https://developers.weixin.qq.com/miniprogram/en/dev/component/button.html) returned `rawData`. Choose between 'iv' + 'encrypteddata'. If 'rawdata' is passed, the authing server will directly use the data as the user's profile. Manual authorization is required for the first time. Optional. 150 | 151 | #### Example 152 | 153 | 1. Silent authorization 154 | 155 | The nickname and avatar in the profile of the first registered user will be empty because the user's Avatar and nickname are not obtained. 156 | 157 | ```javascript 158 | const { code } = await wx.login(); 159 | const data = await authing.loginByCode(code); 160 | ``` 161 | 162 | 2. User manually authorized to obtain nickname Avatar 163 | 164 | > Authorization is only required for the first time. Users can use ` Wx GetUserInfo ` get the nickname of the avatar directly 165 | 166 | - Request user manual authorization for the first time 167 | 168 | ```html 169 | 172 | ``` 173 | 174 | ```javascript 175 | getUserInfo: async function (e) { 176 | const { code } = await wx.login() 177 | const { rawData } = e.detail 178 | const user = await authing.loginByCode(code, { rawData }) 179 | 180 | // or passing iv encryptedData 181 | // const { iv, encryptedData } = e.detail 182 | // const user = await authing.loginByCode(code, { iv, encryptedData }) 183 | 184 | console.log(user) 185 | } 186 | ``` 187 | 188 | - After that, you can use the `wx.getUserInfo` auto get 189 | 190 | ```javascript 191 | const { rawData } = await wx.getUserInfo(); 192 | const user = await authing.loginByCode(code, { rawData }); 193 | // 或者传 iv encryptedData 194 | // const { iv, encryptedData } = e.detail 195 | // const user = await authing.loginByCode(code, { iv, encryptedData }) 196 | ``` 197 | 198 | ### loginByPhone 199 | 200 | > Log in through wechat mobile number authorization. Each call requires manual authorization by the user. 201 | 202 | - If the mobile phone number is registered for the first time, it will bind the mobile phone number with the wechat account (it will be created if it does not exist). 203 | - If the mobile phone number has been registered before, the account corresponding to the mobile phone number will be returned, and the mobile phone number will be bound with the current wechat account. 204 | 205 | #### Parameter 206 | 207 | - `code`: Call [wx.login()](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html) get `code`,no user authorization is required. Required. 208 | - `iv`: `open-type` is `getPhoneNumber` [Weixin Button Component](https://developers.weixin.qq.com/miniprogram/en/dev/component/button.html) returned `iv`. Required. 209 | - `encryptedData`: `open-type` is `getPhoneNumber` [Weixin Button Component](https://developers.weixin.qq.com/miniprogram/en/dev/component/button.html) return `encryptedData`. Required. 210 | 211 | #### Example 212 | 213 | ```html 214 | 217 | ``` 218 | 219 | ```javascript 220 | getPhone: async function(e) { 221 | const { code } = await wx.login() 222 | const { iv, encryptedData } = e.detail 223 | const data = await authing.loginByPhone(code, iv, encryptedData) 224 | console.log(data) 225 | } 226 | ``` 227 | 228 | ### getPhone 229 | 230 | > Get the mobile phone number of the current user (you will not use this mobile phone number to register or bind an account). 231 | 232 | #### Parameter 233 | 234 | - `code`: Call [wx.login()](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html) get `code`,no user authorization is required. Required 235 | - `iv`: `open-type` is `getPhoneNumber` [Weixin Button Component](https://developers.weixin.qq.com/miniprogram/en/dev/component/button.html) return `iv`. Required. 236 | - `encryptedData`: `open-type` is `getPhoneNumber` [Weixin Button Component](https://developers.weixin.qq.com/miniprogram/en/dev/component/button.html) return `encryptedData`. Required. 237 | 238 | #### Example 239 | 240 | ```html 241 | 244 | ``` 245 | 246 | ```javascript 247 | getPhone: async function(e) { 248 | const { code } = await wx.login() 249 | const { iv, encryptedData } = e.detail 250 | const data = await authing.getPhone(code, iv, encryptedData) 251 | console.log(data) 252 | } 253 | ``` 254 | 255 | Example of returned data: 256 | 257 | ```json 258 | { 259 | "countryCode": "86", 260 | "phoneNumber": "176xxxx6754", 261 | "purePhoneNumber": "176xxxx6754", 262 | "openid": "o1p9H4wAgb9uTqpxG5Z1g0pIr3FE", 263 | "unionid": "o0pqE6Fbr5M-exSu_PeL_sjwN44U" 264 | } 265 | ``` 266 | 267 | ### updateAvatar 268 | 269 | > Update user avatar, this method will automatically call `wx.chooseimage` to get the image and upload it to the CDN of authoring, only one line of code is required. 270 | 271 | #### Example 272 | 273 | ```javascript 274 | const { photo } = await authing.updateAvatar(); 275 | console.log(photo); 276 | ``` 277 | 278 | ## Best practices 279 | 280 | We recommend that when the user uses the applet for the first time, use 'loginbycode' to obtain the authing account corresponding to the applet account. If the account has been bound with a mobile phone number before, there is no need to request the user to authorize the mobile phone number again. If the account is not bound with a mobile phone number, call the 'loginbyphone' method to request the user to authorize a mobile phone number. 281 | 282 | After the user logs in, `authing wxApp SDK` will write the `token` to the `storage` of the applet. You can call `authing.checkloginstatus()` judge whether the user's token is valid, and log in again when the token is invalid. 283 | 284 | ## Error handling 285 | 286 | You can use `try catch` to handle errors: 287 | 288 | ```js 289 | try { 290 | const user = await authing.loginByEmail("test@example.com", "passw0rd"); 291 | } catch (error) { 292 | console.log(error.code); // 2004 293 | console.log(error.message); // User does not exist 294 | } 295 | ``` 296 | 297 | > See for complete error codes: [doc](https://docs.authing.cn/v2/reference/error-code.html)。 298 | 299 | You can also specify `onerror` to catch all authing request exceptions, such as using `wx.showmodal` and other wechat components display error prompts. 300 | 301 | ```js 302 | const authing = new AuthenticationClient({ 303 | userPoolId, 304 | onError: (code, message) => { 305 | wx.showModal({ 306 | content: message, 307 | showCancel: false, 308 | }); 309 | }, 310 | }); 311 | ``` 312 | 313 | ## Contribution 314 | - Fork it 315 | - Create your feature branch (git checkout -b my-new-feature) 316 | - Commit your changes (git commit -am 'Add some feature') 317 | - Push to the branch (git push origin my-new-feature) 318 | - Create new Pull Request 319 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "authing-wxapp-sdk", 3 | "version": "4.3.22-alpha.7", 4 | "main": "./dist/index.js", 5 | "repository": "git@git.authing.co:sdk/authing-wxapp-sdk.git", 6 | "author": "cj ", 7 | "license": "MIT", 8 | "scripts": { 9 | "build": "tsc", 10 | "release": "node scripts/release.js" 11 | }, 12 | "dependencies": { 13 | "authing-js-sdk": "4.15.8", 14 | "wx-axios": "^0.0.7" 15 | }, 16 | "devDependencies": { 17 | "@types/node": "^14.14.7", 18 | "typescript": "^4.0.5", 19 | "chalk": "^4.1.0", 20 | "conventional-changelog-cli": "^2.0.31", 21 | "execa": "^4.0.2", 22 | "node-console-colors": "^1.1.4" 23 | } 24 | } -------------------------------------------------------------------------------- /scripts/release.js: -------------------------------------------------------------------------------- 1 | // npm run release --target_version=xxx 2 | 3 | const fs = require('fs') 4 | const chalk = require('chalk') 5 | const execa = require('execa') 6 | 7 | const { getArgsFromTerminal } = require('./utils') 8 | const step = msg => console.log(chalk.cyan(msg)) 9 | const run = (bin, args, opts = {}) => execa(bin, args, { stdio: 'inherit', ...opts }) 10 | 11 | readyGo() 12 | 13 | function updateVersion (targetVersion) { 14 | const files = ['package.json', 'package-lock.json'] 15 | 16 | files.forEach(file => { 17 | const pkg = require(`../${file}`) 18 | pkg.version = targetVersion 19 | 20 | const content = JSON.stringify(pkg, null, 2) 21 | fs.writeFileSync(`./${file}`, content, 'utf8') 22 | }) 23 | } 24 | 25 | async function readyGo () { 26 | const targetVersion = getArgsFromTerminal('target_version') 27 | 28 | updateVersion(targetVersion) 29 | 30 | const { stdout } = await run('git', ['diff'], { stdio: 'pipe' }) 31 | 32 | if (stdout) { 33 | step('\nCommitting changes...') 34 | await run('git', ['add', '-A']) 35 | await run('git', ['commit', '-m', `release: v${targetVersion} :rocket:`]) 36 | } else { 37 | console.log('No changes to commit.') 38 | } 39 | 40 | step('\nPushing to GitHub...') 41 | await run('git', ['tag', `v${targetVersion}`]) 42 | await run('git', ['push', 'origin', `refs/tags/v${targetVersion}`]) 43 | await run('git', ['push']) 44 | } 45 | -------------------------------------------------------------------------------- /scripts/utils.js: -------------------------------------------------------------------------------- 1 | exports.getArgsFromTerminal = arg => process.env[`npm_config_${arg}`] 2 | -------------------------------------------------------------------------------- /src/GraphqlClient.ts: -------------------------------------------------------------------------------- 1 | import { AuthenticationClientOptions } from "authing-js-sdk"; 2 | import Axios from "wx-axios"; 3 | import { VERSION } from "./version"; 4 | 5 | export class GraphqlClient { 6 | endpoint: string; 7 | options: AuthenticationClientOptions; 8 | axios: any; 9 | 10 | constructor(endpoint: string, options: AuthenticationClientOptions) { 11 | this.endpoint = endpoint; 12 | this.options = options; 13 | this.axios = Axios.create(); 14 | } 15 | 16 | async request(options: { query: string; variables?: any; token?: string }) { 17 | const { query, token, variables } = options; 18 | let headers: any = { 19 | "content-type": "application/json", 20 | "x-authing-sdk-version": `wxapp:${VERSION}`, 21 | "x-authing-request-from": "wxapp", 22 | "x-authing-app-id": this.options.appId || "", 23 | }; 24 | token && (headers.Authorization = `Bearer ${token}`); 25 | let data = null; 26 | let errors = null; 27 | try { 28 | let { data: responseData } = await this.axios({ 29 | url: this.endpoint, 30 | data: { 31 | query, 32 | variables, 33 | }, 34 | method: "post", 35 | headers, 36 | timeout: this.options.timeout, 37 | }); 38 | data = responseData.data; 39 | errors = responseData.errors; 40 | } catch (error) { 41 | this.options.onError && this.options.onError(500, "网络请求错误", null); 42 | throw { code: 500, message: "网络请求错误", data: null }; 43 | } 44 | 45 | if (errors?.length > 0) { 46 | let errmsg = null; 47 | let errcode = null; 48 | let data = null; 49 | errors.map((err: any) => { 50 | const { message: msg } = err; 51 | const { code, message, data: _data } = msg; 52 | errcode = code; 53 | errmsg = message; 54 | data = _data; 55 | this.options.onError && this.options.onError(code, message, data); 56 | }); 57 | throw { code: errcode, message: errmsg, data }; 58 | } 59 | 60 | return data; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/HttpClient.ts: -------------------------------------------------------------------------------- 1 | import { 2 | AuthenticationClientOptions, 3 | AuthenticationTokenProvider, 4 | ManagementClientOptions, 5 | ManagementTokenProvider, 6 | } from "authing-js-sdk"; 7 | import { AxiosInstance, AxiosRequestConfig } from "axios"; 8 | import { VERSION } from "./version"; 9 | import Axios from "wx-axios"; 10 | 11 | export class HttpClient { 12 | options: ManagementClientOptions; 13 | tokenProvider: AuthenticationTokenProvider; 14 | axios: AxiosInstance; 15 | 16 | constructor( 17 | options: AuthenticationClientOptions, 18 | tokenProvider: AuthenticationTokenProvider 19 | ) { 20 | this.options = options; 21 | this.tokenProvider = tokenProvider; 22 | // @ts-ignore 23 | this.axios = Axios.create(); 24 | } 25 | 26 | async request(config: AxiosRequestConfig) { 27 | const headers: any = { 28 | "x-authing-sdk-version": `wxapp:${VERSION}`, 29 | "x-authing-userpool-id": this.options.userPoolId, 30 | "x-authing-request-from": "wxapp", 31 | "x-authing-app-id": this.options.appId || "", 32 | }; 33 | if (!(config && config.headers && config.headers.authorization)) { 34 | // 如果用户不传 token,就使用 sdk 自己维护的 35 | const token = await this.tokenProvider.getToken(); 36 | token && (headers.Authorization = `Bearer ${token}`); 37 | } else { 38 | headers.authorization = config.headers.authorization; 39 | } 40 | config.headers = headers; 41 | config.timeout = this.options.timeout; 42 | const { data } = await this.axios.request(config); 43 | const { code, message } = data; 44 | if (code !== 200) { 45 | this.options.onError && this.options.onError(code, message, data.data); 46 | throw new Error(JSON.stringify({ code, message, data: data.data })); 47 | } 48 | return data.data; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/TokenProvider.ts: -------------------------------------------------------------------------------- 1 | import { AuthenticationClientOptions, User } from "authing-js-sdk"; 2 | 3 | const tokenKey = "_authing_token"; 4 | const userKey = "_authing_user"; 5 | 6 | export class MiniprogramTokenProvider { 7 | options: AuthenticationClientOptions; 8 | 9 | constructor(options: AuthenticationClientOptions) { 10 | this.options = options; 11 | } 12 | 13 | setToken(token: string) { 14 | wx.setStorageSync(tokenKey, token); 15 | } 16 | 17 | getToken() { 18 | return wx.getStorageSync(tokenKey); 19 | } 20 | 21 | getUser(): User | null { 22 | return wx.getStorageSync(userKey); 23 | } 24 | 25 | setUser(user: User) { 26 | wx.setStorageSync(userKey, user); 27 | wx.setStorageSync(tokenKey, user.token as string); 28 | } 29 | 30 | clearUser() { 31 | wx.removeStorageSync(userKey); 32 | wx.removeStorageSync(tokenKey); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/encrypt.ts: -------------------------------------------------------------------------------- 1 | const { JSEncrypt } = require("./wxapp-jsencrpt.js"); 2 | 3 | export const encryptFunction = async (plainText: string, publicKey: string) => { 4 | const encrypt = new JSEncrypt(); 5 | encrypt.setPublicKey(publicKey); 6 | const encStr = encrypt.encrypt(plainText); 7 | return encStr.toString(); 8 | }; 9 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | AuthenticationClient as BaseAuthenticationClient, 3 | AuthenticationClientOptions, 4 | } from "authing-js-sdk"; 5 | import { encryptFunction } from "./encrypt"; 6 | import { GraphqlClient } from "./GraphqlClient"; 7 | import { HttpClient } from "./HttpClient"; 8 | import { MiniprogramTokenProvider } from "./TokenProvider"; 9 | 10 | export class AuthenticationClient extends BaseAuthenticationClient { 11 | constructor(options: AuthenticationClientOptions) { 12 | options.encryptFunction = encryptFunction; 13 | options.httpClient = HttpClient; 14 | options.graphqlClient = GraphqlClient; 15 | options.tokenProvider = MiniprogramTokenProvider; 16 | super(options); 17 | } 18 | 19 | /** 20 | * @description 通过 wx.login 获取到的 code 登录 21 | * 22 | */ 23 | async loginByCode( 24 | code: string, 25 | options?: { 26 | iv?: string; 27 | encryptedData?: string; 28 | // wx.getUserInfo 返回的 rawData, 里面包含了原始用户数据 29 | rawData?: string; 30 | } 31 | ) { 32 | const api = `${this.options.host}/connections/social/wechat-miniprogram/auth`; 33 | options = options || {}; 34 | const { iv, encryptedData, rawData } = options; 35 | const user = await this.httpClient.request({ 36 | method: "POST", 37 | url: api, 38 | data: { code, iv, encryptedData, rawData }, 39 | }); 40 | this.tokenProvider.setUser(user); 41 | return user; 42 | } 43 | 44 | /** 45 | * @description 通过获取手机号开放组件事件登录 46 | * 47 | */ 48 | async loginByPhone(code: string, iv: string, encryptedData: string) { 49 | const api = `${this.options.host}/connections/social/wechat-miniprogram/auth-by-phone`; 50 | const user = await this.httpClient.request({ 51 | method: "POST", 52 | url: api, 53 | data: { code, iv, encryptedData }, 54 | }); 55 | this.tokenProvider.setUser(user); 56 | return user; 57 | } 58 | 59 | /** 60 | * @description 获取用户的手机号 61 | * 62 | */ 63 | async getPhone(code: string, iv: string, encryptedData: string) { 64 | const api = `${this.options.host}/connections/social/wechat-miniprogram/getphone`; 65 | const data = await this.httpClient.request({ 66 | method: "POST", 67 | url: api, 68 | data: { code, iv, encryptedData }, 69 | }); 70 | return data; 71 | } 72 | 73 | async updateAvatar() { 74 | this.checkLoggedIn(); 75 | const { tempFilePaths } = await wx.chooseImage({ 76 | count: 1, 77 | }); 78 | const filePath = tempFilePaths[0]; 79 | const uploadTask = new Promise((resolve, reject) => { 80 | wx.uploadFile({ 81 | url: `${this.options.host}/api/v2/upload?folder=avatar`, 82 | name: "file", 83 | filePath, 84 | success: (res: any) => { 85 | const data = JSON.parse(res.data); 86 | const { url } = data.data; 87 | resolve(url as string); 88 | }, 89 | fail: reject, 90 | }); 91 | }); 92 | 93 | let url: string; 94 | try { 95 | // @ts-ignore 96 | url = await uploadTask; 97 | } catch (error) { 98 | throw new Error(`上传图片失败: ${error.message}`); 99 | } 100 | const user = await this.updateProfile({ photo: url }); 101 | this.setCurrentUser(user); 102 | return user; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/types.d.ts: -------------------------------------------------------------------------------- 1 | declare const wx: any; 2 | -------------------------------------------------------------------------------- /src/version.ts: -------------------------------------------------------------------------------- 1 | export const VERSION = "4.2.0"; 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 9 | // "lib": [], /* Specify library files to be included in the compilation. */ 10 | "allowJs": true, /* Allow javascript files to be compiled. */ 11 | // "checkJs": true, /* Report errors in .js files. */ 12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 15 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 16 | // "outFile": "./", /* Concatenate and emit output to single file. */ 17 | "outDir": "./dist", /* Redirect output structure to the directory. */ 18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 19 | // "composite": true, /* Enable project compilation */ 20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 21 | // "removeComments": true, /* Do not emit comments to output. */ 22 | // "noEmit": true, /* Do not emit outputs. */ 23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 26 | 27 | /* Strict Type-Checking Options */ 28 | "strict": true, /* Enable all strict type-checking options. */ 29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 30 | // "strictNullChecks": true, /* Enable strict null checks. */ 31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 36 | 37 | /* Additional Checks */ 38 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 42 | 43 | /* Module Resolution Options */ 44 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 45 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 46 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 47 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 48 | // "typeRoots": [], /* List of folders to include type definitions from. */ 49 | // "types": [], /* Type declaration files to be included in compilation. */ 50 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 51 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 52 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 53 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 54 | 55 | /* Source Map Options */ 56 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 57 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 58 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 59 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 60 | 61 | /* Experimental Options */ 62 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 63 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 64 | 65 | /* Advanced Options */ 66 | "skipLibCheck": true, /* Skip type checking of declaration files. */ 67 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 68 | }, 69 | "include": ["src/**/*.ts", "src/wxapp-jsencrpt.js"], 70 | } 71 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@babel/code-frame@^7.0.0": 6 | "integrity" "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==" 7 | "resolved" "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz" 8 | "version" "7.16.7" 9 | dependencies: 10 | "@babel/highlight" "^7.16.7" 11 | 12 | "@babel/helper-validator-identifier@^7.16.7": 13 | "integrity" "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==" 14 | "resolved" "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz" 15 | "version" "7.16.7" 16 | 17 | "@babel/highlight@^7.16.7": 18 | "integrity" "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==" 19 | "resolved" "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz" 20 | "version" "7.16.10" 21 | dependencies: 22 | "@babel/helper-validator-identifier" "^7.16.7" 23 | "chalk" "^2.0.0" 24 | "js-tokens" "^4.0.0" 25 | 26 | "@hutson/parse-repository-url@^3.0.0": 27 | "integrity" "sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==" 28 | "resolved" "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz" 29 | "version" "3.0.2" 30 | 31 | "@types/minimist@^1.2.0": 32 | "integrity" "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" 33 | "resolved" "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz" 34 | "version" "1.2.2" 35 | 36 | "@types/node@^14.14.7": 37 | "integrity" "sha1-jqHo+OriQwz0QFZLmMbfzh7FlF0= sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==" 38 | "resolved" "https://registry.npm.taobao.org/@types/node/download/@types/node-14.14.7.tgz?cache=0&sync_timestamp=1604951837015&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.14.7.tgz" 39 | "version" "14.14.7" 40 | 41 | "@types/normalize-package-data@^2.4.0": 42 | "integrity" "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==" 43 | "resolved" "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz" 44 | "version" "2.4.1" 45 | 46 | "add-stream@^1.0.0": 47 | "integrity" "sha1-anmQQ3ynNtXhKI25K9MmbV9csqo=" 48 | "resolved" "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz" 49 | "version" "1.0.0" 50 | 51 | "ansi-regex@^5.0.1": 52 | "integrity" "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" 53 | "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" 54 | "version" "5.0.1" 55 | 56 | "ansi-styles@^3.2.1": 57 | "integrity" "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==" 58 | "resolved" "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" 59 | "version" "3.2.1" 60 | dependencies: 61 | "color-convert" "^1.9.0" 62 | 63 | "ansi-styles@^4.0.0", "ansi-styles@^4.1.0": 64 | "integrity" "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==" 65 | "resolved" "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" 66 | "version" "4.3.0" 67 | dependencies: 68 | "color-convert" "^2.0.1" 69 | 70 | "array-ify@^1.0.0": 71 | "integrity" "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=" 72 | "resolved" "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz" 73 | "version" "1.0.0" 74 | 75 | "arrify@^1.0.1": 76 | "integrity" "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" 77 | "resolved" "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" 78 | "version" "1.0.1" 79 | 80 | "authing-js-sdk@4.15.8": 81 | "integrity" "sha1-APRjOTNF0K0h8rqfis5qsLtleoQ= sha512-Yp8WKy3/J7f60m0l39A9E2cUw5I0rGPbEpW6bXsl3PREr3S0pcSuQw1j0E8qDt8ZVEqfDyswThVZcNE3jsAOKQ==" 82 | "resolved" "https://registry.npm.taobao.org/authing-js-sdk/download/authing-js-sdk-4.15.8.tgz" 83 | "version" "4.15.8" 84 | dependencies: 85 | "axios" "^0.19.2" 86 | "jsencrypt" "^3.0.0-rc.1" 87 | "jwt-decode" "^2.2.0" 88 | 89 | "axios@^0.19.2": 90 | "integrity" "sha1-PqNsXYgY0NX4qKl6bTa4bNwAyyc=" 91 | "resolved" "https://registry.npm.taobao.org/axios/download/axios-0.19.2.tgz" 92 | "version" "0.19.2" 93 | dependencies: 94 | "follow-redirects" "1.5.10" 95 | 96 | "camelcase-keys@^6.2.2": 97 | "integrity" "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==" 98 | "resolved" "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz" 99 | "version" "6.2.2" 100 | dependencies: 101 | "camelcase" "^5.3.1" 102 | "map-obj" "^4.0.0" 103 | "quick-lru" "^4.0.1" 104 | 105 | "camelcase@^5.3.1": 106 | "integrity" "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" 107 | "resolved" "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" 108 | "version" "5.3.1" 109 | 110 | "chalk@^2.0.0": 111 | "integrity" "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==" 112 | "resolved" "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" 113 | "version" "2.4.2" 114 | dependencies: 115 | "ansi-styles" "^3.2.1" 116 | "escape-string-regexp" "^1.0.5" 117 | "supports-color" "^5.3.0" 118 | 119 | "chalk@^4.1.0": 120 | "integrity" "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==" 121 | "resolved" "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" 122 | "version" "4.1.2" 123 | dependencies: 124 | "ansi-styles" "^4.1.0" 125 | "supports-color" "^7.1.0" 126 | 127 | "cliui@^7.0.2": 128 | "integrity" "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==" 129 | "resolved" "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" 130 | "version" "7.0.4" 131 | dependencies: 132 | "string-width" "^4.2.0" 133 | "strip-ansi" "^6.0.0" 134 | "wrap-ansi" "^7.0.0" 135 | 136 | "color-convert@^1.9.0": 137 | "integrity" "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==" 138 | "resolved" "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" 139 | "version" "1.9.3" 140 | dependencies: 141 | "color-name" "1.1.3" 142 | 143 | "color-convert@^2.0.1": 144 | "integrity" "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==" 145 | "resolved" "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" 146 | "version" "2.0.1" 147 | dependencies: 148 | "color-name" "~1.1.4" 149 | 150 | "color-name@~1.1.4": 151 | "integrity" "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 152 | "resolved" "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" 153 | "version" "1.1.4" 154 | 155 | "color-name@1.1.3": 156 | "integrity" "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" 157 | "resolved" "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" 158 | "version" "1.1.3" 159 | 160 | "compare-func@^2.0.0": 161 | "integrity" "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==" 162 | "resolved" "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz" 163 | "version" "2.0.0" 164 | dependencies: 165 | "array-ify" "^1.0.0" 166 | "dot-prop" "^5.1.0" 167 | 168 | "conventional-changelog-angular@^5.0.12": 169 | "integrity" "sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==" 170 | "resolved" "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz" 171 | "version" "5.0.13" 172 | dependencies: 173 | "compare-func" "^2.0.0" 174 | "q" "^1.5.1" 175 | 176 | "conventional-changelog-atom@^2.0.8": 177 | "integrity" "sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw==" 178 | "resolved" "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.8.tgz" 179 | "version" "2.0.8" 180 | dependencies: 181 | "q" "^1.5.1" 182 | 183 | "conventional-changelog-cli@^2.0.31": 184 | "integrity" "sha512-8grMV5Jo8S0kP3yoMeJxV2P5R6VJOqK72IiSV9t/4H5r/HiRqEBQ83bYGuz4Yzfdj4bjaAEhZN/FFbsFXr5bOA==" 185 | "resolved" "https://registry.npmjs.org/conventional-changelog-cli/-/conventional-changelog-cli-2.2.2.tgz" 186 | "version" "2.2.2" 187 | dependencies: 188 | "add-stream" "^1.0.0" 189 | "conventional-changelog" "^3.1.24" 190 | "lodash" "^4.17.15" 191 | "meow" "^8.0.0" 192 | "tempfile" "^3.0.0" 193 | 194 | "conventional-changelog-codemirror@^2.0.8": 195 | "integrity" "sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw==" 196 | "resolved" "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.8.tgz" 197 | "version" "2.0.8" 198 | dependencies: 199 | "q" "^1.5.1" 200 | 201 | "conventional-changelog-conventionalcommits@^4.5.0": 202 | "integrity" "sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g==" 203 | "resolved" "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.3.tgz" 204 | "version" "4.6.3" 205 | dependencies: 206 | "compare-func" "^2.0.0" 207 | "lodash" "^4.17.15" 208 | "q" "^1.5.1" 209 | 210 | "conventional-changelog-core@^4.2.1": 211 | "integrity" "sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg==" 212 | "resolved" "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz" 213 | "version" "4.2.4" 214 | dependencies: 215 | "add-stream" "^1.0.0" 216 | "conventional-changelog-writer" "^5.0.0" 217 | "conventional-commits-parser" "^3.2.0" 218 | "dateformat" "^3.0.0" 219 | "get-pkg-repo" "^4.0.0" 220 | "git-raw-commits" "^2.0.8" 221 | "git-remote-origin-url" "^2.0.0" 222 | "git-semver-tags" "^4.1.1" 223 | "lodash" "^4.17.15" 224 | "normalize-package-data" "^3.0.0" 225 | "q" "^1.5.1" 226 | "read-pkg" "^3.0.0" 227 | "read-pkg-up" "^3.0.0" 228 | "through2" "^4.0.0" 229 | 230 | "conventional-changelog-ember@^2.0.9": 231 | "integrity" "sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A==" 232 | "resolved" "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.9.tgz" 233 | "version" "2.0.9" 234 | dependencies: 235 | "q" "^1.5.1" 236 | 237 | "conventional-changelog-eslint@^3.0.9": 238 | "integrity" "sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA==" 239 | "resolved" "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.9.tgz" 240 | "version" "3.0.9" 241 | dependencies: 242 | "q" "^1.5.1" 243 | 244 | "conventional-changelog-express@^2.0.6": 245 | "integrity" "sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ==" 246 | "resolved" "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.6.tgz" 247 | "version" "2.0.6" 248 | dependencies: 249 | "q" "^1.5.1" 250 | 251 | "conventional-changelog-jquery@^3.0.11": 252 | "integrity" "sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw==" 253 | "resolved" "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.11.tgz" 254 | "version" "3.0.11" 255 | dependencies: 256 | "q" "^1.5.1" 257 | 258 | "conventional-changelog-jshint@^2.0.9": 259 | "integrity" "sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA==" 260 | "resolved" "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.9.tgz" 261 | "version" "2.0.9" 262 | dependencies: 263 | "compare-func" "^2.0.0" 264 | "q" "^1.5.1" 265 | 266 | "conventional-changelog-preset-loader@^2.3.4": 267 | "integrity" "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==" 268 | "resolved" "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz" 269 | "version" "2.3.4" 270 | 271 | "conventional-changelog-writer@^5.0.0": 272 | "integrity" "sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ==" 273 | "resolved" "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz" 274 | "version" "5.0.1" 275 | dependencies: 276 | "conventional-commits-filter" "^2.0.7" 277 | "dateformat" "^3.0.0" 278 | "handlebars" "^4.7.7" 279 | "json-stringify-safe" "^5.0.1" 280 | "lodash" "^4.17.15" 281 | "meow" "^8.0.0" 282 | "semver" "^6.0.0" 283 | "split" "^1.0.0" 284 | "through2" "^4.0.0" 285 | 286 | "conventional-changelog@^3.1.24": 287 | "integrity" "sha512-ryhi3fd1mKf3fSjbLXOfK2D06YwKNic1nC9mWqybBHdObPd8KJ2vjaXZfYj1U23t+V8T8n0d7gwnc9XbIdFbyQ==" 288 | "resolved" "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.25.tgz" 289 | "version" "3.1.25" 290 | dependencies: 291 | "conventional-changelog-angular" "^5.0.12" 292 | "conventional-changelog-atom" "^2.0.8" 293 | "conventional-changelog-codemirror" "^2.0.8" 294 | "conventional-changelog-conventionalcommits" "^4.5.0" 295 | "conventional-changelog-core" "^4.2.1" 296 | "conventional-changelog-ember" "^2.0.9" 297 | "conventional-changelog-eslint" "^3.0.9" 298 | "conventional-changelog-express" "^2.0.6" 299 | "conventional-changelog-jquery" "^3.0.11" 300 | "conventional-changelog-jshint" "^2.0.9" 301 | "conventional-changelog-preset-loader" "^2.3.4" 302 | 303 | "conventional-commits-filter@^2.0.7": 304 | "integrity" "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==" 305 | "resolved" "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz" 306 | "version" "2.0.7" 307 | dependencies: 308 | "lodash.ismatch" "^4.4.0" 309 | "modify-values" "^1.0.0" 310 | 311 | "conventional-commits-parser@^3.2.0": 312 | "integrity" "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==" 313 | "resolved" "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz" 314 | "version" "3.2.4" 315 | dependencies: 316 | "is-text-path" "^1.0.1" 317 | "JSONStream" "^1.0.4" 318 | "lodash" "^4.17.15" 319 | "meow" "^8.0.0" 320 | "split2" "^3.0.0" 321 | "through2" "^4.0.0" 322 | 323 | "core-util-is@~1.0.0": 324 | "integrity" "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" 325 | "resolved" "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" 326 | "version" "1.0.3" 327 | 328 | "cross-spawn@^7.0.0": 329 | "integrity" "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==" 330 | "resolved" "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" 331 | "version" "7.0.3" 332 | dependencies: 333 | "path-key" "^3.1.0" 334 | "shebang-command" "^2.0.0" 335 | "which" "^2.0.1" 336 | 337 | "dargs@^7.0.0": 338 | "integrity" "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==" 339 | "resolved" "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz" 340 | "version" "7.0.0" 341 | 342 | "dateformat@^3.0.0": 343 | "integrity" "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==" 344 | "resolved" "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz" 345 | "version" "3.0.3" 346 | 347 | "debug@=3.1.0": 348 | "integrity" "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=" 349 | "resolved" "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz?cache=0&sync_timestamp=1600502820683&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.1.0.tgz" 350 | "version" "3.1.0" 351 | dependencies: 352 | "ms" "2.0.0" 353 | 354 | "decamelize-keys@^1.1.0": 355 | "integrity" "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=" 356 | "resolved" "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz" 357 | "version" "1.1.0" 358 | dependencies: 359 | "decamelize" "^1.1.0" 360 | "map-obj" "^1.0.0" 361 | 362 | "decamelize@^1.1.0": 363 | "integrity" "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" 364 | "resolved" "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" 365 | "version" "1.2.0" 366 | 367 | "dot-prop@^5.1.0": 368 | "integrity" "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==" 369 | "resolved" "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz" 370 | "version" "5.3.0" 371 | dependencies: 372 | "is-obj" "^2.0.0" 373 | 374 | "emoji-regex@^8.0.0": 375 | "integrity" "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" 376 | "resolved" "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" 377 | "version" "8.0.0" 378 | 379 | "end-of-stream@^1.1.0": 380 | "integrity" "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==" 381 | "resolved" "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" 382 | "version" "1.4.4" 383 | dependencies: 384 | "once" "^1.4.0" 385 | 386 | "error-ex@^1.3.1": 387 | "integrity" "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==" 388 | "resolved" "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" 389 | "version" "1.3.2" 390 | dependencies: 391 | "is-arrayish" "^0.2.1" 392 | 393 | "escalade@^3.1.1": 394 | "integrity" "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" 395 | "resolved" "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" 396 | "version" "3.1.1" 397 | 398 | "escape-string-regexp@^1.0.5": 399 | "integrity" "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 400 | "resolved" "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" 401 | "version" "1.0.5" 402 | 403 | "execa@^4.0.2": 404 | "integrity" "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==" 405 | "resolved" "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz" 406 | "version" "4.1.0" 407 | dependencies: 408 | "cross-spawn" "^7.0.0" 409 | "get-stream" "^5.0.0" 410 | "human-signals" "^1.1.1" 411 | "is-stream" "^2.0.0" 412 | "merge-stream" "^2.0.0" 413 | "npm-run-path" "^4.0.0" 414 | "onetime" "^5.1.0" 415 | "signal-exit" "^3.0.2" 416 | "strip-final-newline" "^2.0.0" 417 | 418 | "find-up@^2.0.0": 419 | "integrity" "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=" 420 | "resolved" "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz" 421 | "version" "2.1.0" 422 | dependencies: 423 | "locate-path" "^2.0.0" 424 | 425 | "find-up@^4.1.0": 426 | "integrity" "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==" 427 | "resolved" "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" 428 | "version" "4.1.0" 429 | dependencies: 430 | "locate-path" "^5.0.0" 431 | "path-exists" "^4.0.0" 432 | 433 | "follow-redirects@^1.4.1", "follow-redirects@1.5.10": 434 | "integrity" "sha1-e3qfmuov3/NnhqlP9kPtB/T/Xio=" 435 | "resolved" "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.10.tgz" 436 | "version" "1.5.10" 437 | dependencies: 438 | "debug" "=3.1.0" 439 | 440 | "function-bind@^1.1.1": 441 | "integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 442 | "resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" 443 | "version" "1.1.1" 444 | 445 | "get-caller-file@^2.0.5": 446 | "integrity" "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" 447 | "resolved" "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" 448 | "version" "2.0.5" 449 | 450 | "get-pkg-repo@^4.0.0": 451 | "integrity" "sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA==" 452 | "resolved" "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz" 453 | "version" "4.2.1" 454 | dependencies: 455 | "@hutson/parse-repository-url" "^3.0.0" 456 | "hosted-git-info" "^4.0.0" 457 | "through2" "^2.0.0" 458 | "yargs" "^16.2.0" 459 | 460 | "get-stream@^5.0.0": 461 | "integrity" "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==" 462 | "resolved" "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz" 463 | "version" "5.2.0" 464 | dependencies: 465 | "pump" "^3.0.0" 466 | 467 | "git-raw-commits@^2.0.8": 468 | "integrity" "sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==" 469 | "resolved" "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz" 470 | "version" "2.0.11" 471 | dependencies: 472 | "dargs" "^7.0.0" 473 | "lodash" "^4.17.15" 474 | "meow" "^8.0.0" 475 | "split2" "^3.0.0" 476 | "through2" "^4.0.0" 477 | 478 | "git-remote-origin-url@^2.0.0": 479 | "integrity" "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=" 480 | "resolved" "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz" 481 | "version" "2.0.0" 482 | dependencies: 483 | "gitconfiglocal" "^1.0.0" 484 | "pify" "^2.3.0" 485 | 486 | "git-semver-tags@^4.1.1": 487 | "integrity" "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==" 488 | "resolved" "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz" 489 | "version" "4.1.1" 490 | dependencies: 491 | "meow" "^8.0.0" 492 | "semver" "^6.0.0" 493 | 494 | "gitconfiglocal@^1.0.0": 495 | "integrity" "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=" 496 | "resolved" "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz" 497 | "version" "1.0.0" 498 | dependencies: 499 | "ini" "^1.3.2" 500 | 501 | "graceful-fs@^4.1.2": 502 | "integrity" "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==" 503 | "resolved" "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz" 504 | "version" "4.2.9" 505 | 506 | "handlebars@^4.7.7": 507 | "integrity" "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==" 508 | "resolved" "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz" 509 | "version" "4.7.7" 510 | dependencies: 511 | "minimist" "^1.2.5" 512 | "neo-async" "^2.6.0" 513 | "source-map" "^0.6.1" 514 | "wordwrap" "^1.0.0" 515 | optionalDependencies: 516 | "uglify-js" "^3.1.4" 517 | 518 | "hard-rejection@^2.1.0": 519 | "integrity" "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==" 520 | "resolved" "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz" 521 | "version" "2.1.0" 522 | 523 | "has-flag@^3.0.0": 524 | "integrity" "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" 525 | "resolved" "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" 526 | "version" "3.0.0" 527 | 528 | "has-flag@^4.0.0": 529 | "integrity" "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" 530 | "resolved" "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" 531 | "version" "4.0.0" 532 | 533 | "has@^1.0.3": 534 | "integrity" "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==" 535 | "resolved" "https://registry.npmjs.org/has/-/has-1.0.3.tgz" 536 | "version" "1.0.3" 537 | dependencies: 538 | "function-bind" "^1.1.1" 539 | 540 | "hosted-git-info@^2.1.4": 541 | "integrity" "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" 542 | "resolved" "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz" 543 | "version" "2.8.9" 544 | 545 | "hosted-git-info@^4.0.0", "hosted-git-info@^4.0.1": 546 | "integrity" "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==" 547 | "resolved" "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz" 548 | "version" "4.1.0" 549 | dependencies: 550 | "lru-cache" "^6.0.0" 551 | 552 | "human-signals@^1.1.1": 553 | "integrity" "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==" 554 | "resolved" "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz" 555 | "version" "1.1.1" 556 | 557 | "indent-string@^4.0.0": 558 | "integrity" "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" 559 | "resolved" "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" 560 | "version" "4.0.0" 561 | 562 | "inherits@^2.0.3", "inherits@~2.0.3": 563 | "integrity" "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 564 | "resolved" "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" 565 | "version" "2.0.4" 566 | 567 | "ini@^1.3.2": 568 | "integrity" "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" 569 | "resolved" "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" 570 | "version" "1.3.8" 571 | 572 | "is-arrayish@^0.2.1": 573 | "integrity" "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" 574 | "resolved" "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" 575 | "version" "0.2.1" 576 | 577 | "is-buffer@^2.0.2": 578 | "integrity" "sha1-68JS5ADSL/jXf6CYiIIaJKZYwZE= sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==" 579 | "resolved" "https://registry.npm.taobao.org/is-buffer/download/is-buffer-2.0.5.tgz" 580 | "version" "2.0.5" 581 | 582 | "is-core-module@^2.5.0", "is-core-module@^2.8.1": 583 | "integrity" "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==" 584 | "resolved" "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz" 585 | "version" "2.8.1" 586 | dependencies: 587 | "has" "^1.0.3" 588 | 589 | "is-fullwidth-code-point@^3.0.0": 590 | "integrity" "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" 591 | "resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" 592 | "version" "3.0.0" 593 | 594 | "is-obj@^2.0.0": 595 | "integrity" "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" 596 | "resolved" "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz" 597 | "version" "2.0.0" 598 | 599 | "is-plain-obj@^1.1.0": 600 | "integrity" "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" 601 | "resolved" "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz" 602 | "version" "1.1.0" 603 | 604 | "is-stream@^2.0.0": 605 | "integrity" "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" 606 | "resolved" "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" 607 | "version" "2.0.1" 608 | 609 | "is-text-path@^1.0.1": 610 | "integrity" "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=" 611 | "resolved" "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz" 612 | "version" "1.0.1" 613 | dependencies: 614 | "text-extensions" "^1.0.0" 615 | 616 | "isarray@~1.0.0": 617 | "integrity" "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 618 | "resolved" "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" 619 | "version" "1.0.0" 620 | 621 | "isexe@^2.0.0": 622 | "integrity" "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" 623 | "resolved" "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" 624 | "version" "2.0.0" 625 | 626 | "js-tokens@^4.0.0": 627 | "integrity" "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" 628 | "resolved" "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" 629 | "version" "4.0.0" 630 | 631 | "jsencrypt@^3.0.0-rc.1": 632 | "integrity" "sha1-DgpHRLpDzFV/tc9i/oZGvOtWGxw= sha512-gcvGaqerlUJy1Kq6tNgPYteVEoWNemu+9hBe2CdsCIz4rVcwjoTQ72iD1W76/PRMlnkzG0yVh7nwOOMOOUfKmg==" 633 | "resolved" "https://registry.npm.taobao.org/jsencrypt/download/jsencrypt-3.0.0-rc.1.tgz" 634 | "version" "3.0.0-rc.1" 635 | 636 | "json-parse-better-errors@^1.0.1": 637 | "integrity" "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" 638 | "resolved" "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz" 639 | "version" "1.0.2" 640 | 641 | "json-parse-even-better-errors@^2.3.0": 642 | "integrity" "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" 643 | "resolved" "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" 644 | "version" "2.3.1" 645 | 646 | "json-stringify-safe@^5.0.1": 647 | "integrity" "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 648 | "resolved" "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" 649 | "version" "5.0.1" 650 | 651 | "jsonparse@^1.2.0": 652 | "integrity" "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" 653 | "resolved" "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz" 654 | "version" "1.3.1" 655 | 656 | "JSONStream@^1.0.4": 657 | "integrity" "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==" 658 | "resolved" "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz" 659 | "version" "1.3.5" 660 | dependencies: 661 | "jsonparse" "^1.2.0" 662 | "through" ">=2.2.7 <3" 663 | 664 | "jwt-decode@^2.2.0": 665 | "integrity" "sha1-fYa9VmefWM5qhHBKZX3TkruoGnk=" 666 | "resolved" "https://registry.npm.taobao.org/jwt-decode/download/jwt-decode-2.2.0.tgz" 667 | "version" "2.2.0" 668 | 669 | "kind-of@^6.0.3": 670 | "integrity" "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" 671 | "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" 672 | "version" "6.0.3" 673 | 674 | "lines-and-columns@^1.1.6": 675 | "integrity" "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" 676 | "resolved" "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" 677 | "version" "1.2.4" 678 | 679 | "load-json-file@^4.0.0": 680 | "integrity" "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=" 681 | "resolved" "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz" 682 | "version" "4.0.0" 683 | dependencies: 684 | "graceful-fs" "^4.1.2" 685 | "parse-json" "^4.0.0" 686 | "pify" "^3.0.0" 687 | "strip-bom" "^3.0.0" 688 | 689 | "locate-path@^2.0.0": 690 | "integrity" "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=" 691 | "resolved" "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz" 692 | "version" "2.0.0" 693 | dependencies: 694 | "p-locate" "^2.0.0" 695 | "path-exists" "^3.0.0" 696 | 697 | "locate-path@^5.0.0": 698 | "integrity" "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==" 699 | "resolved" "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" 700 | "version" "5.0.0" 701 | dependencies: 702 | "p-locate" "^4.1.0" 703 | 704 | "lodash.ismatch@^4.4.0": 705 | "integrity" "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=" 706 | "resolved" "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz" 707 | "version" "4.4.0" 708 | 709 | "lodash@^4.17.15": 710 | "integrity" "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" 711 | "resolved" "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" 712 | "version" "4.17.21" 713 | 714 | "lru-cache@^6.0.0": 715 | "integrity" "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==" 716 | "resolved" "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" 717 | "version" "6.0.0" 718 | dependencies: 719 | "yallist" "^4.0.0" 720 | 721 | "map-obj@^1.0.0": 722 | "integrity" "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" 723 | "resolved" "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz" 724 | "version" "1.0.1" 725 | 726 | "map-obj@^4.0.0": 727 | "integrity" "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==" 728 | "resolved" "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz" 729 | "version" "4.3.0" 730 | 731 | "meow@^8.0.0": 732 | "integrity" "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==" 733 | "resolved" "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz" 734 | "version" "8.1.2" 735 | dependencies: 736 | "@types/minimist" "^1.2.0" 737 | "camelcase-keys" "^6.2.2" 738 | "decamelize-keys" "^1.1.0" 739 | "hard-rejection" "^2.1.0" 740 | "minimist-options" "4.1.0" 741 | "normalize-package-data" "^3.0.0" 742 | "read-pkg-up" "^7.0.1" 743 | "redent" "^3.0.0" 744 | "trim-newlines" "^3.0.0" 745 | "type-fest" "^0.18.0" 746 | "yargs-parser" "^20.2.3" 747 | 748 | "merge-stream@^2.0.0": 749 | "integrity" "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" 750 | "resolved" "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" 751 | "version" "2.0.0" 752 | 753 | "mimic-fn@^2.1.0": 754 | "integrity" "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" 755 | "resolved" "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" 756 | "version" "2.1.0" 757 | 758 | "min-indent@^1.0.0": 759 | "integrity" "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" 760 | "resolved" "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" 761 | "version" "1.0.1" 762 | 763 | "minimist-options@4.1.0": 764 | "integrity" "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==" 765 | "resolved" "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" 766 | "version" "4.1.0" 767 | dependencies: 768 | "arrify" "^1.0.1" 769 | "is-plain-obj" "^1.1.0" 770 | "kind-of" "^6.0.3" 771 | 772 | "minimist@^1.2.5": 773 | "integrity" "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" 774 | "resolved" "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" 775 | "version" "1.2.5" 776 | 777 | "modify-values@^1.0.0": 778 | "integrity" "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==" 779 | "resolved" "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz" 780 | "version" "1.0.1" 781 | 782 | "ms@2.0.0": 783 | "integrity" "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 784 | "resolved" "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz" 785 | "version" "2.0.0" 786 | 787 | "neo-async@^2.6.0": 788 | "integrity" "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" 789 | "resolved" "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" 790 | "version" "2.6.2" 791 | 792 | "node-console-colors@^1.1.4": 793 | "integrity" "sha512-8I0zChYxF+l4oCSAAk8fk9Y73KbtVxZxIMAkeZabKhrOaHVM0TwnycUoGhqCA/y6hj3rPs8JUPPZCU8TiKr4Uw==" 794 | "resolved" "https://registry.npmjs.org/node-console-colors/-/node-console-colors-1.1.4.tgz" 795 | "version" "1.1.4" 796 | 797 | "normalize-package-data@^2.3.2": 798 | "integrity" "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==" 799 | "resolved" "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" 800 | "version" "2.5.0" 801 | dependencies: 802 | "hosted-git-info" "^2.1.4" 803 | "resolve" "^1.10.0" 804 | "semver" "2 || 3 || 4 || 5" 805 | "validate-npm-package-license" "^3.0.1" 806 | 807 | "normalize-package-data@^2.5.0": 808 | "integrity" "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==" 809 | "resolved" "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" 810 | "version" "2.5.0" 811 | dependencies: 812 | "hosted-git-info" "^2.1.4" 813 | "resolve" "^1.10.0" 814 | "semver" "2 || 3 || 4 || 5" 815 | "validate-npm-package-license" "^3.0.1" 816 | 817 | "normalize-package-data@^3.0.0": 818 | "integrity" "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==" 819 | "resolved" "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz" 820 | "version" "3.0.3" 821 | dependencies: 822 | "hosted-git-info" "^4.0.1" 823 | "is-core-module" "^2.5.0" 824 | "semver" "^7.3.4" 825 | "validate-npm-package-license" "^3.0.1" 826 | 827 | "npm-run-path@^4.0.0": 828 | "integrity" "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==" 829 | "resolved" "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" 830 | "version" "4.0.1" 831 | dependencies: 832 | "path-key" "^3.0.0" 833 | 834 | "once@^1.3.1", "once@^1.4.0": 835 | "integrity" "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=" 836 | "resolved" "https://registry.npmjs.org/once/-/once-1.4.0.tgz" 837 | "version" "1.4.0" 838 | dependencies: 839 | "wrappy" "1" 840 | 841 | "onetime@^5.1.0": 842 | "integrity" "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==" 843 | "resolved" "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" 844 | "version" "5.1.2" 845 | dependencies: 846 | "mimic-fn" "^2.1.0" 847 | 848 | "p-limit@^1.1.0": 849 | "integrity" "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==" 850 | "resolved" "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz" 851 | "version" "1.3.0" 852 | dependencies: 853 | "p-try" "^1.0.0" 854 | 855 | "p-limit@^2.2.0": 856 | "integrity" "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==" 857 | "resolved" "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" 858 | "version" "2.3.0" 859 | dependencies: 860 | "p-try" "^2.0.0" 861 | 862 | "p-locate@^2.0.0": 863 | "integrity" "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=" 864 | "resolved" "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz" 865 | "version" "2.0.0" 866 | dependencies: 867 | "p-limit" "^1.1.0" 868 | 869 | "p-locate@^4.1.0": 870 | "integrity" "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==" 871 | "resolved" "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" 872 | "version" "4.1.0" 873 | dependencies: 874 | "p-limit" "^2.2.0" 875 | 876 | "p-try@^1.0.0": 877 | "integrity" "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" 878 | "resolved" "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz" 879 | "version" "1.0.0" 880 | 881 | "p-try@^2.0.0": 882 | "integrity" "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" 883 | "resolved" "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" 884 | "version" "2.2.0" 885 | 886 | "parse-json@^4.0.0": 887 | "integrity" "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=" 888 | "resolved" "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz" 889 | "version" "4.0.0" 890 | dependencies: 891 | "error-ex" "^1.3.1" 892 | "json-parse-better-errors" "^1.0.1" 893 | 894 | "parse-json@^5.0.0": 895 | "integrity" "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==" 896 | "resolved" "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" 897 | "version" "5.2.0" 898 | dependencies: 899 | "@babel/code-frame" "^7.0.0" 900 | "error-ex" "^1.3.1" 901 | "json-parse-even-better-errors" "^2.3.0" 902 | "lines-and-columns" "^1.1.6" 903 | 904 | "path-exists@^3.0.0": 905 | "integrity" "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" 906 | "resolved" "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz" 907 | "version" "3.0.0" 908 | 909 | "path-exists@^4.0.0": 910 | "integrity" "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" 911 | "resolved" "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" 912 | "version" "4.0.0" 913 | 914 | "path-key@^3.0.0", "path-key@^3.1.0": 915 | "integrity" "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" 916 | "resolved" "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" 917 | "version" "3.1.1" 918 | 919 | "path-parse@^1.0.7": 920 | "integrity" "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" 921 | "resolved" "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" 922 | "version" "1.0.7" 923 | 924 | "path-type@^3.0.0": 925 | "integrity" "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==" 926 | "resolved" "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz" 927 | "version" "3.0.0" 928 | dependencies: 929 | "pify" "^3.0.0" 930 | 931 | "pify@^2.3.0": 932 | "integrity" "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" 933 | "resolved" "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz" 934 | "version" "2.3.0" 935 | 936 | "pify@^3.0.0": 937 | "integrity" "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" 938 | "resolved" "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz" 939 | "version" "3.0.0" 940 | 941 | "process-nextick-args@~2.0.0": 942 | "integrity" "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 943 | "resolved" "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" 944 | "version" "2.0.1" 945 | 946 | "pump@^3.0.0": 947 | "integrity" "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==" 948 | "resolved" "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz" 949 | "version" "3.0.0" 950 | dependencies: 951 | "end-of-stream" "^1.1.0" 952 | "once" "^1.3.1" 953 | 954 | "q@^1.5.1": 955 | "integrity" "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" 956 | "resolved" "https://registry.npmjs.org/q/-/q-1.5.1.tgz" 957 | "version" "1.5.1" 958 | 959 | "quick-lru@^4.0.1": 960 | "integrity" "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==" 961 | "resolved" "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" 962 | "version" "4.0.1" 963 | 964 | "read-pkg-up@^3.0.0": 965 | "integrity" "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=" 966 | "resolved" "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz" 967 | "version" "3.0.0" 968 | dependencies: 969 | "find-up" "^2.0.0" 970 | "read-pkg" "^3.0.0" 971 | 972 | "read-pkg-up@^7.0.1": 973 | "integrity" "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==" 974 | "resolved" "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz" 975 | "version" "7.0.1" 976 | dependencies: 977 | "find-up" "^4.1.0" 978 | "read-pkg" "^5.2.0" 979 | "type-fest" "^0.8.1" 980 | 981 | "read-pkg@^3.0.0": 982 | "integrity" "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=" 983 | "resolved" "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz" 984 | "version" "3.0.0" 985 | dependencies: 986 | "load-json-file" "^4.0.0" 987 | "normalize-package-data" "^2.3.2" 988 | "path-type" "^3.0.0" 989 | 990 | "read-pkg@^5.2.0": 991 | "integrity" "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==" 992 | "resolved" "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz" 993 | "version" "5.2.0" 994 | dependencies: 995 | "@types/normalize-package-data" "^2.4.0" 996 | "normalize-package-data" "^2.5.0" 997 | "parse-json" "^5.0.0" 998 | "type-fest" "^0.6.0" 999 | 1000 | "readable-stream@^3.0.0", "readable-stream@3": 1001 | "integrity" "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==" 1002 | "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" 1003 | "version" "3.6.0" 1004 | dependencies: 1005 | "inherits" "^2.0.3" 1006 | "string_decoder" "^1.1.1" 1007 | "util-deprecate" "^1.0.1" 1008 | 1009 | "readable-stream@~2.3.6": 1010 | "integrity" "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==" 1011 | "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" 1012 | "version" "2.3.7" 1013 | dependencies: 1014 | "core-util-is" "~1.0.0" 1015 | "inherits" "~2.0.3" 1016 | "isarray" "~1.0.0" 1017 | "process-nextick-args" "~2.0.0" 1018 | "safe-buffer" "~5.1.1" 1019 | "string_decoder" "~1.1.1" 1020 | "util-deprecate" "~1.0.1" 1021 | 1022 | "redent@^3.0.0": 1023 | "integrity" "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==" 1024 | "resolved" "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz" 1025 | "version" "3.0.0" 1026 | dependencies: 1027 | "indent-string" "^4.0.0" 1028 | "strip-indent" "^3.0.0" 1029 | 1030 | "require-directory@^2.1.1": 1031 | "integrity" "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" 1032 | "resolved" "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" 1033 | "version" "2.1.1" 1034 | 1035 | "resolve@^1.10.0": 1036 | "integrity" "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==" 1037 | "resolved" "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz" 1038 | "version" "1.22.0" 1039 | dependencies: 1040 | "is-core-module" "^2.8.1" 1041 | "path-parse" "^1.0.7" 1042 | "supports-preserve-symlinks-flag" "^1.0.0" 1043 | 1044 | "safe-buffer@~5.1.0", "safe-buffer@~5.1.1": 1045 | "integrity" "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 1046 | "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" 1047 | "version" "5.1.2" 1048 | 1049 | "safe-buffer@~5.2.0": 1050 | "integrity" "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 1051 | "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" 1052 | "version" "5.2.1" 1053 | 1054 | "semver@^6.0.0": 1055 | "integrity" "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" 1056 | "resolved" "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" 1057 | "version" "6.3.0" 1058 | 1059 | "semver@^7.3.4": 1060 | "integrity" "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==" 1061 | "resolved" "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz" 1062 | "version" "7.3.5" 1063 | dependencies: 1064 | "lru-cache" "^6.0.0" 1065 | 1066 | "semver@2 || 3 || 4 || 5": 1067 | "integrity" "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" 1068 | "resolved" "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" 1069 | "version" "5.7.1" 1070 | 1071 | "shebang-command@^2.0.0": 1072 | "integrity" "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==" 1073 | "resolved" "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" 1074 | "version" "2.0.0" 1075 | dependencies: 1076 | "shebang-regex" "^3.0.0" 1077 | 1078 | "shebang-regex@^3.0.0": 1079 | "integrity" "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" 1080 | "resolved" "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" 1081 | "version" "3.0.0" 1082 | 1083 | "signal-exit@^3.0.2": 1084 | "integrity" "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==" 1085 | "resolved" "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz" 1086 | "version" "3.0.6" 1087 | 1088 | "source-map@^0.6.1": 1089 | "integrity" "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" 1090 | "resolved" "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" 1091 | "version" "0.6.1" 1092 | 1093 | "spdx-correct@^3.0.0": 1094 | "integrity" "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==" 1095 | "resolved" "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz" 1096 | "version" "3.1.1" 1097 | dependencies: 1098 | "spdx-expression-parse" "^3.0.0" 1099 | "spdx-license-ids" "^3.0.0" 1100 | 1101 | "spdx-exceptions@^2.1.0": 1102 | "integrity" "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" 1103 | "resolved" "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz" 1104 | "version" "2.3.0" 1105 | 1106 | "spdx-expression-parse@^3.0.0": 1107 | "integrity" "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==" 1108 | "resolved" "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz" 1109 | "version" "3.0.1" 1110 | dependencies: 1111 | "spdx-exceptions" "^2.1.0" 1112 | "spdx-license-ids" "^3.0.0" 1113 | 1114 | "spdx-license-ids@^3.0.0": 1115 | "integrity" "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==" 1116 | "resolved" "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz" 1117 | "version" "3.0.11" 1118 | 1119 | "split@^1.0.0": 1120 | "integrity" "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==" 1121 | "resolved" "https://registry.npmjs.org/split/-/split-1.0.1.tgz" 1122 | "version" "1.0.1" 1123 | dependencies: 1124 | "through" "2" 1125 | 1126 | "split2@^3.0.0": 1127 | "integrity" "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==" 1128 | "resolved" "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz" 1129 | "version" "3.2.2" 1130 | dependencies: 1131 | "readable-stream" "^3.0.0" 1132 | 1133 | "string_decoder@^1.1.1": 1134 | "integrity" "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==" 1135 | "resolved" "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" 1136 | "version" "1.3.0" 1137 | dependencies: 1138 | "safe-buffer" "~5.2.0" 1139 | 1140 | "string_decoder@~1.1.1": 1141 | "integrity" "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==" 1142 | "resolved" "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" 1143 | "version" "1.1.1" 1144 | dependencies: 1145 | "safe-buffer" "~5.1.0" 1146 | 1147 | "string-width@^4.1.0", "string-width@^4.2.0": 1148 | "integrity" "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==" 1149 | "resolved" "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" 1150 | "version" "4.2.3" 1151 | dependencies: 1152 | "emoji-regex" "^8.0.0" 1153 | "is-fullwidth-code-point" "^3.0.0" 1154 | "strip-ansi" "^6.0.1" 1155 | 1156 | "strip-ansi@^6.0.0", "strip-ansi@^6.0.1": 1157 | "integrity" "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==" 1158 | "resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" 1159 | "version" "6.0.1" 1160 | dependencies: 1161 | "ansi-regex" "^5.0.1" 1162 | 1163 | "strip-bom@^3.0.0": 1164 | "integrity" "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" 1165 | "resolved" "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz" 1166 | "version" "3.0.0" 1167 | 1168 | "strip-final-newline@^2.0.0": 1169 | "integrity" "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" 1170 | "resolved" "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" 1171 | "version" "2.0.0" 1172 | 1173 | "strip-indent@^3.0.0": 1174 | "integrity" "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==" 1175 | "resolved" "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz" 1176 | "version" "3.0.0" 1177 | dependencies: 1178 | "min-indent" "^1.0.0" 1179 | 1180 | "supports-color@^5.3.0": 1181 | "integrity" "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==" 1182 | "resolved" "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" 1183 | "version" "5.5.0" 1184 | dependencies: 1185 | "has-flag" "^3.0.0" 1186 | 1187 | "supports-color@^7.1.0": 1188 | "integrity" "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==" 1189 | "resolved" "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" 1190 | "version" "7.2.0" 1191 | dependencies: 1192 | "has-flag" "^4.0.0" 1193 | 1194 | "supports-preserve-symlinks-flag@^1.0.0": 1195 | "integrity" "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" 1196 | "resolved" "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" 1197 | "version" "1.0.0" 1198 | 1199 | "temp-dir@^2.0.0": 1200 | "integrity" "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==" 1201 | "resolved" "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz" 1202 | "version" "2.0.0" 1203 | 1204 | "tempfile@^3.0.0": 1205 | "integrity" "sha512-uNFCg478XovRi85iD42egu+eSFUmmka750Jy7L5tfHI5hQKKtbPnxaSaXAbBqCDYrw3wx4tXjKwci4/QmsZJxw==" 1206 | "resolved" "https://registry.npmjs.org/tempfile/-/tempfile-3.0.0.tgz" 1207 | "version" "3.0.0" 1208 | dependencies: 1209 | "temp-dir" "^2.0.0" 1210 | "uuid" "^3.3.2" 1211 | 1212 | "text-extensions@^1.0.0": 1213 | "integrity" "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==" 1214 | "resolved" "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz" 1215 | "version" "1.9.0" 1216 | 1217 | "through@>=2.2.7 <3", "through@2": 1218 | "integrity" "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" 1219 | "resolved" "https://registry.npmjs.org/through/-/through-2.3.8.tgz" 1220 | "version" "2.3.8" 1221 | 1222 | "through2@^2.0.0": 1223 | "integrity" "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==" 1224 | "resolved" "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" 1225 | "version" "2.0.5" 1226 | dependencies: 1227 | "readable-stream" "~2.3.6" 1228 | "xtend" "~4.0.1" 1229 | 1230 | "through2@^4.0.0": 1231 | "integrity" "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==" 1232 | "resolved" "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz" 1233 | "version" "4.0.2" 1234 | dependencies: 1235 | "readable-stream" "3" 1236 | 1237 | "trim-newlines@^3.0.0": 1238 | "integrity" "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==" 1239 | "resolved" "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz" 1240 | "version" "3.0.1" 1241 | 1242 | "type-fest@^0.18.0": 1243 | "integrity" "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==" 1244 | "resolved" "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz" 1245 | "version" "0.18.1" 1246 | 1247 | "type-fest@^0.6.0": 1248 | "integrity" "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==" 1249 | "resolved" "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz" 1250 | "version" "0.6.0" 1251 | 1252 | "type-fest@^0.8.1": 1253 | "integrity" "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" 1254 | "resolved" "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz" 1255 | "version" "0.8.1" 1256 | 1257 | "typescript@^4.0.5": 1258 | "integrity" "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==" 1259 | "resolved" "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz" 1260 | "version" "4.0.5" 1261 | 1262 | "uglify-js@^3.1.4": 1263 | "integrity" "sha512-x+xdeDWq7FiORDvyIJ0q/waWd4PhjBNOm5dQUOq2AKC0IEjxOS66Ha9tctiVDGcRQuh69K7fgU5oRuTK4cysSg==" 1264 | "resolved" "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.0.tgz" 1265 | "version" "3.15.0" 1266 | 1267 | "util-deprecate@^1.0.1", "util-deprecate@~1.0.1": 1268 | "integrity" "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 1269 | "resolved" "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" 1270 | "version" "1.0.2" 1271 | 1272 | "uuid@^3.3.2": 1273 | "integrity" "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" 1274 | "resolved" "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz" 1275 | "version" "3.4.0" 1276 | 1277 | "validate-npm-package-license@^3.0.1": 1278 | "integrity" "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==" 1279 | "resolved" "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" 1280 | "version" "3.0.4" 1281 | dependencies: 1282 | "spdx-correct" "^3.0.0" 1283 | "spdx-expression-parse" "^3.0.0" 1284 | 1285 | "which@^2.0.1": 1286 | "integrity" "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==" 1287 | "resolved" "https://registry.npmjs.org/which/-/which-2.0.2.tgz" 1288 | "version" "2.0.2" 1289 | dependencies: 1290 | "isexe" "^2.0.0" 1291 | 1292 | "wordwrap@^1.0.0": 1293 | "integrity" "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" 1294 | "resolved" "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" 1295 | "version" "1.0.0" 1296 | 1297 | "wrap-ansi@^7.0.0": 1298 | "integrity" "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==" 1299 | "resolved" "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" 1300 | "version" "7.0.0" 1301 | dependencies: 1302 | "ansi-styles" "^4.0.0" 1303 | "string-width" "^4.1.0" 1304 | "strip-ansi" "^6.0.0" 1305 | 1306 | "wrappy@1": 1307 | "integrity" "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 1308 | "resolved" "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" 1309 | "version" "1.0.2" 1310 | 1311 | "wx-axios@^0.0.7": 1312 | "integrity" "sha1-w/SxYDjvimRWWTVxp15SMFQl1Qw= sha512-hPobpb88p9lL0MnLxQ1IqLL2xHICfvDYcAnSSehzuhHhcOZtEFHpFWF7zWf7eUMe3/eHwWCia0bDdkGmLg083g==" 1313 | "resolved" "https://registry.npm.taobao.org/wx-axios/download/wx-axios-0.0.7.tgz" 1314 | "version" "0.0.7" 1315 | dependencies: 1316 | "follow-redirects" "^1.4.1" 1317 | "is-buffer" "^2.0.2" 1318 | 1319 | "xtend@~4.0.1": 1320 | "integrity" "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" 1321 | "resolved" "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" 1322 | "version" "4.0.2" 1323 | 1324 | "y18n@^5.0.5": 1325 | "integrity" "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" 1326 | "resolved" "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" 1327 | "version" "5.0.8" 1328 | 1329 | "yallist@^4.0.0": 1330 | "integrity" "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" 1331 | "resolved" "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" 1332 | "version" "4.0.0" 1333 | 1334 | "yargs-parser@^20.2.2", "yargs-parser@^20.2.3": 1335 | "integrity" "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" 1336 | "resolved" "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" 1337 | "version" "20.2.9" 1338 | 1339 | "yargs@^16.2.0": 1340 | "integrity" "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==" 1341 | "resolved" "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" 1342 | "version" "16.2.0" 1343 | dependencies: 1344 | "cliui" "^7.0.2" 1345 | "escalade" "^3.1.1" 1346 | "get-caller-file" "^2.0.5" 1347 | "require-directory" "^2.1.1" 1348 | "string-width" "^4.2.0" 1349 | "y18n" "^5.0.5" 1350 | "yargs-parser" "^20.2.2" 1351 | -------------------------------------------------------------------------------- /适配不同端环境指引.md: -------------------------------------------------------------------------------- 1 | # authing-js-sdk 适配不同端环境指引 2 | 3 | 本文以小程序为例,介绍如何通过重载的方法让 authing-js-sdk 适配不同端环境。由于小程序端环境载网络请求、本地缓存、密码加密运行环境上都存在差异,所以需要针对这些差异性重载相关类。 4 | 5 | 如果你想适配其他环境,比如 [uni app](https://uniapp.dcloud.io/),也可以参照此指引来适配该环境。 6 | 7 | > uni app 可以使用 [uni-axios](https://github.com/Lingtin/uni-axios) 来做网络请求兼容。 8 | 9 | ## 网络请求 10 | 11 | 由于小程序环境下不能使用 `axios`,所以需要重载 `authing-js-sdk` 的网络请求类: 12 | - HttpClient 13 | - GraphqlClient 14 | 15 | ### HttpClient 16 | 17 | 原始的 HttpClient 类定义如下: 18 | 19 | ```javascript 20 | import { SDK_VERSION } from '../version'; 21 | import { ManagementClientOptions } from '../management/types'; 22 | import { AuthenticationClientOptions } from '../authentication/types'; 23 | import { AuthenticationTokenProvider } from '../authentication/AuthenticationTokenProvider'; 24 | import { ManagementTokenProvider } from '../management/ManagementTokenProvider'; 25 | import Axios, { AxiosInstance, AxiosRequestConfig } from 'axios'; 26 | 27 | export class HttpClient { 28 | options: ManagementClientOptions; 29 | tokenProvider: ManagementTokenProvider | AuthenticationTokenProvider; 30 | axios: AxiosInstance; 31 | 32 | constructor( 33 | options: ManagementClientOptions | AuthenticationClientOptions, 34 | tokenProvider: ManagementTokenProvider | AuthenticationTokenProvider 35 | ) { 36 | this.options = options; 37 | this.tokenProvider = tokenProvider; 38 | this.axios = Axios.create({ 39 | withCredentials: true 40 | }); 41 | } 42 | 43 | async request(config: AxiosRequestConfig) { 44 | const headers: any = { 45 | 'x-authing-sdk-version': `js:${SDK_VERSION}`, 46 | 'x-authing-userpool-id': this.options.userPoolId || '', 47 | 'x-authing-request-from': this.options.requestFrom || 'sdk', 48 | 'x-authing-app-id': this.options.appId || '' 49 | }; 50 | if (!(config && config.headers && config.headers.authorization)) { 51 | // 如果用户不传 token,就使用 sdk 自己维护的 52 | const token = await this.tokenProvider.getToken(); 53 | token && (headers.Authorization = `Bearer ${token}`); 54 | } else { 55 | headers.authorization = config.headers.authorization; 56 | } 57 | config.headers = headers; 58 | config.timeout = this.options.timeout; 59 | const { data } = await this.axios.request(config); 60 | const { code, message } = data; 61 | if (code !== 200) { 62 | this.options.onError(code, message, data.data); 63 | throw new Error(JSON.stringify({ code, message, data: data.data })); 64 | } 65 | return data.data; 66 | } 67 | } 68 | ``` 69 | 70 | 为了兼容小程序环境,将 [`axios`](https://github.com/axios/axios) 替换为 [`wx-axios`](https://github.com/GreenPomelo/wx-axios): 71 | 72 | ```javascript 73 | import { 74 | AuthenticationClientOptions, 75 | AuthenticationTokenProvider, 76 | ManagementClientOptions, 77 | ManagementTokenProvider, 78 | } from "authing-js-sdk"; 79 | import { AxiosInstance, AxiosRequestConfig } from "axios"; 80 | import { VERSION } from "./version"; 81 | import Axios from "wx-axios"; 82 | 83 | export class HttpClient { 84 | options: ManagementClientOptions; 85 | tokenProvider: ManagementTokenProvider | AuthenticationTokenProvider; 86 | axios: AxiosInstance; 87 | 88 | constructor( 89 | options: ManagementClientOptions | AuthenticationClientOptions, 90 | tokenProvider: ManagementTokenProvider | AuthenticationTokenProvider 91 | ) { 92 | this.options = options; 93 | this.tokenProvider = tokenProvider; 94 | // @ts-ignore 95 | this.axios = Axios.create(); 96 | } 97 | 98 | async request(config: AxiosRequestConfig) { 99 | const headers: any = { 100 | "x-authing-sdk-version": `wxapp:${VERSION}`, 101 | "x-authing-userpool-id": this.options.userPoolId, 102 | "x-authing-request-from": "wxapp", 103 | "x-authing-app-id": this.options.appId || "", 104 | }; 105 | if (!(config && config.headers && config.headers.authorization)) { 106 | // 如果用户不传 token,就使用 sdk 自己维护的 107 | const token = await this.tokenProvider.getToken(); 108 | token && (headers.Authorization = `Bearer ${token}`); 109 | } else { 110 | headers.authorization = config.headers.authorization; 111 | } 112 | config.headers = headers; 113 | config.timeout = this.options.timeout; 114 | const { data } = await this.axios.request(config); 115 | const { code, message } = data; 116 | if (code !== 200) { 117 | this.options.onError && this.options.onError(code, message, data.data); 118 | throw new Error(JSON.stringify({ code, message, data: data.data })); 119 | } 120 | return data.data; 121 | } 122 | } 123 | ``` 124 | 125 | ### GraphqlClient 126 | 127 | 原始的 GraphqlClient 类定义如下: 128 | 129 | ```javascript 130 | import { SDK_VERSION } from '../version'; 131 | import { ManagementClientOptions } from '../management/types'; 132 | import { AuthenticationClientOptions } from '../authentication/types'; 133 | import Axios, { AxiosInstance } from 'axios'; 134 | 135 | export class GraphqlClient { 136 | endpoint: string; 137 | options: ManagementClientOptions | AuthenticationClientOptions; 138 | axios: AxiosInstance; 139 | 140 | constructor( 141 | endpoint: string, 142 | options: ManagementClientOptions | AuthenticationClientOptions 143 | ) { 144 | this.endpoint = endpoint; 145 | this.options = options; 146 | this.axios = Axios.create({ 147 | withCredentials: true 148 | }); 149 | } 150 | 151 | async request(options: { query: string; variables?: any; token?: string }) { 152 | const { query, token, variables } = options; 153 | let headers: any = { 154 | 'content-type': 'application/json', 155 | 'x-authing-sdk-version': `js:${SDK_VERSION}`, 156 | 'x-authing-userpool-id': this.options.userPoolId || '', 157 | 'x-authing-request-from': this.options.requestFrom || 'sdk', 158 | 'x-authing-app-id': this.options.appId || '' 159 | }; 160 | token && (headers.Authorization = `Bearer ${token}`); 161 | let data = null; 162 | let errors = null; 163 | try { 164 | let { data: responseData } = await this.axios({ 165 | url: this.endpoint, 166 | data: { 167 | query, 168 | variables 169 | }, 170 | method: 'post', 171 | headers, 172 | timeout: this.options.timeout 173 | }); 174 | data = responseData.data; 175 | errors = responseData.errors; 176 | } catch (error) { 177 | console.log(error); 178 | this.options.onError(500, '网络请求错误', null); 179 | throw { code: 500, message: '网络请求错误', data: null }; 180 | } 181 | 182 | if (errors?.length > 0) { 183 | let errmsg = null; 184 | let errcode = null; 185 | let data = null; 186 | errors.map((err: any) => { 187 | const { message: msg } = err; 188 | const { code, message, data: _data } = msg; 189 | errcode = code; 190 | errmsg = message; 191 | data = _data; 192 | this.options.onError(code, message, data); 193 | }); 194 | throw { code: errcode, message: errmsg, data }; 195 | } 196 | 197 | return data; 198 | } 199 | } 200 | ``` 201 | 202 | 为了兼容小程序环境,将 [`axios`](https://github.com/axios/axios) 替换为 [`wx-axios`](https://github.com/GreenPomelo/wx-axios): 203 | 204 | ```javascript 205 | import { 206 | AuthenticationClientOptions, 207 | ManagementClientOptions, 208 | } from "authing-js-sdk"; 209 | import Axios from "wx-axios"; 210 | import { VERSION } from "./version"; 211 | 212 | export class GraphqlClient { 213 | endpoint: string; 214 | options: AuthenticationClientOptions | AuthenticationClientOptions; 215 | axios: any; 216 | 217 | constructor( 218 | endpoint: string, 219 | options: ManagementClientOptions | AuthenticationClientOptions 220 | ) { 221 | this.endpoint = endpoint; 222 | this.options = options; 223 | this.axios = Axios.create(); 224 | } 225 | 226 | async request(options: { query: string; variables?: any; token?: string }) { 227 | const { query, token, variables } = options; 228 | let headers: any = { 229 | "content-type": "application/json", 230 | "x-authing-sdk-version": `wxapp:${VERSION}`, 231 | "x-authing-userpool-id": this.options.userPoolId, 232 | "x-authing-request-from": "wxapp", 233 | "x-authing-app-id": this.options.appId || "", 234 | }; 235 | token && (headers.Authorization = `Bearer ${token}`); 236 | let data = null; 237 | let errors = null; 238 | try { 239 | let { data: responseData } = await this.axios({ 240 | url: this.endpoint, 241 | data: { 242 | query, 243 | variables, 244 | }, 245 | method: "post", 246 | headers, 247 | timeout: this.options.timeout, 248 | }); 249 | data = responseData.data; 250 | errors = responseData.errors; 251 | } catch (error) { 252 | this.options.onError && this.options.onError(500, "网络请求错误", null); 253 | throw { code: 500, message: "网络请求错误", data: null }; 254 | } 255 | 256 | if (errors?.length > 0) { 257 | let errmsg = null; 258 | let errcode = null; 259 | let data = null; 260 | errors.map((err: any) => { 261 | const { message: msg } = err; 262 | const { code, message, data: _data } = msg; 263 | errcode = code; 264 | errmsg = message; 265 | data = _data; 266 | this.options.onError && this.options.onError(code, message, data); 267 | }); 268 | throw { code: errcode, message: errmsg, data }; 269 | } 270 | 271 | return data; 272 | } 273 | } 274 | 275 | ``` 276 | 277 | ### 重载 authing-js-sdk 的 AuthenticationClient 278 | 279 | ```javascript 280 | import { 281 | AuthenticationClient as BaseAuthenticationClient, 282 | AuthenticationClientOptions, 283 | } from "authing-js-sdk"; 284 | import { GraphqlClient } from "./GraphqlClient"; 285 | import { HttpClient } from "./HttpClient"; 286 | 287 | export class AuthenticationClient extends BaseAuthenticationClient { 288 | constructor(options: AuthenticationClientOptions) { 289 | options.httpClient = HttpClient; 290 | options.graphqlClient = GraphqlClient; 291 | super(options); 292 | } 293 | } 294 | ``` 295 | 296 | ### 重载 authing-js-sdk 的 ManagementClient 297 | 298 | ```javascript 299 | import { 300 | ManagementClient as BaseManagementClient, 301 | ManagementClientOptions, 302 | } from "authing-js-sdk"; 303 | import { GraphqlClient } from "./GraphqlClient"; 304 | import { HttpClient } from "./HttpClient"; 305 | 306 | export class ManagementClient extends BaseManagementClient { 307 | constructor(options: ManagementClientOptions) { 308 | options.httpClient = HttpClient; 309 | options.graphqlClient = GraphqlClient; 310 | super(options); 311 | } 312 | } 313 | ``` 314 | 315 | ## 本地缓存 316 | 317 | 当用户完成登陆之后,Authing 会在端环境的本地缓存中存储用户信息和 token,以记住用户的登录状态。由于小程序中无法引用 `localStorage`,所以需要使用 `wx.storage` 相关方法进行重载 `AuthenticationTokenProvider` 。 318 | 319 | 原始的 `AuthenticationTokenProvider`: 320 | 321 | ```javascript 322 | import { User } from '../../types/graphql.v2'; 323 | import { AuthenticationClientOptions } from './types'; 324 | 325 | const tokenKey = '_authing_token'; 326 | const userKey = '_authing_user'; 327 | 328 | export class AuthenticationTokenProvider { 329 | options: AuthenticationClientOptions; 330 | 331 | private token?: string; 332 | private user?: User; 333 | 334 | constructor(options: AuthenticationClientOptions) { 335 | this.options = options; 336 | 337 | // 为了兼容服务端不支持 localStorage 的情况 338 | this.token = null; 339 | this.user = null; 340 | } 341 | 342 | setToken(token: string) { 343 | if (typeof localStorage !== 'undefined') { 344 | localStorage.setItem(tokenKey, token); 345 | } else { 346 | this.token = token; 347 | } 348 | } 349 | 350 | getToken() { 351 | return typeof localStorage !== 'undefined' 352 | ? localStorage.getItem(tokenKey) || '' 353 | : this.token; 354 | } 355 | 356 | getUser(): User | null { 357 | return typeof localStorage !== 'undefined' 358 | ? localStorage.getItem(userKey) 359 | ? JSON.parse(localStorage.getItem(userKey)) 360 | : null 361 | : this.user; 362 | } 363 | 364 | setUser(user: User) { 365 | if (typeof localStorage !== 'undefined') { 366 | localStorage.setItem(userKey, JSON.stringify(user)); 367 | localStorage.setItem(tokenKey, user.token); 368 | } else { 369 | this.user = user; 370 | this.token = user.token; 371 | } 372 | } 373 | 374 | clearUser() { 375 | if (typeof localStorage !== 'undefined') { 376 | localStorage.removeItem(userKey); 377 | localStorage.removeItem(tokenKey); 378 | } else { 379 | this.user = null; 380 | this.token = null; 381 | } 382 | } 383 | } 384 | ``` 385 | 386 | 使用 `wx.storage` 相关方法替换 `localStorage` 之后: 387 | 388 | ```javascript 389 | import { AuthenticationClientOptions, User } from "authing-js-sdk"; 390 | 391 | const tokenKey = "_authing_token"; 392 | const userKey = "_authing_user"; 393 | 394 | export class MiniprogramTokenProvider { 395 | options: AuthenticationClientOptions; 396 | 397 | constructor(options: AuthenticationClientOptions) { 398 | this.options = options; 399 | } 400 | 401 | setToken(token: string) { 402 | wx.setStorageSync(tokenKey, token); 403 | } 404 | 405 | getToken() { 406 | return wx.getStorageSync(tokenKey); 407 | } 408 | 409 | getUser(): User | null { 410 | return wx.getStorageSync(userKey); 411 | } 412 | 413 | setUser(user: User) { 414 | wx.setStorageSync(userKey, user); 415 | wx.setStorageSync(tokenKey, user.token as string); 416 | } 417 | 418 | clearUser() { 419 | wx.removeStorageSync(userKey); 420 | wx.removeStorageSync(tokenKey); 421 | } 422 | } 423 | ``` 424 | 425 | 接着重载 AuthenticationClient: 426 | 427 | ```javascript 428 | import { 429 | AuthenticationClient as BaseAuthenticationClient, 430 | AuthenticationClientOptions, 431 | } from "authing-js-sdk"; 432 | import { MiniprogramTokenProvider } from "./TokenProvider"; 433 | 434 | export class AuthenticationClient extends BaseAuthenticationClient { 435 | constructor(options: AuthenticationClientOptions) { 436 | options.tokenProvider = MiniprogramTokenProvider; 437 | super(options); 438 | } 439 | } 440 | ``` 441 | 442 | ## 密码加密 443 | 444 | 由于浏览器环境下的 `crypto-js` 在小程序环境中无法使用,所以引入了 `src/wxapp-jsencrpt.js` 作为自定义密码加密函数。 445 | 446 | ```javascript 447 | const { JSEncrypt } = require("./wxapp-jsencrpt.js"); 448 | 449 | export const encryptFunction = async (plainText: string, publicKey: string) => { 450 | const encrypt = new JSEncrypt(); 451 | encrypt.setPublicKey(publicKey); 452 | const encStr = encrypt.encrypt(plainText); 453 | return encStr.toString(); 454 | }; 455 | ``` 456 | 457 | 接着重载 AuthenticationClient: 458 | 459 | ```javascript 460 | import { 461 | AuthenticationClient as BaseAuthenticationClient, 462 | AuthenticationClientOptions, 463 | } from "authing-js-sdk"; 464 | import { encryptFunction } from "./encrypt"; 465 | 466 | export class AuthenticationClient extends BaseAuthenticationClient { 467 | constructor(options: AuthenticationClientOptions) { 468 | options.encryptFunction = encryptFunction; 469 | super(options); 470 | } 471 | } 472 | ``` 473 | 474 | ## 调用重载过后的类 475 | 476 | 重载过后的类调用方式和 `authing-js-sdk` 的方法完全一致, 477 | 478 | 以重载过后的 AuthenticationClient 为例: 479 | 480 | 重载的类: 481 | 482 | ```javascript 483 | import { 484 | AuthenticationClient as BaseAuthenticationClient, 485 | AuthenticationClientOptions, 486 | } from "authing-js-sdk"; 487 | 488 | export class AuthenticationClient extends BaseAuthenticationClient { 489 | constructor(options: AuthenticationClientOptions) { 490 | // extends here 491 | super(options); 492 | } 493 | } 494 | ``` 495 | 496 | 调用示例: 497 | 498 | ```javascript 499 | const authing = new AuthenticationClient({ 500 | appId: "YOUR_APP_ID", 501 | }) 502 | 503 | const email = 'test@example.com'; 504 | const password = 'passw0rd'; 505 | const user = await authing.loginByEmail(email, password); // 成功登录,将 token 写入 localStorage 506 | ``` 507 | --------------------------------------------------------------------------------