1
0
Fork 0

update: octokit

This commit is contained in:
ssube 2020-12-29 00:07:04 -06:00
parent 34cd9a578d
commit 8b0f5f5f16
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
4 changed files with 90 additions and 63 deletions

View File

@ -20,8 +20,8 @@
"@istanbuljs/nyc-config-typescript": "1.0.1", "@istanbuljs/nyc-config-typescript": "1.0.1",
"@microsoft/api-documenter": "7.12.1", "@microsoft/api-documenter": "7.12.1",
"@microsoft/api-extractor": "7.12.1", "@microsoft/api-extractor": "7.12.1",
"@octokit/auth-app": "2.7.0", "@octokit/auth-app": "2.10.5",
"@octokit/rest": "18.0.6", "@octokit/rest": "18.0.12",
"@rollup/plugin-commonjs": "17.0.0", "@rollup/plugin-commonjs": "17.0.0",
"@rollup/plugin-json": "4.1.0", "@rollup/plugin-json": "4.1.0",
"@rollup/plugin-multi-entry": "4.0.0", "@rollup/plugin-multi-entry": "4.0.0",

View File

@ -1,4 +1,4 @@
import { InvalidArgumentError, mustExist } from '@apextoaster/js-utils'; import { doesExist, InvalidArgumentError, mustCoalesce, mustExist } from '@apextoaster/js-utils';
import { createAppAuth } from '@octokit/auth-app'; import { createAppAuth } from '@octokit/auth-app';
import { Octokit } from '@octokit/rest'; import { Octokit } from '@octokit/rest';
@ -119,7 +119,7 @@ export class GithubRemote extends BaseRemote<Octokit, RemoteOptions> implements
for (const issue of repo.data) { for (const issue of repo.data) {
issues.push({ issues.push({
issue: issue.number.toString(), issue: issue.number.toString(),
labels: issue.labels.map((l) => l.name), labels: issue.labels.map((l) => l.name).filter(doesExist),
name: issue.title, name: issue.title,
project: options.project, project: options.project,
}); });
@ -137,7 +137,7 @@ export class GithubRemote extends BaseRemote<Octokit, RemoteOptions> implements
for (const label of repo.data) { for (const label of repo.data) {
labels.push({ labels.push({
color: label.color, color: label.color,
desc: label.description, desc: mustCoalesce(label.description, ''),
name: label.name, name: label.name,
project: options.project, project: options.project,
}); });
@ -178,7 +178,7 @@ export class GithubRemote extends BaseRemote<Octokit, RemoteOptions> implements
return { return {
color: data.data.color, color: data.data.color,
desc: data.data.description, desc: mustCoalesce(data.data.description, ''),
name: data.data.name, name: data.data.name,
project: options.project, project: options.project,
}; };

View File

@ -10,6 +10,7 @@ import { GithubRemote } from '../../src/remote/github';
import { ChangeVerb } from '../../src/resolve'; import { ChangeVerb } from '../../src/resolve';
import { createRemoteContainer } from './helpers'; import { createRemoteContainer } from './helpers';
const REMOTE_STATUS = 200;
const REMOTE_OPTIONS: Omit<RemoteOptions, 'container'> = { const REMOTE_OPTIONS: Omit<RemoteOptions, 'container'> = {
data: { data: {
token: 'test', token: 'test',
@ -304,7 +305,7 @@ describe('github remote', () => {
const listStub = stub(client.issues, 'listForRepo').returns(Promise.resolve({ const listStub = stub(client.issues, 'listForRepo').returns(Promise.resolve({
data: [], data: [],
headers: {}, headers: {},
status: 0, status: REMOTE_STATUS,
url: '', url: '',
})); }));
module.bind(Octokit).toInstance(client); module.bind(Octokit).toInstance(client);
@ -338,7 +339,7 @@ describe('github remote', () => {
const listStub = stub(client.issues, 'listLabelsForRepo').returns(Promise.resolve({ const listStub = stub(client.issues, 'listLabelsForRepo').returns(Promise.resolve({
data: [], data: [],
headers: {}, headers: {},
status: 0, status: REMOTE_STATUS,
url: '', url: '',
})); }));
module.bind(Octokit).toInstance(client); module.bind(Octokit).toInstance(client);
@ -432,7 +433,7 @@ describe('github remote', () => {
url: '', url: '',
}, },
headers: {}, headers: {},
status: 0, status: REMOTE_STATUS,
url: '', url: '',
})); }));
module.bind(Octokit).toInstance(client); module.bind(Octokit).toInstance(client);

134
yarn.lock
View File

@ -350,35 +350,36 @@
"@nodelib/fs.scandir" "2.1.3" "@nodelib/fs.scandir" "2.1.3"
fastq "^1.6.0" fastq "^1.6.0"
"@octokit/auth-app@2.7.0": "@octokit/auth-app@2.10.5":
version "2.7.0" version "2.10.5"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/auth-app/-/auth-app-2.7.0.tgz#a1bec2f0da80c4435cdd3213020e7f7c4364c688" resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/auth-app/-/auth-app-2.10.5.tgz#85d69cb96818f5da34bf0b81bb637d3675ad4e9a"
integrity sha512-znx092EpYmtEr5UjRXrFGGinA3jWJNriKT/N3CZFbx53JfXNsHqKW8UogyuJwob55JAgEzwhRTra/yy6e+AcfQ== integrity sha512-6yXyjtcBWpuPYSdZN8z8IIjGSqkPmiJzdmCdod8at41ANB1FtaKbUIDL5+IkG+svv68NIYs+XORbhBRFXYB3bw==
dependencies: dependencies:
"@octokit/request" "^5.3.0" "@octokit/request" "^5.4.11"
"@octokit/request-error" "^2.0.0" "@octokit/request-error" "^2.0.0"
"@octokit/types" "^5.0.0" "@octokit/types" "^6.0.3"
"@types/lru-cache" "^5.1.0" "@types/lru-cache" "^5.1.0"
deprecation "^2.3.1"
lru-cache "^6.0.0" lru-cache "^6.0.0"
universal-github-app-jwt "^1.0.1" universal-github-app-jwt "^1.0.1"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/auth-token@^2.4.0": "@octokit/auth-token@^2.4.4":
version "2.4.2" version "2.4.4"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/auth-token/-/auth-token-2.4.2.tgz#10d0ae979b100fa6b72fa0e8e63e27e6d0dbff8a" resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/auth-token/-/auth-token-2.4.4.tgz#ee31c69b01d0378c12fd3ffe406030f3d94d3b56"
integrity sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ== integrity sha512-LNfGu3Ro9uFAYh10MUZVaT7X2CnNm2C8IDQmabx+3DygYIQjs9FwzFAHN/0t6mu5HEPhxcb1XOuxdpY82vCg2Q==
dependencies: dependencies:
"@octokit/types" "^5.0.0" "@octokit/types" "^6.0.0"
"@octokit/core@^3.0.0": "@octokit/core@^3.2.3":
version "3.1.2" version "3.2.4"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/core/-/core-3.1.2.tgz#c937d5f9621b764573068fcd2e5defcc872fd9cc" resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/core/-/core-3.2.4.tgz#5791256057a962eca972e31818f02454897fd106"
integrity sha512-AInOFULmwOa7+NFi9F8DlDkm5qtZVmDQayi7TUgChE3yeIGPq0Y+6cAEXPexQ3Ea+uZy66hKEazR7DJyU+4wfw== integrity sha512-d9dTsqdePBqOn7aGkyRFe7pQpCXdibSJ5SFnrTr0axevObZrpz3qkWm7t/NjYv5a66z6vhfteriaq4FRz3e0Qg==
dependencies: dependencies:
"@octokit/auth-token" "^2.4.0" "@octokit/auth-token" "^2.4.4"
"@octokit/graphql" "^4.3.1" "@octokit/graphql" "^4.5.8"
"@octokit/request" "^5.4.0" "@octokit/request" "^5.4.12"
"@octokit/types" "^5.0.0" "@octokit/types" "^6.0.3"
before-after-hook "^2.1.0" before-after-hook "^2.1.0"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
@ -391,33 +392,38 @@
is-plain-object "^4.0.0" is-plain-object "^4.0.0"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/graphql@^4.3.1": "@octokit/graphql@^4.5.8":
version "4.5.3" version "4.5.8"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/graphql/-/graphql-4.5.3.tgz#d5ff0d4a8a33e98614a2a7359dac98bc285e062f" resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/graphql/-/graphql-4.5.8.tgz#d42373633c3015d0eafce64a8ce196be167fdd9b"
integrity sha512-JyYvi3j2tOb5ofASEpcg1Advs07H+Ag+I+ez7buuZfNVAmh1IYcDTuxd4gnYH8S2PSGu+f5IdDGxMmkK+5zsdA== integrity sha512-WnCtNXWOrupfPJgXe+vSmprZJUr0VIu14G58PMlkWGj3cH+KLZEfKMmbUQ6C3Wwx6fdhzVW1CD5RTnBdUHxhhA==
dependencies: dependencies:
"@octokit/request" "^5.3.0" "@octokit/request" "^5.3.0"
"@octokit/types" "^5.0.0" "@octokit/types" "^6.0.0"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/plugin-paginate-rest@^2.2.0": "@octokit/openapi-types@^2.0.1":
version "2.3.0" version "2.0.1"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.3.0.tgz#7d1073e56cfd15d3f99dcfe81fa5d2b466f3a6f6" resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/openapi-types/-/openapi-types-2.0.1.tgz#7453d8281ce66b8ed1607f7ac7d751c3baffd2cc"
integrity sha512-Ye2ZJreP0ZlqJQz8fz+hXvrEAEYK4ay7br1eDpWzr6j76VXs/gKqxFcH8qRzkB3fo/2xh4Vy9VtGii4ZDc9qlA== integrity sha512-9AuC04PUnZrjoLiw3uPtwGh9FE4Q3rTqs51oNlQ0rkwgE8ftYsOC+lsrQyvCvWm85smBbSc0FNRKKumvGyb44Q==
dependencies:
"@octokit/types" "^5.2.0"
"@octokit/plugin-request-log@^1.0.0": "@octokit/plugin-paginate-rest@^2.6.2":
version "1.0.0" version "2.6.2"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/plugin-request-log/-/plugin-request-log-1.0.0.tgz#eef87a431300f6148c39a7f75f8cfeb218b2547e" resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.6.2.tgz#45d13dbf5ff8aed54f1a3716b1d57fdc62720c5f"
integrity sha512-ywoxP68aOT3zHCLgWZgwUJatiENeHE7xJzYjfz8WI0goynp96wETBF+d95b8g/uL4QmS6owPVlaxiz3wyMAzcw== integrity sha512-3Dy7/YZAwdOaRpGQoNHPeT0VU1fYLpIUdPyvR37IyFLgd6XSij4j9V/xN/+eSjF2KKvmfIulEh9LF1tRPjIiDA==
"@octokit/plugin-rest-endpoint-methods@4.2.0":
version "4.2.0"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.2.0.tgz#c5a0691b3aba5d8b4ef5dffd6af3649608f167ba"
integrity sha512-1/qn1q1C1hGz6W/iEDm9DoyNoG/xdFDt78E3eZ5hHeUfJTLJgyAMdj9chL/cNBHjcjd+FH5aO1x0VCqR2RE0mw==
dependencies: dependencies:
"@octokit/types" "^5.5.0" "@octokit/types" "^6.0.1"
"@octokit/plugin-request-log@^1.0.2":
version "1.0.2"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/plugin-request-log/-/plugin-request-log-1.0.2.tgz#394d59ec734cd2f122431fbaf05099861ece3c44"
integrity sha512-oTJSNAmBqyDR41uSMunLQKMX0jmEXbwD1fpz8FG27lScV3RhtGfBa1/BBLym+PxcC16IBlF7KH9vP1BUYxA+Eg==
"@octokit/plugin-rest-endpoint-methods@4.4.1":
version "4.4.1"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.4.1.tgz#105cf93255432155de078c9efc33bd4e14d1cd63"
integrity sha512-+v5PcvrUcDeFXf8hv1gnNvNLdm4C0+2EiuWt9EatjjUmfriM1pTMM+r4j1lLHxeBQ9bVDmbywb11e3KjuavieA==
dependencies:
"@octokit/types" "^6.1.0"
deprecation "^2.3.1" deprecation "^2.3.1"
"@octokit/request-error@^2.0.0": "@octokit/request-error@^2.0.0":
@ -429,7 +435,7 @@
deprecation "^2.0.0" deprecation "^2.0.0"
once "^1.4.0" once "^1.4.0"
"@octokit/request@^5.3.0", "@octokit/request@^5.4.0": "@octokit/request@^5.3.0":
version "5.4.7" version "5.4.7"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/request/-/request-5.4.7.tgz#fd703ee092e0463ceba49ff7a3e61cb4cf8a0fde" resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/request/-/request-5.4.7.tgz#fd703ee092e0463ceba49ff7a3e61cb4cf8a0fde"
integrity sha512-FN22xUDP0i0uF38YMbOfx6TotpcENP5W8yJM1e/LieGXn6IoRxDMnBf7tx5RKSW4xuUZ/1P04NFZy5iY3Rax1A== integrity sha512-FN22xUDP0i0uF38YMbOfx6TotpcENP5W8yJM1e/LieGXn6IoRxDMnBf7tx5RKSW4xuUZ/1P04NFZy5iY3Rax1A==
@ -443,28 +449,43 @@
once "^1.4.0" once "^1.4.0"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/rest@18.0.6": "@octokit/request@^5.4.11", "@octokit/request@^5.4.12":
version "18.0.6" version "5.4.12"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/rest/-/rest-18.0.6.tgz#76c274f1a68f40741a131768ef483f041e7b98b6" resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/request/-/request-5.4.12.tgz#b04826fa934670c56b135a81447be2c1723a2ffc"
integrity sha512-ES4lZBKPJMX/yUoQjAZiyFjei9pJ4lTTfb9k7OtYoUzKPDLl/M8jiHqt6qeSauyU4eZGLw0sgP1WiQl9FYeM5w== integrity sha512-MvWYdxengUWTGFpfpefBBpVmmEYfkwMoxonIB3sUGp5rhdgwjXL1ejo6JbgzG/QD9B/NYt/9cJX1pxXeSIUCkg==
dependencies: dependencies:
"@octokit/core" "^3.0.0" "@octokit/endpoint" "^6.0.1"
"@octokit/plugin-paginate-rest" "^2.2.0" "@octokit/request-error" "^2.0.0"
"@octokit/plugin-request-log" "^1.0.0" "@octokit/types" "^6.0.3"
"@octokit/plugin-rest-endpoint-methods" "4.2.0" 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/types@^5.0.0", "@octokit/types@^5.0.1", "@octokit/types@^5.2.0": "@octokit/rest@18.0.12":
version "18.0.12"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/rest/-/rest-18.0.12.tgz#278bd41358c56d87c201e787e8adc0cac132503a"
integrity sha512-hNRCZfKPpeaIjOVuNJzkEL6zacfZlBPV8vw8ReNeyUkVvbuCvvrrx8K8Gw2eyHHsmd4dPlAxIXIZ9oHhJfkJpw==
dependencies:
"@octokit/core" "^3.2.3"
"@octokit/plugin-paginate-rest" "^2.6.2"
"@octokit/plugin-request-log" "^1.0.2"
"@octokit/plugin-rest-endpoint-methods" "4.4.1"
"@octokit/types@^5.0.0", "@octokit/types@^5.0.1":
version "5.4.0" version "5.4.0"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/types/-/types-5.4.0.tgz#25f2f8e24fec09214553168c41c06383c9d0f529" resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/types/-/types-5.4.0.tgz#25f2f8e24fec09214553168c41c06383c9d0f529"
integrity sha512-D/uotqF69M50OIlwMqgyIg9PuLT2daOiBAYF0P40I2ekFA2ESwwBY5dxZe/UhXdPvIbNKDzuZmQrO7rMpuFbcg== integrity sha512-D/uotqF69M50OIlwMqgyIg9PuLT2daOiBAYF0P40I2ekFA2ESwwBY5dxZe/UhXdPvIbNKDzuZmQrO7rMpuFbcg==
dependencies: dependencies:
"@types/node" ">= 8" "@types/node" ">= 8"
"@octokit/types@^5.5.0": "@octokit/types@^6.0.0", "@octokit/types@^6.0.1", "@octokit/types@^6.0.3", "@octokit/types@^6.1.0":
version "5.5.0" version "6.1.2"
resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/types/-/types-5.5.0.tgz#e5f06e8db21246ca102aa28444cdb13ae17a139b" resolved "https://artifacts.apextoaster.com/repository/group-npm/@octokit/types/-/types-6.1.2.tgz#2b3a6ae0b8b71c27c770b4ff3e9ad8f1f538af58"
integrity sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ== integrity sha512-LPCpcLbcky7fWfHCTuc7tMiSHFpFlrThJqVdaHgowBTMS0ijlZFfonQC/C1PrZOjD4xRCYgBqH9yttEATGE/nw==
dependencies: dependencies:
"@octokit/openapi-types" "^2.0.1"
"@types/node" ">= 8" "@types/node" ">= 8"
"@phenomnomnominal/tsquery@^4.0.0": "@phenomnomnominal/tsquery@^4.0.0":
@ -3143,6 +3164,11 @@ is-plain-object@^4.0.0:
resolved "https://artifacts.apextoaster.com/repository/group-npm/is-plain-object/-/is-plain-object-4.1.1.tgz#1a14d6452cbd50790edc7fdaa0aed5a40a35ebb5" resolved "https://artifacts.apextoaster.com/repository/group-npm/is-plain-object/-/is-plain-object-4.1.1.tgz#1a14d6452cbd50790edc7fdaa0aed5a40a35ebb5"
integrity sha512-5Aw8LLVsDlZsETVMhoMXzqsXwQqr/0vlnBYzIXJbYo2F4yYlhLHs+Ez7Bod7IIQKWkJbJfxrWD7pA1Dw1TKrwA== integrity sha512-5Aw8LLVsDlZsETVMhoMXzqsXwQqr/0vlnBYzIXJbYo2F4yYlhLHs+Ez7Bod7IIQKWkJbJfxrWD7pA1Dw1TKrwA==
is-plain-object@^5.0.0:
version "5.0.0"
resolved "https://artifacts.apextoaster.com/repository/group-npm/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344"
integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==
is-potential-custom-element-name@^1.0.0: is-potential-custom-element-name@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://artifacts.apextoaster.com/repository/group-npm/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397" resolved "https://artifacts.apextoaster.com/repository/group-npm/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397"