├── .gitignore ├── .prettierignore ├── .prettierrc.json ├── src ├── transformers │ ├── transformPostScanStatusAsComment.ts │ └── transformPostFindingsAsReviewComment.ts ├── time.ts ├── postMessage.ts ├── postReviewComment.ts ├── api.ts └── main.ts ├── tsconfig.json ├── .github └── workflows │ ├── test.yaml │ └── verify-build.yaml ├── package.json ├── LICENSE ├── .eslintrc.json ├── action.yaml ├── README.md └── dist ├── licenses.txt └── sourcemap-register.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | lib 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | lib -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "trailingComma": "es5", 4 | "singleQuote": true, 5 | "useTabs": true, 6 | "tabWidth": 4, 7 | "printWidth": 120 8 | } 9 | -------------------------------------------------------------------------------- /src/transformers/transformPostScanStatusAsComment.ts: -------------------------------------------------------------------------------- 1 | export const transformPostScanStatusAsComment = (value: string): string => { 2 | if (value === 'true') return 'on'; 3 | if (value === 'false') return 'off'; 4 | return value; 5 | } 6 | -------------------------------------------------------------------------------- /src/transformers/transformPostFindingsAsReviewComment.ts: -------------------------------------------------------------------------------- 1 | export const transformPostFindingsAsReviewComment = (value: string): string => { 2 | if (value === 'true') return 'on'; 3 | if (value === 'false') return 'off'; 4 | return value; 5 | } 6 | -------------------------------------------------------------------------------- /src/time.ts: -------------------------------------------------------------------------------- 1 | export const sleep = async (ms: number): Promise => { 2 | return new Promise((resolve) => setTimeout(resolve, ms)); 3 | }; 4 | 5 | export const getCurrentUnixTime = (): number => { 6 | const now = new Date(); 7 | return now.getTime(); 8 | }; 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "outDir": "./lib", 6 | "rootDir": "./src", 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "esModuleInterop": true 10 | }, 11 | "exclude": [ 12 | "node_modules", 13 | "lib", 14 | "dist" 15 | ] 16 | } -------------------------------------------------------------------------------- /.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: Test action 2 | on: 3 | pull_request: 4 | branches: 5 | - '*' 6 | 7 | jobs: 8 | test: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v3 12 | 13 | - name: Test action on current repository 14 | id: scan 15 | uses: ./ 16 | with: 17 | secret-key: ${{ secrets.AIKIDO_SECRET_KEY }} 18 | minimum-severity: 'MEDIUM' 19 | github-token: ${{ secrets.GITHUB_TOKEN }} 20 | post-scan-status-comment: true 21 | post-sast-review-comments: true 22 | fail-on-sast-scan: true 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ensure-no-vulnerabilities-action", 3 | "version": "1.0.0", 4 | "private": "true", 5 | "description": "", 6 | "main": "lib/main.js", 7 | "scripts": { 8 | "build": "tsc", 9 | "format": "prettier --write '**/*.ts'", 10 | "lint": "eslint src/**/*.ts", 11 | "package": "ncc build --source-map --license licenses.txt" 12 | }, 13 | "author": "", 14 | "license": "MIT", 15 | "devDependencies": { 16 | "@types/node": "^18.11.18", 17 | "@typescript-eslint/parser": "^5.49.0", 18 | "@vercel/ncc": "^0.36.1", 19 | "eslint": "^8.32.0", 20 | "eslint-config-prettier": "^8.5.0", 21 | "eslint-config-standard-with-typescript": "^23.0.0", 22 | "eslint-plugin-github": "^4.6.0", 23 | "eslint-plugin-prettier": "^4.0.0", 24 | "prettier": "^2.8.3", 25 | "typescript": "^4.9.4" 26 | }, 27 | "dependencies": { 28 | "@actions/core": "^1.10.0", 29 | "@actions/github": "^5.1.1", 30 | "@actions/http-client": "^2.0.1" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.github/workflows/verify-build.yaml: -------------------------------------------------------------------------------- 1 | # `dist/index.js` is a special file for Github Actions. 2 | # When referenced in a workflow, that's the file that will be run. 3 | # We need to make sure the checked-in `index.js` actually matches what we expect it to be. 4 | name: verify build 5 | 6 | on: 7 | push: 8 | branches: 9 | - main 10 | pull_request: 11 | branches: 12 | - '*' 13 | 14 | jobs: 15 | check-dist: 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - uses: actions/checkout@v3 20 | 21 | - name: Setup nodeJS 22 | uses: actions/setup-node@v3 23 | with: 24 | node-version: 16.x 25 | 26 | - name: Install dependencies 27 | run: npm ci 28 | 29 | - name: Rebuild the dist/ directory 30 | run: | 31 | npm run build 32 | npm run package 33 | - name: Compare the expected and actual dist/ directories 34 | run: | 35 | if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then 36 | echo "Detected uncommitted changes after build. See status below:" 37 | git diff 38 | exit 1 39 | fi 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 GitHub, Inc. and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/postMessage.ts: -------------------------------------------------------------------------------- 1 | import * as core from '@actions/core'; 2 | import * as github from '@actions/github'; 3 | 4 | type TPostScanStatusMessageOptions = { onlyIfNewFindings: boolean, hasNewFindings: boolean } 5 | 6 | export const postScanStatusMessage = async (messageBody: string, options: TPostScanStatusMessageOptions): Promise => { 7 | const githubToken = core.getInput('github-token'); 8 | if (!githubToken || githubToken === '') { 9 | core.error('unable to post scan status: missing github-token input parameter'); 10 | return; 11 | } 12 | 13 | const context = github.context; 14 | if (context.payload.pull_request == null) { 15 | core.error('unable to post scan status: action is not run in a pull request context'); 16 | return; 17 | } 18 | 19 | const pullRequestNumber = context.payload.pull_request.number; 20 | 21 | const octokit = github.getOctokit(githubToken); 22 | 23 | const { data: comments } = await octokit.rest.issues.listComments({ 24 | owner: context.repo.owner, 25 | repo: context.repo.repo, 26 | issue_number: pullRequestNumber, 27 | }); 28 | 29 | let intialBotComment = undefined; 30 | for (const comment of comments) { 31 | const isBot = comment.user?.type === 'Bot'; 32 | const isAikidoScannerBot = comment.body?.toLowerCase().includes('https://app.aikido.dev/featurebranch/scan/'); 33 | 34 | if (!isBot || !isAikidoScannerBot) continue; // not our bot, keep looking 35 | 36 | // we found our initial comment 37 | intialBotComment = comment; 38 | break; 39 | } 40 | 41 | // we should only post comment in case of new findings, but there are none: dont create comment 42 | if (!intialBotComment && options.onlyIfNewFindings && options.hasNewFindings) return; 43 | 44 | // no initial comment, let's create one! 45 | if (typeof intialBotComment === 'undefined') { 46 | await octokit.rest.issues.createComment({ 47 | ...context.repo, 48 | issue_number: pullRequestNumber, 49 | body: messageBody, 50 | }); 51 | return; 52 | } 53 | 54 | await octokit.rest.issues.updateComment({ 55 | owner: context.repo.owner, 56 | repo: context.repo.repo, 57 | comment_id: intialBotComment.id, 58 | body: messageBody, 59 | }); 60 | }; 61 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@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 | "i18n-text/no-en": "off", 12 | "eslint-comments/no-use": "off", 13 | "import/no-namespace": "off", 14 | "no-unused-vars": "off", 15 | "@typescript-eslint/no-unused-vars": "error", 16 | "@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}], 17 | "@typescript-eslint/no-require-imports": "error", 18 | "@typescript-eslint/array-type": "error", 19 | "@typescript-eslint/await-thenable": "error", 20 | "@typescript-eslint/ban-ts-comment": "error", 21 | "camelcase": "off", 22 | "@typescript-eslint/consistent-type-assertions": "error", 23 | "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], 24 | "@typescript-eslint/func-call-spacing": ["error", "never"], 25 | "@typescript-eslint/no-array-constructor": "error", 26 | "@typescript-eslint/no-empty-interface": "error", 27 | "@typescript-eslint/no-explicit-any": "error", 28 | "@typescript-eslint/no-extraneous-class": "error", 29 | "@typescript-eslint/no-for-in-array": "error", 30 | "@typescript-eslint/no-inferrable-types": "error", 31 | "@typescript-eslint/no-misused-new": "error", 32 | "@typescript-eslint/no-namespace": "error", 33 | "@typescript-eslint/no-non-null-assertion": "warn", 34 | "@typescript-eslint/no-unnecessary-qualifier": "error", 35 | "@typescript-eslint/no-unnecessary-type-assertion": "error", 36 | "@typescript-eslint/no-useless-constructor": "error", 37 | "@typescript-eslint/no-var-requires": "error", 38 | "@typescript-eslint/prefer-for-of": "warn", 39 | "@typescript-eslint/prefer-function-type": "warn", 40 | "@typescript-eslint/prefer-includes": "error", 41 | "@typescript-eslint/prefer-string-starts-ends-with": "error", 42 | "@typescript-eslint/promise-function-async": "error", 43 | "@typescript-eslint/require-array-sort-compare": "error", 44 | "@typescript-eslint/restrict-plus-operands": "error", 45 | "@typescript-eslint/type-annotation-spacing": "error", 46 | "@typescript-eslint/unbound-method": "error" 47 | }, 48 | "env": { 49 | "node": true, 50 | "es6": true 51 | } 52 | } -------------------------------------------------------------------------------- /action.yaml: -------------------------------------------------------------------------------- 1 | name: 'Aikido Security Github Action' 2 | description: 'This action triggers a scan in Aikido. It will throw an error if any new critical issues were found.' 3 | author: 'Aikido Security' 4 | inputs: 5 | secret-key: 6 | description: 'Secret key provided by Aikido' 7 | required: true 8 | minimum-severity: 9 | description: 'Which minimum severity Aikido should detect. Can be one of the following: LOW, MEDIUM, HIGH, CRITICAL' 10 | required: false 11 | default: "CRITICAL" 12 | fail-on-timeout: 13 | description: 'Whether or not the action should fail when the scan does not complete within 2 minutes.' 14 | required: false 15 | default: "true" 16 | fail-on-dependency-scan: 17 | description: 'Whether or not the action should fail when the pull request introduced new dependency issues with critical severity' 18 | required: false 19 | default: "true" 20 | fail-on-iac-scan: 21 | description: 'Whether or not the action should fail when the pull request introduced new infrastructure as code issues are detected' 22 | required: false 23 | default: "false" 24 | fail-on-sast-scan: 25 | description: 'Whether or not the action should fail when the pull request introduced new SAST issues with critical severity' 26 | required: false 27 | default: "false" 28 | timeout-seconds: 29 | description: 'Provide a number of seconds the action will wait for scans to complete.' 30 | required: false 31 | default: "120" 32 | post-scan-status-comment: 33 | description: 'Let Aikido post a comment on the PR with a summary of the status, this comment will be updated for each scan. Can be one of "on", "off" or "only_if_new_findings". When setting this value to "only_if_new_findings" Aikido will only post a comment once new findings are found, and keep it updated afterwards.' 34 | required: false 35 | default: "off" 36 | post-sast-review-comments: 37 | description: 'Let Aikido post inline review comments for sast findings. Can be one of "on", "off".' 38 | required: false 39 | default: "off" 40 | github-token: 41 | description: 'A token that the action can use to post the status comment, this can be the default GITHUB_TOKEN from the environment with permissions to list and post comments, or a custom PAT.' 42 | required: false 43 | default: "" 44 | outputs: 45 | outcome: 46 | description: | 47 | 'The outcome of the scan. This will return `SUCCESS` in case we managed to do a scan and no new critical issues were found.\n 48 | When we did not get results back in time, within 2 minutes, we will return a `TIMEOUT` status but not let the action fail. 49 | In case we did detect a new critical issue, the action will fail and outcome will be `FAILED`' 50 | scanResultUrl: 51 | description: 'A link to the scan results in Aikido.' 52 | runs: 53 | using: 'node20' 54 | main: 'dist/index.js' 55 | 56 | branding: 57 | icon: 'shield' 58 | color: 'purple' 59 | -------------------------------------------------------------------------------- /src/postReviewComment.ts: -------------------------------------------------------------------------------- 1 | import * as core from '@actions/core'; 2 | import * as github from '@actions/github'; 3 | import * as crypto from 'crypto'; 4 | 5 | type TFinding = { commit_id: string, path: string, line: number, start_line: number, body: string } 6 | 7 | // This function is used to check duplicates on new scans & bypass certain edge cases. 8 | // The app will compare a hash from an Aikido finding against a hash from a Github comment. As such, we can only use properties that live in both entities (e.g. Aikido hash_snippet can not be used). 9 | // Commit_id was not added to the hash, because Github will only send over the comments from the current commit. 10 | // Body was not added to the hash to avoid multiple comments on the same line. 11 | const parseSnippetHashFromComment = (finding: any): string | undefined => { 12 | if (finding.path == null || finding.line == null) return undefined 13 | 14 | return crypto.createHash('sha256').update(`${finding.path}-${finding.line}`).digest('hex'); 15 | } 16 | 17 | // Possible edge cases: 18 | // - Previous finding/comment has moved location in newer commit: Github handles this and passes location within current commit. 19 | // - New finding on the same line number as a previous finding: Github handles this as the old comment is not present in current commit. 20 | // - The same finding (previously deleted) is now back. We detect this as a duplicate, so the old conversation is preserved. 21 | export const postFindingsAsReviewComments = async (findings: TFinding[]): Promise => { 22 | const githubToken = core.getInput('github-token'); 23 | if (!githubToken || githubToken === '') { 24 | core.info('unable to post review comments: missing github-token input parameter'); 25 | return; 26 | } 27 | 28 | const context = github.context; 29 | if (context.payload.pull_request == null) { 30 | core.info('unable to post review comments: action is not run in a pull request context'); 31 | return; 32 | } 33 | 34 | const pullRequestNumber = context.payload.pull_request.number; 35 | 36 | const octokit = github.getOctokit(githubToken); 37 | 38 | const { data: reviewComments } = await octokit.rest.pulls.listReviewComments({ 39 | owner: context.repo.owner, 40 | repo: context.repo.repo, 41 | pull_number: pullRequestNumber 42 | }); 43 | 44 | // Add new review comments 45 | for (const finding of findings) { 46 | const findingId = parseSnippetHashFromComment(finding) 47 | 48 | if (findingId === undefined) continue; 49 | 50 | // Duplicate detection 51 | let existingFinding = undefined 52 | for (const comment of reviewComments) { 53 | const isBot = comment.user?.type === 'Bot'; 54 | const existingCommentId = parseSnippetHashFromComment(comment) 55 | 56 | // Skip comments that generate invalid hashes 57 | if (existingCommentId === undefined) continue; 58 | 59 | // Skip comments that aren't a bot 60 | if (!isBot) continue; 61 | 62 | // Check for duplicate 63 | if (findingId != existingCommentId) continue; 64 | 65 | existingFinding = comment 66 | } 67 | 68 | if (typeof existingFinding === 'undefined') { 69 | try { 70 | await octokit.rest.pulls.createReviewComment({ 71 | ...context.repo, 72 | pull_number: pullRequestNumber, 73 | commit_id: finding.commit_id, 74 | path: finding.path, 75 | body: finding.body, 76 | line: finding.line, 77 | ...(finding.start_line != finding.line) && { start_line: finding.start_line } 78 | }); 79 | } catch (error) { 80 | if (error instanceof Error) { 81 | core.info(`unable to post scan status comment due to error: ${error.message}. Tried posting ${JSON.stringify(finding)}`); 82 | } else { 83 | core.info(`unable to post scan status comment due to unknown error`); 84 | } 85 | } 86 | 87 | } 88 | } 89 | }; 90 | -------------------------------------------------------------------------------- /src/api.ts: -------------------------------------------------------------------------------- 1 | import * as httpClient from '@actions/http-client'; 2 | import { TypedResponse } from '@actions/http-client/lib/interfaces'; 3 | 4 | const AIKIDO_API_URL = 'https://app.aikido.dev'; 5 | 6 | type StartScanResponse = { scan_id: number }; 7 | 8 | export type GetScanStatusResponse = 9 | | { 10 | new_sast_issues_found?: number; 11 | new_iac_issues_found?: number; 12 | new_dependency_issues_found?: number; 13 | all_scans_completed: true; 14 | new_issues_found?: number; 15 | issue_links?: string[]; 16 | diff_url?: string; 17 | gate_passed?: boolean; 18 | outcome?: { 19 | human_readable_message: string; 20 | }; 21 | } 22 | | { 23 | all_scans_completed: false; 24 | }; 25 | 26 | export type GetScanFindingsResponse = 27 | { 28 | group_id: number, 29 | start_commit_id?: string, 30 | end_commit_id: string, 31 | introduced_sast_issues: [ 32 | { 33 | author?: string, 34 | start_column?: number, 35 | end_column?: number, 36 | start_line: number, 37 | end_line: number, 38 | snippet_hash: string, 39 | title: string, 40 | description: string, 41 | remediation: string, 42 | file: string 43 | } 44 | ] 45 | } 46 | 47 | export const startScan = async (secret: string, payload: Object): Promise => { 48 | const requestClient = new httpClient.HttpClient('ci-github-actions'); 49 | 50 | const url = `${AIKIDO_API_URL}/api/integrations/continuous_integration/scan/repository`; 51 | 52 | let response: TypedResponse | undefined; 53 | try { 54 | response = await requestClient.postJson(url, payload, { 'X-AIK-API-SECRET': secret }); 55 | } catch (error) { 56 | if (error instanceof httpClient.HttpClientError && error.statusCode === 401) { 57 | throw new Error( 58 | `Start scan failed. The provided api key is most likely no longer valid and has been rotated or revoked. Visit https://app.aikido.dev/settings/integrations/continuous-integration to generate a new key.` 59 | ); 60 | } 61 | 62 | if (error instanceof httpClient.HttpClientError && (error.statusCode >= 400 || error.statusCode <= 499)) { 63 | throw new Error(`start scan failed: ${error.message}`); 64 | } 65 | 66 | throw new Error(`start scan failed: an unexpected error occurred whilst starting the scan`); 67 | } 68 | 69 | if (response === undefined) throw new Error(`start scan failed: did not get a response`); 70 | 71 | if (response.statusCode !== 200) { 72 | throw new Error(`start scan failed: unable to start scan: ${JSON.stringify(response.result ?? {})}`); 73 | } 74 | 75 | if (response.result?.scan_id) return response.result.scan_id; 76 | 77 | throw new Error(`start scan failed: no scan_id received in the response: ${response.result}`); 78 | }; 79 | 80 | export const getScanStatus = (secret: string, scanId: number): (() => Promise) => { 81 | const requestClient = new httpClient.HttpClient('ci-github-actions'); 82 | 83 | return async (): Promise => { 84 | const url = new URL(`${AIKIDO_API_URL}/api/integrations/continuous_integration/scan/repository`); 85 | url.searchParams.set('scan_id', scanId.toString()); 86 | 87 | const response = await requestClient.getJson(url.toString(), { 88 | 'X-AIK-API-SECRET': secret, 89 | }); 90 | 91 | if (response.statusCode !== 200 || !response.result) { 92 | throw new Error( 93 | `check if scan is complete failed: did not receive a good result: ${JSON.stringify( 94 | response.result ?? {} 95 | )}` 96 | ); 97 | } 98 | 99 | return response.result; 100 | }; 101 | }; 102 | 103 | export const getScanFindings = async (secret: string, scanId: number): Promise => { 104 | const requestClient = new httpClient.HttpClient('ci-github-actions'); 105 | 106 | const url = new URL(`${AIKIDO_API_URL}/api/integrations/continuous_integration/scan/${scanId}/introducedSastIssues`); 107 | 108 | const response = await requestClient.getJson(url.toString(), { 109 | 'X-AIK-API-SECRET': secret, 110 | }); 111 | 112 | if (response.statusCode !== 200 || !response.result) { 113 | throw new Error( 114 | `fetch findings failed: did not receive a good result: ${JSON.stringify( 115 | response.result ?? {} 116 | )}` 117 | ); 118 | } 119 | 120 | return response.result; 121 | }; 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Aikido Security Github action 2 | 3 | > [!WARNING] 4 | > We do not recommend using this functionality anymore, but to use the PR gating via the Aikido Dashboard instead. It does not use CI minutes, has improved bulk PR management and is less error-prone. [Check out Aikido docs for more information](https://help.aikido.dev/doc/github-ci-pr-gating-via-aikido-dashboard/docZayPeps1j). 5 | 6 | This repository contains an application that can be used in Github action workflows. It will trigger a scan in Aikido to make sure no new critical issues are introduced into your application. The free tier plan allows for scanning on dependencies. Other features such as blocking on SAST or license findings are part of the paid plan. 7 | 8 | ## Using the action 9 | 10 | This is an example workflow you could use to trigger a scan for each new pull request 11 | 12 | ```yaml 13 | name: Aikido Security 14 | on: 15 | pull_request: 16 | branches: 17 | - '*' 18 | 19 | jobs: 20 | aikido-security: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout code 24 | uses: actions/checkout@v4 25 | 26 | - name: Detect new vulnerabilities 27 | uses: AikidoSec/github-actions-workflow@v1.0.13 28 | with: 29 | secret-key: ${{ secrets.AIKIDO_SECRET_KEY }} 30 | fail-on-timeout: true 31 | fail-on-dependency-scan: true 32 | fail-on-sast-scan: false 33 | fail-on-iac-scan: false 34 | minimum-severity: 'CRITICAL' 35 | timeout-seconds: 180 36 | post-scan-status-comment: 'off' 37 | post-sast-review-comments: 'off' 38 | github-token: ${{ secrets.GITHUB_TOKEN }} 39 | ``` 40 | 41 | The action has 3 possible outcomes: 42 | - `SUCCEEDED`: the scan was completed successfully and we did not encounter any new critical issues 43 | - `FAILED`: the scan was completed successfully, but we found new critical issues 44 | - `TIMED_OUT`: the scan did not complete before the set timeout. In this case we won't let the action fail, but we do return this special case to not block your pipeline. 45 | 46 | Required fields: 47 | - `secret-key`: The secret key generated at [CI integrations settings](https://app.aikido.dev/settings/integrations/continuous-integration). 48 | - `minimum-severity`: Determines on which (minimum) severity Aikido should respond with `FAILED`. This value can be one of `LOW`, `MEDIUM`, `HIGH`, `CRITICAL`. 49 | 50 | Optional fields: 51 | - `fail-on-timeout`: Determines whether the workflow should respond with `FAILED` in case the scans timed out after 2 minutes. 52 | - `fail-on-dependency-scan`: Determines whether Aikido should block on new dependency issues (CVEs). 53 | - `fail-on-sast-scan`: Determines whether Aikido should block on new SAST issues. This is available in all [paid plans](https://www.aikido.dev/pricing). 54 | - `fail-on-iac-scan`: Determines whether Aikido should block on new Infrastructure as Code issues. This is available in all [paid plans](https://www.aikido.dev/pricing). 55 | - `post-scan-status-comment`: Let Aikido post a comment on the PR (when in PR context) with the latest scan status and a link to the scan results. Value can be one of "on", "off" or "only_if_new_findings". When setting this value to "only_if_new_findings" Aikido will only post a comment once new findings are found, and keep it updated afterwards. 56 | - `post-sast-review-comments`: Let Aikido post review comments on the PR of SAST findings that are above the failure treshold and a link to the Aikido platform. Value can be one of "on", "off". 57 | - `github-token`: Must be set only if you want Aikido to post a comment on the PR. If the default `${{ secrets.GITHUB_TOKEN }}` environment token does not have write capabilities, Aikido needs a PAT with specific permissions to read and write comments in a PR. 58 | 59 | 60 | ## Contributing 61 | 62 | Install the dependencies 63 | ```bash 64 | $ npm install 65 | ``` 66 | 67 | When the changes have been implemented, you need to build and package the code for release. Run the following commands and commit it to the repository. 68 | ```bash 69 | $ npm run build && npm run package 70 | ``` 71 | 72 | ## Change action.yml 73 | 74 | The action.yml defines the inputs and output of our action. 75 | 76 | See the [documentation](https://help.github.com/en/articles/metadata-syntax-for-github-actions) 77 | 78 | ## Creating a new release 79 | 80 | To update the app, you will need to update the app's bundle. First run 81 | ```shell 82 | npm run build 83 | ``` 84 | Followed by: 85 | ```shell 86 | npm run package 87 | ``` 88 | The contents of the dist folder should now be altered, commit these changes and merge them into the main branch. 89 | 90 | Next, create a release on Github by clicking on `tags` and then `releases`. Then you can draft and release a new version. 91 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import * as core from '@actions/core'; 2 | import * as github from '@actions/github'; 3 | 4 | import { getScanStatus, startScan, getScanFindings } from './api'; 5 | import { getCurrentUnixTime, sleep } from './time'; 6 | import { postScanStatusMessage } from './postMessage'; 7 | import { postFindingsAsReviewComments } from './postReviewComment'; 8 | import { transformPostScanStatusAsComment } from './transformers/transformPostScanStatusAsComment'; 9 | import { transformPostFindingsAsReviewComment } from './transformers/transformPostFindingsAsReviewComment'; 10 | 11 | const STATUS_FAILED = 'FAILED'; 12 | const STATUS_SUCCEEDED = 'SUCCEEDED'; 13 | const STATUS_TIMED_OUT = 'TIMED_OUT'; 14 | 15 | const ALLOWED_POST_SCAN_STATUS_OPTIONS = ['on', 'off', 'only_if_new_findings']; 16 | const ALLOWED_POST_REVIEW_COMMENTS_OPTIONS = ['on', 'off']; 17 | 18 | async function run(): Promise { 19 | try { 20 | const secretKey: string = core.getInput('secret-key'); 21 | const fromSeverity: string = core.getInput('minimum-severity'); 22 | const failOnTimeout: string = core.getInput('fail-on-timeout'); 23 | const failOnDependencyScan: string = core.getInput('fail-on-dependency-scan'); 24 | const failOnSastScan: string = core.getInput('fail-on-sast-scan'); 25 | const failOnIacScan: string = core.getInput('fail-on-iac-scan'); 26 | const timeoutInSeconds = parseTimeoutDuration(core.getInput('timeout-seconds')); 27 | let postScanStatusAsComment = core.getInput('post-scan-status-comment'); 28 | let postReviewComments = core.getInput('post-sast-review-comments'); 29 | 30 | if (!['LOW', 'MEDIUM', 'HIGH', 'CRITICAL'].includes(fromSeverity.toUpperCase())) { 31 | core.setOutput('output', STATUS_FAILED); 32 | core.setFailed(`Invalid property value for minimum-severity. Allowed values are: LOW, MEDIUM, HIGH, CRITICAL`); 33 | return; 34 | } 35 | 36 | postScanStatusAsComment = transformPostScanStatusAsComment(postScanStatusAsComment); 37 | if (!ALLOWED_POST_SCAN_STATUS_OPTIONS.includes(postScanStatusAsComment)) { 38 | core.setOutput('ouput', STATUS_FAILED); 39 | core.setFailed(`Invalid property value for post-scan-status-comment. Allowed values are: ${ALLOWED_POST_SCAN_STATUS_OPTIONS.join(', ')}`); 40 | return; 41 | } 42 | 43 | postReviewComments = transformPostFindingsAsReviewComment(postReviewComments); 44 | if (!ALLOWED_POST_REVIEW_COMMENTS_OPTIONS.includes(postReviewComments)) { 45 | core.setOutput('ouput', STATUS_FAILED); 46 | core.setFailed(`Invalid property value for post-sast-review-comments. Allowed values are: ${ALLOWED_POST_SCAN_STATUS_OPTIONS.join(', ')}`); 47 | return; 48 | } 49 | 50 | const isMergeGroupAction = !!github.context.payload?.merge_group; 51 | 52 | const startScanPayload = { 53 | version: '1.0.5', 54 | branch_name: github.context.payload?.pull_request?.head?.ref || github.context.payload?.ref || (isMergeGroupAction && 'merge_group'), 55 | repository_id: github.context.payload.repository?.node_id, 56 | base_commit_id: github.context.payload?.pull_request?.base?.sha || github.context.payload?.before || github.context.payload?.merge_group?.base_sha, 57 | head_commit_id: github.context.payload?.pull_request?.head?.sha || github.context.payload?.after || github.context.payload?.merge_group?.head_sha, 58 | author: 59 | github.context.payload?.pull_request?.user?.login || 60 | github.context.payload?.head_commit?.author?.username || 61 | github.context.payload?.merge_group?.head_commit?.author?.name, 62 | pull_request_metadata: { 63 | title: github.context.payload?.pull_request?.title, 64 | url: github.context.payload?.pull_request?.html_url, 65 | }, 66 | 67 | // user config 68 | fail_on_dependency_scan: failOnDependencyScan, 69 | fail_on_sast_scan: failOnSastScan, 70 | fail_on_iac_scan: failOnIacScan, 71 | minimum_severity: fromSeverity, 72 | }; 73 | 74 | if (secretKey) { 75 | const redactedToken = '********************' + secretKey.slice(-4); 76 | core.info(`starting a scan with secret key: "${redactedToken}"`); 77 | } else { 78 | const isLikelyDependabotPr = (startScanPayload.branch_name ?? '').startsWith('dependabot/') 79 | if (isLikelyDependabotPr) { 80 | core.info(`it looks like the action is running on a dependabot PR, this means that secret variables are not available in this context and thus we can not start a scan. Please see: https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/`); 81 | core.setOutput('outcome', STATUS_SUCCEEDED); 82 | return; 83 | } 84 | 85 | core.info(`secret key not set.`); 86 | } 87 | 88 | if (failOnDependencyScan === 'false' && failOnIacScan === 'false' && failOnSastScan === 'false') { 89 | core.setOutput('output', STATUS_FAILED); 90 | core.setFailed(`You must enable at least one of the scans.`); 91 | return; 92 | } 93 | 94 | const scanId = await startScan(secretKey, startScanPayload); 95 | 96 | core.info(`successfully started a scan with id: "${scanId}"`); 97 | 98 | const getScanCompletionStatus = getScanStatus(secretKey, scanId); 99 | 100 | const expirationTimestamp = getCurrentUnixTime() + timeoutInSeconds * 1000; 101 | 102 | let scanIsCompleted = false; 103 | 104 | core.info('==== check if scan is completed ===='); 105 | 106 | do { 107 | const result = await getScanCompletionStatus(); 108 | 109 | if (!result.all_scans_completed) { 110 | core.info('==== scan is not yet completed, wait a few seconds ===='); 111 | await sleep(5000); 112 | 113 | const dependencyScanTimeoutReached = getCurrentUnixTime() > expirationTimestamp; 114 | if (dependencyScanTimeoutReached) { 115 | if (failOnTimeout === 'true') { 116 | core.setOutput('output', STATUS_FAILED); 117 | core.setFailed( 118 | `dependency scan reached time out: the scan did not complete within the set timeout` 119 | ); 120 | return; 121 | } 122 | 123 | core.setOutput('output', STATUS_TIMED_OUT); 124 | core.info(`dependency scan reached time out: the scan did not complete within the set timeout.`); 125 | return; 126 | } 127 | 128 | continue; 129 | } 130 | 131 | scanIsCompleted = true; 132 | 133 | let moreDetailsText = ''; 134 | if (result.diff_url) { 135 | moreDetailsText = ` More details at ${result.diff_url}`; 136 | } 137 | 138 | let shouldPostComment = (postScanStatusAsComment === 'on' || postScanStatusAsComment === 'only_if_new_findings'); 139 | if (isMergeGroupAction) { 140 | shouldPostComment = false; // no review comments in merge queue 141 | } 142 | 143 | if (shouldPostComment && !!result.outcome?.human_readable_message) { 144 | try { 145 | const options = { onlyIfNewFindings: postScanStatusAsComment === 'only_if_new_findings', hasNewFindings: !!result.gate_passed }; 146 | await postScanStatusMessage(result.outcome?.human_readable_message, options); 147 | } catch (error) { 148 | if (error instanceof Error) { 149 | core.info(`unable to post scan status comment due to error: ${error.message}`); 150 | } else { 151 | core.info(`unable to post scan status comment due to unknown error`); 152 | } 153 | } 154 | } 155 | 156 | let shouldPostReviewComments = (postReviewComments === 'on'); 157 | if (isMergeGroupAction) { 158 | shouldPostReviewComments = false; // no review comments in merge queue 159 | } 160 | 161 | if (shouldPostReviewComments) { 162 | await createReviewComments(secretKey, scanId) 163 | } 164 | 165 | core.setOutput('scanResultUrl', result.diff_url); 166 | 167 | const { 168 | gate_passed = false, 169 | new_issues_found = 0, 170 | issue_links = [], 171 | new_dependency_issues_found = 0, 172 | new_iac_issues_found = 0, 173 | new_sast_issues_found = 0, 174 | } = result; 175 | 176 | if (!gate_passed) { 177 | for (const linkToIssue of issue_links) { 178 | core.error(`New issue detected with severity >=${fromSeverity}. Check it out at: ${linkToIssue}`); 179 | } 180 | 181 | throw new Error( 182 | `dependency scan completed: found ${new_issues_found} new issues with severity >=${fromSeverity}.${moreDetailsText}` 183 | ); 184 | } 185 | 186 | if (new_dependency_issues_found > 0) { 187 | throw new Error(`${new_dependency_issues_found} new dependency issue(s) detected.${moreDetailsText}`); 188 | } 189 | if (new_iac_issues_found > 0) { 190 | throw new Error(`${new_iac_issues_found} new IaC issue(s) detected.${moreDetailsText}`); 191 | } 192 | if (new_sast_issues_found > 0) { 193 | throw new Error(`${new_sast_issues_found} new SAST issue(s) detected.${moreDetailsText}`); 194 | } 195 | 196 | core.info( 197 | `==== scan is completed, no new issues with severity >=${fromSeverity} found.${moreDetailsText} ====` 198 | ); 199 | } while (!scanIsCompleted); 200 | 201 | core.setOutput('outcome', STATUS_SUCCEEDED); 202 | } catch (error) { 203 | core.setOutput('outcome', STATUS_FAILED); 204 | if (error instanceof Error) core.setFailed(error.message); 205 | } 206 | } 207 | 208 | async function createReviewComments(secretKey: string, scanId: number): Promise { 209 | try { 210 | const findingResponse = await getScanFindings(secretKey, scanId) 211 | 212 | const findings = findingResponse.introduced_sast_issues.map(finding => ( 213 | { 214 | commit_id: findingResponse.end_commit_id, 215 | path: finding.file, 216 | line: finding.end_line, 217 | start_line: finding.start_line, 218 | body: `**${finding.title}**\n${finding.description}\n**Remediation:** ${finding.remediation}\n[View details in Aikido Security](https://app.aikido.dev/featurebranch/scan/${scanId}?groupId=${findingResponse.group_id})` 219 | } 220 | )) 221 | 222 | if (findings.length > 0) { 223 | await postFindingsAsReviewComments(findings); 224 | } 225 | } catch (error) { 226 | if (error instanceof Error) { 227 | core.info(`unable to post review comments due to error: ${error.message}`); 228 | } else { 229 | core.info(`unable to post review comments due to unknown error`); 230 | } 231 | } 232 | } 233 | 234 | function parseTimeoutDuration(rawTimeoutInSeconds: string): number { 235 | if (rawTimeoutInSeconds === '') return 120; 236 | 237 | try { 238 | return parseInt(rawTimeoutInSeconds, 10); 239 | } catch (error) { 240 | throw new Error( 241 | `Invalid timeout provided. The provided timeout should be a valid number, but got: "${rawTimeoutInSeconds}"` 242 | ); 243 | } 244 | } 245 | 246 | void run(); 247 | -------------------------------------------------------------------------------- /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 | The MIT License (MIT) 16 | 17 | Copyright 2019 GitHub 18 | 19 | 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: 20 | 21 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 22 | 23 | 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. 24 | 25 | @actions/http-client 26 | MIT 27 | Actions Http Client for Node.js 28 | 29 | Copyright (c) GitHub, Inc. 30 | 31 | All rights reserved. 32 | 33 | MIT License 34 | 35 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 36 | associated documentation files (the "Software"), to deal in the Software without restriction, 37 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 38 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 39 | subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 44 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 45 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 46 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 47 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 48 | 49 | 50 | @octokit/auth-token 51 | MIT 52 | The MIT License 53 | 54 | Copyright (c) 2019 Octokit contributors 55 | 56 | Permission is hereby granted, free of charge, to any person obtaining a copy 57 | of this software and associated documentation files (the "Software"), to deal 58 | in the Software without restriction, including without limitation the rights 59 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 60 | copies of the Software, and to permit persons to whom the Software is 61 | furnished to do so, subject to the following conditions: 62 | 63 | The above copyright notice and this permission notice shall be included in 64 | all copies or substantial portions of the Software. 65 | 66 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 67 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 68 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 69 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 70 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 71 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 72 | THE SOFTWARE. 73 | 74 | 75 | @octokit/core 76 | MIT 77 | The MIT License 78 | 79 | Copyright (c) 2019 Octokit contributors 80 | 81 | Permission is hereby granted, free of charge, to any person obtaining a copy 82 | of this software and associated documentation files (the "Software"), to deal 83 | in the Software without restriction, including without limitation the rights 84 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 85 | copies of the Software, and to permit persons to whom the Software is 86 | furnished to do so, subject to the following conditions: 87 | 88 | The above copyright notice and this permission notice shall be included in 89 | all copies or substantial portions of the Software. 90 | 91 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 92 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 93 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 94 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 95 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 96 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 97 | THE SOFTWARE. 98 | 99 | 100 | @octokit/endpoint 101 | MIT 102 | The MIT License 103 | 104 | Copyright (c) 2018 Octokit contributors 105 | 106 | Permission is hereby granted, free of charge, to any person obtaining a copy 107 | of this software and associated documentation files (the "Software"), to deal 108 | in the Software without restriction, including without limitation the rights 109 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 110 | copies of the Software, and to permit persons to whom the Software is 111 | furnished to do so, subject to the following conditions: 112 | 113 | The above copyright notice and this permission notice shall be included in 114 | all copies or substantial portions of the Software. 115 | 116 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 117 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 118 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 119 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 120 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 121 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 122 | THE SOFTWARE. 123 | 124 | 125 | @octokit/graphql 126 | MIT 127 | The MIT License 128 | 129 | Copyright (c) 2018 Octokit contributors 130 | 131 | Permission is hereby granted, free of charge, to any person obtaining a copy 132 | of this software and associated documentation files (the "Software"), to deal 133 | in the Software without restriction, including without limitation the rights 134 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 135 | copies of the Software, and to permit persons to whom the Software is 136 | furnished to do so, subject to the following conditions: 137 | 138 | The above copyright notice and this permission notice shall be included in 139 | all copies or substantial portions of the Software. 140 | 141 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 142 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 143 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 144 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 145 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 146 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 147 | THE SOFTWARE. 148 | 149 | 150 | @octokit/plugin-paginate-rest 151 | MIT 152 | MIT License Copyright (c) 2019 Octokit contributors 153 | 154 | 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: 155 | 156 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 157 | 158 | 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. 159 | 160 | 161 | @octokit/plugin-rest-endpoint-methods 162 | MIT 163 | MIT License Copyright (c) 2019 Octokit contributors 164 | 165 | 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: 166 | 167 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 168 | 169 | 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. 170 | 171 | 172 | @octokit/request 173 | MIT 174 | The MIT License 175 | 176 | Copyright (c) 2018 Octokit contributors 177 | 178 | Permission is hereby granted, free of charge, to any person obtaining a copy 179 | of this software and associated documentation files (the "Software"), to deal 180 | in the Software without restriction, including without limitation the rights 181 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 182 | copies of the Software, and to permit persons to whom the Software is 183 | furnished to do so, subject to the following conditions: 184 | 185 | The above copyright notice and this permission notice shall be included in 186 | all copies or substantial portions of the Software. 187 | 188 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 189 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 190 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 191 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 192 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 193 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 194 | THE SOFTWARE. 195 | 196 | 197 | @octokit/request-error 198 | MIT 199 | The MIT License 200 | 201 | Copyright (c) 2019 Octokit contributors 202 | 203 | Permission is hereby granted, free of charge, to any person obtaining a copy 204 | of this software and associated documentation files (the "Software"), to deal 205 | in the Software without restriction, including without limitation the rights 206 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 207 | copies of the Software, and to permit persons to whom the Software is 208 | furnished to do so, subject to the following conditions: 209 | 210 | The above copyright notice and this permission notice shall be included in 211 | all copies or substantial portions of the Software. 212 | 213 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 214 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 215 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 216 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 217 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 218 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 219 | THE SOFTWARE. 220 | 221 | 222 | @vercel/ncc 223 | MIT 224 | Copyright 2018 ZEIT, Inc. 225 | 226 | 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: 227 | 228 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 229 | 230 | 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. 231 | 232 | before-after-hook 233 | Apache-2.0 234 | Apache License 235 | Version 2.0, January 2004 236 | http://www.apache.org/licenses/ 237 | 238 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 239 | 240 | 1. Definitions. 241 | 242 | "License" shall mean the terms and conditions for use, reproduction, 243 | and distribution as defined by Sections 1 through 9 of this document. 244 | 245 | "Licensor" shall mean the copyright owner or entity authorized by 246 | the copyright owner that is granting the License. 247 | 248 | "Legal Entity" shall mean the union of the acting entity and all 249 | other entities that control, are controlled by, or are under common 250 | control with that entity. For the purposes of this definition, 251 | "control" means (i) the power, direct or indirect, to cause the 252 | direction or management of such entity, whether by contract or 253 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 254 | outstanding shares, or (iii) beneficial ownership of such entity. 255 | 256 | "You" (or "Your") shall mean an individual or Legal Entity 257 | exercising permissions granted by this License. 258 | 259 | "Source" form shall mean the preferred form for making modifications, 260 | including but not limited to software source code, documentation 261 | source, and configuration files. 262 | 263 | "Object" form shall mean any form resulting from mechanical 264 | transformation or translation of a Source form, including but 265 | not limited to compiled object code, generated documentation, 266 | and conversions to other media types. 267 | 268 | "Work" shall mean the work of authorship, whether in Source or 269 | Object form, made available under the License, as indicated by a 270 | copyright notice that is included in or attached to the work 271 | (an example is provided in the Appendix below). 272 | 273 | "Derivative Works" shall mean any work, whether in Source or Object 274 | form, that is based on (or derived from) the Work and for which the 275 | editorial revisions, annotations, elaborations, or other modifications 276 | represent, as a whole, an original work of authorship. For the purposes 277 | of this License, Derivative Works shall not include works that remain 278 | separable from, or merely link (or bind by name) to the interfaces of, 279 | the Work and Derivative Works thereof. 280 | 281 | "Contribution" shall mean any work of authorship, including 282 | the original version of the Work and any modifications or additions 283 | to that Work or Derivative Works thereof, that is intentionally 284 | submitted to Licensor for inclusion in the Work by the copyright owner 285 | or by an individual or Legal Entity authorized to submit on behalf of 286 | the copyright owner. For the purposes of this definition, "submitted" 287 | means any form of electronic, verbal, or written communication sent 288 | to the Licensor or its representatives, including but not limited to 289 | communication on electronic mailing lists, source code control systems, 290 | and issue tracking systems that are managed by, or on behalf of, the 291 | Licensor for the purpose of discussing and improving the Work, but 292 | excluding communication that is conspicuously marked or otherwise 293 | designated in writing by the copyright owner as "Not a Contribution." 294 | 295 | "Contributor" shall mean Licensor and any individual or Legal Entity 296 | on behalf of whom a Contribution has been received by Licensor and 297 | subsequently incorporated within the Work. 298 | 299 | 2. Grant of Copyright License. Subject to the terms and conditions of 300 | this License, each Contributor hereby grants to You a perpetual, 301 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 302 | copyright license to reproduce, prepare Derivative Works of, 303 | publicly display, publicly perform, sublicense, and distribute the 304 | Work and such Derivative Works in Source or Object form. 305 | 306 | 3. Grant of Patent License. Subject to the terms and conditions of 307 | this License, each Contributor hereby grants to You a perpetual, 308 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 309 | (except as stated in this section) patent license to make, have made, 310 | use, offer to sell, sell, import, and otherwise transfer the Work, 311 | where such license applies only to those patent claims licensable 312 | by such Contributor that are necessarily infringed by their 313 | Contribution(s) alone or by combination of their Contribution(s) 314 | with the Work to which such Contribution(s) was submitted. If You 315 | institute patent litigation against any entity (including a 316 | cross-claim or counterclaim in a lawsuit) alleging that the Work 317 | or a Contribution incorporated within the Work constitutes direct 318 | or contributory patent infringement, then any patent licenses 319 | granted to You under this License for that Work shall terminate 320 | as of the date such litigation is filed. 321 | 322 | 4. Redistribution. You may reproduce and distribute copies of the 323 | Work or Derivative Works thereof in any medium, with or without 324 | modifications, and in Source or Object form, provided that You 325 | meet the following conditions: 326 | 327 | (a) You must give any other recipients of the Work or 328 | Derivative Works a copy of this License; and 329 | 330 | (b) You must cause any modified files to carry prominent notices 331 | stating that You changed the files; and 332 | 333 | (c) You must retain, in the Source form of any Derivative Works 334 | that You distribute, all copyright, patent, trademark, and 335 | attribution notices from the Source form of the Work, 336 | excluding those notices that do not pertain to any part of 337 | the Derivative Works; and 338 | 339 | (d) If the Work includes a "NOTICE" text file as part of its 340 | distribution, then any Derivative Works that You distribute must 341 | include a readable copy of the attribution notices contained 342 | within such NOTICE file, excluding those notices that do not 343 | pertain to any part of the Derivative Works, in at least one 344 | of the following places: within a NOTICE text file distributed 345 | as part of the Derivative Works; within the Source form or 346 | documentation, if provided along with the Derivative Works; or, 347 | within a display generated by the Derivative Works, if and 348 | wherever such third-party notices normally appear. The contents 349 | of the NOTICE file are for informational purposes only and 350 | do not modify the License. You may add Your own attribution 351 | notices within Derivative Works that You distribute, alongside 352 | or as an addendum to the NOTICE text from the Work, provided 353 | that such additional attribution notices cannot be construed 354 | as modifying the License. 355 | 356 | You may add Your own copyright statement to Your modifications and 357 | may provide additional or different license terms and conditions 358 | for use, reproduction, or distribution of Your modifications, or 359 | for any such Derivative Works as a whole, provided Your use, 360 | reproduction, and distribution of the Work otherwise complies with 361 | the conditions stated in this License. 362 | 363 | 5. Submission of Contributions. Unless You explicitly state otherwise, 364 | any Contribution intentionally submitted for inclusion in the Work 365 | by You to the Licensor shall be under the terms and conditions of 366 | this License, without any additional terms or conditions. 367 | Notwithstanding the above, nothing herein shall supersede or modify 368 | the terms of any separate license agreement you may have executed 369 | with Licensor regarding such Contributions. 370 | 371 | 6. Trademarks. This License does not grant permission to use the trade 372 | names, trademarks, service marks, or product names of the Licensor, 373 | except as required for reasonable and customary use in describing the 374 | origin of the Work and reproducing the content of the NOTICE file. 375 | 376 | 7. Disclaimer of Warranty. Unless required by applicable law or 377 | agreed to in writing, Licensor provides the Work (and each 378 | Contributor provides its Contributions) on an "AS IS" BASIS, 379 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 380 | implied, including, without limitation, any warranties or conditions 381 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 382 | PARTICULAR PURPOSE. You are solely responsible for determining the 383 | appropriateness of using or redistributing the Work and assume any 384 | risks associated with Your exercise of permissions under this License. 385 | 386 | 8. Limitation of Liability. In no event and under no legal theory, 387 | whether in tort (including negligence), contract, or otherwise, 388 | unless required by applicable law (such as deliberate and grossly 389 | negligent acts) or agreed to in writing, shall any Contributor be 390 | liable to You for damages, including any direct, indirect, special, 391 | incidental, or consequential damages of any character arising as a 392 | result of this License or out of the use or inability to use the 393 | Work (including but not limited to damages for loss of goodwill, 394 | work stoppage, computer failure or malfunction, or any and all 395 | other commercial damages or losses), even if such Contributor 396 | has been advised of the possibility of such damages. 397 | 398 | 9. Accepting Warranty or Additional Liability. While redistributing 399 | the Work or Derivative Works thereof, You may choose to offer, 400 | and charge a fee for, acceptance of support, warranty, indemnity, 401 | or other liability obligations and/or rights consistent with this 402 | License. However, in accepting such obligations, You may act only 403 | on Your own behalf and on Your sole responsibility, not on behalf 404 | of any other Contributor, and only if You agree to indemnify, 405 | defend, and hold each Contributor harmless for any liability 406 | incurred by, or claims asserted against, such Contributor by reason 407 | of your accepting any such warranty or additional liability. 408 | 409 | END OF TERMS AND CONDITIONS 410 | 411 | APPENDIX: How to apply the Apache License to your work. 412 | 413 | To apply the Apache License to your work, attach the following 414 | boilerplate notice, with the fields enclosed by brackets "{}" 415 | replaced with your own identifying information. (Don't include 416 | the brackets!) The text should be enclosed in the appropriate 417 | comment syntax for the file format. We also recommend that a 418 | file or class name and description of purpose be included on the 419 | same "printed page" as the copyright notice for easier 420 | identification within third-party archives. 421 | 422 | Copyright 2018 Gregor Martynus and other contributors. 423 | 424 | Licensed under the Apache License, Version 2.0 (the "License"); 425 | you may not use this file except in compliance with the License. 426 | You may obtain a copy of the License at 427 | 428 | http://www.apache.org/licenses/LICENSE-2.0 429 | 430 | Unless required by applicable law or agreed to in writing, software 431 | distributed under the License is distributed on an "AS IS" BASIS, 432 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 433 | See the License for the specific language governing permissions and 434 | limitations under the License. 435 | 436 | 437 | deprecation 438 | ISC 439 | The ISC License 440 | 441 | Copyright (c) Gregor Martynus and contributors 442 | 443 | Permission to use, copy, modify, and/or distribute this software for any 444 | purpose with or without fee is hereby granted, provided that the above 445 | copyright notice and this permission notice appear in all copies. 446 | 447 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 448 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 449 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 450 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 451 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 452 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 453 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 454 | 455 | 456 | is-plain-object 457 | MIT 458 | The MIT License (MIT) 459 | 460 | Copyright (c) 2014-2017, Jon Schlinkert. 461 | 462 | Permission is hereby granted, free of charge, to any person obtaining a copy 463 | of this software and associated documentation files (the "Software"), to deal 464 | in the Software without restriction, including without limitation the rights 465 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 466 | copies of the Software, and to permit persons to whom the Software is 467 | furnished to do so, subject to the following conditions: 468 | 469 | The above copyright notice and this permission notice shall be included in 470 | all copies or substantial portions of the Software. 471 | 472 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 473 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 474 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 475 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 476 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 477 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 478 | THE SOFTWARE. 479 | 480 | 481 | node-fetch 482 | MIT 483 | The MIT License (MIT) 484 | 485 | Copyright (c) 2016 David Frank 486 | 487 | Permission is hereby granted, free of charge, to any person obtaining a copy 488 | of this software and associated documentation files (the "Software"), to deal 489 | in the Software without restriction, including without limitation the rights 490 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 491 | copies of the Software, and to permit persons to whom the Software is 492 | furnished to do so, subject to the following conditions: 493 | 494 | The above copyright notice and this permission notice shall be included in all 495 | copies or substantial portions of the Software. 496 | 497 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 498 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 499 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 500 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 501 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 502 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 503 | SOFTWARE. 504 | 505 | 506 | 507 | once 508 | ISC 509 | The ISC License 510 | 511 | Copyright (c) Isaac Z. Schlueter and Contributors 512 | 513 | Permission to use, copy, modify, and/or distribute this software for any 514 | purpose with or without fee is hereby granted, provided that the above 515 | copyright notice and this permission notice appear in all copies. 516 | 517 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 518 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 519 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 520 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 521 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 522 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 523 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 524 | 525 | 526 | tr46 527 | MIT 528 | 529 | tunnel 530 | MIT 531 | The MIT License (MIT) 532 | 533 | Copyright (c) 2012 Koichi Kobayashi 534 | 535 | Permission is hereby granted, free of charge, to any person obtaining a copy 536 | of this software and associated documentation files (the "Software"), to deal 537 | in the Software without restriction, including without limitation the rights 538 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 539 | copies of the Software, and to permit persons to whom the Software is 540 | furnished to do so, subject to the following conditions: 541 | 542 | The above copyright notice and this permission notice shall be included in 543 | all copies or substantial portions of the Software. 544 | 545 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 546 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 547 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 548 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 549 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 550 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 551 | THE SOFTWARE. 552 | 553 | 554 | universal-user-agent 555 | ISC 556 | # [ISC License](https://spdx.org/licenses/ISC) 557 | 558 | Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m) 559 | 560 | 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. 561 | 562 | 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. 563 | 564 | 565 | uuid 566 | MIT 567 | The MIT License (MIT) 568 | 569 | Copyright (c) 2010-2020 Robert Kieffer and other contributors 570 | 571 | 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: 572 | 573 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 574 | 575 | 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. 576 | 577 | 578 | webidl-conversions 579 | BSD-2-Clause 580 | # The BSD 2-Clause License 581 | 582 | Copyright (c) 2014, Domenic Denicola 583 | All rights reserved. 584 | 585 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 586 | 587 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 588 | 589 | 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. 590 | 591 | 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. 592 | 593 | 594 | whatwg-url 595 | MIT 596 | The MIT License (MIT) 597 | 598 | Copyright (c) 2015–2016 Sebastian Mayr 599 | 600 | Permission is hereby granted, free of charge, to any person obtaining a copy 601 | of this software and associated documentation files (the "Software"), to deal 602 | in the Software without restriction, including without limitation the rights 603 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 604 | copies of the Software, and to permit persons to whom the Software is 605 | furnished to do so, subject to the following conditions: 606 | 607 | The above copyright notice and this permission notice shall be included in 608 | all copies or substantial portions of the Software. 609 | 610 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 611 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 612 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 613 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 614 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 615 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 616 | THE SOFTWARE. 617 | 618 | 619 | wrappy 620 | ISC 621 | The ISC License 622 | 623 | Copyright (c) Isaac Z. Schlueter and Contributors 624 | 625 | Permission to use, copy, modify, and/or distribute this software for any 626 | purpose with or without fee is hereby granted, provided that the above 627 | copyright notice and this permission notice appear in all copies. 628 | 629 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 630 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 631 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 632 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 633 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 634 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 635 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 636 | -------------------------------------------------------------------------------- /dist/sourcemap-register.js: -------------------------------------------------------------------------------- 1 | (()=>{var e={650:e=>{var r=Object.prototype.toString;var n=typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},274:(e,r,n)=>{var t=n(339);var o=Object.prototype.hasOwnProperty;var i=typeof Map!=="undefined";function ArraySet(){this._array=[];this._set=i?new Map:Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,r){var n=new ArraySet;for(var t=0,o=e.length;t=0){return r}}else{var n=t.toSetString(e);if(o.call(this._set,n)){return this._set[n]}}throw new Error('"'+e+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e{var t=n(190);var o=5;var i=1<>1;return r?-n:n}r.encode=function base64VLQ_encode(e){var r="";var n;var i=toVLQSigned(e);do{n=i&a;i>>>=o;if(i>0){n|=u}r+=t.encode(n)}while(i>0);return r};r.decode=function base64VLQ_decode(e,r,n){var i=e.length;var s=0;var l=0;var c,p;do{if(r>=i){throw new Error("Expected more digits in base 64 VLQ value.")}p=t.decode(e.charCodeAt(r++));if(p===-1){throw new Error("Invalid base64 digit: "+e.charAt(r-1))}c=!!(p&u);p&=a;s=s+(p<{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(0<=e&&e{r.GREATEST_LOWER_BOUND=1;r.LEAST_UPPER_BOUND=2;function recursiveSearch(e,n,t,o,i,a){var u=Math.floor((n-e)/2)+e;var s=i(t,o[u],true);if(s===0){return u}else if(s>0){if(n-u>1){return recursiveSearch(u,n,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return n1){return recursiveSearch(e,u,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return u}else{return e<0?-1:e}}}r.search=function search(e,n,t,o){if(n.length===0){return-1}var i=recursiveSearch(-1,n.length,e,n,t,o||r.GREATEST_LOWER_BOUND);if(i<0){return-1}while(i-1>=0){if(t(n[i],n[i-1],true)!==0){break}--i}return i}},680:(e,r,n)=>{var t=n(339);function generatedPositionAfter(e,r){var n=e.generatedLine;var o=r.generatedLine;var i=e.generatedColumn;var a=r.generatedColumn;return o>n||o==n&&a>=i||t.compareByGeneratedPositionsInflated(e,r)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,r){this._array.forEach(e,r)};MappingList.prototype.add=function MappingList_add(e){if(generatedPositionAfter(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(t.compareByGeneratedPositionsInflated);this._sorted=true}return this._array};r.H=MappingList},758:(e,r)=>{function swap(e,r,n){var t=e[r];e[r]=e[n];e[n]=t}function randomIntInRange(e,r){return Math.round(e+Math.random()*(r-e))}function doQuickSort(e,r,n,t){if(n{var t;var o=n(339);var i=n(345);var a=n(274).I;var u=n(449);var s=n(758).U;function SourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}return n.sections!=null?new IndexedSourceMapConsumer(n,r):new BasicSourceMapConsumer(n,r)}SourceMapConsumer.fromSourceMap=function(e,r){return BasicSourceMapConsumer.fromSourceMap(e,r)};SourceMapConsumer.prototype._version=3;SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{configurable:true,enumerable:true,get:function(){if(!this.__generatedMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{configurable:true,enumerable:true,get:function(){if(!this.__originalMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._charIsMappingSeparator=function SourceMapConsumer_charIsMappingSeparator(e,r){var n=e.charAt(r);return n===";"||n===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,r){throw new Error("Subclasses must implement _parseMappings")};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.GREATEST_LOWER_BOUND=1;SourceMapConsumer.LEAST_UPPER_BOUND=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(e,r,n){var t=r||null;var i=n||SourceMapConsumer.GENERATED_ORDER;var a;switch(i){case SourceMapConsumer.GENERATED_ORDER:a=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;a.map((function(e){var r=e.source===null?null:this._sources.at(e.source);r=o.computeSourceURL(u,r,this._sourceMapURL);return{source:r,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name===null?null:this._names.at(e.name)}}),this).forEach(e,t)};SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(e){var r=o.getArg(e,"line");var n={source:o.getArg(e,"source"),originalLine:r,originalColumn:o.getArg(e,"column",0)};n.source=this._findSourceIndex(n.source);if(n.source<0){return[]}var t=[];var a=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,i.LEAST_UPPER_BOUND);if(a>=0){var u=this._originalMappings[a];if(e.column===undefined){var s=u.originalLine;while(u&&u.originalLine===s){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}else{var l=u.originalColumn;while(u&&u.originalLine===r&&u.originalColumn==l){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}}return t};r.SourceMapConsumer=SourceMapConsumer;function BasicSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sources");var u=o.getArg(n,"names",[]);var s=o.getArg(n,"sourceRoot",null);var l=o.getArg(n,"sourcesContent",null);var c=o.getArg(n,"mappings");var p=o.getArg(n,"file",null);if(t!=this._version){throw new Error("Unsupported version: "+t)}if(s){s=o.normalize(s)}i=i.map(String).map(o.normalize).map((function(e){return s&&o.isAbsolute(s)&&o.isAbsolute(e)?o.relative(s,e):e}));this._names=a.fromArray(u.map(String),true);this._sources=a.fromArray(i,true);this._absoluteSources=this._sources.toArray().map((function(e){return o.computeSourceURL(s,e,r)}));this.sourceRoot=s;this.sourcesContent=l;this._mappings=c;this._sourceMapURL=r;this.file=p}BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype);BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer;BasicSourceMapConsumer.prototype._findSourceIndex=function(e){var r=e;if(this.sourceRoot!=null){r=o.relative(this.sourceRoot,r)}if(this._sources.has(r)){return this._sources.indexOf(r)}var n;for(n=0;n1){v.source=l+_[1];l+=_[1];v.originalLine=i+_[2];i=v.originalLine;v.originalLine+=1;v.originalColumn=a+_[3];a=v.originalColumn;if(_.length>4){v.name=c+_[4];c+=_[4]}}m.push(v);if(typeof v.originalLine==="number"){d.push(v)}}}s(m,o.compareByGeneratedPositionsDeflated);this.__generatedMappings=m;s(d,o.compareByOriginalPositions);this.__originalMappings=d};BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(e,r,n,t,o,a){if(e[n]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+e[n])}if(e[t]<0){throw new TypeError("Column must be greater than or equal to 0, got "+e[t])}return i.search(e,r,o,a)};BasicSourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var e=0;e=0){var t=this._generatedMappings[n];if(t.generatedLine===r.generatedLine){var i=o.getArg(t,"source",null);if(i!==null){i=this._sources.at(i);i=o.computeSourceURL(this.sourceRoot,i,this._sourceMapURL)}var a=o.getArg(t,"name",null);if(a!==null){a=this._names.at(a)}return{source:i,line:o.getArg(t,"originalLine",null),column:o.getArg(t,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function BasicSourceMapConsumer_hasContentsOfAllSources(){if(!this.sourcesContent){return false}return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return e==null}))};BasicSourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(e,r){if(!this.sourcesContent){return null}var n=this._findSourceIndex(e);if(n>=0){return this.sourcesContent[n]}var t=e;if(this.sourceRoot!=null){t=o.relative(this.sourceRoot,t)}var i;if(this.sourceRoot!=null&&(i=o.urlParse(this.sourceRoot))){var a=t.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a)){return this.sourcesContent[this._sources.indexOf(a)]}if((!i.path||i.path=="/")&&this._sources.has("/"+t)){return this.sourcesContent[this._sources.indexOf("/"+t)]}}if(r){return null}else{throw new Error('"'+t+'" is not in the SourceMap.')}};BasicSourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(e){var r=o.getArg(e,"source");r=this._findSourceIndex(r);if(r<0){return{line:null,column:null,lastColumn:null}}var n={source:r,originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")};var t=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(t>=0){var i=this._originalMappings[t];if(i.source===n.source){return{line:o.getArg(i,"generatedLine",null),column:o.getArg(i,"generatedColumn",null),lastColumn:o.getArg(i,"lastGeneratedColumn",null)}}}return{line:null,column:null,lastColumn:null}};t=BasicSourceMapConsumer;function IndexedSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sections");if(t!=this._version){throw new Error("Unsupported version: "+t)}this._sources=new a;this._names=new a;var u={line:-1,column:0};this._sections=i.map((function(e){if(e.url){throw new Error("Support for url field in sections not implemented.")}var n=o.getArg(e,"offset");var t=o.getArg(n,"line");var i=o.getArg(n,"column");if(t{var t=n(449);var o=n(339);var i=n(274).I;var a=n(680).H;function SourceMapGenerator(e){if(!e){e={}}this._file=o.getArg(e,"file",null);this._sourceRoot=o.getArg(e,"sourceRoot",null);this._skipValidation=o.getArg(e,"skipValidation",false);this._sources=new i;this._names=new i;this._mappings=new a;this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(e){var r=e.sourceRoot;var n=new SourceMapGenerator({file:e.file,sourceRoot:r});e.eachMapping((function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){t.source=e.source;if(r!=null){t.source=o.relative(r,t.source)}t.original={line:e.originalLine,column:e.originalColumn};if(e.name!=null){t.name=e.name}}n.addMapping(t)}));e.sources.forEach((function(t){var i=t;if(r!==null){i=o.relative(r,t)}if(!n._sources.has(i)){n._sources.add(i)}var a=e.sourceContentFor(t);if(a!=null){n.setSourceContent(t,a)}}));return n};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(e){var r=o.getArg(e,"generated");var n=o.getArg(e,"original",null);var t=o.getArg(e,"source",null);var i=o.getArg(e,"name",null);if(!this._skipValidation){this._validateMapping(r,n,t,i)}if(t!=null){t=String(t);if(!this._sources.has(t)){this._sources.add(t)}}if(i!=null){i=String(i);if(!this._names.has(i)){this._names.add(i)}}this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:t,name:i})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(e,r){var n=e;if(this._sourceRoot!=null){n=o.relative(this._sourceRoot,n)}if(r!=null){if(!this._sourcesContents){this._sourcesContents=Object.create(null)}this._sourcesContents[o.toSetString(n)]=r}else if(this._sourcesContents){delete this._sourcesContents[o.toSetString(n)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(e,r,n){var t=r;if(r==null){if(e.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}t=e.file}var a=this._sourceRoot;if(a!=null){t=o.relative(a,t)}var u=new i;var s=new i;this._mappings.unsortedForEach((function(r){if(r.source===t&&r.originalLine!=null){var i=e.originalPositionFor({line:r.originalLine,column:r.originalColumn});if(i.source!=null){r.source=i.source;if(n!=null){r.source=o.join(n,r.source)}if(a!=null){r.source=o.relative(a,r.source)}r.originalLine=i.line;r.originalColumn=i.column;if(i.name!=null){r.name=i.name}}}var l=r.source;if(l!=null&&!u.has(l)){u.add(l)}var c=r.name;if(c!=null&&!s.has(c)){s.add(c)}}),this);this._sources=u;this._names=s;e.sources.forEach((function(r){var t=e.sourceContentFor(r);if(t!=null){if(n!=null){r=o.join(n,r)}if(a!=null){r=o.relative(a,r)}this.setSourceContent(r,t)}}),this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(e,r,n,t){if(r&&typeof r.line!=="number"&&typeof r.column!=="number"){throw new Error("original.line and original.column are not numbers -- you probably meant to omit "+"the original mapping entirely and only map the generated position. If so, pass "+"null for the original mapping instead of an object with empty or null values.")}if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!t){return}else if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:t}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var e=0;var r=1;var n=0;var i=0;var a=0;var u=0;var s="";var l;var c;var p;var f;var g=this._mappings.toArray();for(var h=0,d=g.length;h0){if(!o.compareByGeneratedPositionsInflated(c,g[h-1])){continue}l+=","}}l+=t.encode(c.generatedColumn-e);e=c.generatedColumn;if(c.source!=null){f=this._sources.indexOf(c.source);l+=t.encode(f-u);u=f;l+=t.encode(c.originalLine-1-i);i=c.originalLine-1;l+=t.encode(c.originalColumn-n);n=c.originalColumn;if(c.name!=null){p=this._names.indexOf(c.name);l+=t.encode(p-a);a=p}}s+=l}return s};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(e,r){return e.map((function(e){if(!this._sourcesContents){return null}if(r!=null){e=o.relative(r,e)}var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){e.file=this._file}if(this._sourceRoot!=null){e.sourceRoot=this._sourceRoot}if(this._sourcesContents){e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)}return e};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())};r.h=SourceMapGenerator},351:(e,r,n)=>{var t;var o=n(591).h;var i=n(339);var a=/(\r?\n)/;var u=10;var s="$$$isSourceNode$$$";function SourceNode(e,r,n,t,o){this.children=[];this.sourceContents={};this.line=e==null?null:e;this.column=r==null?null:r;this.source=n==null?null:n;this.name=o==null?null:o;this[s]=true;if(t!=null)this.add(t)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(e,r,n){var t=new SourceNode;var o=e.split(a);var u=0;var shiftNextLine=function(){var e=getNextLine();var r=getNextLine()||"";return e+r;function getNextLine(){return u=0;r--){this.prepend(e[r])}}else if(e[s]||typeof e==="string"){this.children.unshift(e)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};SourceNode.prototype.walk=function SourceNode_walk(e){var r;for(var n=0,t=this.children.length;n0){r=[];for(n=0;n{function getArg(e,r,n){if(r in e){return e[r]}else if(arguments.length===3){return n}else{throw new Error('"'+r+'" is a required argument.')}}r.getArg=getArg;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;var t=/^data:.+\,.+$/;function urlParse(e){var r=e.match(n);if(!r){return null}return{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}}r.urlParse=urlParse;function urlGenerate(e){var r="";if(e.scheme){r+=e.scheme+":"}r+="//";if(e.auth){r+=e.auth+"@"}if(e.host){r+=e.host}if(e.port){r+=":"+e.port}if(e.path){r+=e.path}return r}r.urlGenerate=urlGenerate;function normalize(e){var n=e;var t=urlParse(e);if(t){if(!t.path){return e}n=t.path}var o=r.isAbsolute(n);var i=n.split(/\/+/);for(var a,u=0,s=i.length-1;s>=0;s--){a=i[s];if(a==="."){i.splice(s,1)}else if(a===".."){u++}else if(u>0){if(a===""){i.splice(s+1,u);u=0}else{i.splice(s,2);u--}}}n=i.join("/");if(n===""){n=o?"/":"."}if(t){t.path=n;return urlGenerate(t)}return n}r.normalize=normalize;function join(e,r){if(e===""){e="."}if(r===""){r="."}var n=urlParse(r);var o=urlParse(e);if(o){e=o.path||"/"}if(n&&!n.scheme){if(o){n.scheme=o.scheme}return urlGenerate(n)}if(n||r.match(t)){return r}if(o&&!o.host&&!o.path){o.host=r;return urlGenerate(o)}var i=r.charAt(0)==="/"?r:normalize(e.replace(/\/+$/,"")+"/"+r);if(o){o.path=i;return urlGenerate(o)}return i}r.join=join;r.isAbsolute=function(e){return e.charAt(0)==="/"||n.test(e)};function relative(e,r){if(e===""){e="."}e=e.replace(/\/$/,"");var n=0;while(r.indexOf(e+"/")!==0){var t=e.lastIndexOf("/");if(t<0){return r}e=e.slice(0,t);if(e.match(/^([^\/]+:\/)?\/*$/)){return r}++n}return Array(n+1).join("../")+r.substr(e.length+1)}r.relative=relative;var o=function(){var e=Object.create(null);return!("__proto__"in e)}();function identity(e){return e}function toSetString(e){if(isProtoString(e)){return"$"+e}return e}r.toSetString=o?identity:toSetString;function fromSetString(e){if(isProtoString(e)){return e.slice(1)}return e}r.fromSetString=o?identity:fromSetString;function isProtoString(e){if(!e){return false}var r=e.length;if(r<9){return false}if(e.charCodeAt(r-1)!==95||e.charCodeAt(r-2)!==95||e.charCodeAt(r-3)!==111||e.charCodeAt(r-4)!==116||e.charCodeAt(r-5)!==111||e.charCodeAt(r-6)!==114||e.charCodeAt(r-7)!==112||e.charCodeAt(r-8)!==95||e.charCodeAt(r-9)!==95){return false}for(var n=r-10;n>=0;n--){if(e.charCodeAt(n)!==36){return false}}return true}function compareByOriginalPositions(e,r,n){var t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0||n){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0){return t}t=e.generatedLine-r.generatedLine;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositionsDeflated(e,r,n){var t=e.generatedLine-r.generatedLine;if(t!==0){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0||n){return t}t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsDeflated=compareByGeneratedPositionsDeflated;function strcmp(e,r){if(e===r){return 0}if(e===null){return 1}if(r===null){return-1}if(e>r){return 1}return-1}function compareByGeneratedPositionsInflated(e,r){var n=e.generatedLine-r.generatedLine;if(n!==0){return n}n=e.generatedColumn-r.generatedColumn;if(n!==0){return n}n=strcmp(e.source,r.source);if(n!==0){return n}n=e.originalLine-r.originalLine;if(n!==0){return n}n=e.originalColumn-r.originalColumn;if(n!==0){return n}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated;function parseSourceMapInput(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}r.parseSourceMapInput=parseSourceMapInput;function computeSourceURL(e,r,n){r=r||"";if(e){if(e[e.length-1]!=="/"&&r[0]!=="/"){e+="/"}r=e+r}if(n){var t=urlParse(n);if(!t){throw new Error("sourceMapURL could not be parsed")}if(t.path){var o=t.path.lastIndexOf("/");if(o>=0){t.path=t.path.substring(0,o+1)}}r=join(urlGenerate(t),r)}return normalize(r)}r.computeSourceURL=computeSourceURL},997:(e,r,n)=>{n(591).h;r.SourceMapConsumer=n(952).SourceMapConsumer;n(351)},284:(e,r,n)=>{e=n.nmd(e);var t=n(997).SourceMapConsumer;var o=n(17);var i;try{i=n(147);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var a=n(650);function dynamicRequire(e,r){return e.require(r)}var u=false;var s=false;var l=false;var c="auto";var p={};var f={};var g=/^data:application\/json[^,]+base64,/;var h=[];var d=[];function isInBrowser(){if(c==="browser")return true;if(c==="node")return false;return typeof window!=="undefined"&&typeof XMLHttpRequest==="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hasGlobalProcessEventEmitter(){return typeof process==="object"&&process!==null&&typeof process.on==="function"}function globalProcessVersion(){if(typeof process==="object"&&process!==null){return process.version}else{return""}}function globalProcessStderr(){if(typeof process==="object"&&process!==null){return process.stderr}}function globalProcessExit(e){if(typeof process==="object"&&process!==null&&typeof process.exit==="function"){return process.exit(e)}}function handlerExec(e){return function(r){for(var n=0;n"}var n=this.getLineNumber();if(n!=null){r+=":"+n;var t=this.getColumnNumber();if(t){r+=":"+t}}}var o="";var i=this.getFunctionName();var a=true;var u=this.isConstructor();var s=!(this.isToplevel()||u);if(s){var l=this.getTypeName();if(l==="[object Object]"){l="null"}var c=this.getMethodName();if(i){if(l&&i.indexOf(l)!=0){o+=l+"."}o+=i;if(c&&i.indexOf("."+c)!=i.length-c.length-1){o+=" [as "+c+"]"}}else{o+=l+"."+(c||"")}}else if(u){o+="new "+(i||"")}else if(i){o+=i}else{o+=r;a=false}if(a){o+=" ("+r+")"}return o}function cloneCallSite(e){var r={};Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(n){r[n]=/^(?:is|get)/.test(n)?function(){return e[n].call(e)}:e[n]}));r.toString=CallSiteToString;return r}function wrapCallSite(e,r){if(r===undefined){r={nextPosition:null,curPosition:null}}if(e.isNative()){r.curPosition=null;return e}var n=e.getFileName()||e.getScriptNameOrSourceURL();if(n){var t=e.getLineNumber();var o=e.getColumnNumber()-1;var i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;var a=i.test(globalProcessVersion())?0:62;if(t===1&&o>a&&!isInBrowser()&&!e.isEval()){o-=a}var u=mapSourcePosition({source:n,line:t,column:o});r.curPosition=u;e=cloneCallSite(e);var s=e.getFunctionName;e.getFunctionName=function(){if(r.nextPosition==null){return s()}return r.nextPosition.name||s()};e.getFileName=function(){return u.source};e.getLineNumber=function(){return u.line};e.getColumnNumber=function(){return u.column+1};e.getScriptNameOrSourceURL=function(){return u.source};return e}var l=e.isEval()&&e.getEvalOrigin();if(l){l=mapEvalOrigin(l);e=cloneCallSite(e);e.getEvalOrigin=function(){return l};return e}return e}function prepareStackTrace(e,r){if(l){p={};f={}}var n=e.name||"Error";var t=e.message||"";var o=n+": "+t;var i={nextPosition:null,curPosition:null};var a=[];for(var u=r.length-1;u>=0;u--){a.push("\n at "+wrapCallSite(r[u],i));i.nextPosition=i.curPosition}i.curPosition=i.nextPosition=null;return o+a.reverse().join("")}function getErrorSource(e){var r=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(e.stack);if(r){var n=r[1];var t=+r[2];var o=+r[3];var a=p[n];if(!a&&i&&i.existsSync(n)){try{a=i.readFileSync(n,"utf8")}catch(e){a=""}}if(a){var u=a.split(/(?:\r\n|\r|\n)/)[t-1];if(u){return n+":"+t+"\n"+u+"\n"+new Array(o).join(" ")+"^"}}}return null}function printErrorAndExit(e){var r=getErrorSource(e);var n=globalProcessStderr();if(n&&n._handle&&n._handle.setBlocking){n._handle.setBlocking(true)}if(r){console.error();console.error(r)}console.error(e.stack);globalProcessExit(1)}function shimEmitUncaughtException(){var e=process.emit;process.emit=function(r){if(r==="uncaughtException"){var n=arguments[1]&&arguments[1].stack;var t=this.listeners(r).length>0;if(n&&!t){return printErrorAndExit(arguments[1])}}return e.apply(this,arguments)}}var S=h.slice(0);var _=d.slice(0);r.wrapCallSite=wrapCallSite;r.getErrorSource=getErrorSource;r.mapSourcePosition=mapSourcePosition;r.retrieveSourceMap=v;r.install=function(r){r=r||{};if(r.environment){c=r.environment;if(["node","browser","auto"].indexOf(c)===-1){throw new Error("environment "+c+" was unknown. Available options are {auto, browser, node}")}}if(r.retrieveFile){if(r.overrideRetrieveFile){h.length=0}h.unshift(r.retrieveFile)}if(r.retrieveSourceMap){if(r.overrideRetrieveSourceMap){d.length=0}d.unshift(r.retrieveSourceMap)}if(r.hookRequire&&!isInBrowser()){var n=dynamicRequire(e,"module");var t=n.prototype._compile;if(!t.__sourceMapSupport){n.prototype._compile=function(e,r){p[r]=e;f[r]=undefined;return t.call(this,e,r)};n.prototype._compile.__sourceMapSupport=true}}if(!l){l="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:false}if(!u){u=true;Error.prepareStackTrace=prepareStackTrace}if(!s){var o="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:true;try{var i=dynamicRequire(e,"worker_threads");if(i.isMainThread===false){o=false}}catch(e){}if(o&&hasGlobalProcessEventEmitter()){s=true;shimEmitUncaughtException()}}};r.resetRetrieveHandlers=function(){h.length=0;d.length=0;h=S.slice(0);d=_.slice(0);v=handlerExec(d);m=handlerExec(h)}},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")}};var r={};function __webpack_require__(n){var t=r[n];if(t!==undefined){return t.exports}var o=r[n]={id:n,loaded:false,exports:{}};var i=true;try{e[n](o,o.exports,__webpack_require__);i=false}finally{if(i)delete r[n]}o.loaded=true;return o.exports}(()=>{__webpack_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __webpack_require__!=="undefined")__webpack_require__.ab=__dirname+"/";var n={};(()=>{__webpack_require__(284).install()})();module.exports=n})(); --------------------------------------------------------------------------------