@oomol-lab/open-connector 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/open-connector/catalog/apps/agentearth.json +441 -0
- package/assets/open-connector/catalog/apps/appgrowing_mcp.json +863 -0
- package/assets/open-connector/catalog/apps/arcmira.json +610 -0
- package/assets/open-connector/catalog/apps/bainiu.json +654 -0
- package/assets/open-connector/catalog/apps/chaport.json +331 -0
- package/assets/open-connector/catalog/apps/cnb.json +1408 -0
- package/assets/open-connector/catalog/apps/crtsh.json +123 -0
- package/assets/open-connector/catalog/apps/eastmoney_miaoxiang.json +406 -0
- package/assets/open-connector/catalog/apps/fastmoss_mcp.json +876 -876
- package/assets/open-connector/catalog/apps/ftshare.json +1162 -0
- package/assets/open-connector/catalog/apps/fusion-api.json +143 -0
- package/assets/open-connector/catalog/apps/fxbaogao.json +308 -0
- package/assets/open-connector/catalog/apps/github.json +38 -3
- package/assets/open-connector/catalog/apps/hrmos_kintai.json +7519 -0
- package/assets/open-connector/catalog/apps/humor_api.json +351 -0
- package/assets/open-connector/catalog/apps/kaonavi.json +1723 -0
- package/assets/open-connector/catalog/apps/linear_mcp.json +882 -22
- package/assets/open-connector/catalog/apps/listinggood.json +362 -0
- package/assets/open-connector/catalog/apps/notion_mcp.json +338 -1
- package/assets/open-connector/catalog/apps/outlook.json +414 -0
- package/assets/open-connector/catalog/apps/porteden.json +1258 -0
- package/assets/open-connector/catalog/apps/qiuxiaoce.json +915 -0
- package/assets/open-connector/catalog/apps/qqmusic.json +1834 -0
- package/assets/open-connector/catalog/apps/rakuraku_seisan.json +217 -0
- package/assets/open-connector/catalog/apps/redfox.json +9661 -897
- package/assets/open-connector/catalog/apps/salesforce.json +4907 -0
- package/assets/open-connector/catalog/apps/sansan.json +4594 -0
- package/assets/open-connector/catalog/apps/smarthr.json +8071 -0
- package/assets/open-connector/catalog/apps/smooth.json +914 -0
- package/assets/open-connector/catalog/apps/tapd.json +727 -0
- package/assets/open-connector/catalog/apps/tencent_meeting_mcp.json +1301 -0
- package/assets/open-connector/catalog/apps/threatfox.json +203 -0
- package/assets/open-connector/catalog/apps/tradebee.json +915 -0
- package/assets/open-connector/catalog/apps/twittrapi.json +4914 -0
- package/assets/open-connector/catalog/apps/urlhaus.json +246 -0
- package/assets/open-connector/catalog/apps/weread.json +1514 -0
- package/assets/open-connector/catalog/apps/whatsapp.json +12 -0
- package/assets/open-connector/catalog/apps/zhiliaobiaoxun.json +812 -0
- package/assets/open-connector/catalog/apps-index.json +1 -1
- package/package.json +2 -1
- package/src/connection-service.js +55 -11
- package/src/core/provider-error-codes.d.ts +9 -0
- package/src/core/provider-error-codes.js +13 -0
- package/src/core/request.d.ts +2 -0
- package/src/core/request.js +11 -2
- package/src/mail/imap-smtp/protocol.js +4 -3
- package/src/oauth/oauth-flow-service.js +1 -0
- package/src/oauth/oauth-token.d.ts +2 -0
- package/src/providers/17track/runtime.js +17 -20
- package/src/providers/action-contracts.generated.d.ts +36 -6
- package/src/providers/agentearth/actions.d.ts +2 -0
- package/src/providers/agentearth/actions.js +100 -0
- package/src/providers/agentearth/executors.d.ts +4 -0
- package/src/providers/agentearth/executors.js +109 -0
- package/src/providers/appgrowing_mcp/actions.d.ts +2 -0
- package/src/providers/appgrowing_mcp/actions.js +175 -0
- package/src/providers/appgrowing_mcp/executors.d.ts +4 -0
- package/src/providers/appgrowing_mcp/executors.js +66 -0
- package/src/providers/arcmira/executors.d.ts +3 -0
- package/src/providers/arcmira/executors.js +8 -0
- package/src/providers/arcmira/runtime.d.ts +6 -0
- package/src/providers/arcmira/runtime.js +41 -0
- package/src/providers/bainiu/actions.d.ts +2 -0
- package/src/providers/bainiu/actions.js +108 -0
- package/src/providers/bainiu/executors.d.ts +4 -0
- package/src/providers/bainiu/executors.js +113 -0
- package/src/providers/baixiao/executors.js +1 -1
- package/src/providers/bing_webmaster/executors.js +1 -1
- package/src/providers/chaport/actions.d.ts +2 -0
- package/src/providers/chaport/actions.js +70 -0
- package/src/providers/chaport/executors.d.ts +4 -0
- package/src/providers/chaport/executors.js +128 -0
- package/src/providers/clickup/runtime.js +49 -52
- package/src/providers/cnb/actions.d.ts +2 -0
- package/src/providers/cnb/actions.js +341 -0
- package/src/providers/cnb/executors.d.ts +4 -0
- package/src/providers/cnb/executors.js +135 -0
- package/src/providers/coupontools/runtime.js +11 -14
- package/src/providers/crtsh/executors.d.ts +3 -0
- package/src/providers/crtsh/executors.js +19 -0
- package/src/providers/crtsh/runtime.d.ts +17 -0
- package/src/providers/crtsh/runtime.js +84 -0
- package/src/providers/eastmoney_miaoxiang/actions.d.ts +2 -0
- package/src/providers/eastmoney_miaoxiang/actions.js +95 -0
- package/src/providers/eastmoney_miaoxiang/executors.d.ts +4 -0
- package/src/providers/eastmoney_miaoxiang/executors.js +81 -0
- package/src/providers/fastmoss_mcp/actions-content.d.ts +2 -0
- package/src/providers/fastmoss_mcp/actions-content.js +140 -0
- package/src/providers/fastmoss_mcp/actions-creator.d.ts +2 -0
- package/src/providers/fastmoss_mcp/actions-creator.js +154 -0
- package/src/providers/fastmoss_mcp/actions-product.d.ts +2 -0
- package/src/providers/fastmoss_mcp/actions-product.js +167 -0
- package/src/providers/fastmoss_mcp/actions-research.d.ts +2 -0
- package/src/providers/fastmoss_mcp/actions-research.js +174 -0
- package/src/providers/fastmoss_mcp/actions-shop.d.ts +2 -0
- package/src/providers/fastmoss_mcp/actions-shop.js +142 -0
- package/src/providers/fastmoss_mcp/actions.js +11 -12
- package/src/providers/fastmoss_mcp/schemas.d.ts +51 -0
- package/src/providers/fastmoss_mcp/schemas.js +52 -0
- package/src/providers/ftshare/actions.d.ts +2 -0
- package/src/providers/ftshare/actions.js +124 -0
- package/src/providers/ftshare/executors.d.ts +4 -0
- package/src/providers/ftshare/executors.js +102 -0
- package/src/providers/fusion-api/operations.js +37 -0
- package/src/providers/fxbaogao/actions.d.ts +2 -0
- package/src/providers/fxbaogao/actions.js +74 -0
- package/src/providers/fxbaogao/executors.d.ts +4 -0
- package/src/providers/fxbaogao/executors.js +155 -0
- package/src/providers/github/app-installation.d.ts +37 -0
- package/src/providers/github/app-installation.js +233 -0
- package/src/providers/github/executors.js +93 -15
- package/src/providers/github/runtime-repository.js +21 -1
- package/src/providers/github/runtime-shared.d.ts +2 -0
- package/src/providers/github/runtime-shared.js +1 -0
- package/src/providers/googledrive/runtime-request.js +3 -3
- package/src/providers/hrmos_kintai/actions.d.ts +2 -0
- package/src/providers/hrmos_kintai/actions.js +139 -0
- package/src/providers/hrmos_kintai/attendance-actions.d.ts +2 -0
- package/src/providers/hrmos_kintai/attendance-actions.js +276 -0
- package/src/providers/hrmos_kintai/business-actions.d.ts +2 -0
- package/src/providers/hrmos_kintai/business-actions.js +143 -0
- package/src/providers/hrmos_kintai/business-schemas.d.ts +4 -0
- package/src/providers/hrmos_kintai/business-schemas.js +320 -0
- package/src/providers/hrmos_kintai/executors.d.ts +4 -0
- package/src/providers/hrmos_kintai/executors.js +61 -0
- package/src/providers/hrmos_kintai/export-actions.d.ts +2 -0
- package/src/providers/hrmos_kintai/export-actions.js +58 -0
- package/src/providers/hrmos_kintai/operations.d.ts +9 -0
- package/src/providers/hrmos_kintai/operations.js +278 -0
- package/src/providers/hrmos_kintai/runtime.d.ts +10 -0
- package/src/providers/hrmos_kintai/runtime.js +217 -0
- package/src/providers/hrmos_kintai/schemas.d.ts +10 -0
- package/src/providers/hrmos_kintai/schemas.js +70 -0
- package/src/providers/humor_api/actions.d.ts +2 -0
- package/src/providers/humor_api/actions.js +96 -0
- package/src/providers/humor_api/executors.d.ts +4 -0
- package/src/providers/humor_api/executors.js +76 -0
- package/src/providers/kaonavi/actions.d.ts +4 -0
- package/src/providers/kaonavi/actions.js +144 -0
- package/src/providers/kaonavi/additional-actions.d.ts +10 -0
- package/src/providers/kaonavi/additional-actions.js +203 -0
- package/src/providers/kaonavi/executors.d.ts +4 -0
- package/src/providers/kaonavi/executors.js +69 -0
- package/src/providers/kaonavi/runtime.d.ts +4 -0
- package/src/providers/kaonavi/runtime.js +69 -0
- package/src/providers/linear_mcp/actions.d.ts +14 -0
- package/src/providers/linear_mcp/actions.js +134 -0
- package/src/providers/linear_mcp/runtime-mcp.d.ts +7 -1
- package/src/providers/linear_mcp/runtime-mcp.js +140 -28
- package/src/providers/linkfox/runtime.js +48 -51
- package/src/providers/listinggood/actions.d.ts +2 -0
- package/src/providers/listinggood/actions.js +95 -0
- package/src/providers/listinggood/executors.d.ts +4 -0
- package/src/providers/listinggood/executors.js +99 -0
- package/src/providers/mcp-tools.d.ts +3 -0
- package/src/providers/mcp-tools.js +5 -4
- package/src/providers/notion_mcp/executors.js +53 -24
- package/src/providers/notion_mcp/mcp-response.d.ts +26 -0
- package/src/providers/notion_mcp/mcp-response.js +95 -0
- package/src/providers/omise/executors.js +1 -1
- package/src/providers/outlook/executors.js +35 -2
- package/src/providers/porteden/actions.d.ts +2 -0
- package/src/providers/porteden/actions.js +162 -0
- package/src/providers/porteden/executors.d.ts +4 -0
- package/src/providers/porteden/executors.js +140 -0
- package/src/providers/provider-runtime.d.ts +3 -2
- package/src/providers/pushover/runtime.js +28 -31
- package/src/providers/qianfan/runtime.js +16 -19
- package/src/providers/qiuxiaoce/actions.d.ts +2 -0
- package/src/providers/qiuxiaoce/actions.js +248 -0
- package/src/providers/qiuxiaoce/executors.d.ts +4 -0
- package/src/providers/qiuxiaoce/executors.js +76 -0
- package/src/providers/qiuxiaoce/routes.d.ts +1 -0
- package/src/providers/qiuxiaoce/routes.js +20 -0
- package/src/providers/qqmusic/actions.d.ts +2 -0
- package/src/providers/qqmusic/actions.js +229 -0
- package/src/providers/qqmusic/executors.d.ts +4 -0
- package/src/providers/qqmusic/executors.js +92 -0
- package/src/providers/qqmusic/report-schema.d.ts +4 -0
- package/src/providers/qqmusic/report-schema.js +119 -0
- package/src/providers/rakuraku_seisan/actions.d.ts +2 -0
- package/src/providers/rakuraku_seisan/actions.js +50 -0
- package/src/providers/rakuraku_seisan/executors.d.ts +4 -0
- package/src/providers/rakuraku_seisan/executors.js +40 -0
- package/src/providers/rakuraku_seisan/runtime.d.ts +8 -0
- package/src/providers/rakuraku_seisan/runtime.js +251 -0
- package/src/providers/redfox/actions-account.d.ts +2 -0
- package/src/providers/redfox/actions-account.js +24 -0
- package/src/providers/redfox/actions-autohome.d.ts +2 -0
- package/src/providers/redfox/actions-autohome.js +51 -0
- package/src/providers/redfox/actions-baijiahao.d.ts +2 -0
- package/src/providers/redfox/actions-baijiahao.js +58 -0
- package/src/providers/redfox/actions-bilibili.d.ts +2 -0
- package/src/providers/redfox/actions-bilibili.js +67 -0
- package/src/providers/redfox/actions-dongchedi.d.ts +2 -0
- package/src/providers/redfox/actions-dongchedi.js +49 -0
- package/src/providers/redfox/actions-douyin.d.ts +2 -0
- package/src/providers/redfox/actions-douyin.js +297 -0
- package/src/providers/redfox/actions-generation.d.ts +2 -0
- package/src/providers/redfox/actions-generation.js +293 -0
- package/src/providers/redfox/actions-instagram.d.ts +2 -0
- package/src/providers/redfox/actions-instagram.js +49 -0
- package/src/providers/redfox/actions-kuaishou.d.ts +2 -0
- package/src/providers/redfox/actions-kuaishou.js +53 -0
- package/src/providers/redfox/actions-search.d.ts +2 -0
- package/src/providers/redfox/actions-search.js +125 -0
- package/src/providers/redfox/actions-tiktok.d.ts +2 -0
- package/src/providers/redfox/actions-tiktok.js +136 -0
- package/src/providers/redfox/actions-tools.d.ts +2 -0
- package/src/providers/redfox/actions-tools.js +151 -0
- package/src/providers/redfox/actions-toutiao.d.ts +2 -0
- package/src/providers/redfox/actions-toutiao.js +68 -0
- package/src/providers/redfox/actions-transcription.d.ts +2 -0
- package/src/providers/redfox/actions-transcription.js +165 -0
- package/src/providers/redfox/actions-wechat-channel.d.ts +2 -0
- package/src/providers/redfox/actions-wechat-channel.js +63 -0
- package/src/providers/redfox/actions-wechat.d.ts +2 -0
- package/src/providers/redfox/actions-wechat.js +302 -0
- package/src/providers/redfox/actions-weibo.d.ts +2 -0
- package/src/providers/redfox/actions-weibo.js +61 -0
- package/src/providers/redfox/actions-x.d.ts +2 -0
- package/src/providers/redfox/actions-x.js +126 -0
- package/src/providers/redfox/actions-xiaohongshu.d.ts +2 -0
- package/src/providers/redfox/actions-xiaohongshu.js +244 -0
- package/src/providers/redfox/actions-yiche.d.ts +2 -0
- package/src/providers/redfox/actions-yiche.js +59 -0
- package/src/providers/redfox/actions-youtube.d.ts +2 -0
- package/src/providers/redfox/actions-youtube.js +64 -0
- package/src/providers/redfox/actions-zhihu.d.ts +2 -0
- package/src/providers/redfox/actions-zhihu.js +26 -0
- package/src/providers/redfox/actions.d.ts +2 -0
- package/src/providers/redfox/actions.js +49 -0
- package/src/providers/redfox/executors.d.ts +2 -14
- package/src/providers/redfox/executors.js +28 -551
- package/src/providers/redfox/routes.d.ts +11 -0
- package/src/providers/redfox/routes.js +329 -0
- package/src/providers/redfox/runtime.d.ts +6 -0
- package/src/providers/redfox/runtime.js +151 -0
- package/src/providers/redfox/schemas.d.ts +9 -0
- package/src/providers/redfox/schemas.js +40 -0
- package/src/providers/registry.generated.js +30 -0
- package/src/providers/salesforce/context.d.ts +16 -0
- package/src/providers/salesforce/context.js +58 -0
- package/src/providers/salesforce/executors.d.ts +5 -0
- package/src/providers/salesforce/executors.js +54 -0
- package/src/providers/salesforce/media.d.ts +9 -0
- package/src/providers/salesforce/media.js +66 -0
- package/src/providers/salesforce/oauth.d.ts +2 -0
- package/src/providers/salesforce/oauth.js +89 -0
- package/src/providers/salesforce/runtime-analytics.d.ts +2 -0
- package/src/providers/salesforce/runtime-analytics.js +60 -0
- package/src/providers/salesforce/runtime-automation.d.ts +2 -0
- package/src/providers/salesforce/runtime-automation.js +64 -0
- package/src/providers/salesforce/runtime-base.d.ts +2 -0
- package/src/providers/salesforce/runtime-base.js +51 -0
- package/src/providers/salesforce/runtime-bulk.d.ts +2 -0
- package/src/providers/salesforce/runtime-bulk.js +98 -0
- package/src/providers/salesforce/runtime-data.d.ts +2 -0
- package/src/providers/salesforce/runtime-data.js +207 -0
- package/src/providers/salesforce/runtime-files.d.ts +2 -0
- package/src/providers/salesforce/runtime-files.js +108 -0
- package/src/providers/salesforce/transport.d.ts +9 -0
- package/src/providers/salesforce/transport.js +65 -0
- package/src/providers/sansan/actions.d.ts +2 -0
- package/src/providers/sansan/actions.js +165 -0
- package/src/providers/sansan/admin-actions.d.ts +2 -0
- package/src/providers/sansan/admin-actions.js +181 -0
- package/src/providers/sansan/admin.d.ts +2 -0
- package/src/providers/sansan/admin.js +42 -0
- package/src/providers/sansan/business-actions.d.ts +2 -0
- package/src/providers/sansan/business-actions.js +160 -0
- package/src/providers/sansan/business.d.ts +2 -0
- package/src/providers/sansan/business.js +51 -0
- package/src/providers/sansan/executors.d.ts +4 -0
- package/src/providers/sansan/executors.js +59 -0
- package/src/providers/sansan/file-schema.d.ts +2 -0
- package/src/providers/sansan/file-schema.js +8 -0
- package/src/providers/sansan/files.d.ts +11 -0
- package/src/providers/sansan/files.js +49 -0
- package/src/providers/sansan/organization-actions.d.ts +2 -0
- package/src/providers/sansan/organization-actions.js +198 -0
- package/src/providers/sansan/organization-columns.d.ts +2 -0
- package/src/providers/sansan/organization-columns.js +33 -0
- package/src/providers/sansan/organization.d.ts +2 -0
- package/src/providers/sansan/organization.js +88 -0
- package/src/providers/sansan/read.d.ts +2 -0
- package/src/providers/sansan/read.js +25 -0
- package/src/providers/sansan/request.d.ts +22 -0
- package/src/providers/sansan/request.js +94 -0
- package/src/providers/sansan/schemas.d.ts +7 -0
- package/src/providers/sansan/schemas.js +72 -0
- package/src/providers/shopee/runtime.d.ts +33 -29
- package/src/providers/shopee/runtime.js +166 -169
- package/src/providers/smarthr/actions.d.ts +2 -0
- package/src/providers/smarthr/actions.js +286 -0
- package/src/providers/smarthr/employee-runtime.d.ts +1 -0
- package/src/providers/smarthr/employee-runtime.js +63 -0
- package/src/providers/smarthr/employee-schema.d.ts +3 -0
- package/src/providers/smarthr/employee-schema.js +222 -0
- package/src/providers/smarthr/executors.d.ts +4 -0
- package/src/providers/smarthr/executors.js +35 -0
- package/src/providers/smarthr/pagination.d.ts +1 -0
- package/src/providers/smarthr/pagination.js +84 -0
- package/src/providers/smarthr/resource-routes.d.ts +16 -0
- package/src/providers/smarthr/resource-routes.js +163 -0
- package/src/providers/smarthr/runtime.d.ts +13 -0
- package/src/providers/smarthr/runtime.js +242 -0
- package/src/providers/smarthr/supplemental-actions.d.ts +2 -0
- package/src/providers/smarthr/supplemental-actions.js +541 -0
- package/src/providers/smooth/actions.d.ts +2 -0
- package/src/providers/smooth/actions.js +138 -0
- package/src/providers/smooth/executors.d.ts +4 -0
- package/src/providers/smooth/executors.js +102 -0
- package/src/providers/tapd/actions.d.ts +8 -0
- package/src/providers/tapd/actions.js +89 -0
- package/src/providers/tapd/executors.d.ts +4 -0
- package/src/providers/tapd/executors.js +137 -0
- package/src/providers/teable/runtime.js +12 -15
- package/src/providers/tencent_meeting_mcp/actions.d.ts +2 -0
- package/src/providers/tencent_meeting_mcp/actions.js +420 -0
- package/src/providers/tencent_meeting_mcp/executors.d.ts +4 -0
- package/src/providers/tencent_meeting_mcp/executors.js +117 -0
- package/src/providers/threatfox/executors.d.ts +4 -0
- package/src/providers/threatfox/executors.js +40 -0
- package/src/providers/threatfox/runtime.d.ts +15 -0
- package/src/providers/threatfox/runtime.js +128 -0
- package/src/providers/ticket_tailor/runtime.js +1 -1
- package/src/providers/ticketmaster/runtime.js +3 -6
- package/src/providers/timelinesai/runtime.js +13 -16
- package/src/providers/tradebee/actions.d.ts +2 -0
- package/src/providers/tradebee/actions.js +176 -0
- package/src/providers/tradebee/executors.d.ts +4 -0
- package/src/providers/tradebee/executors.js +83 -0
- package/src/providers/twittrapi/executors.d.ts +4 -0
- package/src/providers/twittrapi/executors.js +17 -0
- package/src/providers/twittrapi/runtime.d.ts +12 -0
- package/src/providers/twittrapi/runtime.js +203 -0
- package/src/providers/urlhaus/executors.d.ts +4 -0
- package/src/providers/urlhaus/executors.js +40 -0
- package/src/providers/urlhaus/runtime.d.ts +15 -0
- package/src/providers/urlhaus/runtime.js +142 -0
- package/src/providers/wangdian/runtime.js +16 -19
- package/src/providers/weread/actions.d.ts +2 -0
- package/src/providers/weread/actions.js +424 -0
- package/src/providers/weread/executors.d.ts +4 -0
- package/src/providers/weread/executors.js +98 -0
- package/src/providers/whatsapp/runtime.js +6 -1
- package/src/providers/workast/runtime.js +12 -17
- package/src/providers/youzan/runtime.js +21 -24
- package/src/providers/zenkit/runtime.js +13 -19
- package/src/providers/zhiliaobiaoxun/actions.d.ts +2 -0
- package/src/providers/zhiliaobiaoxun/actions.js +138 -0
- package/src/providers/zhiliaobiaoxun/executors.d.ts +4 -0
- package/src/providers/zhiliaobiaoxun/executors.js +78 -0
- package/src/server/api/auth.d.ts +2 -0
- package/src/server/api/auth.js +2 -1
- package/src/server/api/console-catalog-routes.d.ts +17 -0
- package/src/server/api/console-catalog-routes.js +88 -0
- package/src/server/api/console-oauth-routes.d.ts +18 -0
- package/src/server/api/console-oauth-routes.js +298 -0
- package/src/server/api/docs-routes.d.ts +12 -0
- package/src/server/api/docs-routes.js +38 -0
- package/src/server/api/http-utils.d.ts +1 -0
- package/src/server/api/http-utils.js +8 -0
- package/src/server/api/marketplace-routes.d.ts +7 -0
- package/src/server/api/marketplace-routes.js +62 -0
- package/src/server/api/mcp-routes.d.ts +18 -0
- package/src/server/api/mcp-routes.js +37 -0
- package/src/server/api/policy-routes.d.ts +13 -0
- package/src/server/api/policy-routes.js +50 -0
- package/src/server/api/policy-snapshot.d.ts +14 -0
- package/src/server/api/policy-snapshot.js +30 -0
- package/src/server/api/run-log-routes.d.ts +7 -0
- package/src/server/api/run-log-routes.js +70 -0
- package/src/server/api/runtime-api.d.ts +0 -7
- package/src/server/api/runtime-api.js +0 -13
- package/src/server/api/runtime-app-routes.d.ts +10 -0
- package/src/server/api/runtime-app-routes.js +72 -0
- package/src/server/api/runtime-catalog-routes.d.ts +37 -0
- package/src/server/api/runtime-catalog-routes.js +133 -0
- package/src/server/api/runtime-execution-routes.d.ts +16 -0
- package/src/server/api/runtime-execution-routes.js +198 -0
- package/src/server/api/saas-oauth-routes.d.ts +9 -0
- package/src/server/api/saas-oauth-routes.js +27 -0
- package/src/server/api/saas-project-routes.d.ts +7 -0
- package/src/server/api/saas-project-routes.js +16 -0
- package/src/server/api/transit-file-routes.d.ts +9 -0
- package/src/server/api/transit-file-routes.js +49 -0
- package/src/server/api/trigger-routes.d.ts +15 -0
- package/src/server/api/trigger-routes.js +48 -0
- package/src/server/connect-app.d.ts +1 -0
- package/src/server/connect-app.js +3 -1
- package/src/server/connect-server.d.ts +3 -54
- package/src/server/connect-server.js +95 -1148
- package/src/providers/fastmoss_mcp/official-tools.json +0 -2922
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { importPKCS8, SignJWT } from "jose";
|
|
2
|
+
import { sha256Hex } from "../../core/aws-sigv4.js";
|
|
3
|
+
import { base64Bytes, optionalRecord, optionalString, stringRecord } from "../../core/cast.js";
|
|
4
|
+
import { ProviderRequestError, requiredInputString, runProviderRequest } from "../provider-runtime.js";
|
|
5
|
+
import { githubRequestJson } from "./runtime-shared.js";
|
|
6
|
+
/**
|
|
7
|
+
* GitHub App installation credentials.
|
|
8
|
+
*
|
|
9
|
+
* A GitHub App authenticates in two steps: the App's private key signs a short
|
|
10
|
+
* RS256 JWT that identifies the App, and that JWT is exchanged for an
|
|
11
|
+
* installation access token scoped to one installation (an account that
|
|
12
|
+
* installed the App and the repositories it selected). Installation tokens are
|
|
13
|
+
* what the REST API accepts on repository endpoints; they expire after one hour
|
|
14
|
+
* and cannot be refreshed, only minted again.
|
|
15
|
+
*
|
|
16
|
+
* The stored credential therefore holds the three inputs of that exchange —
|
|
17
|
+
* `appId`, `installationId`, `privateKey` — and the runtime mints tokens on
|
|
18
|
+
* demand, reusing one across calls until shortly before it expires.
|
|
19
|
+
*/
|
|
20
|
+
/** GitHub refuses an App JWT older than ten minutes; nine leaves room for clock skew. */
|
|
21
|
+
const appJwtLifetimeSeconds = 9 * 60;
|
|
22
|
+
/** Issued-at is backdated so a runtime clock slightly ahead of GitHub's still validates. */
|
|
23
|
+
const appJwtClockSkewSeconds = 60;
|
|
24
|
+
/** A cached installation token is replaced this long before GitHub expires it. */
|
|
25
|
+
const installationTokenRenewalMarginMs = 5 * 60 * 1000;
|
|
26
|
+
const pkcs8Marker = "-----BEGIN PRIVATE KEY-----";
|
|
27
|
+
const pkcs1Marker = "-----BEGIN RSA PRIVATE KEY-----";
|
|
28
|
+
export function readGitHubAppInstallationCredential(values) {
|
|
29
|
+
const appId = requiredInputString(values.appId, "appId").trim();
|
|
30
|
+
if (!/^\d+$/u.test(appId)) {
|
|
31
|
+
throw new ProviderRequestError(400, "appId must be the numeric App ID shown on the GitHub App's settings page");
|
|
32
|
+
}
|
|
33
|
+
const installationId = requiredInputString(values.installationId, "installationId").trim();
|
|
34
|
+
if (!/^\d+$/u.test(installationId)) {
|
|
35
|
+
throw new ProviderRequestError(400, "installationId must be the numeric installation id from the installation's settings URL or the post-install redirect");
|
|
36
|
+
}
|
|
37
|
+
return { appId, installationId, privateKey: normalizePrivateKey(values.privateKey) };
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Accept the key as GitHub downloads it (PKCS#1, `BEGIN RSA PRIVATE KEY`) or
|
|
41
|
+
* already converted to PKCS#8, with literal or escaped line breaks.
|
|
42
|
+
*/
|
|
43
|
+
function normalizePrivateKey(value) {
|
|
44
|
+
const pem = requiredInputString(value, "privateKey").replaceAll("\\n", "\n").trim();
|
|
45
|
+
if (pem.includes(pkcs8Marker)) {
|
|
46
|
+
return pem;
|
|
47
|
+
}
|
|
48
|
+
if (pem.includes(pkcs1Marker)) {
|
|
49
|
+
return pkcs1ToPkcs8Pem(pem);
|
|
50
|
+
}
|
|
51
|
+
throw new ProviderRequestError(400, "privateKey must be the PEM contents of the GitHub App private key (.pem) file, starting with -----BEGIN RSA PRIVATE KEY-----");
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Wrap a PKCS#1 RSAPrivateKey in the PKCS#8 PrivateKeyInfo structure WebCrypto
|
|
55
|
+
* imports. The wrapper is fixed for RSA: version 0, the rsaEncryption algorithm
|
|
56
|
+
* identifier with a NULL parameter, then the PKCS#1 DER as an OCTET STRING.
|
|
57
|
+
*/
|
|
58
|
+
export function pkcs1ToPkcs8Pem(pkcs1Pem) {
|
|
59
|
+
const base64 = pkcs1Pem.replace(pkcs1Marker, "").replace("-----END RSA PRIVATE KEY-----", "").replace(/\s+/gu, "");
|
|
60
|
+
const pkcs1 = base64ToBytes(base64);
|
|
61
|
+
const algorithm = Uint8Array.from([
|
|
62
|
+
0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00,
|
|
63
|
+
]);
|
|
64
|
+
const version = Uint8Array.from([0x02, 0x01, 0x00]);
|
|
65
|
+
const keyOctets = derTlv(0x04, pkcs1);
|
|
66
|
+
const body = concatBytes(version, algorithm, keyOctets);
|
|
67
|
+
const pkcs8 = derTlv(0x30, body);
|
|
68
|
+
const lines = bytesToBase64(pkcs8).match(/.{1,64}/gu) ?? [];
|
|
69
|
+
return `${pkcs8Marker}\n${lines.join("\n")}\n-----END PRIVATE KEY-----`;
|
|
70
|
+
}
|
|
71
|
+
function derTlv(tag, value) {
|
|
72
|
+
return concatBytes(Uint8Array.from([tag]), derLength(value.byteLength), value);
|
|
73
|
+
}
|
|
74
|
+
function derLength(length) {
|
|
75
|
+
if (length < 0x80) {
|
|
76
|
+
return Uint8Array.from([length]);
|
|
77
|
+
}
|
|
78
|
+
const bytes = [];
|
|
79
|
+
for (let remaining = length; remaining > 0; remaining = Math.floor(remaining / 0x100)) {
|
|
80
|
+
bytes.unshift(remaining % 0x100);
|
|
81
|
+
}
|
|
82
|
+
return Uint8Array.from([0x80 | bytes.length, ...bytes]);
|
|
83
|
+
}
|
|
84
|
+
function concatBytes(...parts) {
|
|
85
|
+
const out = new Uint8Array(parts.reduce((total, part) => total + part.byteLength, 0));
|
|
86
|
+
let offset = 0;
|
|
87
|
+
for (const part of parts) {
|
|
88
|
+
out.set(part, offset);
|
|
89
|
+
offset += part.byteLength;
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
function base64ToBytes(base64) {
|
|
94
|
+
return base64Bytes(base64, "privateKey", () => new ProviderRequestError(400, "privateKey is not a valid PEM: its body is not base64"));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Encode DER bytes for a PEM body. These are key bytes assembled one at a
|
|
98
|
+
* time, so the binary string is Latin-1 by construction; the `btoa` fallback
|
|
99
|
+
* is the same shape the provider source guard allowlists for gitea and
|
|
100
|
+
* pi_hole, and it never sees a credential string.
|
|
101
|
+
*/
|
|
102
|
+
function bytesToBase64(bytes) {
|
|
103
|
+
if (typeof Buffer !== "undefined") {
|
|
104
|
+
return Buffer.from(bytes).toString("base64");
|
|
105
|
+
}
|
|
106
|
+
let binary = "";
|
|
107
|
+
for (const byte of bytes) {
|
|
108
|
+
binary += String.fromCharCode(byte);
|
|
109
|
+
}
|
|
110
|
+
return btoa(binary);
|
|
111
|
+
}
|
|
112
|
+
/** Sign the App JWT GitHub's App endpoints and the token mint take as bearer. */
|
|
113
|
+
export async function signGitHubAppJwt(credential) {
|
|
114
|
+
let signingKey;
|
|
115
|
+
try {
|
|
116
|
+
signingKey = await importPKCS8(credential.privateKey, "RS256");
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
throw new ProviderRequestError(400, "privateKey must be an RSA private key in PEM format, as downloaded from the GitHub App's settings page");
|
|
120
|
+
}
|
|
121
|
+
const now = Math.floor(Date.now() / 1000);
|
|
122
|
+
return new SignJWT({})
|
|
123
|
+
.setProtectedHeader({ alg: "RS256", typ: "JWT" })
|
|
124
|
+
.setIssuer(credential.appId)
|
|
125
|
+
.setIssuedAt(now - appJwtClockSkewSeconds)
|
|
126
|
+
.setExpirationTime(now - appJwtClockSkewSeconds + appJwtLifetimeSeconds)
|
|
127
|
+
.sign(signingKey);
|
|
128
|
+
}
|
|
129
|
+
/** Describe the installation the credential names, authenticated as the App. */
|
|
130
|
+
export async function fetchGitHubAppInstallation(credential, fetcher, signal) {
|
|
131
|
+
return runProviderRequest({ label: "GitHub installation", signal }, async (signal) => githubRequestJson({
|
|
132
|
+
path: `/app/installations/${encodeURIComponent(credential.installationId)}`,
|
|
133
|
+
accessToken: await signGitHubAppJwt(credential),
|
|
134
|
+
fetcher,
|
|
135
|
+
signal,
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
138
|
+
/** Mint an installation access token with the App's full granted permissions. */
|
|
139
|
+
export async function mintGitHubInstallationToken(credential, fetcher, signal) {
|
|
140
|
+
return runProviderRequest({ label: "GitHub installation token", signal }, async (signal) => {
|
|
141
|
+
const minted = await githubRequestJson({
|
|
142
|
+
method: "POST",
|
|
143
|
+
path: `/app/installations/${encodeURIComponent(credential.installationId)}/access_tokens`,
|
|
144
|
+
body: {},
|
|
145
|
+
accessToken: await signGitHubAppJwt(credential),
|
|
146
|
+
fetcher,
|
|
147
|
+
signal,
|
|
148
|
+
});
|
|
149
|
+
const token = optionalString(minted.token);
|
|
150
|
+
const expiresAt = optionalString(minted.expires_at);
|
|
151
|
+
if (!token || !expiresAt) {
|
|
152
|
+
throw new ProviderRequestError(500, "GitHub returned an installation token without a token or expiry", 502);
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
token,
|
|
156
|
+
expiresAt,
|
|
157
|
+
permissions: stringRecord(optionalRecord(minted.permissions) ?? {}),
|
|
158
|
+
repositorySelection: optionalString(minted.repository_selection),
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Installation tokens shared across action runs in this process, keyed by App,
|
|
164
|
+
* installation and private-key digest. A token is reused until five minutes before GitHub expires
|
|
165
|
+
* it; a failed mint evicts itself so the next run retries instead of inheriting
|
|
166
|
+
* the rejection.
|
|
167
|
+
*/
|
|
168
|
+
const installationTokens = new Map();
|
|
169
|
+
export function clearGitHubInstallationTokenCache() {
|
|
170
|
+
installationTokens.clear();
|
|
171
|
+
}
|
|
172
|
+
function cachedInstallationToken(credential, fetcher) {
|
|
173
|
+
const key = `${credential.appId}:${credential.installationId}:${sha256Hex(credential.privateKey)}`;
|
|
174
|
+
const cached = installationTokens.get(key);
|
|
175
|
+
if (!cached) {
|
|
176
|
+
return refreshInstallationToken(key, credential, fetcher);
|
|
177
|
+
}
|
|
178
|
+
// No rejection handler, deliberately. A caller that joined an in-flight mint
|
|
179
|
+
// is told that the mint failed; the eviction in `refreshInstallationToken`
|
|
180
|
+
// has already made the NEXT call start over, so retrying here would turn one
|
|
181
|
+
// failure into a burst of one retry per waiting caller.
|
|
182
|
+
return cached.then((token) => {
|
|
183
|
+
if (isFresh(token)) {
|
|
184
|
+
return token;
|
|
185
|
+
}
|
|
186
|
+
// Stale. Another caller may already have started the replacement while
|
|
187
|
+
// this one was waiting on the old promise; join it rather than minting a
|
|
188
|
+
// second token for the same installation.
|
|
189
|
+
const latest = installationTokens.get(key);
|
|
190
|
+
return latest && latest !== cached ? latest : refreshInstallationToken(key, credential, fetcher);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function refreshInstallationToken(key, credential, fetcher) {
|
|
194
|
+
const current = installationTokens.get(key);
|
|
195
|
+
const minting = mintGitHubInstallationToken(credential, fetcher);
|
|
196
|
+
installationTokens.set(key, minting);
|
|
197
|
+
void minting.catch(() => {
|
|
198
|
+
if (installationTokens.get(key) === minting) {
|
|
199
|
+
if (current) {
|
|
200
|
+
installationTokens.set(key, current);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
installationTokens.delete(key);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
return minting;
|
|
208
|
+
}
|
|
209
|
+
function isFresh(token) {
|
|
210
|
+
const expiresAt = Date.parse(token.expiresAt);
|
|
211
|
+
return Number.isFinite(expiresAt) && expiresAt - Date.now() > installationTokenRenewalMarginMs;
|
|
212
|
+
}
|
|
213
|
+
/** Resolve installation tokens without letting one caller cancel a shared mint. */
|
|
214
|
+
export function createGitHubInstallationTokenResolver(values, fetcher) {
|
|
215
|
+
const credential = readGitHubAppInstallationCredential(values);
|
|
216
|
+
return async (signal) => {
|
|
217
|
+
signal?.throwIfAborted();
|
|
218
|
+
const pending = cachedInstallationToken(credential, fetcher);
|
|
219
|
+
if (!signal)
|
|
220
|
+
return (await pending).token;
|
|
221
|
+
return new Promise((resolve, reject) => {
|
|
222
|
+
const abort = () => reject(signal.reason);
|
|
223
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
224
|
+
void pending.then((token) => {
|
|
225
|
+
signal.removeEventListener("abort", abort);
|
|
226
|
+
resolve(token.token);
|
|
227
|
+
}, (error) => {
|
|
228
|
+
signal.removeEventListener("abort", abort);
|
|
229
|
+
reject(error);
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { combineProviderActionHandlers, defineProviderExecutors, defineProviderProxy, requireBearerCredential, } from "../provider-runtime.js";
|
|
1
|
+
import { combineProviderActionHandlers, defineProviderExecutors, defineProviderProxy, ProviderRequestError, requireBearerCredential, } from "../provider-runtime.js";
|
|
2
|
+
import { createGitHubInstallationTokenResolver, fetchGitHubAppInstallation, mintGitHubInstallationToken, readGitHubAppInstallationCredential, } from "./app-installation.js";
|
|
2
3
|
import { activityActionHandlers } from "./runtime-activity.js";
|
|
3
4
|
import { issueActionHandlers } from "./runtime-issue.js";
|
|
4
5
|
import { pullRequestActionHandlers } from "./runtime-pull-request.js";
|
|
@@ -9,29 +10,68 @@ import { githubApiBaseUrl, githubApiVersion, githubDefaultAcceptHeader, githubRe
|
|
|
9
10
|
import { githubRepoEvent } from "./trigger-on-repo-event.js";
|
|
10
11
|
import { githubPullRequestListener } from "./trigger-watch-pull-request.js";
|
|
11
12
|
const service = "github";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
const { get_current_user, ...installationHandlers } = combineProviderActionHandlers(service, activityActionHandlers, repositoryActionHandlers, issueActionHandlers, pullRequestActionHandlers, releaseActionHandlers, searchActionHandlers);
|
|
14
|
+
export const executors = {
|
|
15
|
+
...defineProviderExecutors({
|
|
16
|
+
service,
|
|
17
|
+
handlers: installationHandlers,
|
|
18
|
+
async createContext(context, fetcher) {
|
|
19
|
+
const credential = await context.getCredential(service);
|
|
20
|
+
if (credential?.authType === "custom_credential") {
|
|
21
|
+
return {
|
|
22
|
+
accessToken: await createGitHubInstallationTokenResolver(credential.values, fetcher)(context.signal),
|
|
23
|
+
fetcher,
|
|
24
|
+
transitFiles: context.transitFiles,
|
|
25
|
+
signal: context.signal,
|
|
26
|
+
installation: true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const bearer = await requireBearerCredential(context, service);
|
|
30
|
+
return {
|
|
31
|
+
accessToken: bearer.accessToken,
|
|
32
|
+
fetcher,
|
|
33
|
+
transitFiles: context.transitFiles,
|
|
34
|
+
signal: context.signal,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
...defineProviderExecutors({
|
|
39
|
+
service,
|
|
40
|
+
handlers: { get_current_user },
|
|
41
|
+
async createContext(context, fetcher) {
|
|
42
|
+
const credential = await context.getCredential(service);
|
|
43
|
+
if (credential?.authType === "custom_credential") {
|
|
44
|
+
throw new ProviderRequestError(400, "get_current_user requires a personal access token or OAuth user credential. This connection uses a GitHub App installation.");
|
|
45
|
+
}
|
|
46
|
+
const bearer = await requireBearerCredential(context, service);
|
|
47
|
+
return { accessToken: bearer.accessToken, fetcher, signal: context.signal };
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
25
51
|
export const proxy = defineProviderProxy({
|
|
26
52
|
service,
|
|
27
53
|
baseUrl: githubApiBaseUrl,
|
|
28
|
-
|
|
54
|
+
// Resolved rather than `bearer`, because an installation credential has no
|
|
55
|
+
// stored token: it is minted from the App key at request time.
|
|
56
|
+
auth: {
|
|
57
|
+
type: "bearer_resolver",
|
|
58
|
+
async resolve({ context, fetcher }) {
|
|
59
|
+
return { accessToken: await resolveGitHubAccessToken(context, fetcher) };
|
|
60
|
+
},
|
|
61
|
+
},
|
|
29
62
|
skipDnsValidation: true,
|
|
30
63
|
customizeRequest({ headers }) {
|
|
31
64
|
headers.set("accept", githubDefaultAcceptHeader);
|
|
32
65
|
headers.set("x-github-api-version", githubApiVersion);
|
|
33
66
|
},
|
|
34
67
|
});
|
|
68
|
+
async function resolveGitHubAccessToken(context, fetcher) {
|
|
69
|
+
const credential = await context.getCredential(service);
|
|
70
|
+
if (credential?.authType === "custom_credential") {
|
|
71
|
+
return createGitHubInstallationTokenResolver(credential.values, fetcher)(context.signal);
|
|
72
|
+
}
|
|
73
|
+
return (await requireBearerCredential(context, service)).accessToken;
|
|
74
|
+
}
|
|
35
75
|
export const credentialValidators = {
|
|
36
76
|
async apiKey(input, { fetcher }) {
|
|
37
77
|
return validateGitHubToken(input.apiKey, fetcher);
|
|
@@ -39,6 +79,9 @@ export const credentialValidators = {
|
|
|
39
79
|
async oauth2(input, { fetcher }) {
|
|
40
80
|
return validateGitHubToken(input.accessToken, fetcher);
|
|
41
81
|
},
|
|
82
|
+
async customCredential(input, { fetcher, signal }) {
|
|
83
|
+
return validateGitHubAppInstallation(input.values, fetcher, signal);
|
|
84
|
+
},
|
|
42
85
|
};
|
|
43
86
|
async function validateGitHubToken(accessToken, fetcher) {
|
|
44
87
|
const user = await githubRequestJson({
|
|
@@ -59,6 +102,41 @@ async function validateGitHubToken(accessToken, fetcher) {
|
|
|
59
102
|
},
|
|
60
103
|
};
|
|
61
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Prove the three inputs agree with each other and with GitHub: the key signs
|
|
107
|
+
* for this App (the installation lookup accepts the JWT), the installation
|
|
108
|
+
* belongs to it, and a token can actually be minted. The profile is the
|
|
109
|
+
* installation's account, identifying where the App is installed.
|
|
110
|
+
*/
|
|
111
|
+
async function validateGitHubAppInstallation(values, fetcher, signal) {
|
|
112
|
+
const credential = readGitHubAppInstallationCredential(values);
|
|
113
|
+
const installation = await fetchGitHubAppInstallation(credential, fetcher, signal);
|
|
114
|
+
const minted = await mintGitHubInstallationToken(credential, fetcher, signal);
|
|
115
|
+
const account = installation.account ?? {};
|
|
116
|
+
const login = typeof account.login === "string" ? account.login : undefined;
|
|
117
|
+
const accountId = account.id === undefined ? undefined : String(account.id);
|
|
118
|
+
const accountType = typeof account.type === "string" ? account.type : undefined;
|
|
119
|
+
if (!login && !accountId) {
|
|
120
|
+
throw new ProviderRequestError(500, "GitHub described the installation without an account", 502);
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
profile: {
|
|
124
|
+
accountId: login ?? accountId ?? `github:installation:${credential.installationId}`,
|
|
125
|
+
displayName: `GitHub App installation on ${login ?? accountId}`,
|
|
126
|
+
// Installation permissions are the closest thing to scopes an App has;
|
|
127
|
+
// they are reported as `<permission>:<level>` so a consumer can see what
|
|
128
|
+
// the credential may read without knowing GitHub's OAuth scope names.
|
|
129
|
+
grantedScopes: Object.entries(minted.permissions).map(([permission, level]) => `${permission}:${level}`),
|
|
130
|
+
},
|
|
131
|
+
metadata: {
|
|
132
|
+
appId: credential.appId,
|
|
133
|
+
installationId: credential.installationId,
|
|
134
|
+
accountType: accountType ?? null,
|
|
135
|
+
repositorySelection: minted.repositorySelection ?? installation.repository_selection ?? null,
|
|
136
|
+
permissions: minted.permissions,
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
}
|
|
62
140
|
export const triggers = [
|
|
63
141
|
githubRepoEvent,
|
|
64
142
|
githubPullRequestListener,
|
|
@@ -9,7 +9,10 @@ export const repositoryActionHandlers = {
|
|
|
9
9
|
fetcher,
|
|
10
10
|
});
|
|
11
11
|
},
|
|
12
|
-
list_my_repositories(input, { accessToken, fetcher }) {
|
|
12
|
+
list_my_repositories(input, { accessToken, fetcher, installation }) {
|
|
13
|
+
if (installation) {
|
|
14
|
+
return listInstallationRepositories(input, accessToken, fetcher);
|
|
15
|
+
}
|
|
13
16
|
return listMyRepositories(input, accessToken, fetcher);
|
|
14
17
|
},
|
|
15
18
|
create_repository(input, { accessToken, fetcher }) {
|
|
@@ -295,6 +298,23 @@ async function listMyRepositories(input, accessToken, fetcher) {
|
|
|
295
298
|
});
|
|
296
299
|
return { repositories };
|
|
297
300
|
}
|
|
301
|
+
async function listInstallationRepositories(input, accessToken, fetcher) {
|
|
302
|
+
for (const field of ["visibility", "sort", "direction"]) {
|
|
303
|
+
if (input[field] !== undefined) {
|
|
304
|
+
throw new ProviderRequestError(400, `${field} is not supported with a GitHub App installation credential. Omit it to list the installation's repositories.`);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
const page = await githubRequestJson({
|
|
308
|
+
path: "/installation/repositories",
|
|
309
|
+
query: compactObject({
|
|
310
|
+
per_page: optionalInteger(input.perPage),
|
|
311
|
+
page: optionalInteger(input.page),
|
|
312
|
+
}),
|
|
313
|
+
accessToken,
|
|
314
|
+
fetcher,
|
|
315
|
+
});
|
|
316
|
+
return { repositories: page.repositories ?? [] };
|
|
317
|
+
}
|
|
298
318
|
async function deleteRepository(input, accessToken, fetcher) {
|
|
299
319
|
await githubRequestNoContent({
|
|
300
320
|
method: "DELETE",
|
|
@@ -11,9 +11,11 @@ export type GitHubActionContext = {
|
|
|
11
11
|
fetcher: typeof fetch;
|
|
12
12
|
transitFiles?: TransitFileWriter;
|
|
13
13
|
signal?: AbortSignal;
|
|
14
|
+
installation?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export type GitHubActionHandler = (input: Record<string, unknown>, context: GitHubActionContext) => Promise<unknown>;
|
|
16
17
|
interface GitHubJsonRequest {
|
|
18
|
+
signal?: AbortSignal;
|
|
17
19
|
method?: string;
|
|
18
20
|
path: string;
|
|
19
21
|
query?: Record<string, string | number | boolean | undefined>;
|
|
@@ -9,6 +9,7 @@ export async function githubRequestJson(input) {
|
|
|
9
9
|
const url = buildGitHubUrl(input.path, input.query);
|
|
10
10
|
const response = await input.fetcher(url, {
|
|
11
11
|
method: input.method ?? "GET",
|
|
12
|
+
signal: input.signal,
|
|
12
13
|
headers: githubHeaders(input.accessToken, input.body !== undefined),
|
|
13
14
|
body: input.body === undefined ? undefined : JSON.stringify(input.body),
|
|
14
15
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { looseArray, optionalRecord, optionalString } from "../../core/cast.js";
|
|
2
|
-
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, } from "../provider-runtime.js";
|
|
2
|
+
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, providerInputError, providerResponseError, } from "../provider-runtime.js";
|
|
3
3
|
const defaultService = "googledrive";
|
|
4
4
|
const googleDefaultRequestTimeoutMs = 30_000;
|
|
5
5
|
export async function googleJsonRequest(url, input) {
|
|
@@ -29,7 +29,7 @@ export async function googleRequest(url, input) {
|
|
|
29
29
|
const hasRequestBody = input.rawBody != null || hasJsonBody;
|
|
30
30
|
const method = (input.method ?? (hasRequestBody ? "POST" : "GET")).toUpperCase();
|
|
31
31
|
if ((method === "GET" || method === "HEAD") && hasRequestBody) {
|
|
32
|
-
throw
|
|
32
|
+
throw providerInputError(`${service} ${method} request must not include a body`);
|
|
33
33
|
}
|
|
34
34
|
const requestInit = {
|
|
35
35
|
method,
|
|
@@ -51,7 +51,7 @@ export async function googleRequest(url, input) {
|
|
|
51
51
|
if (timeout.didTimeout() && isAbortLikeError(error)) {
|
|
52
52
|
const timeoutSeconds = Math.max(1, Math.ceil(timeoutMs / 1000));
|
|
53
53
|
const unit = timeoutSeconds === 1 ? "second" : "seconds";
|
|
54
|
-
throw
|
|
54
|
+
throw providerResponseError(`${service} request timed out after ${timeoutSeconds} ${unit}`);
|
|
55
55
|
}
|
|
56
56
|
throw error;
|
|
57
57
|
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { s } from "../../core/json-schema.js";
|
|
2
|
+
import { defineProviderAction } from "../../core/provider-definition.js";
|
|
3
|
+
import { attendanceActions } from "./attendance-actions.js";
|
|
4
|
+
import { businessActions } from "./business-actions.js";
|
|
5
|
+
import { exportActions } from "./export-actions.js";
|
|
6
|
+
import { pagination, employeeRecord, namedRecord, segmentRecord, attendanceRecord, reportRecord, stampRecord, leaveRecord, listOutput, } from "./schemas.js";
|
|
7
|
+
export const hrmosKintaiActions = [
|
|
8
|
+
...attendanceActions,
|
|
9
|
+
...businessActions,
|
|
10
|
+
...exportActions,
|
|
11
|
+
defineProviderAction("hrmos_kintai", {
|
|
12
|
+
name: "list_employees",
|
|
13
|
+
operationType: "read",
|
|
14
|
+
description: "List employees in the connected HRMOS Kintai company.",
|
|
15
|
+
inputSchema: s.object("Filters for list_employees.", {
|
|
16
|
+
...pagination,
|
|
17
|
+
}, { optional: ["limit", "page", "from", "to"] }),
|
|
18
|
+
outputSchema: listOutput(employeeRecord),
|
|
19
|
+
}),
|
|
20
|
+
defineProviderAction("hrmos_kintai", {
|
|
21
|
+
name: "list_departments",
|
|
22
|
+
operationType: "read",
|
|
23
|
+
description: "List departments in the connected company.",
|
|
24
|
+
inputSchema: s.object("Filters for list_departments.", {
|
|
25
|
+
...pagination,
|
|
26
|
+
}, { optional: ["limit", "page", "from", "to"] }),
|
|
27
|
+
outputSchema: listOutput(namedRecord),
|
|
28
|
+
}),
|
|
29
|
+
defineProviderAction("hrmos_kintai", {
|
|
30
|
+
name: "list_employment_types",
|
|
31
|
+
operationType: "read",
|
|
32
|
+
description: "List employment types in the connected company.",
|
|
33
|
+
inputSchema: s.object("Filters for list_employment_types.", {
|
|
34
|
+
...pagination,
|
|
35
|
+
}, { optional: ["limit", "page", "from", "to"] }),
|
|
36
|
+
outputSchema: listOutput(namedRecord),
|
|
37
|
+
}),
|
|
38
|
+
defineProviderAction("hrmos_kintai", {
|
|
39
|
+
name: "list_workplaces",
|
|
40
|
+
operationType: "read",
|
|
41
|
+
description: "List workplaces, optionally filtered by prefecture.",
|
|
42
|
+
inputSchema: s.object("Filters for list_workplaces.", {
|
|
43
|
+
...pagination,
|
|
44
|
+
prefectureId: s.integer("Filter workplaces by prefecture ID."),
|
|
45
|
+
}, { optional: ["prefectureId", "limit", "page", "from", "to"] }),
|
|
46
|
+
outputSchema: listOutput(namedRecord),
|
|
47
|
+
}),
|
|
48
|
+
defineProviderAction("hrmos_kintai", {
|
|
49
|
+
name: "list_work_segments",
|
|
50
|
+
operationType: "read",
|
|
51
|
+
description: "List work classifications and their configured working hours.",
|
|
52
|
+
inputSchema: s.object("Filters for list_work_segments.", {
|
|
53
|
+
...pagination,
|
|
54
|
+
}, { optional: ["limit", "page", "from", "to"] }),
|
|
55
|
+
outputSchema: listOutput(segmentRecord),
|
|
56
|
+
}),
|
|
57
|
+
defineProviderAction("hrmos_kintai", {
|
|
58
|
+
name: "list_leave_types",
|
|
59
|
+
operationType: "read",
|
|
60
|
+
description: "List leave settings used to query employee leave balances and history.",
|
|
61
|
+
inputSchema: s.object("Filters for list_leave_types.", {
|
|
62
|
+
...pagination,
|
|
63
|
+
}, { optional: ["limit", "page", "from", "to"] }),
|
|
64
|
+
outputSchema: listOutput(namedRecord),
|
|
65
|
+
}),
|
|
66
|
+
defineProviderAction("hrmos_kintai", {
|
|
67
|
+
name: "list_daily_attendance",
|
|
68
|
+
operationType: "read",
|
|
69
|
+
description: "List attendance records for all employees on a specified day.",
|
|
70
|
+
inputSchema: s.object("Filters for list_daily_attendance.", {
|
|
71
|
+
...pagination,
|
|
72
|
+
day: s.string("Target date in YYYY-MM-DD format.", { format: "date" }),
|
|
73
|
+
}, { optional: ["limit", "page", "from", "to"] }),
|
|
74
|
+
outputSchema: listOutput(attendanceRecord),
|
|
75
|
+
}),
|
|
76
|
+
defineProviderAction("hrmos_kintai", {
|
|
77
|
+
name: "list_monthly_attendance",
|
|
78
|
+
operationType: "read",
|
|
79
|
+
description: "List daily attendance records for a month, respecting each employee's cutoff date. Optionally filter by employee ID.",
|
|
80
|
+
inputSchema: s.object("Filters for list_monthly_attendance.", {
|
|
81
|
+
...pagination,
|
|
82
|
+
month: s.string("Target month in YYYY-MM format. Attendance detail respects employee cutoff dates.", {
|
|
83
|
+
pattern: "^[0-9]{4}-(0[1-9]|1[0-2])$",
|
|
84
|
+
}),
|
|
85
|
+
employeeId: s.integer("HRMOS employee ID."),
|
|
86
|
+
}, { optional: ["employeeId", "limit", "page", "from", "to"] }),
|
|
87
|
+
outputSchema: listOutput(attendanceRecord),
|
|
88
|
+
}),
|
|
89
|
+
defineProviderAction("hrmos_kintai", {
|
|
90
|
+
name: "list_monthly_reports",
|
|
91
|
+
operationType: "read",
|
|
92
|
+
description: "List monthly attendance summaries, optionally filtered by employee numbers and month-closing statuses.",
|
|
93
|
+
inputSchema: s.object("Filters for list_monthly_reports.", {
|
|
94
|
+
...pagination,
|
|
95
|
+
month: s.string("Target month in YYYY-MM format. Attendance detail respects employee cutoff dates.", {
|
|
96
|
+
pattern: "^[0-9]{4}-(0[1-9]|1[0-2])$",
|
|
97
|
+
}),
|
|
98
|
+
employeeNumbers: s.array("Employee numbers to include; omit to include all employees.", s.string("Employee number.", { minLength: 1 }), { minItems: 1 }),
|
|
99
|
+
statuses: s.array("Month-closing statuses: 0 not submitted, 1 ready, 2 pending, 3 approved, 99 forcibly approved.", { ...s.integer("One month-closing status."), enum: [0, 1, 2, 3, 99] }, { minItems: 1, uniqueItems: true }),
|
|
100
|
+
}, { optional: ["employeeNumbers", "statuses", "limit", "page", "from", "to"] }),
|
|
101
|
+
outputSchema: listOutput(reportRecord),
|
|
102
|
+
}),
|
|
103
|
+
defineProviderAction("hrmos_kintai", {
|
|
104
|
+
name: "list_daily_stamp_logs",
|
|
105
|
+
operationType: "read",
|
|
106
|
+
description: "List clock-in, clock-out and break punch history for a specified day.",
|
|
107
|
+
inputSchema: s.object("Filters for list_daily_stamp_logs.", {
|
|
108
|
+
...pagination,
|
|
109
|
+
day: s.string("Target date in YYYY-MM-DD format.", { format: "date" }),
|
|
110
|
+
}, { optional: ["limit", "page", "from", "to"] }),
|
|
111
|
+
outputSchema: listOutput(stampRecord),
|
|
112
|
+
}),
|
|
113
|
+
defineProviderAction("hrmos_kintai", {
|
|
114
|
+
name: "list_employee_stamp_logs",
|
|
115
|
+
operationType: "read",
|
|
116
|
+
description: "List an employee's punch history, optionally filtered by punch type and update time.",
|
|
117
|
+
inputSchema: s.object("Filters for list_employee_stamp_logs.", {
|
|
118
|
+
...pagination,
|
|
119
|
+
employeeId: s.integer("HRMOS employee ID."),
|
|
120
|
+
stampType: {
|
|
121
|
+
...s.integer("Punch type: 1 clock-in, 2 clock-out, 7 break start, 8 break end."),
|
|
122
|
+
enum: [1, 2, 7, 8],
|
|
123
|
+
},
|
|
124
|
+
}, { optional: ["stampType", "limit", "page", "from", "to"] }),
|
|
125
|
+
outputSchema: listOutput(stampRecord),
|
|
126
|
+
}),
|
|
127
|
+
defineProviderAction("hrmos_kintai", {
|
|
128
|
+
name: "list_employee_leave_history",
|
|
129
|
+
operationType: "read",
|
|
130
|
+
description: "List an employee's leave grants, usage, adjustments and remaining balances for a leave setting and year.",
|
|
131
|
+
inputSchema: s.object("Filters for list_employee_leave_history.", {
|
|
132
|
+
...pagination,
|
|
133
|
+
leaveTypeId: s.integer("Leave setting ID returned by list_leave_types."),
|
|
134
|
+
employeeId: s.integer("HRMOS employee ID."),
|
|
135
|
+
year: s.integer("Target leave year."),
|
|
136
|
+
}, { optional: ["limit", "page", "from", "to"] }),
|
|
137
|
+
outputSchema: listOutput(leaveRecord),
|
|
138
|
+
}),
|
|
139
|
+
];
|