kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: add GitHubClient; minor types fix for
rodzic
f700727e80
commit
e22d3c8b3f
|
@ -121,6 +121,7 @@
|
|||
"mathjs": "^13.0.3",
|
||||
"np": "^10.0.7",
|
||||
"npm-run-all2": "^6.2.2",
|
||||
"octokit": "^4.0.2",
|
||||
"only-allow": "^1.2.1",
|
||||
"openai-fetch": "^2.0.4",
|
||||
"prettier": "^3.3.3",
|
||||
|
@ -140,6 +141,7 @@
|
|||
"ai": "^3.1.30",
|
||||
"llamaindex": "^0.3.16",
|
||||
"mathjs": "^13.0.0",
|
||||
"octokit": "^4.0.2",
|
||||
"twitter-api-sdk": "^1.2.1"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
|
@ -167,6 +169,9 @@
|
|||
"mathjs": {
|
||||
"optional": true
|
||||
},
|
||||
"octokit": {
|
||||
"optional": true
|
||||
},
|
||||
"twitter-api-sdk": {
|
||||
"optional": true
|
||||
}
|
||||
|
|
298
pnpm-lock.yaml
298
pnpm-lock.yaml
|
@ -111,6 +111,9 @@ importers:
|
|||
npm-run-all2:
|
||||
specifier: ^6.2.2
|
||||
version: 6.2.2
|
||||
octokit:
|
||||
specifier: ^4.0.2
|
||||
version: 4.0.2
|
||||
only-allow:
|
||||
specifier: ^1.2.1
|
||||
version: 1.2.1
|
||||
|
@ -882,6 +885,113 @@ packages:
|
|||
resolution: {integrity: sha512-XhdSY/4B1D34tSco/GION+23GMjaS9S2zszcqYkMHo8RcWInymF6L1x+Gk7EmHdrSxNFva2WM8orhC4BwQCwgw==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
'@octokit/app@15.1.0':
|
||||
resolution: {integrity: sha512-TkBr7QgOmE6ORxvIAhDbZsqPkF7RSqTY4pLTtUQCvr6dTXqvi2fFo46q3h1lxlk/sGMQjqyZ0kEahkD/NyzOHg==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/auth-app@7.1.0':
|
||||
resolution: {integrity: sha512-cazGaJPSgeZ8NkVYeM/C5l/6IQ5vZnsI8p1aMucadCkt/bndI+q+VqwrlnWbASRmenjOkf1t1RpCKrif53U8gw==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/auth-oauth-app@8.1.1':
|
||||
resolution: {integrity: sha512-5UtmxXAvU2wfcHIPPDWzVSAWXVJzG3NWsxb7zCFplCWEmMCArSZV0UQu5jw5goLQXbFyOr5onzEH37UJB3zQQg==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/auth-oauth-device@7.1.1':
|
||||
resolution: {integrity: sha512-HWl8lYueHonuyjrKKIup/1tiy0xcmQCdq5ikvMO1YwkNNkxb6DXfrPjrMYItNLyCP/o2H87WuijuE+SlBTT8eg==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/auth-oauth-user@5.1.1':
|
||||
resolution: {integrity: sha512-rRkMz0ErOppdvEfnemHJXgZ9vTPhBuC6yASeFaB7I2yLMd7QpjfrL1mnvRPlyKo+M6eeLxrKanXJ9Qte29SRsw==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/auth-token@5.1.1':
|
||||
resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/auth-unauthenticated@6.1.0':
|
||||
resolution: {integrity: sha512-zPSmfrUAcspZH/lOFQnVnvjQZsIvmfApQH6GzJrkIunDooU1Su2qt2FfMTSVPRp7WLTQyC20Kd55lF+mIYaohQ==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/core@6.1.2':
|
||||
resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/endpoint@10.1.1':
|
||||
resolution: {integrity: sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/graphql@8.1.1':
|
||||
resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/oauth-app@7.1.3':
|
||||
resolution: {integrity: sha512-EHXbOpBkSGVVGF1W+NLMmsnSsJRkcrnVmDKt0TQYRBb6xWfWzoi9sBD4DIqZ8jGhOWO/V8t4fqFyJ4vDQDn9bg==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/oauth-authorization-url@7.1.1':
|
||||
resolution: {integrity: sha512-ooXV8GBSabSWyhLUowlMIVd9l1s2nsOGQdlP2SQ4LnkEsGXzeCvbSbCPdZThXhEFzleGPwbapT0Sb+YhXRyjCA==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/oauth-methods@5.1.2':
|
||||
resolution: {integrity: sha512-C5lglRD+sBlbrhCUTxgJAFjWgJlmTx5bQ7Ch0+2uqRjYv7Cfb5xpX4WuSC9UgQna3sqRGBL9EImX9PvTpMaQ7g==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/openapi-types@22.2.0':
|
||||
resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==}
|
||||
|
||||
'@octokit/openapi-webhooks-types@8.3.0':
|
||||
resolution: {integrity: sha512-vKLsoR4xQxg4Z+6rU/F65ItTUz/EXbD+j/d4mlq2GW8TsA4Tc8Kdma2JTAAJ5hrKWUQzkR/Esn2fjsqiVRYaQg==}
|
||||
|
||||
'@octokit/plugin-paginate-graphql@5.2.2':
|
||||
resolution: {integrity: sha512-7znSVvlNAOJisCqAnjN1FtEziweOHSjPGAuc5W58NeGNAr/ZB57yCsjQbXDlWsVryA7hHQaEQPcBbJYFawlkyg==}
|
||||
engines: {node: '>= 18'}
|
||||
peerDependencies:
|
||||
'@octokit/core': '>=6'
|
||||
|
||||
'@octokit/plugin-paginate-rest@11.3.3':
|
||||
resolution: {integrity: sha512-o4WRoOJZlKqEEgj+i9CpcmnByvtzoUYC6I8PD2SA95M+BJ2x8h7oLcVOg9qcowWXBOdcTRsMZiwvM3EyLm9AfA==}
|
||||
engines: {node: '>= 18'}
|
||||
peerDependencies:
|
||||
'@octokit/core': '>=6'
|
||||
|
||||
'@octokit/plugin-rest-endpoint-methods@13.2.4':
|
||||
resolution: {integrity: sha512-gusyAVgTrPiuXOdfqOySMDztQHv6928PQ3E4dqVGEtOvRXAKRbJR4b1zQyniIT9waqaWk/UDaoJ2dyPr7Bk7Iw==}
|
||||
engines: {node: '>= 18'}
|
||||
peerDependencies:
|
||||
'@octokit/core': '>=6'
|
||||
|
||||
'@octokit/plugin-retry@7.1.1':
|
||||
resolution: {integrity: sha512-G9Ue+x2odcb8E1XIPhaFBnTTIrrUDfXN05iFXiqhR+SeeeDMMILcAnysOsxUpEWcQp2e5Ft397FCXTcPkiPkLw==}
|
||||
engines: {node: '>= 18'}
|
||||
peerDependencies:
|
||||
'@octokit/core': '>=6'
|
||||
|
||||
'@octokit/plugin-throttling@9.3.1':
|
||||
resolution: {integrity: sha512-Qd91H4liUBhwLB2h6jZ99bsxoQdhgPk6TdwnClPyTBSDAdviGPceViEgUwj+pcQDmB/rfAXAXK7MTochpHM3yQ==}
|
||||
engines: {node: '>= 18'}
|
||||
peerDependencies:
|
||||
'@octokit/core': ^6.0.0
|
||||
|
||||
'@octokit/request-error@6.1.4':
|
||||
resolution: {integrity: sha512-VpAhIUxwhWZQImo/dWAN/NpPqqojR6PSLgLYAituLM6U+ddx9hCioFGwBr5Mi+oi5CLeJkcAs3gJ0PYYzU6wUg==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/request@9.1.3':
|
||||
resolution: {integrity: sha512-V+TFhu5fdF3K58rs1pGUJIDH5RZLbZm5BI+MNF+6o/ssFNT4vWlCh/tVpF3NxGtP15HUxTTMUbsG5llAuU2CZA==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/types@13.5.0':
|
||||
resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==}
|
||||
|
||||
'@octokit/webhooks-methods@5.1.0':
|
||||
resolution: {integrity: sha512-yFZa3UH11VIxYnnoOYCVoJ3q4ChuSOk2IVBBQ0O3xtKX4x9bmKb/1t+Mxixv2iUhzMdOl1qeWJqEhouXXzB3rQ==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@octokit/webhooks@13.3.0':
|
||||
resolution: {integrity: sha512-TUkJLtI163Bz5+JK0O+zDkQpn4gKwN+BovclUvCj6pI/6RXrFqQvUMRS2M+Rt8Rv0qR3wjoMoOPmpJKeOh0nBg==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
'@opentelemetry/api-logs@0.49.1':
|
||||
resolution: {integrity: sha512-kaNl/T7WzyMUQHQlVq7q0oV4Kev6+0xFwqzofryC66jgGMacd0QH5TwfpbUwSTby+SdAdprAe5UKMvBw4tKS5Q==}
|
||||
engines: {node: '>=14'}
|
||||
|
@ -1437,6 +1547,9 @@ packages:
|
|||
'@total-typescript/ts-reset@0.5.1':
|
||||
resolution: {integrity: sha512-AqlrT8YA1o7Ff5wPfMOL0pvL+1X+sw60NN6CcOCqs658emD6RfiXhF7Gu9QcfKBH7ELY2nInLhKSCWVoNL70MQ==}
|
||||
|
||||
'@types/aws-lambda@8.10.141':
|
||||
resolution: {integrity: sha512-SMWlRBukG9KV8ZNjwemp2AzDibp/czIAeKKTw09nCPbWxVskIxactCJCGOp4y6I1hCMY7T7UGfySvBLXNeUbEw==}
|
||||
|
||||
'@types/diff-match-patch@1.0.36':
|
||||
resolution: {integrity: sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==}
|
||||
|
||||
|
@ -1916,6 +2029,9 @@ packages:
|
|||
resolution: {integrity: sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
|
||||
before-after-hook@3.0.2:
|
||||
resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==}
|
||||
|
||||
bignumber.js@9.1.2:
|
||||
resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==}
|
||||
|
||||
|
@ -1936,6 +2052,9 @@ packages:
|
|||
resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==}
|
||||
engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
|
||||
|
||||
bottleneck@2.19.5:
|
||||
resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==}
|
||||
|
||||
bowser@2.11.0:
|
||||
resolution: {integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==}
|
||||
|
||||
|
@ -4523,6 +4642,10 @@ packages:
|
|||
obuf@1.1.2:
|
||||
resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==}
|
||||
|
||||
octokit@4.0.2:
|
||||
resolution: {integrity: sha512-wbqF4uc1YbcldtiBFfkSnquHtECEIpYD78YUXI6ri1Im5OO2NLo6ZVpRdbJpdnpZ05zMrVPssNiEo6JQtea+Qg==}
|
||||
engines: {node: '>= 18'}
|
||||
|
||||
on-finished@2.4.1:
|
||||
resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
@ -5889,6 +6012,12 @@ packages:
|
|||
resolution: {integrity: sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
universal-github-app-jwt@2.2.0:
|
||||
resolution: {integrity: sha512-G5o6f95b5BggDGuUfKDApKaCgNYy2x7OdHY0zSMF081O0EJobw+1130VONhrA7ezGSV2FNOGyM+KQpQZAr9bIQ==}
|
||||
|
||||
universal-user-agent@7.0.2:
|
||||
resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==}
|
||||
|
||||
universalify@0.2.0:
|
||||
resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==}
|
||||
engines: {node: '>= 4.0.0'}
|
||||
|
@ -7427,6 +7556,152 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
||||
'@octokit/app@15.1.0':
|
||||
dependencies:
|
||||
'@octokit/auth-app': 7.1.0
|
||||
'@octokit/auth-unauthenticated': 6.1.0
|
||||
'@octokit/core': 6.1.2
|
||||
'@octokit/oauth-app': 7.1.3
|
||||
'@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2)
|
||||
'@octokit/types': 13.5.0
|
||||
'@octokit/webhooks': 13.3.0
|
||||
|
||||
'@octokit/auth-app@7.1.0':
|
||||
dependencies:
|
||||
'@octokit/auth-oauth-app': 8.1.1
|
||||
'@octokit/auth-oauth-user': 5.1.1
|
||||
'@octokit/request': 9.1.3
|
||||
'@octokit/request-error': 6.1.4
|
||||
'@octokit/types': 13.5.0
|
||||
lru-cache: 10.4.3
|
||||
universal-github-app-jwt: 2.2.0
|
||||
universal-user-agent: 7.0.2
|
||||
|
||||
'@octokit/auth-oauth-app@8.1.1':
|
||||
dependencies:
|
||||
'@octokit/auth-oauth-device': 7.1.1
|
||||
'@octokit/auth-oauth-user': 5.1.1
|
||||
'@octokit/request': 9.1.3
|
||||
'@octokit/types': 13.5.0
|
||||
universal-user-agent: 7.0.2
|
||||
|
||||
'@octokit/auth-oauth-device@7.1.1':
|
||||
dependencies:
|
||||
'@octokit/oauth-methods': 5.1.2
|
||||
'@octokit/request': 9.1.3
|
||||
'@octokit/types': 13.5.0
|
||||
universal-user-agent: 7.0.2
|
||||
|
||||
'@octokit/auth-oauth-user@5.1.1':
|
||||
dependencies:
|
||||
'@octokit/auth-oauth-device': 7.1.1
|
||||
'@octokit/oauth-methods': 5.1.2
|
||||
'@octokit/request': 9.1.3
|
||||
'@octokit/types': 13.5.0
|
||||
universal-user-agent: 7.0.2
|
||||
|
||||
'@octokit/auth-token@5.1.1': {}
|
||||
|
||||
'@octokit/auth-unauthenticated@6.1.0':
|
||||
dependencies:
|
||||
'@octokit/request-error': 6.1.4
|
||||
'@octokit/types': 13.5.0
|
||||
|
||||
'@octokit/core@6.1.2':
|
||||
dependencies:
|
||||
'@octokit/auth-token': 5.1.1
|
||||
'@octokit/graphql': 8.1.1
|
||||
'@octokit/request': 9.1.3
|
||||
'@octokit/request-error': 6.1.4
|
||||
'@octokit/types': 13.5.0
|
||||
before-after-hook: 3.0.2
|
||||
universal-user-agent: 7.0.2
|
||||
|
||||
'@octokit/endpoint@10.1.1':
|
||||
dependencies:
|
||||
'@octokit/types': 13.5.0
|
||||
universal-user-agent: 7.0.2
|
||||
|
||||
'@octokit/graphql@8.1.1':
|
||||
dependencies:
|
||||
'@octokit/request': 9.1.3
|
||||
'@octokit/types': 13.5.0
|
||||
universal-user-agent: 7.0.2
|
||||
|
||||
'@octokit/oauth-app@7.1.3':
|
||||
dependencies:
|
||||
'@octokit/auth-oauth-app': 8.1.1
|
||||
'@octokit/auth-oauth-user': 5.1.1
|
||||
'@octokit/auth-unauthenticated': 6.1.0
|
||||
'@octokit/core': 6.1.2
|
||||
'@octokit/oauth-authorization-url': 7.1.1
|
||||
'@octokit/oauth-methods': 5.1.2
|
||||
'@types/aws-lambda': 8.10.141
|
||||
universal-user-agent: 7.0.2
|
||||
|
||||
'@octokit/oauth-authorization-url@7.1.1': {}
|
||||
|
||||
'@octokit/oauth-methods@5.1.2':
|
||||
dependencies:
|
||||
'@octokit/oauth-authorization-url': 7.1.1
|
||||
'@octokit/request': 9.1.3
|
||||
'@octokit/request-error': 6.1.4
|
||||
'@octokit/types': 13.5.0
|
||||
|
||||
'@octokit/openapi-types@22.2.0': {}
|
||||
|
||||
'@octokit/openapi-webhooks-types@8.3.0': {}
|
||||
|
||||
'@octokit/plugin-paginate-graphql@5.2.2(@octokit/core@6.1.2)':
|
||||
dependencies:
|
||||
'@octokit/core': 6.1.2
|
||||
|
||||
'@octokit/plugin-paginate-rest@11.3.3(@octokit/core@6.1.2)':
|
||||
dependencies:
|
||||
'@octokit/core': 6.1.2
|
||||
'@octokit/types': 13.5.0
|
||||
|
||||
'@octokit/plugin-rest-endpoint-methods@13.2.4(@octokit/core@6.1.2)':
|
||||
dependencies:
|
||||
'@octokit/core': 6.1.2
|
||||
'@octokit/types': 13.5.0
|
||||
|
||||
'@octokit/plugin-retry@7.1.1(@octokit/core@6.1.2)':
|
||||
dependencies:
|
||||
'@octokit/core': 6.1.2
|
||||
'@octokit/request-error': 6.1.4
|
||||
'@octokit/types': 13.5.0
|
||||
bottleneck: 2.19.5
|
||||
|
||||
'@octokit/plugin-throttling@9.3.1(@octokit/core@6.1.2)':
|
||||
dependencies:
|
||||
'@octokit/core': 6.1.2
|
||||
'@octokit/types': 13.5.0
|
||||
bottleneck: 2.19.5
|
||||
|
||||
'@octokit/request-error@6.1.4':
|
||||
dependencies:
|
||||
'@octokit/types': 13.5.0
|
||||
|
||||
'@octokit/request@9.1.3':
|
||||
dependencies:
|
||||
'@octokit/endpoint': 10.1.1
|
||||
'@octokit/request-error': 6.1.4
|
||||
'@octokit/types': 13.5.0
|
||||
universal-user-agent: 7.0.2
|
||||
|
||||
'@octokit/types@13.5.0':
|
||||
dependencies:
|
||||
'@octokit/openapi-types': 22.2.0
|
||||
|
||||
'@octokit/webhooks-methods@5.1.0': {}
|
||||
|
||||
'@octokit/webhooks@13.3.0':
|
||||
dependencies:
|
||||
'@octokit/openapi-webhooks-types': 8.3.0
|
||||
'@octokit/request-error': 6.1.4
|
||||
'@octokit/webhooks-methods': 5.1.0
|
||||
|
||||
'@opentelemetry/api-logs@0.49.1':
|
||||
dependencies:
|
||||
'@opentelemetry/api': 1.9.0
|
||||
|
@ -8090,6 +8365,8 @@ snapshots:
|
|||
|
||||
'@total-typescript/ts-reset@0.5.1': {}
|
||||
|
||||
'@types/aws-lambda@8.10.141': {}
|
||||
|
||||
'@types/diff-match-patch@1.0.36': {}
|
||||
|
||||
'@types/estree@1.0.5': {}
|
||||
|
@ -8663,6 +8940,8 @@ snapshots:
|
|||
|
||||
basic-ftp@5.0.5: {}
|
||||
|
||||
before-after-hook@3.0.2: {}
|
||||
|
||||
bignumber.js@9.1.2: {}
|
||||
|
||||
binary-extensions@2.3.0: {}
|
||||
|
@ -8694,6 +8973,8 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
bottleneck@2.19.5: {}
|
||||
|
||||
bowser@2.11.0: {}
|
||||
|
||||
boxen@7.1.1:
|
||||
|
@ -11635,6 +11916,19 @@ snapshots:
|
|||
|
||||
obuf@1.1.2: {}
|
||||
|
||||
octokit@4.0.2:
|
||||
dependencies:
|
||||
'@octokit/app': 15.1.0
|
||||
'@octokit/core': 6.1.2
|
||||
'@octokit/oauth-app': 7.1.3
|
||||
'@octokit/plugin-paginate-graphql': 5.2.2(@octokit/core@6.1.2)
|
||||
'@octokit/plugin-paginate-rest': 11.3.3(@octokit/core@6.1.2)
|
||||
'@octokit/plugin-rest-endpoint-methods': 13.2.4(@octokit/core@6.1.2)
|
||||
'@octokit/plugin-retry': 7.1.1(@octokit/core@6.1.2)
|
||||
'@octokit/plugin-throttling': 9.3.1(@octokit/core@6.1.2)
|
||||
'@octokit/request-error': 6.1.4
|
||||
'@octokit/types': 13.5.0
|
||||
|
||||
on-finished@2.4.1:
|
||||
dependencies:
|
||||
ee-first: 1.1.1
|
||||
|
@ -13138,6 +13432,10 @@ snapshots:
|
|||
dependencies:
|
||||
crypto-random-string: 4.0.0
|
||||
|
||||
universal-github-app-jwt@2.2.0: {}
|
||||
|
||||
universal-user-agent@7.0.2: {}
|
||||
|
||||
universalify@0.2.0: {}
|
||||
|
||||
universalify@2.0.1: {}
|
||||
|
|
|
@ -94,26 +94,27 @@ export namespace diffbot {
|
|||
}
|
||||
|
||||
export interface DiffbotObject {
|
||||
date: string
|
||||
sentiment: number
|
||||
images: Image[]
|
||||
author: string
|
||||
estimatedDate: string
|
||||
publisherRegion: string
|
||||
icon: string
|
||||
diffbotUri: string
|
||||
siteName: string
|
||||
type: string
|
||||
title: string
|
||||
tags: Tag[]
|
||||
publisherCountry: string
|
||||
humanLanguage: string
|
||||
authorUrl: string
|
||||
pageUrl: string
|
||||
html: string
|
||||
text: string
|
||||
diffbotUri: string
|
||||
description?: string
|
||||
date?: string
|
||||
sentiment?: number
|
||||
author?: string
|
||||
estimatedDate?: string
|
||||
publisherRegion?: string
|
||||
icon?: string
|
||||
siteName?: string
|
||||
publisherCountry?: string
|
||||
humanLanguage?: string
|
||||
authorUrl?: string
|
||||
html?: string
|
||||
text?: string
|
||||
images?: Image[]
|
||||
tags?: Tag[]
|
||||
categories?: ObjectCategory[]
|
||||
authors: Author[]
|
||||
authors?: Author[]
|
||||
breadcrumb?: Breadcrumb[]
|
||||
items?: ListItem[]
|
||||
meta?: any
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
import { Octokit } from 'octokit'
|
||||
|
||||
import { AIFunctionsProvider } from '../fns.js'
|
||||
import { assert, getEnv } from '../utils.js'
|
||||
|
||||
export namespace github {
|
||||
export interface User {
|
||||
id: number
|
||||
login: string
|
||||
name: string
|
||||
bio: string
|
||||
node_id: string
|
||||
gravatar_id: string
|
||||
type: string
|
||||
site_admin: boolean
|
||||
company: string
|
||||
blog?: string
|
||||
location?: string
|
||||
hireable?: boolean
|
||||
twitter_username?: string
|
||||
email?: string
|
||||
public_repos: number
|
||||
public_gists: number
|
||||
followers: number
|
||||
following: number
|
||||
avatar_url: string
|
||||
url: string
|
||||
html_url: string
|
||||
followers_url: string
|
||||
following_url: string
|
||||
gists_url: string
|
||||
starred_url: string
|
||||
subscriptions_url: string
|
||||
organizations_url: string
|
||||
repos_url: string
|
||||
events_url: string
|
||||
received_events_url: string
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic GitHub API wrapper.
|
||||
*/
|
||||
export class GitHubClient extends AIFunctionsProvider {
|
||||
protected readonly apiKey: string
|
||||
protected readonly octokit: Octokit
|
||||
|
||||
constructor({
|
||||
apiKey = getEnv('GITHUB_API_KEY')
|
||||
}: {
|
||||
apiKey?: string
|
||||
} = {}) {
|
||||
assert(
|
||||
apiKey,
|
||||
'GitHubClient missing required "apiKey" (defaults to "GITHUB_API_KEY")'
|
||||
)
|
||||
super()
|
||||
|
||||
this.apiKey = apiKey
|
||||
this.octokit = new Octokit({ auth: apiKey })
|
||||
}
|
||||
|
||||
async getUser(username: string): Promise<github.User> {
|
||||
const res = await this.octokit.request(`GET /users/${username}`, {
|
||||
headers: {
|
||||
'X-GitHub-Api-Version': '2022-11-28'
|
||||
}
|
||||
})
|
||||
|
||||
return res.data
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ export * from './dexa-client.js'
|
|||
export * from './diffbot-client.js'
|
||||
export * from './exa-client.js'
|
||||
export * from './firecrawl-client.js'
|
||||
export * from './github-client.js'
|
||||
export * from './hacker-news-client.js'
|
||||
export * from './hunter-client.js'
|
||||
export * from './jina-client.js'
|
||||
|
|
Ładowanie…
Reference in New Issue