mirror of
https://github.com/kahole/edamagit.git
synced 2024-09-11 07:15:31 +03:00
forge cache and refresh interval
This commit is contained in:
parent
3657dbb11c
commit
50f3416058
294
package-lock.json
generated
294
package-lock.json
generated
@ -94,128 +94,10 @@
|
||||
"fastq": "^1.6.0"
|
||||
}
|
||||
},
|
||||
"@octokit/auth-token": {
|
||||
"version": "2.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.4.tgz",
|
||||
"integrity": "sha512-LNfGu3Ro9uFAYh10MUZVaT7X2CnNm2C8IDQmabx+3DygYIQjs9FwzFAHN/0t6mu5HEPhxcb1XOuxdpY82vCg2Q==",
|
||||
"requires": {
|
||||
"@octokit/types": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"@octokit/core": {
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.2.4.tgz",
|
||||
"integrity": "sha512-d9dTsqdePBqOn7aGkyRFe7pQpCXdibSJ5SFnrTr0axevObZrpz3qkWm7t/NjYv5a66z6vhfteriaq4FRz3e0Qg==",
|
||||
"requires": {
|
||||
"@octokit/auth-token": "^2.4.4",
|
||||
"@octokit/graphql": "^4.5.8",
|
||||
"@octokit/request": "^5.4.12",
|
||||
"@octokit/types": "^6.0.3",
|
||||
"before-after-hook": "^2.1.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"@octokit/endpoint": {
|
||||
"version": "6.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.10.tgz",
|
||||
"integrity": "sha512-9+Xef8nT7OKZglfkOMm7IL6VwxXUQyR7DUSU0LH/F7VNqs8vyd7es5pTfz9E7DwUIx7R3pGscxu1EBhYljyu7Q==",
|
||||
"requires": {
|
||||
"@octokit/types": "^6.0.0",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"@octokit/graphql": {
|
||||
"version": "4.5.8",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.5.8.tgz",
|
||||
"integrity": "sha512-WnCtNXWOrupfPJgXe+vSmprZJUr0VIu14G58PMlkWGj3cH+KLZEfKMmbUQ6C3Wwx6fdhzVW1CD5RTnBdUHxhhA==",
|
||||
"requires": {
|
||||
"@octokit/request": "^5.3.0",
|
||||
"@octokit/types": "^6.0.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"@octokit/openapi-types": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-2.0.0.tgz",
|
||||
"integrity": "sha512-J4bfM7lf8oZvEAdpS71oTvC1ofKxfEZgU5vKVwzZKi4QPiL82udjpseJwxPid9Pu2FNmyRQOX4iEj6W1iOSnPw=="
|
||||
},
|
||||
"@octokit/plugin-paginate-rest": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.6.2.tgz",
|
||||
"integrity": "sha512-3Dy7/YZAwdOaRpGQoNHPeT0VU1fYLpIUdPyvR37IyFLgd6XSij4j9V/xN/+eSjF2KKvmfIulEh9LF1tRPjIiDA==",
|
||||
"requires": {
|
||||
"@octokit/types": "^6.0.1"
|
||||
}
|
||||
},
|
||||
"@octokit/plugin-request-log": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.2.tgz",
|
||||
"integrity": "sha512-oTJSNAmBqyDR41uSMunLQKMX0jmEXbwD1fpz8FG27lScV3RhtGfBa1/BBLym+PxcC16IBlF7KH9vP1BUYxA+Eg=="
|
||||
},
|
||||
"@octokit/plugin-rest-endpoint-methods": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.2.0.tgz",
|
||||
"integrity": "sha512-1/qn1q1C1hGz6W/iEDm9DoyNoG/xdFDt78E3eZ5hHeUfJTLJgyAMdj9chL/cNBHjcjd+FH5aO1x0VCqR2RE0mw==",
|
||||
"requires": {
|
||||
"@octokit/types": "^5.5.0",
|
||||
"deprecation": "^2.3.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@octokit/types": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz",
|
||||
"integrity": "sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==",
|
||||
"requires": {
|
||||
"@types/node": ">= 8"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@octokit/request": {
|
||||
"version": "5.4.12",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.12.tgz",
|
||||
"integrity": "sha512-MvWYdxengUWTGFpfpefBBpVmmEYfkwMoxonIB3sUGp5rhdgwjXL1ejo6JbgzG/QD9B/NYt/9cJX1pxXeSIUCkg==",
|
||||
"requires": {
|
||||
"@octokit/endpoint": "^6.0.1",
|
||||
"@octokit/request-error": "^2.0.0",
|
||||
"@octokit/types": "^6.0.3",
|
||||
"deprecation": "^2.0.0",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"once": "^1.4.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"@octokit/request-error": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.4.tgz",
|
||||
"integrity": "sha512-LjkSiTbsxIErBiRh5wSZvpZqT4t0/c9+4dOe0PII+6jXR+oj/h66s7E4a/MghV7iT8W9ffoQ5Skoxzs96+gBPA==",
|
||||
"requires": {
|
||||
"@octokit/types": "^6.0.0",
|
||||
"deprecation": "^2.0.0",
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"@octokit/rest": {
|
||||
"version": "18.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.0.6.tgz",
|
||||
"integrity": "sha512-ES4lZBKPJMX/yUoQjAZiyFjei9pJ4lTTfb9k7OtYoUzKPDLl/M8jiHqt6qeSauyU4eZGLw0sgP1WiQl9FYeM5w==",
|
||||
"requires": {
|
||||
"@octokit/core": "^3.0.0",
|
||||
"@octokit/plugin-paginate-rest": "^2.2.0",
|
||||
"@octokit/plugin-request-log": "^1.0.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "4.2.0"
|
||||
}
|
||||
},
|
||||
"@octokit/types": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.1.1.tgz",
|
||||
"integrity": "sha512-btm3D6S7VkRrgyYF31etUtVY/eQ1KzrNRqhFt25KSe2mKlXuLXJilglRC6eDA2P6ou94BUnk/Kz5MPEolXgoiw==",
|
||||
"requires": {
|
||||
"@octokit/openapi-types": "^2.0.0",
|
||||
"@types/node": ">= 8"
|
||||
}
|
||||
"@types/cookiejar": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz",
|
||||
"integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog=="
|
||||
},
|
||||
"@types/eslint": {
|
||||
"version": "7.2.5",
|
||||
@ -276,6 +158,15 @@
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.9.tgz",
|
||||
"integrity": "sha512-JsoLXFppG62tWTklIoO4knA+oDTYsmqWxHRvd4lpmfQRNhX6osheUOWETP2jMoV/2bEHuMra8Pp3Dmo/stBFcw=="
|
||||
},
|
||||
"@types/superagent": {
|
||||
"version": "4.1.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.10.tgz",
|
||||
"integrity": "sha512-xAgkb2CMWUMCyVc/3+7iQfOEBE75NvuZeezvmixbUw3nmENf2tCnQkW5yQLTYqvXUQ+R6EXxdqKKbal2zM5V/g==",
|
||||
"requires": {
|
||||
"@types/cookiejar": "*",
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/vscode": {
|
||||
"version": "1.51.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.51.0.tgz",
|
||||
@ -686,17 +577,17 @@
|
||||
"integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||
"dev": true
|
||||
},
|
||||
"before-after-hook": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz",
|
||||
"integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A=="
|
||||
},
|
||||
"big.js": {
|
||||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
|
||||
@ -864,6 +755,14 @@
|
||||
"integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"requires": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"command-line-usage": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.1.tgz",
|
||||
@ -888,12 +787,22 @@
|
||||
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
|
||||
"dev": true
|
||||
},
|
||||
"component-emitter": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
|
||||
"integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"cookiejar": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz",
|
||||
"integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA=="
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||
@ -920,7 +829,6 @@
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
|
||||
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.1.2"
|
||||
}
|
||||
@ -943,10 +851,10 @@
|
||||
"integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
|
||||
"dev": true
|
||||
},
|
||||
"deprecation": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
|
||||
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||
},
|
||||
"diff": {
|
||||
"version": "4.0.2",
|
||||
@ -1494,6 +1402,11 @@
|
||||
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
|
||||
"dev": true
|
||||
},
|
||||
"fast-safe-stringify": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz",
|
||||
"integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
|
||||
},
|
||||
"fastq": {
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz",
|
||||
@ -1553,6 +1466,21 @@
|
||||
"integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==",
|
||||
"dev": true
|
||||
},
|
||||
"form-data": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz",
|
||||
"integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==",
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
},
|
||||
"formidable": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz",
|
||||
"integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q=="
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
|
||||
@ -1788,8 +1716,7 @@
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"interpret": {
|
||||
"version": "2.2.0",
|
||||
@ -1848,11 +1775,6 @@
|
||||
"integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
|
||||
"dev": true
|
||||
},
|
||||
"is-plain-object": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
|
||||
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
|
||||
},
|
||||
"is-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
|
||||
@ -2065,6 +1987,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"requires": {
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"memory-fs": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz",
|
||||
@ -2087,6 +2017,11 @@
|
||||
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
|
||||
"dev": true
|
||||
},
|
||||
"methods": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
|
||||
},
|
||||
"micromatch": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
|
||||
@ -2097,17 +2032,20 @@
|
||||
"picomatch": "^2.0.5"
|
||||
}
|
||||
},
|
||||
"mime": {
|
||||
"version": "2.4.6",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz",
|
||||
"integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA=="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.44.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
|
||||
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.27",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
|
||||
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mime-db": "1.44.0"
|
||||
}
|
||||
@ -2271,8 +2209,7 @@
|
||||
"ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||
"dev": true
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"nanoid": {
|
||||
"version": "3.1.12",
|
||||
@ -2292,11 +2229,6 @@
|
||||
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
|
||||
"dev": true
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
|
||||
},
|
||||
"node-releases": {
|
||||
"version": "1.1.67",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz",
|
||||
@ -2328,6 +2260,7 @@
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
@ -2509,6 +2442,11 @@
|
||||
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
|
||||
"dev": true
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.9.4",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz",
|
||||
"integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ=="
|
||||
},
|
||||
"randombytes": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||
@ -2632,8 +2570,7 @@
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"dev": true
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"schema-utils": {
|
||||
"version": "3.0.0",
|
||||
@ -2768,7 +2705,6 @@
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
@ -2802,6 +2738,44 @@
|
||||
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
|
||||
"dev": true
|
||||
},
|
||||
"superagent": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz",
|
||||
"integrity": "sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==",
|
||||
"requires": {
|
||||
"component-emitter": "^1.3.0",
|
||||
"cookiejar": "^2.1.2",
|
||||
"debug": "^4.1.1",
|
||||
"fast-safe-stringify": "^2.0.7",
|
||||
"form-data": "^3.0.0",
|
||||
"formidable": "^1.2.2",
|
||||
"methods": "^1.1.2",
|
||||
"mime": "^2.4.6",
|
||||
"qs": "^6.9.4",
|
||||
"readable-stream": "^3.6.0",
|
||||
"semver": "^7.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.3.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
|
||||
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
|
||||
"requires": {
|
||||
"lru-cache": "^6.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
@ -2955,11 +2929,6 @@
|
||||
"integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==",
|
||||
"dev": true
|
||||
},
|
||||
"universal-user-agent": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
|
||||
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
|
||||
},
|
||||
"universalify": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
|
||||
@ -2978,8 +2947,7 @@
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
|
||||
"dev": true
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"v8-compile-cache": {
|
||||
"version": "2.2.0",
|
||||
@ -3224,7 +3192,8 @@
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"write": {
|
||||
"version": "1.0.3",
|
||||
@ -3241,6 +3210,11 @@
|
||||
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
|
||||
"dev": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
||||
},
|
||||
"yargs": {
|
||||
"version": "13.3.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz",
|
||||
|
@ -392,6 +392,11 @@
|
||||
],
|
||||
"default": "other-column",
|
||||
"description": "Choose where new buffers will be displayed. (reload extension for effect)"
|
||||
},
|
||||
"magit.forge-enabled": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Enable Forge functionality (show pull requests, issues, etc from e.g. Github)"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -684,8 +689,9 @@
|
||||
"webpack-cli": "^4.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/superagent": "^4.1.10",
|
||||
"date-fns": "^2.16.1",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"@octokit/rest": "18.0.6"
|
||||
"superagent": "^6.1.0"
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ async function checkoutPullRequest(menuState: MenuState) {
|
||||
}
|
||||
const prItems = prs.map((v, idx) => ({
|
||||
label: v.id.toString(),
|
||||
description: v.name,
|
||||
description: v.title,
|
||||
meta: idx
|
||||
}));
|
||||
const prIdx = await PickMenuUtil.showMenu(prItems, 'Checkout pull request');
|
||||
|
@ -17,7 +17,7 @@ import { MagitRevertingState } from '../models/magitRevertingState';
|
||||
import { Stash } from '../models/stash';
|
||||
import { MagitRepository } from '../models/magitRepository';
|
||||
import ViewUtils from '../utils/viewUtils';
|
||||
import { forgeStatus } from '../utils/forgeUtils';
|
||||
import { forgeStatus } from '../forge';
|
||||
|
||||
export async function magitRefresh() { }
|
||||
|
||||
|
@ -40,6 +40,7 @@ import { blameFile } from './commands/blamingCommands';
|
||||
import { copySectionValueCommand } from './commands/copySectionValueCommands';
|
||||
import { copyBufferRevisionCommands } from './commands/copyBufferRevisionCommands';
|
||||
import { submodules } from './commands/submodulesCommands';
|
||||
import { forgeRefreshInterval } from './forge';
|
||||
|
||||
export const magitRepositories: Map<string, MagitRepository> = new Map<string, MagitRepository>();
|
||||
export const views: Map<string, DocumentView> = new Map<string, DocumentView>();
|
||||
@ -47,7 +48,16 @@ export const processLog: MagitProcessLogEntry[] = [];
|
||||
|
||||
export let gitApi: API;
|
||||
export let logPath: string;
|
||||
export let magitConfig: { displayBufferFunction?: string };
|
||||
export let magitConfig: { displayBufferFunction?: string, forgeEnabled?: boolean };
|
||||
|
||||
function loadConfig() {
|
||||
let workspaceConfig = workspace.getConfiguration('magit');
|
||||
|
||||
magitConfig = {
|
||||
displayBufferFunction: workspaceConfig.get('display-buffer-function'),
|
||||
forgeEnabled: workspaceConfig.get('forge-enabled')
|
||||
};
|
||||
}
|
||||
|
||||
export function activate(context: ExtensionContext) {
|
||||
|
||||
@ -56,7 +66,12 @@ export function activate(context: ExtensionContext) {
|
||||
throw new Error('vscode.git Git extension not enabled');
|
||||
}
|
||||
|
||||
magitConfig = { displayBufferFunction: workspace.getConfiguration('magit').get('display-buffer-function') };
|
||||
loadConfig();
|
||||
workspace.onDidChangeConfiguration(configChangedEvent => {
|
||||
if (configChangedEvent.affectsConfiguration('magit')) {
|
||||
loadConfig();
|
||||
}
|
||||
});
|
||||
|
||||
context.subscriptions.push(gitExtension.onDidChangeEnablement(enabled => {
|
||||
if (!enabled) {
|
||||
@ -153,4 +168,8 @@ export function activate(context: ExtensionContext) {
|
||||
}
|
||||
|
||||
export function deactivate() {
|
||||
|
||||
if (forgeRefreshInterval) {
|
||||
clearInterval(forgeRefreshInterval);
|
||||
}
|
||||
}
|
||||
|
79
src/forge/github.ts
Normal file
79
src/forge/github.ts
Normal file
@ -0,0 +1,79 @@
|
||||
import { PullRequest } from './model/pullRequest';
|
||||
import * as request from 'superagent';
|
||||
import * as vscode from 'vscode';
|
||||
import { ForgeState } from './model/forgeState';
|
||||
|
||||
const GITHUB_AUTH_PROVIDER_ID = 'github';
|
||||
const SCOPES = ['repo'];
|
||||
|
||||
export async function getGithubForgeState(remoteUrl: string): Promise<ForgeState> {
|
||||
|
||||
let cleaned = remoteUrl
|
||||
.replace(/.*github.com(\/|:)/, '')
|
||||
.replace('.git', '');
|
||||
|
||||
const owner = cleaned.split('/').filter(Boolean)[0];
|
||||
const repo = cleaned.split('/').filter(Boolean)[1];
|
||||
|
||||
let accessToken = await authenticate();
|
||||
|
||||
let pullRequestsTask = getPullRequests(accessToken, owner, repo);
|
||||
|
||||
return {
|
||||
forgeRemote: remoteUrl.toString(),
|
||||
pullRequests: await pullRequestsTask
|
||||
};
|
||||
}
|
||||
|
||||
async function authenticate(): Promise<string> {
|
||||
|
||||
const session = await vscode.authentication.getSession(GITHUB_AUTH_PROVIDER_ID, SCOPES, { createIfNone: true });
|
||||
return session.accessToken;
|
||||
}
|
||||
|
||||
async function getPullRequests(accessToken: string, owner: string, repo: string): Promise<PullRequest[]> {
|
||||
|
||||
let res = await queryGithub(accessToken,
|
||||
{
|
||||
query:
|
||||
`query GetOpenPullRequests($owner: String!, $repo: String!) {
|
||||
repository(owner: $owner, name: $repo) {
|
||||
pullRequests(last:10, states: OPEN) {
|
||||
edges { node {
|
||||
number
|
||||
title
|
||||
labels(last: 10) {
|
||||
edges { node {
|
||||
name
|
||||
color
|
||||
}}}}}}}}`,
|
||||
variables: {
|
||||
owner,
|
||||
repo
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return res.data.repository.pullRequests.edges.map((e: any) => ({
|
||||
id: e.node.number,
|
||||
title: e.node.title,
|
||||
labels: e.node.labels.edges.map((labelEdge: any) => ({
|
||||
name: labelEdge.node.name,
|
||||
color: labelEdge.node.color
|
||||
})
|
||||
),
|
||||
remoteRef: `pull/${e.node.number}/head`
|
||||
}));
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
async function queryGithub(accessToken: string, ql: object) {
|
||||
let res = await request
|
||||
.post('https://api.github.com/graphql')
|
||||
.set('Authorization', `Bearer ${accessToken}`)
|
||||
.set('User-Agent', 'edamagit')
|
||||
.send(ql);
|
||||
|
||||
return JSON.parse(res.text);
|
||||
}
|
116
src/forge/index.ts
Normal file
116
src/forge/index.ts
Normal file
@ -0,0 +1,116 @@
|
||||
import { MagitRemote } from '../models/magitRemote';
|
||||
import { ForgeState } from './model/forgeState';
|
||||
import { getGithubForgeState } from './github';
|
||||
import { magitConfig } from '../extension';
|
||||
|
||||
const REFRESH_INTERVAL_DURATION_MS = 2 * 60 * 1000;
|
||||
const INACTIVITY_TRESHOLD_DURATION_MS = 25 * 60 * 1000;
|
||||
|
||||
type GetForgeState = (remoteUrl: string) => Promise<ForgeState>;
|
||||
|
||||
const cached = new Map<string, { state: ForgeState, updatedAt: number, refresh: GetForgeState, lastAccessed: number }>();
|
||||
|
||||
export let forgeRefreshInterval: NodeJS.Timeout | undefined;
|
||||
|
||||
function setSelfHydratingCacheEntry(remoteUrl: string, state: ForgeState, factory: GetForgeState) {
|
||||
|
||||
cached.set(remoteUrl, {
|
||||
state,
|
||||
updatedAt: Date.now(),
|
||||
refresh: factory,
|
||||
lastAccessed: Date.now()
|
||||
});
|
||||
|
||||
if (!forgeRefreshInterval) {
|
||||
|
||||
forgeRefreshInterval = setInterval(() => {
|
||||
|
||||
if (cached.entries.length === 0 && forgeRefreshInterval) {
|
||||
clearInterval(forgeRefreshInterval);
|
||||
forgeRefreshInterval = undefined;
|
||||
}
|
||||
|
||||
cached.forEach(async (entry, remoteUrl) => {
|
||||
|
||||
if (entry.lastAccessed > Date.now() - INACTIVITY_TRESHOLD_DURATION_MS) {
|
||||
cached.delete(remoteUrl);
|
||||
return;
|
||||
}
|
||||
|
||||
cached.set(remoteUrl, {
|
||||
state: await entry.refresh(remoteUrl),
|
||||
updatedAt: Date.now(),
|
||||
refresh: entry.refresh,
|
||||
lastAccessed: entry.lastAccessed
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}, REFRESH_INTERVAL_DURATION_MS);
|
||||
}
|
||||
}
|
||||
|
||||
function getCached(remoteUrl: string) {
|
||||
|
||||
let cacheEntry = cached.get(remoteUrl);
|
||||
|
||||
if (cacheEntry) {
|
||||
if (cacheEntry.updatedAt ?? 0 > Date.now() - REFRESH_INTERVAL_DURATION_MS) {
|
||||
|
||||
cached.set(remoteUrl, { ...cacheEntry, lastAccessed: Date.now() });
|
||||
|
||||
return cacheEntry?.state;
|
||||
} else {
|
||||
cached.delete(remoteUrl);
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export async function forgeStatus(remotes: MagitRemote[]): Promise<ForgeState | undefined> {
|
||||
|
||||
if (magitConfig.forgeEnabled !== true) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Check remotes, in order: upstream, origin.
|
||||
let forgeRemote = remotes.find(v => v.name === 'upstream') ?? remotes.find(v => v.name === 'origin');
|
||||
if (forgeRemote?.fetchUrl !== undefined) {
|
||||
|
||||
let cachedState = getCached(forgeRemote.fetchUrl);
|
||||
|
||||
if (cachedState) {
|
||||
return cachedState;
|
||||
}
|
||||
|
||||
let getForgeState = selectForgeType(forgeRemote.fetchUrl);
|
||||
|
||||
if (getForgeState) {
|
||||
|
||||
try {
|
||||
let forgeState = await getForgeState(forgeRemote.fetchUrl);
|
||||
|
||||
setSelfHydratingCacheEntry(forgeRemote.fetchUrl, forgeState, getForgeState);
|
||||
|
||||
return forgeState;
|
||||
|
||||
} catch (error) {
|
||||
|
||||
// TODO: procsess-Log / display error
|
||||
console.error(error);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function selectForgeType(remoteUrl: string): GetForgeState | undefined {
|
||||
|
||||
if (remoteUrl.includes('github.com')) {
|
||||
|
||||
return getGithubForgeState;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
6
src/forge/model/forgeState.ts
Normal file
6
src/forge/model/forgeState.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { PullRequest } from './pullRequest';
|
||||
|
||||
export interface ForgeState {
|
||||
readonly forgeRemote: string;
|
||||
readonly pullRequests: PullRequest[];
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
export interface PullRequest {
|
||||
id: number;
|
||||
name: string;
|
||||
title: string;
|
||||
labels: Label[];
|
||||
remoteRef: string;
|
||||
}
|
@ -8,8 +8,9 @@ import { MagitRemote } from './magitRemote';
|
||||
import { MagitCherryPickingState } from './magitCherryPickingState';
|
||||
import { MagitRevertingState } from './magitRevertingState';
|
||||
import { Stash } from './stash';
|
||||
import { PullRequest } from './pullRequest';
|
||||
import { PullRequest } from '../forge/model/pullRequest';
|
||||
import { Uri } from 'vscode';
|
||||
import { ForgeState } from '../forge/model/forgeState';
|
||||
|
||||
export interface MagitRepository {
|
||||
readonly uri: Uri;
|
||||
@ -32,9 +33,4 @@ export interface MagitRepository {
|
||||
readonly gitRepository: Repository;
|
||||
|
||||
readonly forgeState?: ForgeState;
|
||||
}
|
||||
|
||||
export interface ForgeState {
|
||||
readonly forgeRemote: string;
|
||||
readonly pullRequests: PullRequest[];
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
import { PullRequest } from '../models/pullRequest';
|
||||
import { Octokit } from '@octokit/rest';
|
||||
import { URL } from 'url';
|
||||
import * as vscode from 'vscode';
|
||||
import { ForgeState } from '../models/magitRepository';
|
||||
import { MagitRemote } from '../models/magitRemote';
|
||||
|
||||
const GITHUB_AUTH_PROVIDER_ID = 'github';
|
||||
const SCOPES = ['repos'];
|
||||
|
||||
export interface Forge {
|
||||
getForgeState(remote: MagitRemote): Promise<ForgeState>;
|
||||
}
|
||||
|
||||
class Github implements Forge {
|
||||
constructor(
|
||||
public owner: string,
|
||||
public repo: string,
|
||||
public octokit: Octokit) { }
|
||||
|
||||
async getForgeState(remote: MagitRemote): Promise<ForgeState> {
|
||||
return {
|
||||
forgeRemote: remote.fetchUrl!,
|
||||
pullRequests: await this.getPullRequests()
|
||||
};
|
||||
}
|
||||
|
||||
async getPullRequests(): Promise<PullRequest[]> {
|
||||
try {
|
||||
let prs = await this.octokit.pulls.list({
|
||||
owner: this.owner,
|
||||
repo: this.repo.replace('.git', '')
|
||||
});
|
||||
|
||||
return prs.data.map(v => ({
|
||||
id: v.number,
|
||||
name: v.title,
|
||||
labels: v.labels.map(v => ({
|
||||
name: v.name,
|
||||
color: v.color,
|
||||
})),
|
||||
remoteRef: `pull/${v.number}/head`,
|
||||
}));
|
||||
} catch (err) {
|
||||
// Catch errors like 404, return an empty list instead.
|
||||
//console.error(err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function forgeStatus(remotes: MagitRemote[]): Promise<ForgeState | undefined> {
|
||||
|
||||
// Check remotes, in order: upstream, origin.
|
||||
let forgeRemote = remotes.find(v => v.name === 'upstream') ?? remotes.find(v => v.name === 'origin');
|
||||
if (forgeRemote?.fetchUrl !== undefined) {
|
||||
let forge = await findForge(new URL(forgeRemote?.fetchUrl));
|
||||
|
||||
return forge?.getForgeState(forgeRemote);
|
||||
}
|
||||
}
|
||||
|
||||
async function findForge(url: URL): Promise<Forge | undefined> {
|
||||
if (url.hostname === 'github.com') {
|
||||
const session = await vscode.authentication.getSession(GITHUB_AUTH_PROVIDER_ID, SCOPES, { createIfNone: false });
|
||||
|
||||
if (session) {
|
||||
const octokit = new Octokit({
|
||||
userAgent: 'edamagit-forge',
|
||||
auth: session.accessToken
|
||||
});
|
||||
const owner = url.pathname.split('/').filter(Boolean)[0];
|
||||
const repo = url.pathname.split('/').filter(Boolean)[1];
|
||||
return new Github(owner, repo, octokit);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import { View } from '../general/view';
|
||||
import { Section, SectionHeaderView } from '../general/sectionHeader';
|
||||
import { LineBreakView } from '../general/lineBreakView';
|
||||
import { PullRequest } from '../../models/pullRequest';
|
||||
import { PullRequest } from '../../forge/model/pullRequest';
|
||||
import { TextView } from '../general/textView';
|
||||
|
||||
export class PullRequestSectionView extends View {
|
||||
@ -29,6 +29,6 @@ export class PullRequestItemView extends TextView {
|
||||
}
|
||||
|
||||
constructor(public pr: PullRequest) {
|
||||
super(`${PullRequestItemView.getSection(pr)} ${pr.name}`);
|
||||
super(`${PullRequestItemView.getSection(pr)} ${pr.title}`);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user