├── .gitkeep ├── .eslintignore ├── .gitattributes ├── src ├── model │ ├── cache │ │ ├── SummaryModel.js │ │ ├── SummaryFileModel.js │ │ └── ViewModel.js │ ├── input │ │ ├── HeaderModel.js │ │ └── RequestModel.js │ ├── octokit │ │ ├── ResponseModel.js │ │ ├── ViewModel.js │ │ ├── RequestModel.js │ │ ├── RespositoryModel.js │ │ ├── ResponseViewsModel.js │ │ ├── ResponseRepositoryModel.js │ │ ├── DataModel.js │ │ └── ResponseCommitsModel.js │ ├── file │ │ ├── SummaryFileModel.js │ │ ├── GraphFileModel.js │ │ ├── ConfigFileModel.js │ │ └── CacheFileModel.js │ └── config │ │ └── ConfigDataModel.js ├── index.test.js ├── helper │ ├── git │ │ ├── pull-git.js │ │ ├── push-git.js │ │ └── commit-git.js │ ├── directory │ │ ├── svg-directory.js │ │ ├── cache-directory.js │ │ ├── graph-directory.js │ │ └── readme-directory.js │ ├── file │ │ ├── svg-file.js │ │ ├── markdown-file.js │ │ ├── json-file.js │ │ └── graph-file.js │ ├── octokit │ │ ├── request-repository.js │ │ ├── request-views.js │ │ ├── request-commits.js │ │ ├── verify-commits.js │ │ └── request-octokit.js │ ├── svg │ │ ├── summary-svg.js │ │ ├── profile_svg.js │ │ └── svg-file.js │ ├── readme │ │ ├── year-readme.js │ │ ├── week-readme.js │ │ ├── month-readme.js │ │ ├── summary-readme.js │ │ └── markdown-template.js │ ├── graph │ │ ├── year-graph.js │ │ ├── week-graph.js │ │ └── month-graph.js │ ├── cache │ │ ├── week-cache.js │ │ ├── month-cache.js │ │ ├── record-cache.js │ │ ├── max-cache.js │ │ ├── year-cache.js │ │ └── summary-cache.js │ └── config │ │ └── input.js ├── core │ ├── git.js │ ├── directory.js │ ├── octokit.js │ ├── range.js │ ├── file.js │ └── record.js └── index.js ├── config.json ├── README.md ├── .eslintrc.json ├── action.yml ├── .github └── workflows │ └── test.yml ├── package.json ├── LICENSE ├── .gitignore └── dist ├── sourcemap-register.js └── licenses.txt /.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | dist/** -diff linguist-generated=true -------------------------------------------------------------------------------- /src/model/cache/SummaryModel.js: -------------------------------------------------------------------------------- 1 | let SummaryModel = function (uniques, count) { 2 | this.uniques = uniques; 3 | this.count = count; 4 | } 5 | module.exports = SummaryModel; -------------------------------------------------------------------------------- /src/model/input/HeaderModel.js: -------------------------------------------------------------------------------- 1 | let HeaderModel = function (authKey, userAgent) { 2 | this.authKey = authKey; 3 | this.userAgent = userAgent; 4 | } 5 | module.exports = HeaderModel; -------------------------------------------------------------------------------- /src/model/octokit/ResponseModel.js: -------------------------------------------------------------------------------- 1 | let ResponseModel = function (status, response) { 2 | this.status = status; 3 | this.response = response; 4 | } 5 | module.exports = ResponseModel; -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "devMode": "true", 3 | "advancedMode": "true", 4 | "language": "en-US", 5 | "repository": [ 6 | "android-vpn-client-ics-openvpn", 7 | "top-github-users" 8 | ] 9 | } -------------------------------------------------------------------------------- /src/model/cache/SummaryFileModel.js: -------------------------------------------------------------------------------- 1 | let SummaryFileModel = function (timestamp, summary) { 2 | this.timestamp = timestamp; 3 | this.summary = summary; 4 | } 5 | module.exports = SummaryFileModel; -------------------------------------------------------------------------------- /src/model/file/SummaryFileModel.js: -------------------------------------------------------------------------------- 1 | let SummaryFileModel = function (status, response) { 2 | this.status = status; 3 | if (status) this.views = response; 4 | } 5 | module.exports = SummaryFileModel; -------------------------------------------------------------------------------- /src/model/octokit/ViewModel.js: -------------------------------------------------------------------------------- 1 | let ViewModel = function (view) { 2 | this.timestamp = new Date(view.timestamp); 3 | this.count = view.count; 4 | this.uniques = view.uniques; 5 | } 6 | module.exports = ViewModel; -------------------------------------------------------------------------------- /src/model/octokit/RequestModel.js: -------------------------------------------------------------------------------- 1 | let RequestModel = function (url, username, repository) { 2 | this.url = url; 3 | this.username = username; 4 | this.repository = repository; 5 | } 6 | module.exports = RequestModel; -------------------------------------------------------------------------------- /src/model/file/GraphFileModel.js: -------------------------------------------------------------------------------- 1 | let GraphFileModel = function (labels, uniqueData, countData) { 2 | this.labels = labels; 3 | this.uniqueData = uniqueData; 4 | this.countData = countData; 5 | } 6 | module.exports = GraphFileModel; -------------------------------------------------------------------------------- /src/model/octokit/RespositoryModel.js: -------------------------------------------------------------------------------- 1 | let Repository = function (data) { 2 | this.repositoryName = data.name; 3 | this.repositoryId = data.id; 4 | this.ownerLogin = data.owner.login; 5 | this.ownerId = data.owner.id; 6 | } 7 | module.exports = Repository; -------------------------------------------------------------------------------- /src/model/file/ConfigFileModel.js: -------------------------------------------------------------------------------- 1 | const ConfigDataModel = require('../../model/config/ConfigDataModel'); 2 | let ConfigFileModel = function (status, file) { 3 | this.status = status; 4 | if (status) this.data = new ConfigDataModel(file); 5 | } 6 | module.exports = ConfigFileModel; -------------------------------------------------------------------------------- /src/model/cache/ViewModel.js: -------------------------------------------------------------------------------- 1 | let ViewModel = function (view) { 2 | let getDate = function (timestamp) { 3 | return new Date(timestamp); 4 | } 5 | this.timestamp = getDate(view.timestamp); 6 | this.count = view.count; 7 | this.uniques = view.uniques; 8 | } 9 | module.exports = ViewModel; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # github-profile-views-counter-action 2 | GitHub Action for setting up insights of your repositories on your workflow without using any third-party apps. 3 | 4 | 5 | ## Watch this video 6 | [![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/K6FYiP_XRuU/0.jpg)](https://www.youtube.com/watch?v=K6FYiP_XRuU) 7 | -------------------------------------------------------------------------------- /src/index.test.js: -------------------------------------------------------------------------------- 1 | const cp = require('child_process'); 2 | const path = require('path'); 3 | 4 | // shows how the runner will run a javascript action with env / stdout protocol 5 | test('test runs', () => { 6 | const ip = path.join(__dirname, 'index.js'); 7 | console.log(cp.execSync(`node ${ip}`, {env: process.env}).toString()); 8 | }) 9 | -------------------------------------------------------------------------------- /src/model/octokit/ResponseViewsModel.js: -------------------------------------------------------------------------------- 1 | const DataModel = require('./DataModel'); 2 | let ResponseViewsModel = function (status, response) { 3 | this.status = status; 4 | if(status){ 5 | this.response = new DataModel(response.data); 6 | } else { 7 | this.response = response; 8 | } 9 | } 10 | module.exports = ResponseViewsModel; -------------------------------------------------------------------------------- /src/model/octokit/ResponseRepositoryModel.js: -------------------------------------------------------------------------------- 1 | const RepositoryModel = require('./RespositoryModel'); 2 | let ResponseRepositoryModel = function (status, response) { 3 | this.status = status; 4 | if(status){ 5 | this.response = new RepositoryModel(response.data); 6 | } else { 7 | this.response = response; 8 | } 9 | } 10 | module.exports = ResponseRepositoryModel; -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "commonjs": true, 4 | "es6": true, 5 | "jest": true, 6 | "node": true 7 | }, 8 | "extends": "eslint:recommended", 9 | "globals": { 10 | "Atomics": "readonly", 11 | "SharedArrayBuffer": "readonly" 12 | }, 13 | "parserOptions": { 14 | "ecmaVersion": 2018 15 | }, 16 | "rules": { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/helper/git/pull-git.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const git = require('../../core/git'); 3 | let pullGit = function () { 4 | let pull = async function () { 5 | core.info(`Git Pull`) 6 | try { 7 | await git.pull(); 8 | } catch (error) { 9 | core.info(error); 10 | } 11 | } 12 | return { 13 | pull: pull 14 | }; 15 | }(); 16 | module.exports = pullGit; -------------------------------------------------------------------------------- /src/model/octokit/DataModel.js: -------------------------------------------------------------------------------- 1 | const ViewModel = require('./ViewModel'); 2 | let DataModel = function (data) { 3 | let views = function (views) { 4 | let array = []; 5 | for (const view of views) { 6 | array.push(new ViewModel(view)); 7 | } 8 | return array; 9 | } 10 | this.count = data.count; 11 | this.uniques = data.uniques; 12 | this.views = views(data.views); 13 | } 14 | module.exports = DataModel; -------------------------------------------------------------------------------- /src/helper/git/push-git.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const git = require('../../core/git'); 3 | let pushGit = function () { 4 | const BRANCH = 'master'; 5 | let push = async function () { 6 | core.info(`Git Push`); 7 | try { 8 | await git.push(BRANCH); 9 | } catch (error) { 10 | core.info(error); 11 | } 12 | } 13 | return { 14 | push: push 15 | }; 16 | }(); 17 | module.exports = pushGit; -------------------------------------------------------------------------------- /src/model/file/CacheFileModel.js: -------------------------------------------------------------------------------- 1 | const View = require('../cache/ViewModel'); 2 | let CacheFileModel = function (status, response) { 3 | let getViewsArray = function (views) { 4 | let views_array = []; 5 | for (const view of views) { 6 | views_array.push(new View(view)); 7 | } 8 | return views_array; 9 | } 10 | this.status = status; 11 | if (status) this.views = getViewsArray(response); 12 | } 13 | module.exports = CacheFileModel; -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'JavaScript Action | File Handling and GitHub Operations' 2 | description: 'The repository shows core handling and git operations' 3 | inputs: 4 | repository: # names of the repositories 5 | description: 'names of the repositories' 6 | required: true 7 | dev_mode: # dev mode 8 | description: 'dev mode' 9 | required: true 10 | advanced_mode: # advanced mode 11 | description: 'advanced mode' 12 | required: true 13 | runs: 14 | using: 'node12' 15 | main: 'dist/index.js' 16 | -------------------------------------------------------------------------------- /src/model/octokit/ResponseCommitsModel.js: -------------------------------------------------------------------------------- 1 | let ResponseCommitsModel = function (status, response) { 2 | let author = function (commits) { 3 | let array = []; 4 | for (const commit of commits) { 5 | array.push(commit.author.login); 6 | } 7 | return array; 8 | } 9 | this.status = status; 10 | if(status){ 11 | this.response = author(response); 12 | } else { 13 | this.response = response; 14 | } 15 | } 16 | module.exports = ResponseCommitsModel; -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: "units-test" 2 | on: 3 | 4 | push: 5 | branches: 6 | - main 7 | - 'releases/*' 8 | 9 | jobs: 10 | # unit tests 11 | units: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - run: npm ci 16 | - run: npm test 17 | 18 | # test action works running from the graph 19 | test: 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/checkout@v2 23 | - uses: ./ 24 | with: 25 | milliseconds: 1000 26 | -------------------------------------------------------------------------------- /src/helper/directory/svg-directory.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const directory = require('../../core/directory'); 3 | let svgDirectory = (function () { 4 | let SVG_DIRECTORY = 'svg'; 5 | let create = async function () { 6 | core.info(`If not exist create '${SVG_DIRECTORY}' directory`); 7 | await directory.createDirectory(SVG_DIRECTORY); 8 | await directory.createGitIgnore(SVG_DIRECTORY); 9 | } 10 | return { 11 | create: create 12 | }; 13 | })(); 14 | module.exports = svgDirectory; -------------------------------------------------------------------------------- /src/model/input/RequestModel.js: -------------------------------------------------------------------------------- 1 | let RequestModel = function (status, username, insightsRepository, devMode, advancedMode, language, repository) { 2 | this.status = status; 3 | if (this.status) this.username = username; 4 | if (this.status) this.insightsRepository = insightsRepository; 5 | if (this.status) this.devMode = devMode; 6 | if (this.status) this.advancedMode = advancedMode; 7 | if (this.status) this.language = language; 8 | if (this.status) this.repository = repository; 9 | } 10 | module.exports = RequestModel; -------------------------------------------------------------------------------- /src/helper/directory/cache-directory.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const directory = require('../../core/directory'); 3 | let cacheDirectory = (function () { 4 | let CACHE_DIRECTORY = 'cache'; 5 | let create = async function () { 6 | core.info(`If not exist create '${CACHE_DIRECTORY}' directory`); 7 | await directory.createDirectory(CACHE_DIRECTORY); 8 | await directory.createGitIgnore(CACHE_DIRECTORY); 9 | } 10 | return { 11 | create: create 12 | }; 13 | })(); 14 | module.exports = cacheDirectory; -------------------------------------------------------------------------------- /src/helper/directory/graph-directory.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const directory = require('../../core/directory'); 3 | let graphDirectory = (function () { 4 | let GRAPH_DIRECTORY = 'graph'; 5 | let create = async function () { 6 | core.info(`If not exist create '${GRAPH_DIRECTORY}' directory`); 7 | await directory.createDirectory(GRAPH_DIRECTORY); 8 | await directory.createGitIgnore(GRAPH_DIRECTORY); 9 | } 10 | return { 11 | create: create 12 | }; 13 | })(); 14 | module.exports = graphDirectory; -------------------------------------------------------------------------------- /src/helper/directory/readme-directory.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const directory = require('../../core/directory'); 3 | let readmeDirectory = (function () { 4 | let README_DIRECTORY = 'readme'; 5 | let create = async function () { 6 | core.info(`If not exist create '${README_DIRECTORY}' directory`); 7 | await directory.createDirectory(README_DIRECTORY); 8 | await directory.createGitIgnore(README_DIRECTORY); 9 | } 10 | return { 11 | create: create 12 | }; 13 | })(); 14 | module.exports = readmeDirectory; -------------------------------------------------------------------------------- /src/core/git.js: -------------------------------------------------------------------------------- 1 | const simpleGit = require('simple-git'); 2 | let git = (function () { 3 | const git = simpleGit(); 4 | let pull = async function () { 5 | await git.pull(); 6 | } 7 | let commit = async function (username, email, message) { 8 | await git.addConfig('user.name', username) 9 | await git.addConfig('user.email', email) 10 | await git.add('./*') 11 | await git.commit(message) 12 | } 13 | let push = async function (branch) { 14 | await git.push('origin', branch); 15 | } 16 | return { 17 | pull: pull, 18 | commit: commit, 19 | push: push 20 | }; 21 | })(); 22 | module.exports = git; -------------------------------------------------------------------------------- /src/helper/file/svg-file.js: -------------------------------------------------------------------------------- 1 | const file = require('../../core/file'); 2 | let svgFile = (function () { 3 | const SVG = 'svg'; 4 | let createBadgeSVGFile = async function (repositoryName, fileName, object) { 5 | let path = `${SVG}/${repositoryName}/${fileName}.svg`; 6 | await file.createOtherFile(path, object); 7 | } 8 | let createProfileSVGFile = async function (object) { 9 | let path = `${SVG}/profile/badge.svg`; 10 | await file.createOtherFile(path, object); 11 | } 12 | return { 13 | createBadgeSVGFile: createBadgeSVGFile, 14 | createProfileSVGFile: createProfileSVGFile 15 | }; 16 | })(); 17 | module.exports = svgFile; -------------------------------------------------------------------------------- /src/helper/octokit/request-repository.js: -------------------------------------------------------------------------------- 1 | const octokit = require('../../core/octokit'); 2 | const ResponseRepositoryModel = require('../../model/octokit/ResponseRepositoryModel'); 3 | let requestRepository = (function () { 4 | let request = async function (header, request) { 5 | let octokitResponse = await octokit.request(header, request); 6 | if(octokitResponse.status){ 7 | return new ResponseRepositoryModel(true, octokitResponse.response); 8 | } else { 9 | return new ResponseRepositoryModel(false, octokitResponse.response); 10 | } 11 | } 12 | return { 13 | request: request 14 | }; 15 | })(); 16 | module.exports = requestRepository; -------------------------------------------------------------------------------- /src/helper/octokit/request-views.js: -------------------------------------------------------------------------------- 1 | const octokit = require('../../core/octokit'); 2 | const ResponseViewsModel = require('../../model/octokit/ResponseViewsModel'); 3 | let requestViews = (function () { 4 | let requestResponseViews = async function (header, request) { 5 | let octokitResponse = await octokit.request(header, request); 6 | if(octokitResponse.status){ 7 | return new ResponseViewsModel(true, octokitResponse.response); 8 | } else { 9 | return new ResponseViewsModel(false, octokitResponse.response); 10 | } 11 | } 12 | return { 13 | requestResponseViews: requestResponseViews 14 | }; 15 | })(); 16 | module.exports = requestViews; -------------------------------------------------------------------------------- /src/helper/file/markdown-file.js: -------------------------------------------------------------------------------- 1 | const file = require('../../core/file'); 2 | let markdownFile = (function () { 3 | const README = 'readme'; 4 | let createListMarkDownFile = async function (repositoryId, fileName, object) { 5 | let path = `${README}/${repositoryId}/${fileName}.md`; 6 | await file.createOtherFile(path, object); 7 | } 8 | let createSummaryMarkDownFile = async function (object) { 9 | let path = `README.md`; 10 | await file.createOtherFile(path, object); 11 | } 12 | return { 13 | createListMarkDownFile: createListMarkDownFile, 14 | createSummaryMarkDownFile: createSummaryMarkDownFile 15 | }; 16 | })(); 17 | module.exports = markdownFile; -------------------------------------------------------------------------------- /src/core/directory.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra') 2 | let directory = (function () { 3 | let createDirectory = async function (directory) { 4 | try { 5 | await fs.ensureDir(directory); 6 | } catch (error) { 7 | console.log(error); 8 | } 9 | } 10 | let createGitIgnore = async function (directory) { 11 | let path = `${directory}/.gitkeep`; 12 | try { 13 | await fs.outputFile(path, '') 14 | } catch (error) { 15 | console.log(error); 16 | } 17 | } 18 | return { 19 | createDirectory: createDirectory, 20 | createGitIgnore: createGitIgnore 21 | }; 22 | })(); 23 | module.exports = directory; -------------------------------------------------------------------------------- /src/helper/svg/summary-svg.js: -------------------------------------------------------------------------------- 1 | const svg = require('../../helper/svg/svg-file'); 2 | const svgFile = require('../../helper/file/svg-file'); 3 | const recordSummaryFile = require('../../helper/cache/summary-cache'); 4 | let summarySVG = (function () { 5 | const filename = 'badge'; 6 | let updateSummarySVGFile = async function (repositoryName) { 7 | let summaryCache = await recordSummaryFile.readSummaryCacheFile(repositoryName); 8 | let object = await svg.create(summaryCache.views.summary.count) 9 | await svgFile.createBadgeSVGFile(repositoryName, filename, object); 10 | } 11 | return { 12 | updateSummarySVGFile: updateSummarySVGFile 13 | }; 14 | })(); 15 | module.exports = summarySVG; -------------------------------------------------------------------------------- /src/helper/readme/year-readme.js: -------------------------------------------------------------------------------- 1 | const markdownTemplate = require('./markdown-template'); 2 | const markdownFile = require('../file/markdown-file'); 3 | const yearCache = require('../../helper/cache/year-cache'); 4 | let yearReadme = (function () { 5 | const YEAR = 'year'; 6 | let updateYearMarkDownFile = async function (response, request) { 7 | let year = await yearCache.readYearCacheFile(response.repositoryId); 8 | let object = await markdownTemplate.createListMarkDownTemplate(year.views, 'Year', response, request) 9 | await markdownFile.createListMarkDownFile(response.repositoryId, YEAR, object); 10 | } 11 | return { 12 | updateYearMarkDownFile: updateYearMarkDownFile 13 | }; 14 | })(); 15 | module.exports = yearReadme; -------------------------------------------------------------------------------- /src/helper/readme/week-readme.js: -------------------------------------------------------------------------------- 1 | const markdownTemplate = require('./markdown-template'); 2 | const markdownFile = require('../file/markdown-file'); 3 | const weekCache = require('../../helper/cache/week-cache'); 4 | let weekReadme = (function () { 5 | const filename = 'week'; 6 | let updateWeekMarkDownFile = async function (response, request) { 7 | let week = await weekCache.readWeekCacheFile(response.repositoryId); 8 | let object = await markdownTemplate.createListMarkDownTemplate(week.views, 'Week', response, request) 9 | await markdownFile.createListMarkDownFile(response.repositoryId, filename, object); 10 | } 11 | return { 12 | updateWeekMarkDownFile: updateWeekMarkDownFile 13 | }; 14 | })(); 15 | module.exports = weekReadme; -------------------------------------------------------------------------------- /src/helper/readme/month-readme.js: -------------------------------------------------------------------------------- 1 | const markdownTemplate = require('./markdown-template'); 2 | const markdownFile = require('../file/markdown-file'); 3 | const monthCache = require('../../helper/cache/month-cache'); 4 | let weekReadme = (function () { 5 | const MONTH = 'month'; 6 | let updateMonthMarkDownFile = async function (response, request) { 7 | let month = await monthCache.readMonthCacheFile(response.repositoryId); 8 | let object = await markdownTemplate.createListMarkDownTemplate(month.views, 'Month', response, request) 9 | await markdownFile.createListMarkDownFile(response.repositoryId, MONTH, object); 10 | } 11 | return { 12 | updateMonthMarkDownFile: updateMonthMarkDownFile 13 | }; 14 | })(); 15 | module.exports = weekReadme; -------------------------------------------------------------------------------- /src/helper/git/commit-git.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const git = require('../../core/git'); 3 | let commitGit = function () { 4 | // let INSIGHT_BOT_USERNAME = 'github-actions[bot]'; 5 | // let INSIGHT_BOT_EMAIL = '41898282+github-actions[bot]@users.noreply.github.com'; 6 | // let INSIGHT_BOT_USERNAME = 'somekindofwallflower'; 7 | // let INSIGHT_BOT_EMAIL = 'someone.ana13@gmail.com'; 8 | let commit = async function (message) { 9 | core.info(`Git Commit ${message}`) 10 | try { 11 | await git.commit('somekindofwallflower', 'someone.ana13@gmail.com', message); 12 | } catch (error) { 13 | core.info(error); 14 | } 15 | 16 | } 17 | return { 18 | commit: commit 19 | }; 20 | }(); 21 | module.exports = commitGit; 22 | -------------------------------------------------------------------------------- /src/helper/svg/profile_svg.js: -------------------------------------------------------------------------------- 1 | const svg = require('../../helper/svg/svg-file'); 2 | const svgFile = require('../../helper/file/svg-file'); 3 | const recordSummaryFile = require('../../helper/cache/summary-cache'); 4 | let profileSVG = function () { 5 | let updateProfileSVGFile = async function (response) { 6 | let numberOfViews = 0; 7 | for (const repository of response) { 8 | let summaryCache = await recordSummaryFile.readSummaryCacheFile(repository.repositoryId); 9 | numberOfViews = numberOfViews + summaryCache.views.summary.count; 10 | } 11 | let object = await svg.create(numberOfViews) 12 | await svgFile.createProfileSVGFile(object); 13 | } 14 | return { 15 | updateProfileSVGFile: updateProfileSVGFile 16 | }; 17 | }(); 18 | module.exports = profileSVG; -------------------------------------------------------------------------------- /src/helper/octokit/request-commits.js: -------------------------------------------------------------------------------- 1 | const octokit = require('../../core/octokit'); 2 | const ResponseCommitsModel = require('../../model/octokit/ResponseCommitsModel'); 3 | let requestCommits = (function () { 4 | let requestResponseCommits = async function (header, request) { 5 | let octokitResponse = await octokit.request(header, request); 6 | if(octokitResponse.status){ 7 | let data = octokitResponse.response.data; 8 | if(data.length === 0){ 9 | return new ResponseCommitsModel(false, octokitResponse.response) 10 | } else { 11 | return new ResponseCommitsModel(true, data) 12 | } 13 | } else { 14 | return new ResponseCommitsModel(false, octokitResponse.response) 15 | } 16 | } 17 | return { 18 | requestResponseCommits: requestResponseCommits 19 | }; 20 | })(); 21 | module.exports = requestCommits; -------------------------------------------------------------------------------- /src/helper/readme/summary-readme.js: -------------------------------------------------------------------------------- 1 | const markdownTemplate = require('./markdown-template'); 2 | const markdownFile = require('../file/markdown-file'); 3 | let summaryReadme = (function () { 4 | let updateSummaryMarkDownFileAdvanced = async function (response, request) { 5 | let object = await markdownTemplate.createSummaryMarkDownTemplateAdvanced(response, request.insightsRepository) 6 | await markdownFile.createSummaryMarkDownFile(object); 7 | } 8 | let updateSummaryMarkDownFileBasic = async function (response, request) { 9 | let object = await markdownTemplate.createSummaryMarkDownTemplateBasic(response, request.insightsRepository) 10 | await markdownFile.createSummaryMarkDownFile(object); 11 | } 12 | return { 13 | updateSummaryMarkDownFileAdvanced: updateSummaryMarkDownFileAdvanced, 14 | updateSummaryMarkDownFileBasic: updateSummaryMarkDownFileBasic 15 | }; 16 | })(); 17 | module.exports = summaryReadme; -------------------------------------------------------------------------------- /src/helper/octokit/verify-commits.js: -------------------------------------------------------------------------------- 1 | const requestCommits = require('./request-commits'); 2 | const RequestModel = require('../../model/octokit/RequestModel'); 3 | let verifyCommits = (function () { 4 | const URL = '/commits?path=cache'; 5 | // const USERNAME = 'github-actions[bot]'; 6 | const USERNAME = 'somekindofwallflower'; 7 | let verify = async function (header, username, repository) { 8 | let request = new RequestModel(URL, username, repository); 9 | let responseCommits = await requestCommits.requestResponseCommits(header, request); 10 | if (responseCommits.status) { 11 | for (const commit of responseCommits.response) { 12 | if (commit !== USERNAME) { 13 | // return false; 14 | return true; // allow unverified commits 15 | } 16 | } 17 | return true; 18 | } else { 19 | return true; 20 | } 21 | } 22 | return { 23 | verify: verify 24 | }; 25 | })(); 26 | module.exports = verifyCommits; 27 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "github-insights", 3 | "version": "1.0.0", 4 | "description": "GitHub Insights Template", 5 | "main": "src/index.js", 6 | "scripts": { 7 | "lint": "eslint .", 8 | "prepare": "ncc build src/index.js -o dist --source-map --license licenses.txt", 9 | "test": "jest", 10 | "all": "npm run lint && npm run prepare && npm run test" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/actions/javascript-action.git" 15 | }, 16 | "keywords": [ 17 | "GitHub", 18 | "Actions", 19 | "JavaScript" 20 | ], 21 | "author": "", 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/actions/javascript-action/issues" 25 | }, 26 | "homepage": "https://github.com/actions/javascript-action#readme", 27 | "dependencies": { 28 | "@actions/core": "1.2.6", 29 | "@octokit/rest": "18.5.3", 30 | "fs-extra": "9.1.0", 31 | "simple-git": "2.39.0" 32 | }, 33 | "devDependencies": { 34 | "@vercel/ncc": "0.27.0", 35 | "eslint": "7.4.0", 36 | "jest": "26.6.3" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/model/config/ConfigDataModel.js: -------------------------------------------------------------------------------- 1 | let ConfigDataModel = function (file) { 2 | const languages = ["en-US"]; 3 | let getRepositoryArray = function (repositories) { 4 | let repository_array = []; 5 | for (const repository of repositories) { 6 | repository_array.push(repository); 7 | } 8 | return repository_array; 9 | } 10 | let getBooleanValue = function (value) { 11 | return value === 'true' || value === true; 12 | } 13 | let getLanguageValue = function (language) { 14 | if (language === undefined) { 15 | return "en-US"; 16 | } else { 17 | if (languages.includes(language)) { 18 | return language; 19 | } else { 20 | return "en-US"; 21 | } 22 | } 23 | } 24 | this.devMode = getBooleanValue(file.devMode); 25 | this.advancedMode = getBooleanValue(file.advancedMode); 26 | this.language = getLanguageValue(file.language); 27 | this.repository = getRepositoryArray(file.repository); 28 | } 29 | module.exports = ConfigDataModel; -------------------------------------------------------------------------------- /src/helper/graph/year-graph.js: -------------------------------------------------------------------------------- 1 | const graphFile = require('../file/graph-file'); 2 | const yearCache = require('../../helper/cache/year-cache'); 3 | const GraphFileModel = require('../../model/file/GraphFileModel'); 4 | let yearGraph = (function () { 5 | const filename = 'year' 6 | let updateYearGraphFile = async function (response) { 7 | let year = await yearCache.readYearCacheFile(response.repositoryId); 8 | let labels = []; 9 | let uniqueData = []; 10 | let countData = []; 11 | if(year.status){ 12 | for(const view of year.views){ 13 | labels.push('"' + (view.timestamp.getFullYear() + 1) + '/' + view.timestamp.getMonth() + '"'); 14 | uniqueData.push(view.uniques); 15 | countData.push(view.count); 16 | } 17 | } 18 | let graph = new GraphFileModel(labels, uniqueData, countData); 19 | await graphFile.createGraphFile(response.repositoryId, filename, graph); 20 | } 21 | return { 22 | updateYearGraphFile: updateYearGraphFile 23 | }; 24 | })(); 25 | module.exports = yearGraph; -------------------------------------------------------------------------------- /src/helper/graph/week-graph.js: -------------------------------------------------------------------------------- 1 | const weekCache = require('../../helper/cache/week-cache'); 2 | const graphFile = require('../../helper/file/graph-file'); 3 | const GraphFileModel = require('../../model/file/GraphFileModel'); 4 | let weekGraph = function () { 5 | const filename = 'week' 6 | let updateWeekGraphFile = async function (response) { 7 | let week = await weekCache.readWeekCacheFile(response.repositoryId); 8 | let labels = []; 9 | let uniqueData = []; 10 | let countData = []; 11 | if(week.status){ 12 | for(const view of week.views){ 13 | labels.push('"' + (view.timestamp.getMonth() + 1) + '/' + view.timestamp.getDate() + '"'); 14 | uniqueData.push(view.uniques); 15 | countData.push(view.count); 16 | } 17 | } 18 | let graph = new GraphFileModel(labels, uniqueData, countData); 19 | await graphFile.createGraphFile(response.repositoryId, filename, graph); 20 | } 21 | return { 22 | updateWeekGraphFile: updateWeekGraphFile 23 | }; 24 | }(); 25 | module.exports = weekGraph; -------------------------------------------------------------------------------- /src/helper/graph/month-graph.js: -------------------------------------------------------------------------------- 1 | const graphFile = require('../file/graph-file'); 2 | const monthCache = require('../../helper/cache/month-cache'); 3 | const GraphFileModel = require('../../model/file/GraphFileModel'); 4 | let monthGraph = (function () { 5 | const filename = 'month' 6 | let updateMonthGraphFile = async function (response) { 7 | let month = await monthCache.readMonthCacheFile(response.repositoryId); 8 | let labels = []; 9 | let uniqueData = []; 10 | let countData = []; 11 | if(month.status){ 12 | for(const view of month.views){ 13 | labels.push('"' + (view.timestamp.getMonth() + 1) + '/' + view.timestamp.getDate() + '"'); 14 | uniqueData.push(view.uniques); 15 | countData.push(view.count); 16 | } 17 | } 18 | let graph = new GraphFileModel(labels, uniqueData, countData); 19 | await graphFile.createGraphFile(response.repositoryId, filename, graph); 20 | } 21 | return { 22 | updateMonthGraphFile: updateMonthGraphFile 23 | }; 24 | })(); 25 | module.exports = monthGraph; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 GitHub Actions 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/helper/file/json-file.js: -------------------------------------------------------------------------------- 1 | const file = require('../../core/file'); 2 | let jsonFile = (function () { 3 | const CACHE = 'cache'; 4 | let createCacheFile = async function (repositoryName, fileName, object) { 5 | let path = `${CACHE}/${repositoryName}/${fileName}.json`; 6 | await file.createJsonFile(path, object); 7 | } 8 | let readCacheFile = async function (repositoryName, fileName) { 9 | let path = `${CACHE}/${repositoryName}/${fileName}.json`; 10 | return await file.readCacheFile(path) 11 | } 12 | let readConfigFile = async function () { 13 | let path = `config.json`; 14 | return await file.readConfigFile(path) 15 | } 16 | let readSummaryCacheFile = async function (repositoryName, fileName) { 17 | let path = `${CACHE}/${repositoryName}/${fileName}.json`; 18 | return await file.readSummaryFile(path) 19 | } 20 | return { 21 | createCacheFile: createCacheFile, 22 | readCacheFile: readCacheFile, 23 | readConfigFile: readConfigFile, 24 | readSummaryCacheFile: readSummaryCacheFile, 25 | }; 26 | })(); 27 | module.exports = jsonFile; -------------------------------------------------------------------------------- /src/helper/cache/week-cache.js: -------------------------------------------------------------------------------- 1 | const range = require('../../core/range'); 2 | const record = require('../../core/record'); 3 | const recordCacheFile = require('../../helper/cache/record-cache'); 4 | const jsonFile = require('../../helper/file/json-file'); 5 | let weekCache = (function () { 6 | const MAXIMUM_DAYS = 7; 7 | const WEEK = 'week'; 8 | let createViews = function (records) { 9 | let week = []; 10 | for (const date of range.getDates(MAXIMUM_DAYS)) { 11 | week.push(record.createDailyRecord(date, records)) 12 | } 13 | return week; 14 | } 15 | let readWeekCacheFile = async function (repositoryName) { 16 | return await jsonFile.readCacheFile(repositoryName, WEEK); 17 | } 18 | let updateWeekCacheFile = async function (repositoryName) { 19 | let records = await recordCacheFile.readRecordCacheFile(repositoryName); 20 | if (records.status) { 21 | let weekViews = createViews(records); 22 | await jsonFile.createCacheFile(repositoryName, WEEK, weekViews) 23 | } 24 | } 25 | return { 26 | updateWeekCacheFile: updateWeekCacheFile, 27 | readWeekCacheFile: readWeekCacheFile 28 | }; 29 | })(); 30 | module.exports = weekCache; -------------------------------------------------------------------------------- /src/helper/svg/svg-file.js: -------------------------------------------------------------------------------- 1 | let svgFile = (function () { 2 | let template = ` 4 | Maintained?: yes 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Views 19 | {views} 20 | 21 | `; 22 | let create = async function (views) { 23 | return template.replace('{views}', views); 24 | } 25 | return { 26 | create: create 27 | }; 28 | })(); 29 | module.exports = svgFile -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | 3 | # Editors 4 | .vscode/ 5 | .idea/ 6 | *.iml 7 | 8 | # Logs 9 | logs 10 | *.log 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | 15 | # Runtime data 16 | pids 17 | *.pid 18 | *.seed 19 | *.pid.lock 20 | 21 | # Directory for instrumented libs generated by jscoverage/JSCover 22 | lib-cov 23 | 24 | # Coverage directory used by tools like istanbul 25 | coverage 26 | 27 | # nyc test coverage 28 | .nyc_output 29 | 30 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 31 | .grunt 32 | 33 | # Bower dependency directory (https://bower.io/) 34 | bower_components 35 | 36 | # node-waf configuration 37 | .lock-wscript 38 | 39 | # Compiled binary addons (https://nodejs.org/api/addons.html) 40 | build/Release 41 | 42 | # Other Dependency directories 43 | jspm_packages/ 44 | 45 | # TypeScript v1 declaration files 46 | typings/ 47 | 48 | # Optional npm cache directory 49 | .npm 50 | 51 | # Optional eslint cache 52 | .eslintcache 53 | 54 | # Optional REPL history 55 | .node_repl_history 56 | 57 | # Output of 'npm pack' 58 | *.tgz 59 | 60 | # Yarn Integrity core 61 | .yarn-integrity 62 | 63 | # dotenv environment variables core 64 | .env 65 | 66 | # next.js build output 67 | .next 68 | -------------------------------------------------------------------------------- /src/helper/cache/month-cache.js: -------------------------------------------------------------------------------- 1 | const range = require('../../core/range'); 2 | const record = require('../../core/record'); 3 | const recordCacheFile = require('../../helper/cache/record-cache'); 4 | const jsonFile = require('../../helper/file/json-file'); 5 | let monthCache = (function () { 6 | const DAYS = 30; 7 | const MONTH = 'month'; 8 | let createViews = function (records) { 9 | let month = []; 10 | for (const date of range.getDates(DAYS)) { 11 | month.push(record.createDailyRecord(date, records)) 12 | } 13 | return month; 14 | } 15 | let readMonthCacheFile = async function (repositoryName) { 16 | return await jsonFile.readCacheFile(repositoryName, MONTH); 17 | } 18 | let updateMonthCacheFile = async function (repositoryName) { 19 | let records = await recordCacheFile.readRecordCacheFile(repositoryName); 20 | if (records.status) { 21 | let monthViews = createViews(records); 22 | await jsonFile.createCacheFile(repositoryName, MONTH, monthViews) 23 | } 24 | } 25 | return { 26 | updateMonthCacheFile: updateMonthCacheFile, 27 | readMonthCacheFile: readMonthCacheFile 28 | }; 29 | })(); 30 | module.exports = monthCache; -------------------------------------------------------------------------------- /src/core/octokit.js: -------------------------------------------------------------------------------- 1 | const {Octokit} = require("@octokit/rest"); 2 | const ResponseModel = require('../model/octokit/ResponseModel'); 3 | let octokit = (function () { 4 | let request = async function (header, request) { 5 | const octokit = new Octokit({ 6 | auth: header.authKey, 7 | userAgent: header.userAgent, 8 | }); 9 | return await octokit.request('GET /repos/{owner}/{repo}' + request.url, { 10 | owner: request.username, 11 | repo: request.repository 12 | }).then(response => { 13 | return new ResponseModel(true, response) 14 | }).catch(error => { 15 | if(error.status === 401){ 16 | return new ResponseModel(false, `Error ${error.status}. Invalid credentials for 'authentication key' is invalid.`) 17 | } else if(error.status === 404){ 18 | return new ResponseModel(false, `Error ${error.status}. The requested URL '${request.username}/${request.repository}' was not found. ` + 19 | `The required 'username' or 'repository' is invalid.`) 20 | } else { 21 | return new ResponseModel(false, `Error ${error.status}. ${error.name}`) 22 | } 23 | }); 24 | } 25 | return { 26 | request: request 27 | }; 28 | })(); 29 | module.exports = octokit; -------------------------------------------------------------------------------- /src/core/range.js: -------------------------------------------------------------------------------- 1 | let range = (function () { 2 | const getDatesBetweenDays = (startDate, endDate) => { 3 | let dates = [] 4 | const theDate = new Date(startDate) 5 | while (theDate < endDate) { 6 | dates = [...dates, new Date(theDate)] 7 | theDate.setDate(theDate.getDate() + 1) 8 | } 9 | dates = [...dates, endDate] 10 | return dates 11 | } 12 | const getMonthsBetweenDays = (startDate, endDate) => { 13 | let dates = [] 14 | startDate = startDate.setDate(1); 15 | const theDate = new Date(startDate) 16 | while (theDate < endDate) { 17 | dates = [...dates, new Date(theDate)] 18 | theDate.setMonth(theDate.getMonth() + 1) 19 | } 20 | dates = [...dates] 21 | return dates 22 | } 23 | let getRemainingDates = function (date) { 24 | const endDate = new Date() 25 | const startDate = new Date(date) 26 | return getDatesBetweenDays(startDate, endDate); 27 | } 28 | let getDates = function (days) { 29 | const endDate = new Date() 30 | const startDate = new Date(endDate) 31 | startDate.setDate(startDate.getDate() - days) 32 | return getDatesBetweenDays(startDate, endDate); 33 | } 34 | let getMonths = function (maxNumberOfMonths) { 35 | const endDate = new Date() 36 | const startDate = new Date(endDate) 37 | startDate.setMonth(startDate.getMonth() - maxNumberOfMonths) 38 | return getMonthsBetweenDays(startDate, endDate); 39 | } 40 | 41 | return { 42 | getRemainingDates: getRemainingDates, 43 | getDates: getDates, 44 | getMonths: getMonths 45 | }; 46 | })(); 47 | module.exports = range; -------------------------------------------------------------------------------- /src/helper/cache/record-cache.js: -------------------------------------------------------------------------------- 1 | const range = require('../../core/range'); 2 | const record = require('../../core/record'); 3 | const jsonFile = require('../../helper/file/json-file'); 4 | let recordCache = (function () { 5 | const MAXIMUM_DAYS = 365; 6 | const RECORDS = 'records'; 7 | let updateViews = function (views, traffic) { 8 | let file = []; 9 | for (const date of range.getDates(MAXIMUM_DAYS)) { 10 | file.push(record.checkDailyRecord(views, date)) 11 | } 12 | let update = []; 13 | for (const view of file) { 14 | update.push(record.updateDailyRecord(view, traffic)) 15 | } 16 | return update; 17 | } 18 | let createViews = function (traffic) { 19 | let file = []; 20 | for (const date of range.getDates(MAXIMUM_DAYS)) { 21 | file.push(record.createDailyRecord(date, traffic)) 22 | } 23 | return file; 24 | } 25 | let readRecordCacheFile = async function (repositoryName) { 26 | return await jsonFile.readCacheFile(repositoryName, RECORDS); 27 | } 28 | let updateRecordCacheFile = async function (repositoryName, traffic) { 29 | let records = await jsonFile.readCacheFile(repositoryName, RECORDS); 30 | if (records.status) { 31 | let recordViews = updateViews(records.views, traffic) 32 | await jsonFile.createCacheFile(repositoryName, RECORDS, recordViews) 33 | } else { 34 | let recordViews = createViews(traffic); 35 | await jsonFile.createCacheFile(repositoryName, RECORDS, recordViews) 36 | } 37 | } 38 | return { 39 | updateRecordCacheFile: updateRecordCacheFile, 40 | readRecordCacheFile: readRecordCacheFile 41 | }; 42 | })(); 43 | module.exports = recordCache; -------------------------------------------------------------------------------- /src/helper/config/input.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const HeaderModel = require('../../model/input/HeaderModel'); 3 | const RequestModel = require('../../model/input/RequestModel'); 4 | const jsonFile = require('../../helper/file/json-file'); 5 | let input = (function () { 6 | // const INSIGHT_REPOSITORY = 'gayanvoice/my-profile-view-counter'; 7 | // const AUTH_KEY = ''; 8 | // const USER_AGENT = 'process.env.USER_AGENT'; 9 | const INSIGHT_REPOSITORY = process.env.GITHUB_REPOSITORY; 10 | const AUTH_KEY = process.env.INSIGHTS_TOKEN; 11 | const USER_AGENT = process.env.USER_AGENT; 12 | let getUsernameAndRepository = function () { 13 | return INSIGHT_REPOSITORY.split("/"); 14 | } 15 | let getHeader = async function () { 16 | return new HeaderModel(AUTH_KEY, USER_AGENT); 17 | } 18 | let getRequest = async function () { 19 | const USERNAME = getUsernameAndRepository()[0]; 20 | const REPOSITORY = getUsernameAndRepository()[1]; 21 | let configJson = await jsonFile.readConfigFile(); 22 | if(configJson.status){ 23 | core.info("Config Json available") 24 | core.info(`Config Json username='${USERNAME}' insightRepository='${REPOSITORY}' devMode='${configJson.data.devMode}' ` + 25 | `advancedMode='${configJson.data.advancedMode}' language='${configJson.data.language}' repository='${configJson.data.repository.toString()}'`) 26 | return new RequestModel( 27 | true, 28 | USERNAME, 29 | REPOSITORY, 30 | configJson.data.devMode, 31 | configJson.data.advancedMode, 32 | configJson.data.language, 33 | configJson.data.repository); 34 | } else { 35 | core.info("Config Json Error") 36 | return new RequestModel(false); 37 | } 38 | } 39 | return { 40 | getHeader: getHeader, 41 | getRequest: getRequest 42 | }; 43 | })(); 44 | module.exports = input; -------------------------------------------------------------------------------- /src/helper/cache/max-cache.js: -------------------------------------------------------------------------------- 1 | const range = require('../../core/range'); 2 | const record = require('../../core/record'); 3 | const recordCacheFile = require('../../helper/cache/record-cache'); 4 | const jsonFile = require('../../helper/file/json-file'); 5 | let maxCache = (function () { 6 | const MAXIMUM_MONTHS = 60; 7 | const UPDATE_MINIMUM_MONTHS = 1; 8 | const MAX = 'max'; 9 | let updateViews = function (maxRecords, records) { 10 | let viewsFromFile = []; 11 | for (const date of range.getMonths(MAXIMUM_MONTHS)) { 12 | viewsFromFile.push(record.checkMonthlyRecord(date, maxRecords.views)) 13 | } 14 | let updateMonth = []; 15 | for (const date of range.getMonths(UPDATE_MINIMUM_MONTHS)) { 16 | updateMonth.push(record.updateMonthlyRecord(date, records)); 17 | } 18 | let updates = []; 19 | for (const view of viewsFromFile) { 20 | updates.push(record.checkMonthlyRecordUpdated(view, updateMonth)); 21 | } 22 | return updates; 23 | } 24 | let createViews = function (records) { 25 | let max = []; 26 | for (const date of range.getMonths(MAXIMUM_MONTHS)) { 27 | max.push(record.createMonthlyRecord(date, records)) 28 | } 29 | return max; 30 | } 31 | let readMaxCacheFile = async function (repositoryName) { 32 | return await jsonFile.readCacheFile(repositoryName, MAX); 33 | } 34 | let updateMaxCacheFile = async function (repositoryName) { 35 | let records = await recordCacheFile.readRecordCacheFile(repositoryName); 36 | let maxRecords = await readMaxCacheFile(repositoryName); 37 | if (records.status && maxRecords.status) { 38 | let maxViews = updateViews(maxRecords, records); 39 | await jsonFile.createCacheFile(repositoryName, MAX, maxViews) 40 | } else { 41 | let maxViews = createViews(records); 42 | await jsonFile.createCacheFile(repositoryName, MAX, maxViews) 43 | } 44 | } 45 | return { 46 | updateMaxCacheFile: updateMaxCacheFile, 47 | readMaxCacheFile: readMaxCacheFile 48 | }; 49 | })(); 50 | module.exports = maxCache; -------------------------------------------------------------------------------- /src/helper/cache/year-cache.js: -------------------------------------------------------------------------------- 1 | const range = require('../../core/range'); 2 | const record = require('../../core/record'); 3 | const recordCacheFile = require('../../helper/cache/record-cache'); 4 | const jsonFile = require('../../helper/file/json-file'); 5 | let yearCache = (function () { 6 | const MAXIMUM_MONTHS = 12; 7 | const MINIMUM_MONTHS = 1; 8 | const YEAR = 'year'; 9 | let updateViews = function (yearRecords, records) { 10 | let viewsFromFile = []; 11 | for (const date of range.getMonths(MAXIMUM_MONTHS)) { 12 | viewsFromFile.push(record.checkMonthlyRecord(date, yearRecords.views)) 13 | } 14 | let updateMonth = []; 15 | for (const date of range.getMonths(MINIMUM_MONTHS)) { 16 | updateMonth.push(record.updateMonthlyRecord(date, records)); 17 | } 18 | let updates = []; 19 | for (const view of viewsFromFile) { 20 | updates.push(record.checkMonthlyRecordUpdated(view, updateMonth)); 21 | } 22 | return updates; 23 | } 24 | let createViews = function (records) { 25 | let month = []; 26 | for (const date of range.getMonths(MAXIMUM_MONTHS)) { 27 | month.push(record.createMonthlyRecord(date, records)) 28 | } 29 | return month; 30 | } 31 | let readYearCacheFile = async function (repositoryName) { 32 | return await jsonFile.readCacheFile(repositoryName, YEAR); 33 | } 34 | let updateYearCacheFile = async function (repositoryName) { 35 | let records = await recordCacheFile.readRecordCacheFile(repositoryName); 36 | let yearRecords = await readYearCacheFile(repositoryName); 37 | if (records.status && yearRecords.status) { 38 | let yearViews = updateViews(yearRecords, records); 39 | await jsonFile.createCacheFile(repositoryName, YEAR, yearViews) 40 | } else { 41 | let yearViews = createViews(records); 42 | await jsonFile.createCacheFile(repositoryName, YEAR, yearViews) 43 | } 44 | } 45 | return { 46 | updateYearCacheFile: updateYearCacheFile, 47 | readYearCacheFile: readYearCacheFile 48 | }; 49 | })(); 50 | module.exports = yearCache; -------------------------------------------------------------------------------- /src/helper/file/graph-file.js: -------------------------------------------------------------------------------- 1 | const util = require('util'); 2 | const exec = util.promisify(require('child_process').exec); 3 | let jsonFile = (function () { 4 | const directory = 'graph'; 5 | const height = 400; 6 | const width = 400; 7 | const uniqueBorderColor = '#008bad'; 8 | const uniqueBackgroundColor = '#00a1c1'; 9 | const countBorderColor = '#00e7f2'; 10 | const countBackgroundColor = '#00ffff'; 11 | let execute = async function (command) { 12 | const { stdout, stderr } = await exec(command); 13 | if (stderr) { 14 | console.error(`error: ${stderr}`); 15 | } 16 | console.log(stdout); 17 | } 18 | let createGraphLargeFile = async function (repository, fileName, graph) { 19 | const path = `${directory}/${repository}/large/${fileName}.png`; 20 | const options = false; 21 | const command = `npx node-chart-exec@2.0.1 --type='line' --options='${options}' --height=${height} --width=${width} --labels='[${graph.labels}]' --dataset='[{"label":"Unique", "data":[${graph.uniqueData}], "backgroundColor":"${uniqueBackgroundColor}", "borderColor":"${uniqueBorderColor}"}, {"label":"Count", "data":[${graph.countData}], "backgroundColor":"${countBackgroundColor}", "borderColor":"${countBorderColor}"}]' --outputfile='${path}'`; 22 | await execute(command); 23 | } 24 | let createGraphSmallFile = async function (repository, fileName, graph) { 25 | const path = `${directory}/${repository}/small/${fileName}.png`; 26 | const options = true; 27 | const command = `npx node-chart-exec@2.0.1 --type='line' --options='${options}' --height=${height} --width=${width} --labels='[${graph.labels}]' --dataset='[{"label":"Unique", "data":[${graph.uniqueData}], "backgroundColor":"${uniqueBackgroundColor}", "borderColor":"${uniqueBorderColor}"}, {"label":"Count", "data":[${graph.countData}], "backgroundColor":"${countBackgroundColor}", "borderColor":"${countBorderColor}"}]' --outputfile='${path}'`; 28 | await execute(command); 29 | } 30 | let createGraphFile = async function (repositoryId, fileName, graph) { 31 | await createGraphLargeFile(repositoryId, fileName, graph); 32 | await createGraphSmallFile(repositoryId, fileName, graph); 33 | } 34 | return { 35 | createGraphFile: createGraphFile, 36 | }; 37 | })(); 38 | module.exports = jsonFile; -------------------------------------------------------------------------------- /src/core/file.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const fs = require('fs-extra') 3 | const ConfigFileModel = require('../model/file/ConfigFileModel'); 4 | const CacheFileModel = require('../model/file/CacheFileModel'); 5 | const SummaryFileModel = require('../model/file/SummaryFileModel'); 6 | let file = (function () { 7 | let saveJson = async function (fileName, jsonObject) { 8 | try { 9 | await fs.outputJson(fileName, jsonObject) 10 | core.info( `Json file has been updated at ${fileName}`) 11 | } catch (error) { 12 | core.info( `Json file has not been updated at ${fileName}`) 13 | } 14 | } 15 | let saveOther = async function (fileName, object) { 16 | try { 17 | await fs.outputFile(fileName, object) 18 | core.info( `Other file has been updated at ${fileName}`) 19 | } catch (error) { 20 | core.info( `Other file has not been updated at ${fileName}`) 21 | } 22 | } 23 | let readCacheJson = async function (fileName) { 24 | try { 25 | let file = await fs.readJson(fileName); 26 | return new CacheFileModel(true, file); 27 | } catch (error) { 28 | return new CacheFileModel(false); 29 | } 30 | } 31 | let readConfigJson = async function (fileName) { 32 | try { 33 | let file = await fs.readJson(fileName); 34 | return new ConfigFileModel(true, file); 35 | } catch (error) { 36 | return new ConfigFileModel(false); 37 | } 38 | } 39 | let readSummaryJson = async function (fileName) { 40 | try { 41 | let file = await fs.readJson(fileName); 42 | return new SummaryFileModel(true, file); 43 | } catch (error) { 44 | return new SummaryFileModel(false); 45 | } 46 | } 47 | let createJsonFile = async function (fileName, jsonObject) { 48 | await saveJson(fileName, jsonObject); 49 | } 50 | let createOtherFile = async function (fileName, object) { 51 | await saveOther(fileName, object); 52 | } 53 | let readConfigFile = async function (fileName) { 54 | return await readConfigJson(fileName); 55 | } 56 | let readCacheFile = async function (fileName) { 57 | return await readCacheJson(fileName); 58 | } 59 | let readSummaryFile = async function (fileName) { 60 | return await readSummaryJson(fileName); 61 | } 62 | return { 63 | createJsonFile: createJsonFile, 64 | createOtherFile: createOtherFile, 65 | readCacheFile: readCacheFile, 66 | readConfigFile: readConfigFile, 67 | readSummaryFile: readSummaryFile 68 | }; 69 | })(); 70 | module.exports = file; 71 | -------------------------------------------------------------------------------- /src/helper/cache/summary-cache.js: -------------------------------------------------------------------------------- 1 | const range = require('../../core/range'); 2 | const recordCacheFile = require('../../helper/cache/record-cache'); 3 | const jsonFile = require('../../helper/file/json-file'); 4 | const SummaryModel = require('../../model/cache/SummaryModel'); 5 | const SummaryFileModel = require('../../model/cache/SummaryFileModel'); 6 | let summaryCache = (function () { 7 | const SUMMARY = 'summary'; 8 | let checkIfUpdated = function (date, timestamp) { 9 | let today = new Date(); 10 | let yesterday = new Date(); 11 | yesterday.setDate(yesterday.getDate() - 1) 12 | if (date.getFullYear() === timestamp.getFullYear() && 13 | date.getMonth() === timestamp.getMonth() && 14 | date.getDate() === timestamp.getDate()) { 15 | return false; 16 | } else { 17 | return !(date.getDate() === today.getDate() || 18 | date.getDate() === yesterday.getDate()); 19 | } 20 | } 21 | let updateViews = function (summaryCache, recordCache) { 22 | let timestamp = new Date(summaryCache.views.timestamp); 23 | let uniques = summaryCache.views.summary.uniques; 24 | let count = summaryCache.views.summary.count; 25 | let dateRange = []; 26 | for (const date of range.getRemainingDates(timestamp)) { 27 | if (checkIfUpdated(date, timestamp)) { 28 | dateRange.push(date) 29 | } 30 | } 31 | for (const record of recordCache) { 32 | for (const date of dateRange) { 33 | if (date.getFullYear() === record.timestamp.getFullYear() && 34 | date.getMonth() === record.timestamp.getMonth() && 35 | date.getDate() === record.timestamp.getDate()) { 36 | timestamp = record.timestamp; 37 | uniques = uniques + record.uniques; 38 | count = count + record.count; 39 | } 40 | } 41 | } 42 | return { timestamp: timestamp, summary: new SummaryModel(uniques, count)} 43 | } 44 | let createViews = function (records) { 45 | let uniques = 0; 46 | let count = 0; 47 | for (const record of records) { 48 | uniques = uniques + record.uniques; 49 | count = count + record.count; 50 | } 51 | return new SummaryModel(uniques, count); 52 | } 53 | let readSummaryCacheFile = async function (repositoryName) { 54 | return await jsonFile.readSummaryCacheFile(repositoryName, SUMMARY); 55 | } 56 | let updateSummaryCacheFile = async function (repositoryName) { 57 | let recordsCache = await recordCacheFile.readRecordCacheFile(repositoryName); 58 | let summaryCache = await readSummaryCacheFile(repositoryName); 59 | if (recordsCache.status && summaryCache.status) { 60 | let summaryViews = updateViews(summaryCache, recordsCache.views); 61 | await jsonFile.createCacheFile(repositoryName, SUMMARY,summaryViews ) 62 | } else { 63 | let view = recordsCache.views[recordsCache.views.length - 4] 64 | let summaryViews = new SummaryFileModel(new Date(view.timestamp), createViews(recordsCache.views)); 65 | await jsonFile.createCacheFile(repositoryName, SUMMARY, summaryViews) 66 | } 67 | } 68 | return { 69 | updateSummaryCacheFile: updateSummaryCacheFile, 70 | readSummaryCacheFile: readSummaryCacheFile 71 | }; 72 | })(); 73 | module.exports = summaryCache; -------------------------------------------------------------------------------- /src/helper/octokit/request-octokit.js: -------------------------------------------------------------------------------- 1 | const core = require('@actions/core'); 2 | const requestRepositoryOctokit = require('../octokit/request-repository'); 3 | const verifyCommitsOctokit = require('../octokit/verify-commits'); 4 | const requestViewsOctokit = require('../octokit/request-views'); 5 | const RequestModel = require('../../model/octokit/RequestModel'); 6 | let requestOctokit = (function () { 7 | let verifyCommits = async function (header, request) { 8 | let verify = await verifyCommitsOctokit.verify(header, request.username, request.insightsRepository); 9 | if(verify){ 10 | core.info(`Insight repository '${request.username}/${request.insightsRepository}/cache' verified`); 11 | } else { 12 | core.info(`Not verified. Found unauthorized commits in '${request.username}/${request.insightsRepository}/cache'. ` + 13 | `Revoke previous unauthorized commits from '${request.username}/${request.insightsRepository}/cache'`); 14 | } 15 | return verify; 16 | } 17 | let requestViews = async function (header, response) { 18 | let request = new RequestModel('/traffic/views', response.ownerLogin, response.repositoryName) 19 | let views = await requestViewsOctokit.requestResponseViews(header, request); 20 | if(views.status){ 21 | core.info(`Repository views '${response.ownerLogin}/${response.repositoryName}' available`); 22 | } else { 23 | core.info(`Repository views not available '${response.ownerLogin}/${response.repositoryName}'. `+ 24 | `This property may not exist for this URL '${response.ownerLogin}/${response.repositoryName}', may not be retrievable ` + 25 | `${views.response}`); 26 | } 27 | return views; 28 | } 29 | let requestInsightRepository = async function (header, request) { 30 | let requestModel = new RequestModel('', request.username, request.insightsRepository) 31 | let insightsRepository = await requestRepositoryOctokit.request(header, requestModel); 32 | if(insightsRepository.status){ 33 | core.info(`Insight repository '${request.username}/${request.insightsRepository}' available`); 34 | } else { 35 | core.info(`Insight repository not available '${request.username}/${request.insightsRepository}'. `+ 36 | `This property may not exist for this URL '${request.username}/${request.insightsRepository}', may not be retrievable ` + 37 | `${insightsRepository.response}`); 38 | } 39 | return insightsRepository; 40 | } 41 | let requestRepository = async function (header, request, repositoryName) { 42 | let requestModel = new RequestModel('', request.username, repositoryName); 43 | let repository = await requestRepositoryOctokit.request(header, requestModel); 44 | if(repository.status){ 45 | core.info(`Repository '${request.username}/${repositoryName}' available`); 46 | } else { 47 | core.info(`Repository not available '${request.username}/${repositoryName}'. `+ 48 | `This property may not exist for this URL '${request.username}/${repositoryName}', may not be retrievable ` + 49 | `${repository.response}`); 50 | } 51 | return repository; 52 | } 53 | return { 54 | verifyCommits: verifyCommits, 55 | requestViews: requestViews, 56 | requestInsightRepository: requestInsightRepository, 57 | requestRepository: requestRepository 58 | }; 59 | })(); 60 | module.exports = requestOctokit; 61 | -------------------------------------------------------------------------------- /src/core/record.js: -------------------------------------------------------------------------------- 1 | const ViewModel = require('../model/cache/ViewModel'); 2 | let record = (function () { 3 | let checkDailyRecord = function (views, date) { 4 | for (const view of views) { 5 | if (date.getFullYear() === view.timestamp.getFullYear() && 6 | date.getMonth() === view.timestamp.getMonth() && 7 | date.getDate() === view.timestamp.getDate()) { 8 | return view; 9 | } 10 | } 11 | let emptyView = {timestamp: date, count: 0, uniques: 0}; 12 | return new ViewModel(emptyView); 13 | } 14 | let createDailyRecord = function (date, records) { 15 | for (const record of records.views) { 16 | if (date.getFullYear() === record.timestamp.getFullYear() && 17 | date.getMonth() === record.timestamp.getMonth() && 18 | date.getDate() === record.timestamp.getDate()) { 19 | return record; 20 | } 21 | } 22 | let emptyView = {timestamp: date, count: 0, uniques: 0}; 23 | return new ViewModel(emptyView); 24 | } 25 | let updateDailyRecord = function (view, traffic) { 26 | for (const record of traffic.views) { 27 | if (view.timestamp.getFullYear() === record.timestamp.getFullYear() && 28 | view.timestamp.getMonth() === record.timestamp.getMonth() && 29 | view.timestamp.getDate() === record.timestamp.getDate()) { 30 | if ((view.uniques !== record.uniques) || (view.count !== record.count)) { 31 | return record; 32 | } 33 | } 34 | } 35 | return view; 36 | } 37 | let createMonthlyRecord = function (date, records) { 38 | let count = 0; 39 | let uniques = 0; 40 | for (const record of records.views) { 41 | if (date.getFullYear() === record.timestamp.getFullYear() && 42 | date.getMonth() === record.timestamp.getMonth()) { 43 | count = count + record.count; 44 | uniques = uniques + record.uniques; 45 | } 46 | } 47 | let view = {timestamp: date, count: count, uniques: uniques}; 48 | return new ViewModel(view); 49 | } 50 | let checkMonthlyRecord = function (date, views) { 51 | for (const view of views) { 52 | if (date.getFullYear() === view.timestamp.getFullYear() && 53 | date.getMonth() === view.timestamp.getMonth()) { 54 | return view; 55 | } 56 | } 57 | let emptyView = {timestamp: date, count: 0, uniques: 0}; 58 | return new ViewModel(emptyView); 59 | } 60 | let updateMonthlyRecord = function (date, records) { 61 | let count = 0; 62 | let uniques = 0; 63 | for (const record of records.views) { 64 | if (date.getFullYear() === record.timestamp.getFullYear() && 65 | date.getMonth() === record.timestamp.getMonth()) { 66 | count = count + record.count; 67 | uniques = uniques + record.uniques; 68 | } 69 | } 70 | let view = {timestamp: date, count: count, uniques: uniques}; 71 | return new ViewModel(view); 72 | } 73 | let checkMonthlyRecordUpdated = function (view, updates) { 74 | for (const update of updates) { 75 | if (view.timestamp.getFullYear() === update.timestamp.getFullYear() && 76 | view.timestamp.getMonth() === update.timestamp.getMonth()) { 77 | if ((view.uniques !== update.uniques) || (view.count !== update.count)) { 78 | return update; 79 | } 80 | } 81 | } 82 | return view; 83 | } 84 | return { 85 | checkDailyRecord: checkDailyRecord, 86 | createDailyRecord: createDailyRecord, 87 | updateDailyRecord: updateDailyRecord, 88 | checkMonthlyRecord: checkMonthlyRecord, 89 | createMonthlyRecord: createMonthlyRecord, 90 | updateMonthlyRecord: updateMonthlyRecord, 91 | checkMonthlyRecordUpdated: checkMonthlyRecordUpdated 92 | }; 93 | })(); 94 | module.exports = record; -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | const input = require('./helper/config/input'); 2 | const cacheDirectory = require('./helper/directory/cache-directory'); 3 | const svgDirectory = require('./helper/directory/svg-directory'); 4 | const readmeDirectory = require('./helper/directory/readme-directory'); 5 | const graphDirectory = require('./helper/directory/graph-directory'); 6 | const pullGit = require('./helper/git/pull-git'); 7 | const commitGit = require('./helper/git/commit-git'); 8 | const pushGit = require('./helper/git/push-git'); 9 | const recordCache = require('./helper/cache/record-cache'); 10 | const weekCache = require('./helper/cache/week-cache'); 11 | const monthCache = require('./helper/cache/month-cache'); 12 | const yearCache = require('./helper/cache/year-cache'); 13 | const maxCache = require('./helper/cache/max-cache'); 14 | const summaryCache = require('./helper/cache/summary-cache'); 15 | const requestOctokit = require('./helper/octokit/request-octokit'); 16 | const summarySVG = require('./helper/svg/summary-svg'); 17 | const profileSVG = require('./helper/svg/profile_svg'); 18 | const summaryReadme = require('./helper/readme/summary-readme'); 19 | const weekReadme = require('./helper/readme/week-readme'); 20 | const monthReadme = require('./helper/readme/month-readme'); 21 | const yearReadme = require('./helper/readme/year-readme'); 22 | const weekGraph = require('./helper/graph/week-graph'); 23 | const monthGraph = require('./helper/graph/month-graph'); 24 | const yearGraph = require('./helper/graph/year-graph'); 25 | let Index = function () { 26 | let createDirectories = async function () { 27 | await cacheDirectory.create(); 28 | await svgDirectory.create(); 29 | await readmeDirectory.create(); 30 | await graphDirectory.create(); 31 | } 32 | let advancedMode = async function (responseRepository, octokitResponseViews, request) { 33 | await recordCache.updateRecordCacheFile(responseRepository.response.repositoryId, octokitResponseViews.response); 34 | await weekCache.updateWeekCacheFile(responseRepository.response.repositoryId); 35 | await monthCache.updateMonthCacheFile(responseRepository.response.repositoryId); 36 | await yearCache.updateYearCacheFile(responseRepository.response.repositoryId); 37 | await maxCache.updateMaxCacheFile(responseRepository.response.repositoryId); 38 | await summaryCache.updateSummaryCacheFile(responseRepository.response.repositoryId); 39 | await summarySVG.updateSummarySVGFile(responseRepository.response.repositoryId); 40 | await weekReadme.updateWeekMarkDownFile(responseRepository.response, request); 41 | await monthReadme.updateMonthMarkDownFile(responseRepository.response, request); 42 | await yearReadme.updateYearMarkDownFile(responseRepository.response, request); 43 | if (!request.devMode) await weekGraph.updateWeekGraphFile(responseRepository.response); 44 | if (!request.devMode) await monthGraph.updateMonthGraphFile(responseRepository.response); 45 | if (!request.devMode) await yearGraph.updateYearGraphFile(responseRepository.response); 46 | } 47 | let basicMode = async function (responseRepository, octokitResponseViews, request) { 48 | await recordCache.updateRecordCacheFile(responseRepository.response.repositoryId, octokitResponseViews.response); 49 | await yearCache.updateYearCacheFile(responseRepository.response.repositoryId); 50 | await summaryCache.updateSummaryCacheFile(responseRepository.response.repositoryId); 51 | await summarySVG.updateSummarySVGFile(responseRepository.response.repositoryId); 52 | await yearReadme.updateYearMarkDownFile(responseRepository.response, request); 53 | if (!request.devMode) await yearGraph.updateYearGraphFile(responseRepository.response); 54 | } 55 | let main = async function () { 56 | let header = await input.getHeader(); 57 | let request = await input.getRequest(); 58 | if(request.status) { 59 | if (!request.devMode) await pullGit.pull(); 60 | await createDirectories() 61 | let insightRepository = await requestOctokit.requestInsightRepository(header, request) 62 | let verifyCommits = await requestOctokit.verifyCommits(header, request); 63 | if (insightRepository.status && verifyCommits) { 64 | let response = []; 65 | for await (const repositoryName of request.repository) { 66 | let responseRepository = await requestOctokit.requestRepository(header, request, repositoryName); 67 | if (responseRepository.status) { 68 | let octokitResponseViews = await requestOctokit.requestViews(header, responseRepository.response); 69 | if (octokitResponseViews.status) { 70 | response.push(responseRepository.response); 71 | if (request.advancedMode) { 72 | await advancedMode(responseRepository, octokitResponseViews, request); 73 | } else { 74 | await basicMode(responseRepository, octokitResponseViews, request); 75 | } 76 | } 77 | } 78 | } 79 | await profileSVG.updateProfileSVGFile(response); 80 | if (request.advancedMode) { 81 | await summaryReadme.updateSummaryMarkDownFileAdvanced(response, request); 82 | } else { 83 | await summaryReadme.updateSummaryMarkDownFileBasic(response, request); 84 | } 85 | if (!request.devMode) await commitGit.commit("Update views"); 86 | if (!request.devMode) await pushGit.push(); 87 | } 88 | } 89 | } 90 | return { 91 | run: main, 92 | }; 93 | }(); 94 | Index.run().then(() => { }); -------------------------------------------------------------------------------- /src/helper/readme/markdown-template.js: -------------------------------------------------------------------------------- 1 | const recordSummaryFile = require('../../helper/cache/summary-cache'); 2 | let markdownTemplate = function () { 3 | const ACTION_NAME = 'GitHub Profile Views Counter'; 4 | const ACTION_URL = 'https://github.com/gayanvoice/github-profile-views-counter'; 5 | const AUTHOR_NAME = 'gayanvoice'; 6 | const AUTHOR_URL = 'https://github.com/gayanvoice'; 7 | let getDate = function () { 8 | let date = new Date(); 9 | let time = date.toLocaleString('en-US', { timeZone: 'UTC', hour: 'numeric', minute: 'numeric', hour12: true }) 10 | return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()} ${time} UTC` 11 | } 12 | let formatDate = function (timestamp) { 13 | let date = new Date(timestamp); 14 | let time = date.toLocaleString('en-US', { timeZone: 'UTC', hour: 'numeric', minute: 'numeric', hour12: true }) 15 | return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()} ${time} UTC` 16 | } 17 | let footerComponent = function (actionName, actionUrl, authorName, authorUrl) { 18 | let markdown = `[**Set up ${actionName} for your repositories**](${actionUrl})\n`; 19 | markdown = markdown + `## ⛔ DO NOT\n`; 20 | markdown = markdown + `- Do not commit any changes to \`./cache\` directory. This feature helps to integrity of the records for visitors.\n`; 21 | markdown = markdown + `- The app will automatically stop measuring insights until you revoke those commits.\n`; 22 | markdown = markdown + `## 📦 Third party\n\n`; 23 | markdown = markdown + `- [@octokit/rest](https://www.npmjs.com/package/@octokit/rest) - Send REST API requests to GitHub.\n`; 24 | markdown = markdown + `- [fs-extra](https://www.npmjs.com/package/fs-extra) - Creating directories and files.\n`; 25 | markdown = markdown + `- [simple-git](https://www.npmjs.com/package/simple-git) - Handling Git commands.\n`; 26 | markdown = markdown + `- [node-chart-exec](https://www.npmjs.com/package/node-chart-exec) - Generate graphs.\n`; 27 | markdown = markdown + `## 📄 License\n`; 28 | markdown = markdown + `- Powered by: [${actionName}](${actionUrl})\n`; 29 | markdown = markdown + `- Code: [MIT](./LICENSE) © [${authorName}](${authorUrl})\n`; 30 | markdown = markdown + `- Data in the \`./cache\` directory: [Open Database License](https://opendatacommons.org/licenses/odbl/1-0/)`; 31 | return markdown; 32 | } 33 | let createSummaryPageTableComponent = async function (fileName, response, insightsRepository) { 34 | let table = `\n`; 35 | table = table + `\t\n`; 36 | table = table + `\t\t\n`; 39 | table = table + `\t\t\n`; 42 | table = table + `\t\t\n`; 45 | table = table + `\t\t\n`; 48 | table = table + `\t\n`; 49 | for (const repository of response) { 50 | let repositoryUrl = `https://github.com/${repository.ownerLogin}/${insightsRepository}`; 51 | let readmeUrl = `${repositoryUrl}/tree/master/readme` 52 | let graphUrl = `${repositoryUrl}/raw/master/graph` 53 | let summaryCache = await recordSummaryFile.readSummaryCacheFile(repository.repositoryId); 54 | table = table + `\t\n`; 55 | table = table + `\t\t\n`; 60 | table = table + `\t\t\n`; 63 | table = table + `\t\t\n`; 66 | table = table + `\t\t\n`; 69 | table = table + `\t\n`; 70 | } 71 | table = table + `
\n`; 37 | table = table + `\t\t\tRepository\n`; 38 | table = table + `\t\t\n`; 40 | table = table + `\t\t\tLast Updated\n`; 41 | table = table + `\t\t\n`; 43 | table = table + `\t\t\tUnique\n`; 44 | table = table + `\t\t\n`; 46 | table = table + `\t\t\tViews\n`; 47 | table = table + `\t\t
\n`; 56 | table = table + `\t\t\t\n`; 57 | table = table + `\t\t\t\t${repository.repositoryName}\n`; 58 | table = table + `\t\t\t\n`; 59 | table = table + `\t\t\n`; 61 | table = table + `\t\t\t${formatDate(summaryCache.views.timestamp)}\n`; 62 | table = table + `\t\t\n`; 64 | table = table + `\t\t\t${summaryCache.views.summary.uniques}\n`; 65 | table = table + `\t\t\n`; 67 | table = table + `\t\t\tResponse time graph ${summaryCache.views.summary.count}\n`; 68 | table = table + `\t\t
\n\n`; 72 | return table; 73 | } 74 | let summaryPage = async function (fileName, actionName, actionUrl, authorName, authorUrl, response, insightsRepository) { 75 | let lastUpdate = getDate(); 76 | let tableComponent = await createSummaryPageTableComponent(fileName, response, insightsRepository); 77 | let repositoryUrl = `https://github.com/${response[0].ownerLogin}/${insightsRepository}`; 78 | let svgBadge = `[![Image of ${repositoryUrl}](${repositoryUrl}/blob/master/svg/profile/badge.svg)](${repositoryUrl})`; 79 | let markdown = `## [🚀 ${actionName}](${actionUrl})\n`; 80 | markdown = markdown + `**${actionName}** is an opensource project that powered entirely by \`GitHub Actions\` to fetch and store insights of repositories.\n`; 81 | markdown = markdown + `It uses \`GitHub API\` to fetch the insight data of your repositories and commits changes into a separate repository.\n\n` 82 | markdown = markdown + `The project created and maintained by [gayanvoice](https://github.com/gayanvoice). Don't forget to follow him on [GitHub](https://github.com/gayanvoice), [Twitter](https://twitter.com/gayanvoice), and [Medium](https://gayanvoice.medium.com/).\n\n`; 83 | markdown = markdown + tableComponent; 84 | markdown = markdown + `Last updated on ${lastUpdate}\n\n`; 85 | markdown = markdown + `## ✂️Copy and 📋 Paste\n`; 86 | markdown = markdown + `### Total Views Badge\n`; 87 | markdown = markdown + `${svgBadge}\n\n`; 88 | markdown = markdown + `\`\`\`readme\n`; 89 | markdown = markdown + `${svgBadge}\n`; 90 | markdown = markdown + `\`\`\`\n`; 91 | markdown = markdown + footerComponent(actionName, actionUrl, authorName, authorUrl); 92 | return markdown; 93 | } 94 | let menuComponent = function (request, readmeUrl) { 95 | if (request.advancedMode) { 96 | return `| [**Week →**](${readmeUrl}/week.md) | [**Month →**](${readmeUrl}/month.md) | [**Year →**](${readmeUrl}/year.md) |\n| ---- | ---- | ----- |\n`; 97 | } else { 98 | return `\n` 99 | } 100 | } 101 | let createRepositoryPageTableComponent = function (views) { 102 | let table = `\n`; 103 | table = table + `\t\n`; 104 | table = table + `\t\t\n`; 107 | table = table + `\t\t\n`; 110 | table = table + `\t\t\n`; 113 | table = table + `\t\n`; 114 | for (const view of views.reverse()) { 115 | table = table + `\t\n`; 116 | table = table + `\t\t\n`; 119 | table = table + `\t\t\n`; 122 | table = table + `\t\t\n`; 125 | table = table + `\t\n`; 126 | } 127 | table = table + `
\n`; 105 | table = table + `\t\t\tLast Updated\n`; 106 | table = table + `\t\t\n`; 108 | table = table + `\t\t\tUnique\n`; 109 | table = table + `\t\t\n`; 111 | table = table + `\t\t\tCount\n`; 112 | table = table + `\t\t
\n`; 117 | table = table + `\t\t\t${view.timestamp.getFullYear()}/${view.timestamp.getMonth() + 1}/${view.timestamp.getDate()}\n`; 118 | table = table + `\t\t\n`; 120 | table = table + `\t\t\t${view.uniques}\n`; 121 | table = table + `\t\t\n`; 123 | table = table + `\t\t\t${view.count}\n`; 124 | table = table + `\t\t
\n\n`; 128 | return table; 129 | } 130 | let repositoryPage = async function (ACTION_NAME, ACTION_URL, AUTHOR_NAME, AUTHOR_URL, views, file, response, request) { 131 | let insightsRepositoryUrl = `https://github.com/${response.ownerLogin}/${request.insightsRepository}`; 132 | let readmeUrl = `${insightsRepositoryUrl}/blob/master/readme/${response.repositoryId}`; 133 | let repositoryName = `[${response.repositoryName}](https://github.com/${response.ownerLogin}/${response.repositoryName})`; 134 | let chart = `![Image of ${request.insightsRepository}](${insightsRepositoryUrl}/blob/master/graph/${response.repositoryId}/large/${file.toLowerCase()}.png)`; 135 | let svgBadge = `[![Image of ${request.insightsRepository}](${insightsRepositoryUrl}/blob/master/svg/${response.repositoryId}/badge.svg)](${insightsRepositoryUrl}/blob/master/readme/${response.repositoryId}/week.md)`; 136 | let chartBadge; 137 | if(request.advancedMode) { 138 | chartBadge = `# ${response.repositoryName} [Image of ${request.insightsRepository}](${insightsRepositoryUrl}/blob/master/readme/${response.repositoryId}/week.md)`; 139 | } else { 140 | chartBadge = `# ${response.repositoryName} [Image of ${request.insightsRepository}](${insightsRepositoryUrl}/blob/master/readme/${response.repositoryId}/year.md)`; 141 | } 142 | let markdown = `## [🔙 ${request.insightsRepository}](${insightsRepositoryUrl})\n`; 143 | markdown = markdown + menuComponent(request, readmeUrl); 144 | markdown = markdown + `### :octocat: ${repositoryName}\n`; 145 | markdown = markdown + `${chart}\n\n`; 146 | markdown = markdown + `
\n`; 147 | markdown = markdown + `\tClick to expand table\n`; 148 | markdown = markdown + `\t

:calendar: ${file} Page Views Table

\n`; 149 | markdown = markdown + createRepositoryPageTableComponent(views); 150 | markdown = markdown + `
\n`; 151 | markdown = markdown + `Last updated on ${getDate()}\n\n`; 152 | markdown = markdown + `## ✂️Copy and 📋 Paste\n`; 153 | markdown = markdown + `### SVG Badge\n`; 154 | markdown = markdown + `${svgBadge}\n`; 155 | markdown = markdown + `\`\`\`readme\n`; 156 | markdown = markdown + `${svgBadge}\n`; 157 | markdown = markdown + `\`\`\`\n`; 158 | markdown = markdown + `### Header\n`; 159 | markdown = markdown + `${chartBadge}\n`; 160 | markdown = markdown + `\`\`\`readme\n`; 161 | markdown = markdown + `${chartBadge}\n`; 162 | markdown = markdown + `\`\`\`\n`; 163 | markdown = markdown + footerComponent(ACTION_NAME, ACTION_URL, AUTHOR_NAME, ACTION_URL) 164 | return markdown; 165 | } 166 | let createSummaryMarkDownTemplateAdvanced = async function (response, repository) { 167 | return await summaryPage(`week`, ACTION_NAME, ACTION_URL, AUTHOR_NAME, AUTHOR_URL, response, repository); 168 | } 169 | let createSummaryMarkDownTemplateBasic = async function (response, repository) { 170 | return await summaryPage(`year`, ACTION_NAME, ACTION_URL, AUTHOR_NAME, AUTHOR_URL, response, repository); 171 | } 172 | let createListMarkDownTemplate = async function (views, file, response, request) { 173 | return await repositoryPage(ACTION_NAME, ACTION_URL, AUTHOR_NAME, AUTHOR_URL, views, file, response, request); 174 | } 175 | return { 176 | createListMarkDownTemplate: createListMarkDownTemplate, 177 | createSummaryMarkDownTemplateAdvanced: createSummaryMarkDownTemplateAdvanced, 178 | createSummaryMarkDownTemplateBasic: createSummaryMarkDownTemplateBasic 179 | }; 180 | }(); 181 | module.exports = markdownTemplate -------------------------------------------------------------------------------- /dist/sourcemap-register.js: -------------------------------------------------------------------------------- 1 | module.exports=(()=>{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},645:(e,r,n)=>{n(284).install()},284:(e,r,n)=>{var t=n(596).SourceMapConsumer;var o=n(622);var i;try{i=n(747);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var u=n(650);var s=false;var a=false;var l=false;var c="auto";var f={};var p={};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 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 u=true;var s=this.isConstructor();var a=!(this.isToplevel()||s);if(a){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(s){o+="new "+(i||"")}else if(i){o+=i}else{o+=r;u=false}if(u){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){if(e.isNative()){return e}var r=e.getFileName()||e.getScriptNameOrSourceURL();if(r){var n=e.getLineNumber();var t=e.getColumnNumber()-1;var o=62;if(n===1&&t>o&&!isInBrowser()&&!e.isEval()){t-=o}var i=mapSourcePosition({source:r,line:n,column:t});e=cloneCallSite(e);var u=e.getFunctionName;e.getFunctionName=function(){return i.name||u()};e.getFileName=function(){return i.source};e.getLineNumber=function(){return i.line};e.getColumnNumber=function(){return i.column+1};e.getScriptNameOrSourceURL=function(){return i.source};return e}var s=e.isEval()&&e.getEvalOrigin();if(s){s=mapEvalOrigin(s);e=cloneCallSite(e);e.getEvalOrigin=function(){return s};return e}return e}function prepareStackTrace(e,r){if(l){f={};p={}}return e+r.map(function(e){return"\n at "+wrapCallSite(e)}).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 u=f[n];if(!u&&i&&i.existsSync(n)){try{u=i.readFileSync(n,"utf8")}catch(e){u=""}}if(u){var s=u.split(/(?:\r\n|\r|\n)/)[t-1];if(s){return n+":"+t+"\n"+s+"\n"+new Array(o).join(" ")+"^"}}}return null}function printErrorAndExit(e){var r=getErrorSource(e);if(process.stderr._handle&&process.stderr._handle.setBlocking){process.stderr._handle.setBlocking(true)}if(r){console.error();console.error(r)}console.error(e.stack);process.exit(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 m=d.slice(0);r.wrapCallSite=wrapCallSite;r.getErrorSource=getErrorSource;r.mapSourcePosition=mapSourcePosition;r.retrieveSourceMap=_;r.install=function(e){e=e||{};if(e.environment){c=e.environment;if(["node","browser","auto"].indexOf(c)===-1){throw new Error("environment "+c+" was unknown. Available options are {auto, browser, node}")}}if(e.retrieveFile){if(e.overrideRetrieveFile){h.length=0}h.unshift(e.retrieveFile)}if(e.retrieveSourceMap){if(e.overrideRetrieveSourceMap){d.length=0}d.unshift(e.retrieveSourceMap)}if(e.hookRequire&&!isInBrowser()){var r;try{r=n(282)}catch(e){}var t=r.prototype._compile;if(!t.__sourceMapSupport){r.prototype._compile=function(e,r){f[r]=e;p[r]=undefined;return t.call(this,e,r)};r.prototype._compile.__sourceMapSupport=true}}if(!l){l="emptyCacheBetweenOperations"in e?e.emptyCacheBetweenOperations:false}if(!s){s=true;Error.prepareStackTrace=prepareStackTrace}if(!a){var o="handleUncaughtExceptions"in e?e.handleUncaughtExceptions:true;if(o&&hasGlobalProcessEventEmitter()){a=true;shimEmitUncaughtException()}}};r.resetRetrieveHandlers=function(){h.length=0;d.length=0;h=S.slice(0);d=m.slice(0)}},837:(e,r,n)=>{var t=n(983);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(537);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&u;i>>>=o;if(i>0){n|=s}r+=t.encode(n)}while(i>0);return r};r.decode=function base64VLQ_decode(e,r,n){var i=e.length;var a=0;var l=0;var c,f;do{if(r>=i){throw new Error("Expected more digits in base 64 VLQ value.")}f=t.decode(e.charCodeAt(r++));if(f===-1){throw new Error("Invalid base64 digit: "+e.charAt(r-1))}c=!!(f&s);f&=u;a=a+(f<{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,u){var s=Math.floor((n-e)/2)+e;var a=i(t,o[s],true);if(a===0){return s}else if(a>0){if(n-s>1){return recursiveSearch(s,n,t,o,i,u)}if(u==r.LEAST_UPPER_BOUND){return n1){return recursiveSearch(e,s,t,o,i,u)}if(u==r.LEAST_UPPER_BOUND){return s}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}},740:(e,r,n)=>{var t=n(983);function generatedPositionAfter(e,r){var n=e.generatedLine;var o=r.generatedLine;var i=e.generatedColumn;var u=r.generatedColumn;return o>n||o==n&&u>=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},226:(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(983);var i=n(164);var u=n(837).I;var s=n(215);var a=n(226).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 u;switch(i){case SourceMapConsumer.GENERATED_ORDER:u=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:u=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;u.map(function(e){var r=e.source===null?null:this._sources.at(e.source);r=o.computeSourceURL(s,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 u=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,i.LEAST_UPPER_BOUND);if(u>=0){var s=this._originalMappings[u];if(e.column===undefined){var a=s.originalLine;while(s&&s.originalLine===a){t.push({line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)});s=this._originalMappings[++u]}}else{var l=s.originalColumn;while(s&&s.originalLine===r&&s.originalColumn==l){t.push({line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)});s=this._originalMappings[++u]}}}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 s=o.getArg(n,"names",[]);var a=o.getArg(n,"sourceRoot",null);var l=o.getArg(n,"sourcesContent",null);var c=o.getArg(n,"mappings");var f=o.getArg(n,"file",null);if(t!=this._version){throw new Error("Unsupported version: "+t)}if(a){a=o.normalize(a)}i=i.map(String).map(o.normalize).map(function(e){return a&&o.isAbsolute(a)&&o.isAbsolute(e)?o.relative(a,e):e});this._names=u.fromArray(s.map(String),true);this._sources=u.fromArray(i,true);this._absoluteSources=this._sources.toArray().map(function(e){return o.computeSourceURL(a,e,r)});this.sourceRoot=a;this.sourcesContent=l;this._mappings=c;this._sourceMapURL=r;this.file=f}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){_.source=l+m[1];l+=m[1];_.originalLine=i+m[2];i=_.originalLine;_.originalLine+=1;_.originalColumn=u+m[3];u=_.originalColumn;if(m.length>4){_.name=c+m[4];c+=m[4]}}v.push(_);if(typeof _.originalLine==="number"){d.push(_)}}}a(v,o.compareByGeneratedPositionsDeflated);this.__generatedMappings=v;a(d,o.compareByOriginalPositions);this.__originalMappings=d};BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(e,r,n,t,o,u){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,u)};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 u=o.getArg(t,"name",null);if(u!==null){u=this._names.at(u)}return{source:i,line:o.getArg(t,"originalLine",null),column:o.getArg(t,"originalColumn",null),name:u}}}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 u=t.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(u)){return this.sourcesContent[this._sources.indexOf(u)]}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 u;this._names=new u;var s={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(215);var o=n(983);var i=n(837).I;var u=n(740).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 u;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 u=e.sourceContentFor(t);if(u!=null){n.setSourceContent(t,u)}});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 u=this._sourceRoot;if(u!=null){t=o.relative(u,t)}var s=new i;var a=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(u!=null){r.source=o.relative(u,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&&!s.has(l)){s.add(l)}var c=r.name;if(c!=null&&!a.has(c)){a.add(c)}},this);this._sources=s;this._names=a;e.sources.forEach(function(r){var t=e.sourceContentFor(r);if(t!=null){if(n!=null){r=o.join(n,r)}if(u!=null){r=o.relative(u,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 u=0;var s=0;var a="";var l;var c;var f;var p;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){p=this._sources.indexOf(c.source);l+=t.encode(p-s);s=p;l+=t.encode(c.originalLine-1-i);i=c.originalLine-1;l+=t.encode(c.originalColumn-n);n=c.originalColumn;if(c.name!=null){f=this._names.indexOf(c.name);l+=t.encode(f-u);u=f}}a+=l}return a};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},990:(e,r,n)=>{var t;var o=n(341).h;var i=n(983);var u=/(\r?\n)/;var s=10;var a="$$$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[a]=true;if(t!=null)this.add(t)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(e,r,n){var t=new SourceNode;var o=e.split(u);var s=0;var a=function(){var e=getNextLine();var r=getNextLine()||"";return e+r;function getNextLine(){return s=0;r--){this.prepend(e[r])}}else if(e[a]||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 u,s=0,a=i.length-1;a>=0;a--){u=i[a];if(u==="."){i.splice(a,1)}else if(u===".."){s++}else if(s>0){if(u===""){i.splice(a+1,s);s=0}else{i.splice(a,2);s--}}}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},596:(e,r,n)=>{n(341).h;r.SourceMapConsumer=n(327).SourceMapConsumer;n(990)},747:e=>{"use strict";e.exports=require("fs")},282:e=>{"use strict";e.exports=require("module")},622:e=>{"use strict";e.exports=require("path")}};var r={};function __webpack_require__(n){if(r[n]){return r[n].exports}var t=r[n]={exports:{}};var o=true;try{e[n](t,t.exports,__webpack_require__);o=false}finally{if(o)delete r[n]}return t.exports}__webpack_require__.ab=__dirname+"/";return __webpack_require__(645)})(); -------------------------------------------------------------------------------- /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 | @kwsites/file-exists 14 | MIT 15 | The MIT License (MIT) 16 | 17 | Copyright (c) 2015 Steve King 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy of 20 | this software and associated documentation files (the "Software"), to deal in 21 | the Software without restriction, including without limitation the rights to 22 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 23 | the Software, and to permit persons to whom the Software is furnished to do so, 24 | subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in all 27 | copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 31 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 32 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 33 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 34 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 35 | 36 | 37 | @kwsites/promise-deferred 38 | MIT 39 | MIT License 40 | 41 | Copyright (c) 2018 kwsites 42 | 43 | Permission is hereby granted, free of charge, to any person obtaining a copy 44 | of this software and associated documentation files (the "Software"), to deal 45 | in the Software without restriction, including without limitation the rights 46 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 47 | copies of the Software, and to permit persons to whom the Software is 48 | furnished to do so, subject to the following conditions: 49 | 50 | The above copyright notice and this permission notice shall be included in all 51 | copies or substantial portions of the Software. 52 | 53 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 54 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 55 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 56 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 57 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 58 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 59 | SOFTWARE. 60 | 61 | 62 | @octokit/auth-token 63 | MIT 64 | The MIT License 65 | 66 | Copyright (c) 2019 Octokit contributors 67 | 68 | Permission is hereby granted, free of charge, to any person obtaining a copy 69 | of this software and associated documentation files (the "Software"), to deal 70 | in the Software without restriction, including without limitation the rights 71 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 72 | copies of the Software, and to permit persons to whom the Software is 73 | furnished to do so, subject to the following conditions: 74 | 75 | The above copyright notice and this permission notice shall be included in 76 | all copies or substantial portions of the Software. 77 | 78 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 79 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 80 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 81 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 82 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 83 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 84 | THE SOFTWARE. 85 | 86 | 87 | @octokit/core 88 | MIT 89 | The MIT License 90 | 91 | Copyright (c) 2019 Octokit contributors 92 | 93 | Permission is hereby granted, free of charge, to any person obtaining a copy 94 | of this software and associated documentation files (the "Software"), to deal 95 | in the Software without restriction, including without limitation the rights 96 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 97 | copies of the Software, and to permit persons to whom the Software is 98 | furnished to do so, subject to the following conditions: 99 | 100 | The above copyright notice and this permission notice shall be included in 101 | all copies or substantial portions of the Software. 102 | 103 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 104 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 105 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 106 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 107 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 108 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 109 | THE SOFTWARE. 110 | 111 | 112 | @octokit/endpoint 113 | MIT 114 | The MIT License 115 | 116 | Copyright (c) 2018 Octokit contributors 117 | 118 | Permission is hereby granted, free of charge, to any person obtaining a copy 119 | of this software and associated documentation files (the "Software"), to deal 120 | in the Software without restriction, including without limitation the rights 121 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 122 | copies of the Software, and to permit persons to whom the Software is 123 | furnished to do so, subject to the following conditions: 124 | 125 | The above copyright notice and this permission notice shall be included in 126 | all copies or substantial portions of the Software. 127 | 128 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 129 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 130 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 131 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 132 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 133 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 134 | THE SOFTWARE. 135 | 136 | 137 | @octokit/graphql 138 | MIT 139 | The MIT License 140 | 141 | Copyright (c) 2018 Octokit contributors 142 | 143 | Permission is hereby granted, free of charge, to any person obtaining a copy 144 | of this software and associated documentation files (the "Software"), to deal 145 | in the Software without restriction, including without limitation the rights 146 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 147 | copies of the Software, and to permit persons to whom the Software is 148 | furnished to do so, subject to the following conditions: 149 | 150 | The above copyright notice and this permission notice shall be included in 151 | all copies or substantial portions of the Software. 152 | 153 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 154 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 155 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 156 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 157 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 158 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 159 | THE SOFTWARE. 160 | 161 | 162 | @octokit/plugin-paginate-rest 163 | MIT 164 | MIT License Copyright (c) 2019 Octokit contributors 165 | 166 | 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: 167 | 168 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 169 | 170 | 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. 171 | 172 | 173 | @octokit/plugin-request-log 174 | MIT 175 | MIT License Copyright (c) 2020 Octokit contributors 176 | 177 | 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: 178 | 179 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 180 | 181 | 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. 182 | 183 | 184 | @octokit/plugin-rest-endpoint-methods 185 | MIT 186 | MIT License Copyright (c) 2019 Octokit contributors 187 | 188 | 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: 189 | 190 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 191 | 192 | 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. 193 | 194 | 195 | @octokit/request 196 | MIT 197 | The MIT License 198 | 199 | Copyright (c) 2018 Octokit contributors 200 | 201 | Permission is hereby granted, free of charge, to any person obtaining a copy 202 | of this software and associated documentation files (the "Software"), to deal 203 | in the Software without restriction, including without limitation the rights 204 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 205 | copies of the Software, and to permit persons to whom the Software is 206 | furnished to do so, subject to the following conditions: 207 | 208 | The above copyright notice and this permission notice shall be included in 209 | all copies or substantial portions of the Software. 210 | 211 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 212 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 213 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 214 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 215 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 216 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 217 | THE SOFTWARE. 218 | 219 | 220 | @octokit/request-error 221 | MIT 222 | The MIT License 223 | 224 | Copyright (c) 2019 Octokit contributors 225 | 226 | Permission is hereby granted, free of charge, to any person obtaining a copy 227 | of this software and associated documentation files (the "Software"), to deal 228 | in the Software without restriction, including without limitation the rights 229 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 230 | copies of the Software, and to permit persons to whom the Software is 231 | furnished to do so, subject to the following conditions: 232 | 233 | The above copyright notice and this permission notice shall be included in 234 | all copies or substantial portions of the Software. 235 | 236 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 237 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 238 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 239 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 240 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 241 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 242 | THE SOFTWARE. 243 | 244 | 245 | @octokit/rest 246 | MIT 247 | The MIT License 248 | 249 | Copyright (c) 2012 Cloud9 IDE, Inc. (Mike de Boer) 250 | Copyright (c) 2017-2018 Octokit contributors 251 | 252 | Permission is hereby granted, free of charge, to any person obtaining a copy 253 | of this software and associated documentation files (the "Software"), to deal 254 | in the Software without restriction, including without limitation the rights 255 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 256 | copies of the Software, and to permit persons to whom the Software is 257 | furnished to do so, subject to the following conditions: 258 | 259 | The above copyright notice and this permission notice shall be included in 260 | all copies or substantial portions of the Software. 261 | 262 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 263 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 264 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 265 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 266 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 267 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 268 | THE SOFTWARE. 269 | 270 | 271 | @vercel/ncc 272 | MIT 273 | Copyright 2018 ZEIT, Inc. 274 | 275 | 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: 276 | 277 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 278 | 279 | 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. 280 | 281 | at-least-node 282 | ISC 283 | The ISC License 284 | Copyright (c) 2020 Ryan Zimmerman 285 | 286 | 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. 287 | 288 | 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. 289 | 290 | 291 | before-after-hook 292 | Apache-2.0 293 | Apache License 294 | Version 2.0, January 2004 295 | http://www.apache.org/licenses/ 296 | 297 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 298 | 299 | 1. Definitions. 300 | 301 | "License" shall mean the terms and conditions for use, reproduction, 302 | and distribution as defined by Sections 1 through 9 of this document. 303 | 304 | "Licensor" shall mean the copyright owner or entity authorized by 305 | the copyright owner that is granting the License. 306 | 307 | "Legal Entity" shall mean the union of the acting entity and all 308 | other entities that control, are controlled by, or are under common 309 | control with that entity. For the purposes of this definition, 310 | "control" means (i) the power, direct or indirect, to cause the 311 | direction or management of such entity, whether by contract or 312 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 313 | outstanding shares, or (iii) beneficial ownership of such entity. 314 | 315 | "You" (or "Your") shall mean an individual or Legal Entity 316 | exercising permissions granted by this License. 317 | 318 | "Source" form shall mean the preferred form for making modifications, 319 | including but not limited to software source code, documentation 320 | source, and configuration files. 321 | 322 | "Object" form shall mean any form resulting from mechanical 323 | transformation or translation of a Source form, including but 324 | not limited to compiled object code, generated documentation, 325 | and conversions to other media types. 326 | 327 | "Work" shall mean the work of authorship, whether in Source or 328 | Object form, made available under the License, as indicated by a 329 | copyright notice that is included in or attached to the work 330 | (an example is provided in the Appendix below). 331 | 332 | "Derivative Works" shall mean any work, whether in Source or Object 333 | form, that is based on (or derived from) the Work and for which the 334 | editorial revisions, annotations, elaborations, or other modifications 335 | represent, as a whole, an original work of authorship. For the purposes 336 | of this License, Derivative Works shall not include works that remain 337 | separable from, or merely link (or bind by name) to the interfaces of, 338 | the Work and Derivative Works thereof. 339 | 340 | "Contribution" shall mean any work of authorship, including 341 | the original version of the Work and any modifications or additions 342 | to that Work or Derivative Works thereof, that is intentionally 343 | submitted to Licensor for inclusion in the Work by the copyright owner 344 | or by an individual or Legal Entity authorized to submit on behalf of 345 | the copyright owner. For the purposes of this definition, "submitted" 346 | means any form of electronic, verbal, or written communication sent 347 | to the Licensor or its representatives, including but not limited to 348 | communication on electronic mailing lists, source code control systems, 349 | and issue tracking systems that are managed by, or on behalf of, the 350 | Licensor for the purpose of discussing and improving the Work, but 351 | excluding communication that is conspicuously marked or otherwise 352 | designated in writing by the copyright owner as "Not a Contribution." 353 | 354 | "Contributor" shall mean Licensor and any individual or Legal Entity 355 | on behalf of whom a Contribution has been received by Licensor and 356 | subsequently incorporated within the Work. 357 | 358 | 2. Grant of Copyright License. Subject to the terms and conditions of 359 | this License, each Contributor hereby grants to You a perpetual, 360 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 361 | copyright license to reproduce, prepare Derivative Works of, 362 | publicly display, publicly perform, sublicense, and distribute the 363 | Work and such Derivative Works in Source or Object form. 364 | 365 | 3. Grant of Patent License. Subject to the terms and conditions of 366 | this License, each Contributor hereby grants to You a perpetual, 367 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 368 | (except as stated in this section) patent license to make, have made, 369 | use, offer to sell, sell, import, and otherwise transfer the Work, 370 | where such license applies only to those patent claims licensable 371 | by such Contributor that are necessarily infringed by their 372 | Contribution(s) alone or by combination of their Contribution(s) 373 | with the Work to which such Contribution(s) was submitted. If You 374 | institute patent litigation against any entity (including a 375 | cross-claim or counterclaim in a lawsuit) alleging that the Work 376 | or a Contribution incorporated within the Work constitutes direct 377 | or contributory patent infringement, then any patent licenses 378 | granted to You under this License for that Work shall terminate 379 | as of the date such litigation is filed. 380 | 381 | 4. Redistribution. You may reproduce and distribute copies of the 382 | Work or Derivative Works thereof in any medium, with or without 383 | modifications, and in Source or Object form, provided that You 384 | meet the following conditions: 385 | 386 | (a) You must give any other recipients of the Work or 387 | Derivative Works a copy of this License; and 388 | 389 | (b) You must cause any modified files to carry prominent notices 390 | stating that You changed the files; and 391 | 392 | (c) You must retain, in the Source form of any Derivative Works 393 | that You distribute, all copyright, patent, trademark, and 394 | attribution notices from the Source form of the Work, 395 | excluding those notices that do not pertain to any part of 396 | the Derivative Works; and 397 | 398 | (d) If the Work includes a "NOTICE" text file as part of its 399 | distribution, then any Derivative Works that You distribute must 400 | include a readable copy of the attribution notices contained 401 | within such NOTICE file, excluding those notices that do not 402 | pertain to any part of the Derivative Works, in at least one 403 | of the following places: within a NOTICE text file distributed 404 | as part of the Derivative Works; within the Source form or 405 | documentation, if provided along with the Derivative Works; or, 406 | within a display generated by the Derivative Works, if and 407 | wherever such third-party notices normally appear. The contents 408 | of the NOTICE file are for informational purposes only and 409 | do not modify the License. You may add Your own attribution 410 | notices within Derivative Works that You distribute, alongside 411 | or as an addendum to the NOTICE text from the Work, provided 412 | that such additional attribution notices cannot be construed 413 | as modifying the License. 414 | 415 | You may add Your own copyright statement to Your modifications and 416 | may provide additional or different license terms and conditions 417 | for use, reproduction, or distribution of Your modifications, or 418 | for any such Derivative Works as a whole, provided Your use, 419 | reproduction, and distribution of the Work otherwise complies with 420 | the conditions stated in this License. 421 | 422 | 5. Submission of Contributions. Unless You explicitly state otherwise, 423 | any Contribution intentionally submitted for inclusion in the Work 424 | by You to the Licensor shall be under the terms and conditions of 425 | this License, without any additional terms or conditions. 426 | Notwithstanding the above, nothing herein shall supersede or modify 427 | the terms of any separate license agreement you may have executed 428 | with Licensor regarding such Contributions. 429 | 430 | 6. Trademarks. This License does not grant permission to use the trade 431 | names, trademarks, service marks, or product names of the Licensor, 432 | except as required for reasonable and customary use in describing the 433 | origin of the Work and reproducing the content of the NOTICE file. 434 | 435 | 7. Disclaimer of Warranty. Unless required by applicable law or 436 | agreed to in writing, Licensor provides the Work (and each 437 | Contributor provides its Contributions) on an "AS IS" BASIS, 438 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 439 | implied, including, without limitation, any warranties or conditions 440 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 441 | PARTICULAR PURPOSE. You are solely responsible for determining the 442 | appropriateness of using or redistributing the Work and assume any 443 | risks associated with Your exercise of permissions under this License. 444 | 445 | 8. Limitation of Liability. In no event and under no legal theory, 446 | whether in tort (including negligence), contract, or otherwise, 447 | unless required by applicable law (such as deliberate and grossly 448 | negligent acts) or agreed to in writing, shall any Contributor be 449 | liable to You for damages, including any direct, indirect, special, 450 | incidental, or consequential damages of any character arising as a 451 | result of this License or out of the use or inability to use the 452 | Work (including but not limited to damages for loss of goodwill, 453 | work stoppage, computer failure or malfunction, or any and all 454 | other commercial damages or losses), even if such Contributor 455 | has been advised of the possibility of such damages. 456 | 457 | 9. Accepting Warranty or Additional Liability. While redistributing 458 | the Work or Derivative Works thereof, You may choose to offer, 459 | and charge a fee for, acceptance of support, warranty, indemnity, 460 | or other liability obligations and/or rights consistent with this 461 | License. However, in accepting such obligations, You may act only 462 | on Your own behalf and on Your sole responsibility, not on behalf 463 | of any other Contributor, and only if You agree to indemnify, 464 | defend, and hold each Contributor harmless for any liability 465 | incurred by, or claims asserted against, such Contributor by reason 466 | of your accepting any such warranty or additional liability. 467 | 468 | END OF TERMS AND CONDITIONS 469 | 470 | APPENDIX: How to apply the Apache License to your work. 471 | 472 | To apply the Apache License to your work, attach the following 473 | boilerplate notice, with the fields enclosed by brackets "{}" 474 | replaced with your own identifying information. (Don't include 475 | the brackets!) The text should be enclosed in the appropriate 476 | comment syntax for the file format. We also recommend that a 477 | file or class name and description of purpose be included on the 478 | same "printed page" as the copyright notice for easier 479 | identification within third-party archives. 480 | 481 | Copyright 2018 Gregor Martynus and other contributors. 482 | 483 | Licensed under the Apache License, Version 2.0 (the "License"); 484 | you may not use this file except in compliance with the License. 485 | You may obtain a copy of the License at 486 | 487 | http://www.apache.org/licenses/LICENSE-2.0 488 | 489 | Unless required by applicable law or agreed to in writing, software 490 | distributed under the License is distributed on an "AS IS" BASIS, 491 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 492 | See the License for the specific language governing permissions and 493 | limitations under the License. 494 | 495 | 496 | debug 497 | MIT 498 | (The MIT License) 499 | 500 | Copyright (c) 2014 TJ Holowaychuk 501 | 502 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 503 | and associated documentation files (the 'Software'), to deal in the Software without restriction, 504 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 505 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 506 | subject to the following conditions: 507 | 508 | The above copyright notice and this permission notice shall be included in all copies or substantial 509 | portions of the Software. 510 | 511 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 512 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 513 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 514 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 515 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 516 | 517 | 518 | 519 | deprecation 520 | ISC 521 | The ISC License 522 | 523 | Copyright (c) Gregor Martynus and contributors 524 | 525 | Permission to use, copy, modify, and/or distribute this software for any 526 | purpose with or without fee is hereby granted, provided that the above 527 | copyright notice and this permission notice appear in all copies. 528 | 529 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 530 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 531 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 532 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 533 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 534 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 535 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 536 | 537 | 538 | fs-extra 539 | MIT 540 | (The MIT License) 541 | 542 | Copyright (c) 2011-2017 JP Richardson 543 | 544 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files 545 | (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, 546 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 547 | furnished to do so, subject to the following conditions: 548 | 549 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 550 | 551 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 552 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 553 | OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 554 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 555 | 556 | 557 | graceful-fs 558 | ISC 559 | The ISC License 560 | 561 | Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors 562 | 563 | Permission to use, copy, modify, and/or distribute this software for any 564 | purpose with or without fee is hereby granted, provided that the above 565 | copyright notice and this permission notice appear in all copies. 566 | 567 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 568 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 569 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 570 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 571 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 572 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 573 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 574 | 575 | 576 | has-flag 577 | MIT 578 | MIT License 579 | 580 | Copyright (c) Sindre Sorhus (sindresorhus.com) 581 | 582 | 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: 583 | 584 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 585 | 586 | 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. 587 | 588 | 589 | is-plain-object 590 | MIT 591 | The MIT License (MIT) 592 | 593 | Copyright (c) 2014-2017, Jon Schlinkert. 594 | 595 | Permission is hereby granted, free of charge, to any person obtaining a copy 596 | of this software and associated documentation files (the "Software"), to deal 597 | in the Software without restriction, including without limitation the rights 598 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 599 | copies of the Software, and to permit persons to whom the Software is 600 | furnished to do so, subject to the following conditions: 601 | 602 | The above copyright notice and this permission notice shall be included in 603 | all copies or substantial portions of the Software. 604 | 605 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 606 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 607 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 608 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 609 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 610 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 611 | THE SOFTWARE. 612 | 613 | 614 | jsonfile 615 | MIT 616 | (The MIT License) 617 | 618 | Copyright (c) 2012-2015, JP Richardson 619 | 620 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files 621 | (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, 622 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 623 | furnished to do so, subject to the following conditions: 624 | 625 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 626 | 627 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 628 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 629 | OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 630 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 631 | 632 | 633 | ms 634 | MIT 635 | The MIT License (MIT) 636 | 637 | Copyright (c) 2016 Zeit, Inc. 638 | 639 | Permission is hereby granted, free of charge, to any person obtaining a copy 640 | of this software and associated documentation files (the "Software"), to deal 641 | in the Software without restriction, including without limitation the rights 642 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 643 | copies of the Software, and to permit persons to whom the Software is 644 | furnished to do so, subject to the following conditions: 645 | 646 | The above copyright notice and this permission notice shall be included in all 647 | copies or substantial portions of the Software. 648 | 649 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 650 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 651 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 652 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 653 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 654 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 655 | SOFTWARE. 656 | 657 | 658 | node-fetch 659 | MIT 660 | The MIT License (MIT) 661 | 662 | Copyright (c) 2016 David Frank 663 | 664 | Permission is hereby granted, free of charge, to any person obtaining a copy 665 | of this software and associated documentation files (the "Software"), to deal 666 | in the Software without restriction, including without limitation the rights 667 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 668 | copies of the Software, and to permit persons to whom the Software is 669 | furnished to do so, subject to the following conditions: 670 | 671 | The above copyright notice and this permission notice shall be included in all 672 | copies or substantial portions of the Software. 673 | 674 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 675 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 676 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 677 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 678 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 679 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 680 | SOFTWARE. 681 | 682 | 683 | 684 | once 685 | ISC 686 | The ISC License 687 | 688 | Copyright (c) Isaac Z. Schlueter and Contributors 689 | 690 | Permission to use, copy, modify, and/or distribute this software for any 691 | purpose with or without fee is hereby granted, provided that the above 692 | copyright notice and this permission notice appear in all copies. 693 | 694 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 695 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 696 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 697 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 698 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 699 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 700 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 701 | 702 | 703 | simple-git 704 | MIT 705 | The MIT License (MIT) 706 | 707 | Copyright (c) 2015 Steve King 708 | 709 | Permission is hereby granted, free of charge, to any person obtaining a copy of 710 | this software and associated documentation files (the "Software"), to deal in 711 | the Software without restriction, including without limitation the rights to 712 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 713 | the Software, and to permit persons to whom the Software is furnished to do so, 714 | subject to the following conditions: 715 | 716 | The above copyright notice and this permission notice shall be included in all 717 | copies or substantial portions of the Software. 718 | 719 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 720 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 721 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 722 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 723 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 724 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 725 | 726 | 727 | supports-color 728 | MIT 729 | MIT License 730 | 731 | Copyright (c) Sindre Sorhus (sindresorhus.com) 732 | 733 | 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: 734 | 735 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 736 | 737 | 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. 738 | 739 | 740 | universal-user-agent 741 | ISC 742 | # [ISC License](https://spdx.org/licenses/ISC) 743 | 744 | Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m) 745 | 746 | 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. 747 | 748 | 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. 749 | 750 | 751 | universalify 752 | MIT 753 | (The MIT License) 754 | 755 | Copyright (c) 2017, Ryan Zimmerman 756 | 757 | Permission is hereby granted, free of charge, to any person obtaining a copy of 758 | this software and associated documentation files (the 'Software'), to deal in 759 | the Software without restriction, including without limitation the rights to 760 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 761 | the Software, and to permit persons to whom the Software is furnished to do so, 762 | subject to the following conditions: 763 | 764 | The above copyright notice and this permission notice shall be included in all 765 | copies or substantial portions of the Software. 766 | 767 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 768 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 769 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 770 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 771 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 772 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 773 | 774 | 775 | wrappy 776 | ISC 777 | The ISC License 778 | 779 | Copyright (c) Isaac Z. Schlueter and Contributors 780 | 781 | Permission to use, copy, modify, and/or distribute this software for any 782 | purpose with or without fee is hereby granted, provided that the above 783 | copyright notice and this permission notice appear in all copies. 784 | 785 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 786 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 787 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 788 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 789 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 790 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 791 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 792 | --------------------------------------------------------------------------------