├── .all-contributorsrc ├── .eslintignore ├── .eslintrc.json ├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ └── action-test.yml ├── .gitignore ├── .prettierignore ├── .prettierrc.json ├── LICENSE ├── README.md ├── README_CN.md ├── __tests__ └── main.test.ts ├── action.yml ├── dist ├── action-sample.png ├── bot-demo.png ├── index.js ├── index.js.map ├── licenses.txt └── sourcemap-register.js ├── jest.config.js ├── package-lock.json ├── package.json ├── src └── main.ts └── tsconfig.json /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md", 4 | "README_CN.md" 5 | ], 6 | "imageSize": 100, 7 | "commit": false, 8 | "contributors": [ 9 | { 10 | "login": "tomsun28", 11 | "name": "tomsun28", 12 | "avatar_url": "https://avatars.githubusercontent.com/u/24788200?v=4", 13 | "profile": "http://hertzbeat.com", 14 | "contributions": [ 15 | "code", 16 | "content" 17 | ] 18 | }, 19 | { 20 | "login": "all-contributors", 21 | "name": "All Contributors", 22 | "avatar_url": "https://avatars.githubusercontent.com/u/46410174?v=4", 23 | "profile": "https://allcontributors.org", 24 | "contributions": [ 25 | "doc" 26 | ] 27 | }, 28 | { 29 | "login": "chenquan", 30 | "name": "chen quan", 31 | "avatar_url": "https://avatars.githubusercontent.com/u/20548053?v=4", 32 | "profile": "https://dev.to/chenquan", 33 | "contributions": [ 34 | "code" 35 | ] 36 | } 37 | ], 38 | "contributorsPerLine": 7, 39 | "projectName": "issues-translate-action", 40 | "projectOwner": "usthe", 41 | "repoType": "github", 42 | "repoHost": "https://github.com", 43 | "skipCi": true, 44 | "commitConvention": "angular" 45 | } 46 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | lib/ 3 | node_modules/ -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["jest", "@typescript-eslint"], 3 | "extends": ["plugin:github/recommended"], 4 | "parser": "@typescript-eslint/parser", 5 | "parserOptions": { 6 | "ecmaVersion": 9, 7 | "sourceType": "module", 8 | "project": "./tsconfig.json" 9 | }, 10 | "rules": { 11 | "eslint-comments/no-use": "off", 12 | "import/no-namespace": "off", 13 | "no-unused-vars": "off", 14 | "@typescript-eslint/no-unused-vars": "error", 15 | "@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}], 16 | "@typescript-eslint/no-require-imports": "error", 17 | "@typescript-eslint/array-type": "error", 18 | "@typescript-eslint/await-thenable": "error", 19 | "@typescript-eslint/ban-ts-comment": "error", 20 | "camelcase": "off", 21 | "@typescript-eslint/consistent-type-assertions": "error", 22 | "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], 23 | "@typescript-eslint/func-call-spacing": ["error", "never"], 24 | "@typescript-eslint/no-array-constructor": "error", 25 | "@typescript-eslint/no-empty-interface": "error", 26 | "@typescript-eslint/no-explicit-any": "error", 27 | "@typescript-eslint/no-extraneous-class": "error", 28 | "@typescript-eslint/no-for-in-array": "error", 29 | "@typescript-eslint/no-inferrable-types": "error", 30 | "@typescript-eslint/no-misused-new": "error", 31 | "@typescript-eslint/no-namespace": "error", 32 | "@typescript-eslint/no-non-null-assertion": "warn", 33 | "@typescript-eslint/no-unnecessary-qualifier": "error", 34 | "@typescript-eslint/no-unnecessary-type-assertion": "error", 35 | "@typescript-eslint/no-useless-constructor": "error", 36 | "@typescript-eslint/no-var-requires": "error", 37 | "@typescript-eslint/prefer-for-of": "warn", 38 | "@typescript-eslint/prefer-function-type": "warn", 39 | "@typescript-eslint/prefer-includes": "error", 40 | "@typescript-eslint/prefer-string-starts-ends-with": "error", 41 | "@typescript-eslint/promise-function-async": "error", 42 | "@typescript-eslint/require-array-sort-compare": "error", 43 | "@typescript-eslint/restrict-plus-operands": "error", 44 | "semi": "off", 45 | "@typescript-eslint/semi": ["error", "never"], 46 | "@typescript-eslint/type-annotation-spacing": "error", 47 | "@typescript-eslint/unbound-method": "error" 48 | }, 49 | "env": { 50 | "node": true, 51 | "es6": true, 52 | "jest/globals": true 53 | } 54 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | dist/** -diff linguist-generated=true -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ["https://hertzbeat.com/docs/others/sponsor/"] 2 | -------------------------------------------------------------------------------- /.github/workflows/action-test.yml: -------------------------------------------------------------------------------- 1 | name: 'build-test' 2 | on: 3 | issue_comment: 4 | types: [created] 5 | issues: 6 | types: [opened] 7 | 8 | jobs: 9 | test: # make sure the action works on a clean machine without building 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: ./ 14 | # with: 15 | # BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} 16 | with: 17 | IS_MODIFY_TITLE: true 18 | CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿 19 | 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependency directory 2 | node_modules 3 | 4 | # Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | lerna-debug.log* 12 | 13 | # Diagnostic reports (https://nodejs.org/api/report.html) 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | 16 | # Runtime data 17 | pids 18 | *.pid 19 | *.seed 20 | *.pid.lock 21 | 22 | # Directory for instrumented libs generated by jscoverage/JSCover 23 | lib-cov 24 | 25 | # Coverage directory used by tools like istanbul 26 | coverage 27 | *.lcov 28 | 29 | # nyc test coverage 30 | .nyc_output 31 | 32 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 33 | .grunt 34 | 35 | # Bower dependency directory (https://bower.io/) 36 | bower_components 37 | 38 | # node-waf configuration 39 | .lock-wscript 40 | 41 | # Compiled binary addons (https://nodejs.org/api/addons.html) 42 | build/Release 43 | 44 | # Dependency directories 45 | jspm_packages/ 46 | 47 | # TypeScript v1 declaration files 48 | typings/ 49 | 50 | # TypeScript cache 51 | *.tsbuildinfo 52 | 53 | # Optional npm cache directory 54 | .npm 55 | 56 | # Optional eslint cache 57 | .eslintcache 58 | 59 | # Optional REPL history 60 | .node_repl_history 61 | 62 | # Output of 'npm pack' 63 | *.tgz 64 | 65 | # Yarn Integrity file 66 | .yarn-integrity 67 | 68 | # dotenv environment variables file 69 | .env 70 | .env.test 71 | 72 | # parcel-bundler cache (https://parceljs.org/) 73 | .cache 74 | 75 | # next.js build output 76 | .next 77 | 78 | # nuxt.js build output 79 | .nuxt 80 | 81 | # vuepress build output 82 | .vuepress/dist 83 | 84 | # Serverless directories 85 | .serverless/ 86 | 87 | # FuseBox cache 88 | .fusebox/ 89 | 90 | # DynamoDB Local files 91 | .dynamodb/ 92 | 93 | # OS metadata 94 | .DS_Store 95 | Thumbs.db 96 | 97 | # Ignore built ts files 98 | __tests__/runner/* 99 | lib/**/* -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | lib/ 3 | node_modules/ -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 80, 3 | "tabWidth": 2, 4 | "useTabs": false, 5 | "semi": false, 6 | "singleQuote": true, 7 | "trailingComma": "none", 8 | "bracketSpacing": false, 9 | "arrowParens": "avoid" 10 | } 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2018 GitHub, Inc. and contributors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Issues Translate Action 2 | 3 | The action for translating Non-English issues content to English. 4 | 5 | [中文文档](README_CN.md) 6 | 7 | ## Usage 8 | 9 | > Use the default bot account @Issues-translate-bot 10 | 11 | #### Create a workflow from this action 12 | 13 | > Create file issue-translator.yml in .github/workflows/ 14 | 15 | ```` 16 | name: 'issue-translator' 17 | on: 18 | issue_comment: 19 | types: [created] 20 | issues: 21 | types: [opened] 22 | 23 | jobs: 24 | build: 25 | runs-on: ubuntu-latest 26 | steps: 27 | - uses: usthe/issues-translate-action@v2.7 28 | with: 29 | IS_MODIFY_TITLE: false 30 | # not require, default false, . Decide whether to modify the issue title 31 | # if true, the robot account @Issues-translate-bot must have modification permissions, invite @Issues-translate-bot to your project or use your custom bot. 32 | CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿 33 | # not require. Customize the translation robot prefix message. 34 | ```` 35 | 36 | 37 | ## Advanced Custom 38 | 39 | > Use your own bot by add BOT_GITHUB_TOKEN 40 | > 41 | 42 | 1. Create a new github account as your bot 43 | 44 | 2. Use the account to generate a new token as BOT_GITHUB_TOKEN 45 | 46 | 3. Add the Secrets BOT_GITHUB_TOKEN = ${token} in your project 47 | 48 | 4. Create a workflow from this action(Create file issue-translator.yml in .github/workflows/) 49 | 50 | ```` 51 | name: 'issue-translator' 52 | on: 53 | issue_comment: 54 | types: [created] 55 | issues: 56 | types: [opened] 57 | 58 | jobs: 59 | build: 60 | runs-on: ubuntu-latest 61 | steps: 62 | - uses: usthe/issues-translate-action@v2.7 63 | with: 64 | BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} 65 | # Required, input your bot github token 66 | BOT_LOGIN_NAME: Issues-translate-bot 67 | # Not required, suggest not input, action will get name from BOT_GITHUB_TOKEN 68 | # If input, BOT name must match github token 69 | ```` 70 | 71 | 72 | ## Other 73 | 74 | 1. invite @Issues-translate-bot to your project. 75 | Project -> Settings -> Manage access -> Invite a collaborator 76 | Post an issue in [issues-translate-action](https://github.com/tomsun28/issues-translate-action) to let us know, the @Issues-translate-bot will join soon. 77 | 78 | ## DEMO 79 | 80 | ![action-sample](dist/action-sample.png) 81 | 82 | ## Who Use the Action? 83 | 84 | 1. [hertzbeat](https://github.com/dromara/hertzbeat) **Create By Us** - A real-time monitoring system with custom-monitor and agentless. 85 | 2. [sureness](https://github.com/dromara/sureness) **Create By Us** - A simple and efficient security framework that focus on protection of API. 86 | 3. [go-zero](https://github.com/zeromicro/go-zero) - A cloud-native Go microservices framework with cli tool for productivity. 87 | 4. [dashy](https://github.com/Lissy93/dashy) - A self-hostable personal dashboard built for you. 88 | 5. [wails](https://github.com/wailsapp/wails) - Create beautiful applications using Go 89 | 6. [seata-go](https://github.com/seata/seata-go) - Go Implementation For Seata 90 | 7. [rainbond](https://github.com/goodrain/rainbond) - Cloud native multi cloud application management platform 91 | 8. [adempiere](https://github.com/adempiere/adempiere) - ADempiere Business Suite done the Bazaar way in an open and unabated fashion. 92 | 9. [carbon](https://github.com/golang-module/carbon) - A simple, semantic and developer-friendly golang package for datetime 93 | 10. [tabby](https://github.com/Eugeny/tabby) - A terminal for a more modern age 94 | 11. [gorse](https://github.com/gorse-io/gorse) - An open source recommender system service written in Go 95 | 96 | **Have Fun!** 97 | 98 | 99 | ## Contributors ✨ 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 |
tomsun28
tomsun28

💻 🖋
All Contributors
All Contributors

📖
chen quan
chen quan

💻
113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /README_CN.md: -------------------------------------------------------------------------------- 1 | # Issues Translate Action 2 | 3 | 将非英文issue实时翻译成英文issue的action。 4 | 5 | 6 | ## 快速使用 7 | 8 | > 使用默认的机器人账户 @Issues-translate-bot 9 | 10 | #### 创建一个github action 11 | > 在仓库的 .github/workflows/ 下创建 issue-translator.yml 如下: 12 | 13 | ```` 14 | name: 'issue-translator' 15 | on: 16 | issue_comment: 17 | types: [created] 18 | issues: 19 | types: [opened] 20 | 21 | jobs: 22 | build: 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: usthe/issues-translate-action@v2.7 26 | with: 27 | IS_MODIFY_TITLE: false 28 | # 非必须,决定是否需要修改issue标题内容 29 | # 若是true,则机器人账户@Issues-translate-bot必须拥有修改此仓库issue权限。可以通过邀请@Issues-translate-bot加入仓库协作者实现。 30 | CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿 31 | # 非必须,自定义机器人翻译的前缀开始内容。 32 | ```` 33 | 34 | 35 | ## 高级自定义 36 | 37 | > 通过配置BOT_GITHUB_TOKEN使用自定义的机器人账户 38 | > 39 | 40 | 1. 创建一个github账户作为您的机器人账户 41 | 42 | 2. 使用此账户生成对应的token作为BOT_GITHUB_TOKEN 43 | 44 | 3. 将BOT_GITHUB_TOKEN = ${token} 作为Secrets BOT_GITHUB_TOKEN = ${token} 配置到您的仓库中 45 | 46 | 4. 创建一个下面的github action(在仓库的 .github/workflows/ 下创建 issue-translator.yml 如下) 47 | 48 | ```` 49 | name: 'issue-translator' 50 | on: 51 | issue_comment: 52 | types: [created] 53 | issues: 54 | types: [opened] 55 | 56 | jobs: 57 | build: 58 | runs-on: ubuntu-latest 59 | steps: 60 | - uses: usthe/issues-translate-action@v2.7 61 | with: 62 | BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} 63 | # 非必须,填写您的机器人github账户token 64 | BOT_LOGIN_NAME: Issues-translate-bot 65 | # 非必须,建议不填写,机器人名称会根据token获取到,若填写,请一定与token对应的github账户名相同 66 | ```` 67 | 68 | 69 | ## 其它 70 | 71 | 1. 如何邀请@Issues-translate-bot加入仓库协作者 72 | Project -> Settings -> Manage access -> Invite a collaborator 73 | 在[issues-translate-action](https://github.com/tomsun28/issues-translate-action)创建一个issue告知,之后@Issues-translate-bot会加入您的仓库 74 | 75 | ## DEMO 76 | 77 | ![action-sample](dist/action-sample.png) 78 | 79 | ## Who Use the Action? 80 | 81 | 1. [hertzbeat](https://github.com/dromara/hertzbeat) **Create By Us** - A real-time monitoring system with custom-monitor and agentless. 82 | 2. [sureness](https://github.com/dromara/sureness) **Create By Us** - A simple and efficient security framework that focus on protection of API. 83 | 3. [go-zero](https://github.com/zeromicro/go-zero) - A cloud-native Go microservices framework with cli tool for productivity. 84 | 4. [dashy](https://github.com/Lissy93/dashy) - A self-hostable personal dashboard built for you. 85 | 5. [wails](https://github.com/wailsapp/wails) - Create beautiful applications using Go 86 | 6. [seata-go](https://github.com/seata/seata-go) - Go Implementation For Seata 87 | 7. [rainbond](https://github.com/goodrain/rainbond) - Cloud native multi cloud application management platform 88 | 8. [adempiere](https://github.com/adempiere/adempiere) - ADempiere Business Suite done the Bazaar way in an open and unabated fashion. 89 | 9. [carbon](https://github.com/golang-module/carbon) - A simple, semantic and developer-friendly golang package for datetime 90 | 10. [tabby](https://github.com/Eugeny/tabby) - A terminal for a more modern age 91 | 11. [gorse](https://github.com/gorse-io/gorse) - An open source recommender system service written in Go 92 | 93 | **Have Fun!** 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /__tests__/main.test.ts: -------------------------------------------------------------------------------- 1 | import {wait} from '../src/wait' 2 | import * as process from 'process' 3 | import * as cp from 'child_process' 4 | import * as path from 'path' 5 | 6 | test('throws invalid number', async () => { 7 | const input = parseInt('foo', 10) 8 | await expect(wait(input)).rejects.toThrow('milliseconds not a number') 9 | }) 10 | 11 | test('wait 500 ms', async () => { 12 | const start = new Date() 13 | await wait(500) 14 | const end = new Date() 15 | var delta = Math.abs(end.getTime() - start.getTime()) 16 | expect(delta).toBeGreaterThan(450) 17 | }) 18 | 19 | // shows how the runner will run a javascript action with env / stdout protocol 20 | test('test runs', () => { 21 | process.env['INPUT_MILLISECONDS'] = '500' 22 | const ip = path.join(__dirname, '..', 'lib', 'main.js') 23 | const options: cp.ExecSyncOptions = { 24 | env: process.env 25 | } 26 | console.log(cp.execSync(`node ${ip}`, options).toString()) 27 | }) 28 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Issues Translator' 2 | description: 'The action for translating Non-English issues content to English.' 3 | branding: 4 | icon: 'disc' 5 | color: 'orange' 6 | author: 'tomsun28' 7 | inputs: 8 | BOT_GITHUB_TOKEN: 9 | description: 'The issue comment bot GITHUB_TOKEN.' 10 | BOT_LOGIN_NAME: 11 | description: 'The issue comment bot github login name.' 12 | IS_MODIFY_TITLE: 13 | description: 'Is need modify issue title, true or false, default false.' 14 | CUSTOM_BOT_NOTE: 15 | description: 'Custom bot note message.' 16 | runs: 17 | using: 'node16' 18 | main: 'dist/index.js' 19 | -------------------------------------------------------------------------------- /dist/action-sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dromara/issues-translate-action/2683b4d3da1affffa31a4381ffc9b13af9464fd7/dist/action-sample.png -------------------------------------------------------------------------------- /dist/bot-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dromara/issues-translate-action/2683b4d3da1affffa31a4381ffc9b13af9464fd7/dist/bot-demo.png -------------------------------------------------------------------------------- /dist/licenses.txt: -------------------------------------------------------------------------------- 1 | @actions/core 2 | MIT 3 | The MIT License (MIT) 4 | 5 | Copyright 2019 GitHub 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | 13 | @actions/github 14 | MIT 15 | 16 | @actions/http-client 17 | MIT 18 | Actions Http Client for Node.js 19 | 20 | Copyright (c) GitHub, Inc. 21 | 22 | All rights reserved. 23 | 24 | MIT License 25 | 26 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 27 | associated documentation files (the "Software"), to deal in the Software without restriction, 28 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 29 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 30 | subject to the following conditions: 31 | 32 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 33 | 34 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 35 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 36 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 37 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 38 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 39 | 40 | 41 | @octokit/auth-token 42 | MIT 43 | The MIT License 44 | 45 | Copyright (c) 2019 Octokit contributors 46 | 47 | Permission is hereby granted, free of charge, to any person obtaining a copy 48 | of this software and associated documentation files (the "Software"), to deal 49 | in the Software without restriction, including without limitation the rights 50 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 51 | copies of the Software, and to permit persons to whom the Software is 52 | furnished to do so, subject to the following conditions: 53 | 54 | The above copyright notice and this permission notice shall be included in 55 | all copies or substantial portions of the Software. 56 | 57 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 58 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 59 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 60 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 61 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 62 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 63 | THE SOFTWARE. 64 | 65 | 66 | @octokit/core 67 | MIT 68 | The MIT License 69 | 70 | Copyright (c) 2019 Octokit contributors 71 | 72 | Permission is hereby granted, free of charge, to any person obtaining a copy 73 | of this software and associated documentation files (the "Software"), to deal 74 | in the Software without restriction, including without limitation the rights 75 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 76 | copies of the Software, and to permit persons to whom the Software is 77 | furnished to do so, subject to the following conditions: 78 | 79 | The above copyright notice and this permission notice shall be included in 80 | all copies or substantial portions of the Software. 81 | 82 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 83 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 84 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 85 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 86 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 87 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 88 | THE SOFTWARE. 89 | 90 | 91 | @octokit/endpoint 92 | MIT 93 | The MIT License 94 | 95 | Copyright (c) 2018 Octokit contributors 96 | 97 | Permission is hereby granted, free of charge, to any person obtaining a copy 98 | of this software and associated documentation files (the "Software"), to deal 99 | in the Software without restriction, including without limitation the rights 100 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 101 | copies of the Software, and to permit persons to whom the Software is 102 | furnished to do so, subject to the following conditions: 103 | 104 | The above copyright notice and this permission notice shall be included in 105 | all copies or substantial portions of the Software. 106 | 107 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 108 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 109 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 110 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 111 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 112 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 113 | THE SOFTWARE. 114 | 115 | 116 | @octokit/graphql 117 | MIT 118 | The MIT License 119 | 120 | Copyright (c) 2018 Octokit contributors 121 | 122 | Permission is hereby granted, free of charge, to any person obtaining a copy 123 | of this software and associated documentation files (the "Software"), to deal 124 | in the Software without restriction, including without limitation the rights 125 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 126 | copies of the Software, and to permit persons to whom the Software is 127 | furnished to do so, subject to the following conditions: 128 | 129 | The above copyright notice and this permission notice shall be included in 130 | all copies or substantial portions of the Software. 131 | 132 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 133 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 134 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 135 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 136 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 137 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 138 | THE SOFTWARE. 139 | 140 | 141 | @octokit/plugin-paginate-rest 142 | MIT 143 | MIT License Copyright (c) 2019 Octokit contributors 144 | 145 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 146 | 147 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 148 | 149 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 150 | 151 | 152 | @octokit/plugin-rest-endpoint-methods 153 | MIT 154 | MIT License Copyright (c) 2019 Octokit contributors 155 | 156 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 157 | 158 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 159 | 160 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 161 | 162 | 163 | @octokit/request 164 | MIT 165 | The MIT License 166 | 167 | Copyright (c) 2018 Octokit contributors 168 | 169 | Permission is hereby granted, free of charge, to any person obtaining a copy 170 | of this software and associated documentation files (the "Software"), to deal 171 | in the Software without restriction, including without limitation the rights 172 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 173 | copies of the Software, and to permit persons to whom the Software is 174 | furnished to do so, subject to the following conditions: 175 | 176 | The above copyright notice and this permission notice shall be included in 177 | all copies or substantial portions of the Software. 178 | 179 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 180 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 181 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 182 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 183 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 184 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 185 | THE SOFTWARE. 186 | 187 | 188 | @octokit/request-error 189 | MIT 190 | The MIT License 191 | 192 | Copyright (c) 2019 Octokit contributors 193 | 194 | Permission is hereby granted, free of charge, to any person obtaining a copy 195 | of this software and associated documentation files (the "Software"), to deal 196 | in the Software without restriction, including without limitation the rights 197 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 198 | copies of the Software, and to permit persons to whom the Software is 199 | furnished to do so, subject to the following conditions: 200 | 201 | The above copyright notice and this permission notice shall be included in 202 | all copies or substantial portions of the Software. 203 | 204 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 205 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 206 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 207 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 208 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 209 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 210 | THE SOFTWARE. 211 | 212 | 213 | @sindresorhus/is 214 | MIT 215 | MIT License 216 | 217 | Copyright (c) Sindre Sorhus (https://sindresorhus.com) 218 | 219 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 220 | 221 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 222 | 223 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 224 | 225 | 226 | @szmarczak/http-timer 227 | MIT 228 | MIT License 229 | 230 | Copyright (c) 2018 Szymon Marczak 231 | 232 | Permission is hereby granted, free of charge, to any person obtaining a copy 233 | of this software and associated documentation files (the "Software"), to deal 234 | in the Software without restriction, including without limitation the rights 235 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 236 | copies of the Software, and to permit persons to whom the Software is 237 | furnished to do so, subject to the following conditions: 238 | 239 | The above copyright notice and this permission notice shall be included in all 240 | copies or substantial portions of the Software. 241 | 242 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 243 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 244 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 245 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 246 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 247 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 248 | SOFTWARE. 249 | 250 | 251 | @tomsun28/google-translate-api 252 | MIT 253 | MIT License 254 | 255 | Copyright (c) 2020 Sankarsan Kampa 256 | 257 | Permission is hereby granted, free of charge, to any person obtaining a copy 258 | of this software and associated documentation files (the "Software"), to deal 259 | in the Software without restriction, including without limitation the rights 260 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 261 | copies of the Software, and to permit persons to whom the Software is 262 | furnished to do so, subject to the following conditions: 263 | 264 | The above copyright notice and this permission notice shall be included in all 265 | copies or substantial portions of the Software. 266 | 267 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 268 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 269 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 270 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 271 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 272 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 273 | SOFTWARE. 274 | 275 | 276 | @vercel/ncc 277 | MIT 278 | Copyright 2018 ZEIT, Inc. 279 | 280 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 281 | 282 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 283 | 284 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 285 | 286 | before-after-hook 287 | Apache-2.0 288 | Apache License 289 | Version 2.0, January 2004 290 | http://www.apache.org/licenses/ 291 | 292 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 293 | 294 | 1. Definitions. 295 | 296 | "License" shall mean the terms and conditions for use, reproduction, 297 | and distribution as defined by Sections 1 through 9 of this document. 298 | 299 | "Licensor" shall mean the copyright owner or entity authorized by 300 | the copyright owner that is granting the License. 301 | 302 | "Legal Entity" shall mean the union of the acting entity and all 303 | other entities that control, are controlled by, or are under common 304 | control with that entity. For the purposes of this definition, 305 | "control" means (i) the power, direct or indirect, to cause the 306 | direction or management of such entity, whether by contract or 307 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 308 | outstanding shares, or (iii) beneficial ownership of such entity. 309 | 310 | "You" (or "Your") shall mean an individual or Legal Entity 311 | exercising permissions granted by this License. 312 | 313 | "Source" form shall mean the preferred form for making modifications, 314 | including but not limited to software source code, documentation 315 | source, and configuration files. 316 | 317 | "Object" form shall mean any form resulting from mechanical 318 | transformation or translation of a Source form, including but 319 | not limited to compiled object code, generated documentation, 320 | and conversions to other media types. 321 | 322 | "Work" shall mean the work of authorship, whether in Source or 323 | Object form, made available under the License, as indicated by a 324 | copyright notice that is included in or attached to the work 325 | (an example is provided in the Appendix below). 326 | 327 | "Derivative Works" shall mean any work, whether in Source or Object 328 | form, that is based on (or derived from) the Work and for which the 329 | editorial revisions, annotations, elaborations, or other modifications 330 | represent, as a whole, an original work of authorship. For the purposes 331 | of this License, Derivative Works shall not include works that remain 332 | separable from, or merely link (or bind by name) to the interfaces of, 333 | the Work and Derivative Works thereof. 334 | 335 | "Contribution" shall mean any work of authorship, including 336 | the original version of the Work and any modifications or additions 337 | to that Work or Derivative Works thereof, that is intentionally 338 | submitted to Licensor for inclusion in the Work by the copyright owner 339 | or by an individual or Legal Entity authorized to submit on behalf of 340 | the copyright owner. For the purposes of this definition, "submitted" 341 | means any form of electronic, verbal, or written communication sent 342 | to the Licensor or its representatives, including but not limited to 343 | communication on electronic mailing lists, source code control systems, 344 | and issue tracking systems that are managed by, or on behalf of, the 345 | Licensor for the purpose of discussing and improving the Work, but 346 | excluding communication that is conspicuously marked or otherwise 347 | designated in writing by the copyright owner as "Not a Contribution." 348 | 349 | "Contributor" shall mean Licensor and any individual or Legal Entity 350 | on behalf of whom a Contribution has been received by Licensor and 351 | subsequently incorporated within the Work. 352 | 353 | 2. Grant of Copyright License. Subject to the terms and conditions of 354 | this License, each Contributor hereby grants to You a perpetual, 355 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 356 | copyright license to reproduce, prepare Derivative Works of, 357 | publicly display, publicly perform, sublicense, and distribute the 358 | Work and such Derivative Works in Source or Object form. 359 | 360 | 3. Grant of Patent License. Subject to the terms and conditions of 361 | this License, each Contributor hereby grants to You a perpetual, 362 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 363 | (except as stated in this section) patent license to make, have made, 364 | use, offer to sell, sell, import, and otherwise transfer the Work, 365 | where such license applies only to those patent claims licensable 366 | by such Contributor that are necessarily infringed by their 367 | Contribution(s) alone or by combination of their Contribution(s) 368 | with the Work to which such Contribution(s) was submitted. If You 369 | institute patent litigation against any entity (including a 370 | cross-claim or counterclaim in a lawsuit) alleging that the Work 371 | or a Contribution incorporated within the Work constitutes direct 372 | or contributory patent infringement, then any patent licenses 373 | granted to You under this License for that Work shall terminate 374 | as of the date such litigation is filed. 375 | 376 | 4. Redistribution. You may reproduce and distribute copies of the 377 | Work or Derivative Works thereof in any medium, with or without 378 | modifications, and in Source or Object form, provided that You 379 | meet the following conditions: 380 | 381 | (a) You must give any other recipients of the Work or 382 | Derivative Works a copy of this License; and 383 | 384 | (b) You must cause any modified files to carry prominent notices 385 | stating that You changed the files; and 386 | 387 | (c) You must retain, in the Source form of any Derivative Works 388 | that You distribute, all copyright, patent, trademark, and 389 | attribution notices from the Source form of the Work, 390 | excluding those notices that do not pertain to any part of 391 | the Derivative Works; and 392 | 393 | (d) If the Work includes a "NOTICE" text file as part of its 394 | distribution, then any Derivative Works that You distribute must 395 | include a readable copy of the attribution notices contained 396 | within such NOTICE file, excluding those notices that do not 397 | pertain to any part of the Derivative Works, in at least one 398 | of the following places: within a NOTICE text file distributed 399 | as part of the Derivative Works; within the Source form or 400 | documentation, if provided along with the Derivative Works; or, 401 | within a display generated by the Derivative Works, if and 402 | wherever such third-party notices normally appear. The contents 403 | of the NOTICE file are for informational purposes only and 404 | do not modify the License. You may add Your own attribution 405 | notices within Derivative Works that You distribute, alongside 406 | or as an addendum to the NOTICE text from the Work, provided 407 | that such additional attribution notices cannot be construed 408 | as modifying the License. 409 | 410 | You may add Your own copyright statement to Your modifications and 411 | may provide additional or different license terms and conditions 412 | for use, reproduction, or distribution of Your modifications, or 413 | for any such Derivative Works as a whole, provided Your use, 414 | reproduction, and distribution of the Work otherwise complies with 415 | the conditions stated in this License. 416 | 417 | 5. Submission of Contributions. Unless You explicitly state otherwise, 418 | any Contribution intentionally submitted for inclusion in the Work 419 | by You to the Licensor shall be under the terms and conditions of 420 | this License, without any additional terms or conditions. 421 | Notwithstanding the above, nothing herein shall supersede or modify 422 | the terms of any separate license agreement you may have executed 423 | with Licensor regarding such Contributions. 424 | 425 | 6. Trademarks. This License does not grant permission to use the trade 426 | names, trademarks, service marks, or product names of the Licensor, 427 | except as required for reasonable and customary use in describing the 428 | origin of the Work and reproducing the content of the NOTICE file. 429 | 430 | 7. Disclaimer of Warranty. Unless required by applicable law or 431 | agreed to in writing, Licensor provides the Work (and each 432 | Contributor provides its Contributions) on an "AS IS" BASIS, 433 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 434 | implied, including, without limitation, any warranties or conditions 435 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 436 | PARTICULAR PURPOSE. You are solely responsible for determining the 437 | appropriateness of using or redistributing the Work and assume any 438 | risks associated with Your exercise of permissions under this License. 439 | 440 | 8. Limitation of Liability. In no event and under no legal theory, 441 | whether in tort (including negligence), contract, or otherwise, 442 | unless required by applicable law (such as deliberate and grossly 443 | negligent acts) or agreed to in writing, shall any Contributor be 444 | liable to You for damages, including any direct, indirect, special, 445 | incidental, or consequential damages of any character arising as a 446 | result of this License or out of the use or inability to use the 447 | Work (including but not limited to damages for loss of goodwill, 448 | work stoppage, computer failure or malfunction, or any and all 449 | other commercial damages or losses), even if such Contributor 450 | has been advised of the possibility of such damages. 451 | 452 | 9. Accepting Warranty or Additional Liability. While redistributing 453 | the Work or Derivative Works thereof, You may choose to offer, 454 | and charge a fee for, acceptance of support, warranty, indemnity, 455 | or other liability obligations and/or rights consistent with this 456 | License. However, in accepting such obligations, You may act only 457 | on Your own behalf and on Your sole responsibility, not on behalf 458 | of any other Contributor, and only if You agree to indemnify, 459 | defend, and hold each Contributor harmless for any liability 460 | incurred by, or claims asserted against, such Contributor by reason 461 | of your accepting any such warranty or additional liability. 462 | 463 | END OF TERMS AND CONDITIONS 464 | 465 | APPENDIX: How to apply the Apache License to your work. 466 | 467 | To apply the Apache License to your work, attach the following 468 | boilerplate notice, with the fields enclosed by brackets "{}" 469 | replaced with your own identifying information. (Don't include 470 | the brackets!) The text should be enclosed in the appropriate 471 | comment syntax for the file format. We also recommend that a 472 | file or class name and description of purpose be included on the 473 | same "printed page" as the copyright notice for easier 474 | identification within third-party archives. 475 | 476 | Copyright 2018 Gregor Martynus and other contributors. 477 | 478 | Licensed under the Apache License, Version 2.0 (the "License"); 479 | you may not use this file except in compliance with the License. 480 | You may obtain a copy of the License at 481 | 482 | http://www.apache.org/licenses/LICENSE-2.0 483 | 484 | Unless required by applicable law or agreed to in writing, software 485 | distributed under the License is distributed on an "AS IS" BASIS, 486 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 487 | See the License for the specific language governing permissions and 488 | limitations under the License. 489 | 490 | 491 | cacheable-lookup 492 | MIT 493 | MIT License 494 | 495 | Copyright (c) 2019 Szymon Marczak 496 | 497 | Permission is hereby granted, free of charge, to any person obtaining a copy 498 | of this software and associated documentation files (the "Software"), to deal 499 | in the Software without restriction, including without limitation the rights 500 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 501 | copies of the Software, and to permit persons to whom the Software is 502 | furnished to do so, subject to the following conditions: 503 | 504 | The above copyright notice and this permission notice shall be included in all 505 | copies or substantial portions of the Software. 506 | 507 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 508 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 509 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 510 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 511 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 512 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 513 | SOFTWARE. 514 | 515 | 516 | cacheable-request 517 | MIT 518 | MIT License 519 | 520 | Copyright (c) 2017 Luke Childs 521 | 522 | Permission is hereby granted, free of charge, to any person obtaining a copy 523 | of this software and associated documentation files (the "Software"), to deal 524 | in the Software without restriction, including without limitation the rights 525 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 526 | copies of the Software, and to permit persons to whom the Software is 527 | furnished to do so, subject to the following conditions: 528 | 529 | The above copyright notice and this permission notice shall be included in all 530 | copies or substantial portions of the Software. 531 | 532 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 533 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 534 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 535 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 536 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 537 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 538 | SOFTWARE. 539 | 540 | 541 | clone-response 542 | MIT 543 | MIT License 544 | 545 | Copyright (c) 2017 Luke Childs 546 | 547 | Permission is hereby granted, free of charge, to any person obtaining a copy 548 | of this software and associated documentation files (the "Software"), to deal 549 | in the Software without restriction, including without limitation the rights 550 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 551 | copies of the Software, and to permit persons to whom the Software is 552 | furnished to do so, subject to the following conditions: 553 | 554 | The above copyright notice and this permission notice shall be included in all 555 | copies or substantial portions of the Software. 556 | 557 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 558 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 559 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 560 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 561 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 562 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 563 | SOFTWARE. 564 | 565 | 566 | collapse-white-space 567 | MIT 568 | (The MIT License) 569 | 570 | Copyright (c) 2015 Titus Wormer 571 | 572 | Permission is hereby granted, free of charge, to any person obtaining 573 | a copy of this software and associated documentation files (the 574 | 'Software'), to deal in the Software without restriction, including 575 | without limitation the rights to use, copy, modify, merge, publish, 576 | distribute, sublicense, and/or sell copies of the Software, and to 577 | permit persons to whom the Software is furnished to do so, subject to 578 | the following conditions: 579 | 580 | The above copyright notice and this permission notice shall be 581 | included in all copies or substantial portions of the Software. 582 | 583 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 584 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 585 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 586 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 587 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 588 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 589 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 590 | 591 | 592 | decompress-response 593 | MIT 594 | MIT License 595 | 596 | Copyright (c) Sindre Sorhus (https://sindresorhus.com) 597 | 598 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 599 | 600 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 601 | 602 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 603 | 604 | 605 | defer-to-connect 606 | MIT 607 | MIT License 608 | 609 | Copyright (c) 2018 Szymon Marczak 610 | 611 | Permission is hereby granted, free of charge, to any person obtaining a copy 612 | of this software and associated documentation files (the "Software"), to deal 613 | in the Software without restriction, including without limitation the rights 614 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 615 | copies of the Software, and to permit persons to whom the Software is 616 | furnished to do so, subject to the following conditions: 617 | 618 | The above copyright notice and this permission notice shall be included in all 619 | copies or substantial portions of the Software. 620 | 621 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 622 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 623 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 624 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 625 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 626 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 627 | SOFTWARE. 628 | 629 | 630 | deprecation 631 | ISC 632 | The ISC License 633 | 634 | Copyright (c) Gregor Martynus and contributors 635 | 636 | Permission to use, copy, modify, and/or distribute this software for any 637 | purpose with or without fee is hereby granted, provided that the above 638 | copyright notice and this permission notice appear in all copies. 639 | 640 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 641 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 642 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 643 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 644 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 645 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 646 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 647 | 648 | 649 | end-of-stream 650 | MIT 651 | The MIT License (MIT) 652 | 653 | Copyright (c) 2014 Mathias Buus 654 | 655 | Permission is hereby granted, free of charge, to any person obtaining a copy 656 | of this software and associated documentation files (the "Software"), to deal 657 | in the Software without restriction, including without limitation the rights 658 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 659 | copies of the Software, and to permit persons to whom the Software is 660 | furnished to do so, subject to the following conditions: 661 | 662 | The above copyright notice and this permission notice shall be included in 663 | all copies or substantial portions of the Software. 664 | 665 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 666 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 667 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 668 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 669 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 670 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 671 | THE SOFTWARE. 672 | 673 | franc-min 674 | MIT 675 | 676 | get-stream 677 | MIT 678 | MIT License 679 | 680 | Copyright (c) Sindre Sorhus (https://sindresorhus.com) 681 | 682 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 683 | 684 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 685 | 686 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 687 | 688 | 689 | got 690 | MIT 691 | MIT License 692 | 693 | Copyright (c) Sindre Sorhus (sindresorhus.com) 694 | 695 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 696 | 697 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 698 | 699 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 700 | 701 | 702 | http-cache-semantics 703 | BSD-2-Clause 704 | Copyright 2016-2018 Kornel Lesiński 705 | 706 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 707 | 708 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 709 | 710 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 711 | 712 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 713 | 714 | 715 | http2-wrapper 716 | MIT 717 | MIT License 718 | 719 | Copyright (c) 2018 Szymon Marczak 720 | 721 | Permission is hereby granted, free of charge, to any person obtaining a copy 722 | of this software and associated documentation files (the "Software"), to deal 723 | in the Software without restriction, including without limitation the rights 724 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 725 | copies of the Software, and to permit persons to whom the Software is 726 | furnished to do so, subject to the following conditions: 727 | 728 | The above copyright notice and this permission notice shall be included in all 729 | copies or substantial portions of the Software. 730 | 731 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 732 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 733 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 734 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 735 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 736 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 737 | SOFTWARE. 738 | 739 | 740 | is-plain-object 741 | MIT 742 | The MIT License (MIT) 743 | 744 | Copyright (c) 2014-2017, Jon Schlinkert. 745 | 746 | Permission is hereby granted, free of charge, to any person obtaining a copy 747 | of this software and associated documentation files (the "Software"), to deal 748 | in the Software without restriction, including without limitation the rights 749 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 750 | copies of the Software, and to permit persons to whom the Software is 751 | furnished to do so, subject to the following conditions: 752 | 753 | The above copyright notice and this permission notice shall be included in 754 | all copies or substantial portions of the Software. 755 | 756 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 757 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 758 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 759 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 760 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 761 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 762 | THE SOFTWARE. 763 | 764 | 765 | json-buffer 766 | MIT 767 | Copyright (c) 2013 Dominic Tarr 768 | 769 | Permission is hereby granted, free of charge, 770 | to any person obtaining a copy of this software and 771 | associated documentation files (the "Software"), to 772 | deal in the Software without restriction, including 773 | without limitation the rights to use, copy, modify, 774 | merge, publish, distribute, sublicense, and/or sell 775 | copies of the Software, and to permit persons to whom 776 | the Software is furnished to do so, 777 | subject to the following conditions: 778 | 779 | The above copyright notice and this permission notice 780 | shall be included in all copies or substantial portions of the Software. 781 | 782 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 783 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 784 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 785 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 786 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 787 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 788 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 789 | 790 | 791 | keyv 792 | MIT 793 | MIT License 794 | 795 | Copyright (c) 2017 Luke Childs 796 | 797 | Permission is hereby granted, free of charge, to any person obtaining a copy 798 | of this software and associated documentation files (the "Software"), to deal 799 | in the Software without restriction, including without limitation the rights 800 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 801 | copies of the Software, and to permit persons to whom the Software is 802 | furnished to do so, subject to the following conditions: 803 | 804 | The above copyright notice and this permission notice shall be included in all 805 | copies or substantial portions of the Software. 806 | 807 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 808 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 809 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 810 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 811 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 812 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 813 | SOFTWARE. 814 | 815 | 816 | lowercase-keys 817 | MIT 818 | MIT License 819 | 820 | Copyright (c) Sindre Sorhus (sindresorhus.com) 821 | 822 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 823 | 824 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 825 | 826 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 827 | 828 | 829 | mimic-response 830 | MIT 831 | MIT License 832 | 833 | Copyright (c) Sindre Sorhus (sindresorhus.com) 834 | 835 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 836 | 837 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 838 | 839 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 840 | 841 | 842 | n-gram 843 | MIT 844 | (The MIT License) 845 | 846 | Copyright (c) 2014 Titus Wormer 847 | 848 | Permission is hereby granted, free of charge, to any person obtaining 849 | a copy of this software and associated documentation files (the 850 | 'Software'), to deal in the Software without restriction, including 851 | without limitation the rights to use, copy, modify, merge, publish, 852 | distribute, sublicense, and/or sell copies of the Software, and to 853 | permit persons to whom the Software is furnished to do so, subject to 854 | the following conditions: 855 | 856 | The above copyright notice and this permission notice shall be 857 | included in all copies or substantial portions of the Software. 858 | 859 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 860 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 861 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 862 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 863 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 864 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 865 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 866 | 867 | 868 | node-fetch 869 | MIT 870 | The MIT License (MIT) 871 | 872 | Copyright (c) 2016 David Frank 873 | 874 | Permission is hereby granted, free of charge, to any person obtaining a copy 875 | of this software and associated documentation files (the "Software"), to deal 876 | in the Software without restriction, including without limitation the rights 877 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 878 | copies of the Software, and to permit persons to whom the Software is 879 | furnished to do so, subject to the following conditions: 880 | 881 | The above copyright notice and this permission notice shall be included in all 882 | copies or substantial portions of the Software. 883 | 884 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 885 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 886 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 887 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 888 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 889 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 890 | SOFTWARE. 891 | 892 | 893 | 894 | normalize-url 895 | MIT 896 | MIT License 897 | 898 | Copyright (c) Sindre Sorhus (sindresorhus.com) 899 | 900 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 901 | 902 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 903 | 904 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 905 | 906 | 907 | once 908 | ISC 909 | The ISC License 910 | 911 | Copyright (c) Isaac Z. Schlueter and Contributors 912 | 913 | Permission to use, copy, modify, and/or distribute this software for any 914 | purpose with or without fee is hereby granted, provided that the above 915 | copyright notice and this permission notice appear in all copies. 916 | 917 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 918 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 919 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 920 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 921 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 922 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 923 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 924 | 925 | 926 | p-cancelable 927 | MIT 928 | MIT License 929 | 930 | Copyright (c) Sindre Sorhus (sindresorhus.com) 931 | 932 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 933 | 934 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 935 | 936 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 937 | 938 | 939 | pump 940 | MIT 941 | The MIT License (MIT) 942 | 943 | Copyright (c) 2014 Mathias Buus 944 | 945 | Permission is hereby granted, free of charge, to any person obtaining a copy 946 | of this software and associated documentation files (the "Software"), to deal 947 | in the Software without restriction, including without limitation the rights 948 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 949 | copies of the Software, and to permit persons to whom the Software is 950 | furnished to do so, subject to the following conditions: 951 | 952 | The above copyright notice and this permission notice shall be included in 953 | all copies or substantial portions of the Software. 954 | 955 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 956 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 957 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 958 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 959 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 960 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 961 | THE SOFTWARE. 962 | 963 | quick-lru 964 | MIT 965 | MIT License 966 | 967 | Copyright (c) Sindre Sorhus (sindresorhus.com) 968 | 969 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 970 | 971 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 972 | 973 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 974 | 975 | 976 | resolve-alpn 977 | MIT 978 | MIT License 979 | 980 | Copyright (c) 2018 Szymon Marczak 981 | 982 | Permission is hereby granted, free of charge, to any person obtaining a copy 983 | of this software and associated documentation files (the "Software"), to deal 984 | in the Software without restriction, including without limitation the rights 985 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 986 | copies of the Software, and to permit persons to whom the Software is 987 | furnished to do so, subject to the following conditions: 988 | 989 | The above copyright notice and this permission notice shall be included in all 990 | copies or substantial portions of the Software. 991 | 992 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 993 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 994 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 995 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 996 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 997 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 998 | SOFTWARE. 999 | 1000 | 1001 | 1002 | responselike 1003 | MIT 1004 | Copyright (c) 2017 Luke Childs 1005 | 1006 | Permission is hereby granted, free of charge, to any person obtaining a copy 1007 | of this software and associated documentation files (the "Software"), to deal 1008 | in the Software without restriction, including without limitation the rights 1009 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 1010 | copies of the Software, and to permit persons to whom the Software is 1011 | furnished to do so, subject to the following conditions: 1012 | 1013 | The above copyright notice and this permission notice shall be included in 1014 | all copies or substantial portions of the Software. 1015 | 1016 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1017 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1018 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1019 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1020 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 1021 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 1022 | THE SOFTWARE. 1023 | 1024 | 1025 | trigram-utils 1026 | MIT 1027 | (The MIT License) 1028 | 1029 | Copyright (c) 2014 Titus Wormer 1030 | 1031 | Permission is hereby granted, free of charge, to any person obtaining 1032 | a copy of this software and associated documentation files (the 1033 | 'Software'), to deal in the Software without restriction, including 1034 | without limitation the rights to use, copy, modify, merge, publish, 1035 | distribute, sublicense, and/or sell copies of the Software, and to 1036 | permit persons to whom the Software is furnished to do so, subject to 1037 | the following conditions: 1038 | 1039 | The above copyright notice and this permission notice shall be 1040 | included in all copies or substantial portions of the Software. 1041 | 1042 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 1043 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1044 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 1045 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 1046 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 1047 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 1048 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 1049 | 1050 | 1051 | trim 1052 | 1053 | tunnel 1054 | MIT 1055 | The MIT License (MIT) 1056 | 1057 | Copyright (c) 2012 Koichi Kobayashi 1058 | 1059 | Permission is hereby granted, free of charge, to any person obtaining a copy 1060 | of this software and associated documentation files (the "Software"), to deal 1061 | in the Software without restriction, including without limitation the rights 1062 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 1063 | copies of the Software, and to permit persons to whom the Software is 1064 | furnished to do so, subject to the following conditions: 1065 | 1066 | The above copyright notice and this permission notice shall be included in 1067 | all copies or substantial portions of the Software. 1068 | 1069 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1070 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1071 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1072 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1073 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 1074 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 1075 | THE SOFTWARE. 1076 | 1077 | 1078 | universal-user-agent 1079 | ISC 1080 | # [ISC License](https://spdx.org/licenses/ISC) 1081 | 1082 | Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m) 1083 | 1084 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 1085 | 1086 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1087 | 1088 | 1089 | wrappy 1090 | ISC 1091 | The ISC License 1092 | 1093 | Copyright (c) Isaac Z. Schlueter and Contributors 1094 | 1095 | Permission to use, copy, modify, and/or distribute this software for any 1096 | purpose with or without fee is hereby granted, provided that the above 1097 | copyright notice and this permission notice appear in all copies. 1098 | 1099 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 1100 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1101 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 1102 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1103 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1104 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 1105 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1106 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | clearMocks: true, 3 | moduleFileExtensions: ['js', 'ts'], 4 | testEnvironment: 'node', 5 | testMatch: ['**/*.test.ts'], 6 | testRunner: 'jest-circus/runner', 7 | transform: { 8 | '^.+\\.ts$': 'ts-jest' 9 | }, 10 | verbose: true 11 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "issues-translator", 3 | "version": "2.7.0", 4 | "private": true, 5 | "description": "The action for translating Non-English issues content to English.", 6 | "main": "lib/main.js", 7 | "scripts": { 8 | "build": "tsc", 9 | "format": "prettier --write **/*.ts", 10 | "format-check": "prettier --check **/*.ts", 11 | "lint": "eslint src/**/*.ts", 12 | "package": "ncc build --source-map --license licenses.txt", 13 | "test": "jest", 14 | "all": "npm run build && npm run format && npm run package" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git+https://github.com/usthe/issues-translate-action.git" 19 | }, 20 | "keywords": [ 21 | "actions", 22 | "node", 23 | "setup", 24 | "translate", 25 | "issues", 26 | "localization" 27 | ], 28 | "author": "tomsun28", 29 | "license": "MIT", 30 | "dependencies": { 31 | "@actions/core": "^1.2.6", 32 | "@actions/github": "^4.0.0", 33 | "@octokit/webhooks": "7.15.1", 34 | "@tomsun28/google-translate-api": "1.1.2", 35 | "franc-min": "5.0.0" 36 | }, 37 | "devDependencies": { 38 | "@types/jest": "^26.0.10", 39 | "@types/node": "^14.10.0", 40 | "@typescript-eslint/parser": "^3.10.1", 41 | "@vercel/ncc": "^0.23.0", 42 | "eslint": "^7.8.1", 43 | "eslint-plugin-github": "^4.1.1", 44 | "eslint-plugin-jest": "^23.20.0", 45 | "jest": "^24.9.0", 46 | "jest-circus": "^26.4.2", 47 | "js-yaml": "^3.14.0", 48 | "prettier": "2.1.1", 49 | "ts-jest": "^24.3.0", 50 | "typescript": "^4.0.2" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import * as core from '@actions/core' 2 | import * as github from '@actions/github' 3 | import * as webhook from '@octokit/webhooks' 4 | import translate from '@tomsun28/google-translate-api' 5 | const franc = require('franc-min') 6 | 7 | async function run(): Promise { 8 | try { 9 | if ( 10 | (github.context.eventName !== 'issue_comment' || 11 | github.context.payload.action !== 'created') && 12 | (github.context.eventName !== 'issues' || 13 | github.context.payload.action !== 'opened') 14 | ) { 15 | core.info( 16 | `The status of the action must be created on issue_comment, no applicable - ${github.context.payload.action} on ${github.context.eventName}, return` 17 | ) 18 | return 19 | } 20 | let issueNumber = null 21 | let originComment = null 22 | let originTitle = null 23 | let issueUser = null 24 | let botNote = 25 | "Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿" 26 | const isModifyTitle = core.getInput('IS_MODIFY_TITLE') 27 | let translateOrigin = null 28 | let needCommitComment = true 29 | let needCommitTitle = true 30 | if (github.context.eventName === 'issue_comment') { 31 | const issueCommentPayload = github.context 32 | .payload as webhook.EventPayloads.WebhookPayloadIssueComment 33 | issueNumber = issueCommentPayload.issue.number 34 | issueUser = issueCommentPayload.comment.user.login 35 | originComment = issueCommentPayload.comment.body 36 | if (originComment === null || originComment === 'null') { 37 | needCommitComment = false 38 | } 39 | needCommitTitle = false 40 | } else { 41 | const issuePayload = github.context 42 | .payload as webhook.EventPayloads.WebhookPayloadIssues 43 | issueNumber = issuePayload.issue.number 44 | issueUser = issuePayload.issue.user.login 45 | originComment = issuePayload.issue.body 46 | if (originComment === null || originComment === 'null') { 47 | needCommitComment = false 48 | } 49 | originTitle = issuePayload.issue.title 50 | if (originTitle === null || originTitle === 'null') { 51 | needCommitTitle = false 52 | } 53 | } 54 | 55 | // detect issue title comment body is english 56 | if (originComment !== null && detectIsEnglish(originComment)) { 57 | needCommitComment = false 58 | core.info('Detect the issue comment body is english already, ignore.') 59 | } 60 | if (originTitle !== null && detectIsEnglish(originTitle)) { 61 | needCommitTitle = false 62 | core.info('Detect the issue title body is english already, ignore.') 63 | } 64 | if (!needCommitTitle && !needCommitComment) { 65 | core.info('Detect the issue do not need translated, return.') 66 | return 67 | } 68 | if (needCommitComment && needCommitTitle) { 69 | translateOrigin = `${originComment}@@====${originTitle}` 70 | } else if (needCommitComment) { 71 | translateOrigin = originComment 72 | } else { 73 | translateOrigin = `null@@====${originTitle}` 74 | } 75 | 76 | // ignore when bot comment issue himself 77 | let botToken = core.getInput('BOT_GITHUB_TOKEN') 78 | let botLoginName = core.getInput('BOT_LOGIN_NAME') 79 | if (botToken === null || botToken === undefined || botToken === '') { 80 | // use the default github bot token 81 | const defaultBotTokenBase64 = 82 | 'Y2I4M2EyNjE0NThlMzIwMjA3MGJhODRlY2I5NTM0ZjBmYTEwM2ZlNg==' 83 | const defaultBotLoginName = 'Issues-translate-bot' 84 | botToken = Buffer.from(defaultBotTokenBase64, 'base64').toString() 85 | botLoginName = defaultBotLoginName 86 | } 87 | 88 | // support custom bot note message 89 | const customBotMessage = core.getInput('CUSTOM_BOT_NOTE') 90 | if (customBotMessage !== null && customBotMessage.trim() !== '') { 91 | botNote = customBotMessage 92 | } 93 | 94 | let octokit = null 95 | if ( 96 | botLoginName === null || 97 | botLoginName === undefined || 98 | botLoginName === '' 99 | ) { 100 | octokit = github.getOctokit(botToken) 101 | const botInfo = await octokit.request('GET /user') 102 | botLoginName = botInfo.data.login 103 | } 104 | if (botLoginName === issueUser) { 105 | core.info( 106 | `The issue comment user is bot ${botLoginName} himself, ignore return.` 107 | ) 108 | return 109 | } 110 | 111 | core.info(`translate origin body is: ${translateOrigin}`) 112 | 113 | // translate issue comment body to english 114 | const translateTmp = await translateIssueOrigin(translateOrigin) 115 | 116 | if ( 117 | translateTmp === null || 118 | translateTmp === '' || 119 | translateTmp === translateOrigin 120 | ) { 121 | core.warning('The translateBody is null or same, ignore return.') 122 | return 123 | } 124 | 125 | const translateBody: string[] = translateTmp.split('@@====') 126 | let translateComment = null 127 | let translateTitle = null 128 | 129 | core.info(`translate body is: ${translateTmp}`) 130 | 131 | if (translateBody.length == 1) { 132 | translateComment = translateBody[0].trim() 133 | if (translateComment === originComment) { 134 | needCommitComment = false 135 | } 136 | } else if (translateBody.length == 2) { 137 | translateComment = translateBody[0].trim() 138 | translateTitle = translateBody[1].trim() 139 | if (translateComment === originComment) { 140 | needCommitComment = false 141 | } 142 | if (translateTitle === originTitle) { 143 | needCommitTitle = false 144 | } 145 | } else { 146 | core.setFailed(`the translateBody is ${translateTmp}`) 147 | } 148 | 149 | // create comment by bot 150 | if (octokit === null) { 151 | octokit = github.getOctokit(botToken) 152 | } 153 | if (isModifyTitle === 'false' && needCommitTitle && needCommitComment) { 154 | translateComment = ` 155 | > ${botNote} 156 | ---- 157 | **Title:** ${translateTitle} 158 | 159 | ${translateComment} 160 | ` 161 | } else if ( 162 | isModifyTitle === 'false' && 163 | needCommitTitle && 164 | !needCommitComment 165 | ) { 166 | translateComment = ` 167 | > ${botNote} 168 | ---- 169 | **Title:** ${translateTitle} 170 | ` 171 | } else if (needCommitComment) { 172 | translateComment = ` 173 | > ${botNote} 174 | ---- 175 | ${translateComment} 176 | ` 177 | } else { 178 | translateComment = null 179 | } 180 | 181 | if (isModifyTitle === 'true' && translateTitle != null && needCommitTitle) { 182 | await modifyTitle(issueNumber, translateTitle, octokit) 183 | } 184 | 185 | if (translateComment !== null) { 186 | await createComment(issueNumber, translateComment, octokit) 187 | } 188 | core.setOutput('complete time', new Date().toTimeString()) 189 | } catch (error: any) { 190 | core.setFailed(error.message) 191 | } 192 | } 193 | 194 | function detectIsEnglish(body: string | null): boolean | true { 195 | if (body === null) { 196 | return true 197 | } 198 | const detectResult = franc(body) 199 | if ( 200 | detectResult === 'und' || 201 | detectResult === undefined || 202 | detectResult === null 203 | ) { 204 | core.warning(`Can not detect the undetermined comment body: ${body}`) 205 | return false 206 | } 207 | core.info(`Detect comment body language result is: ${detectResult}`) 208 | return detectResult === 'eng' 209 | } 210 | 211 | async function translateIssueOrigin(body: string): Promise { 212 | let result = '' 213 | await translate(body, {to: 'en'}) 214 | .then(res => { 215 | if (res.text !== body) { 216 | result = res.text 217 | } 218 | }) 219 | .catch(err => { 220 | core.error(err) 221 | core.setFailed(err.message) 222 | }) 223 | return result 224 | } 225 | 226 | async function createComment( 227 | issueNumber: number, 228 | body: string | null, 229 | octokit: any 230 | ): Promise { 231 | const {owner, repo} = github.context.repo 232 | const issue_url = github.context.payload.issue?.html_url 233 | await octokit.issues.createComment({ 234 | owner, 235 | repo, 236 | issue_number: issueNumber, 237 | body 238 | }) 239 | core.info( 240 | `complete to push translate issue comment: ${body} in ${issue_url} ` 241 | ) 242 | } 243 | 244 | async function modifyTitle( 245 | issueNumber: number, 246 | title: string | null, 247 | octokit: any 248 | ): Promise { 249 | const {owner, repo} = github.context.repo 250 | const issue_url = github.context.payload.issue?.html_url 251 | await octokit.issues.update({ 252 | owner, 253 | repo, 254 | issue_number: issueNumber, 255 | title 256 | }) 257 | core.info( 258 | `complete to modify translate issue title: ${title} in ${issue_url} ` 259 | ) 260 | } 261 | 262 | run() 263 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ 4 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ 5 | "outDir": "./lib", /* Redirect output structure to the directory. */ 6 | "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 7 | "strict": true, /* Enable all strict type-checking options. */ 8 | "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 9 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 10 | }, 11 | "exclude": ["node_modules", "**/*.test.ts"] 12 | } 13 | --------------------------------------------------------------------------------