@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,341 @@
|
|
|
1
|
+
import { jsonSchema as s } from "../../core/json-schema.js";
|
|
2
|
+
import { defineProviderAction } from "../../core/provider-definition.js";
|
|
3
|
+
const repo = s.nonWhitespaceString("Repository path without .git, including parent organizations, for example team/project.");
|
|
4
|
+
const number = s.string("Issue or pull request number as a decimal string.", {
|
|
5
|
+
pattern: "^[0-9]+$",
|
|
6
|
+
});
|
|
7
|
+
const page = s.optional(s.integer("Page number, starting at 1.", { minimum: 1, default: 1 }));
|
|
8
|
+
const pageSize = s.optional(s.integer("Number of items per page.", { minimum: 1, default: 10 }));
|
|
9
|
+
const pagination = { page, page_size: pageSize };
|
|
10
|
+
const title = s.nonWhitespaceString("Issue or pull request title.");
|
|
11
|
+
const body = s.optional(s.string("Markdown body content."));
|
|
12
|
+
const priority = s.optional(s.stringEnum("Issue priority.", ["-2P", "-1P", "P0", "P1", "P2", "P3"]));
|
|
13
|
+
const state = s.optional(s.stringEnum("Issue or pull request state.", ["open", "closed"]));
|
|
14
|
+
const labels = s.optional(s.string("Comma-separated label names."));
|
|
15
|
+
const authors = s.optional(s.string("Comma-separated author names."));
|
|
16
|
+
const assignees = s.optional(s.string("Comma-separated assignee names; use - for unassigned."));
|
|
17
|
+
const operator = s.optional(s.stringEnum("Match any or all supplied values.", ["contains_any", "contains_all"]));
|
|
18
|
+
const updated = {
|
|
19
|
+
updated_time_begin: s.optional(s.string("Start of the update date range, for example 2026-01-01.")),
|
|
20
|
+
updated_time_end: s.optional(s.string("End of the update date range, for example 2026-12-31.")),
|
|
21
|
+
};
|
|
22
|
+
const issueDates = {
|
|
23
|
+
start_date: s.optional(s.string("Issue start date, for example 2026-01-01.")),
|
|
24
|
+
end_date: s.optional(s.string("Issue end date, for example 2026-12-31.")),
|
|
25
|
+
};
|
|
26
|
+
const commonOutput = {
|
|
27
|
+
number: s.string("Issue or pull request number."),
|
|
28
|
+
title: s.string("Issue or pull request title."),
|
|
29
|
+
body: s.string("Markdown body content."),
|
|
30
|
+
state: s.string("Current state returned by CNB."),
|
|
31
|
+
};
|
|
32
|
+
const repositoryOutput = s.looseObject("Repository information, including any additional CNB fields.", {
|
|
33
|
+
id: s.string("Repository ID."),
|
|
34
|
+
name: s.string("Repository name."),
|
|
35
|
+
path: s.string("Full repository path."),
|
|
36
|
+
web_url: s.string("Repository web URL."),
|
|
37
|
+
description: s.string("Repository description."),
|
|
38
|
+
});
|
|
39
|
+
const issueFields = {
|
|
40
|
+
number: commonOutput.number,
|
|
41
|
+
title: commonOutput.title,
|
|
42
|
+
state: commonOutput.state,
|
|
43
|
+
priority: s.string("Issue priority."),
|
|
44
|
+
state_reason: s.string("Reason for the current issue state."),
|
|
45
|
+
};
|
|
46
|
+
const issueListOutput = s.looseObject("Issue information, including any additional CNB fields.", issueFields);
|
|
47
|
+
const issueOutput = s.looseObject("Issue information, including any additional CNB fields.", {
|
|
48
|
+
...issueFields,
|
|
49
|
+
body: commonOutput.body,
|
|
50
|
+
});
|
|
51
|
+
const pullOutput = s.looseObject("Pull request information, including any additional CNB fields.", {
|
|
52
|
+
...commonOutput,
|
|
53
|
+
is_merged: s.boolean("Whether the pull request has been merged."),
|
|
54
|
+
mergeable_state: s.string("Current mergeability state."),
|
|
55
|
+
head: s.looseObject("Source branch information.", {}),
|
|
56
|
+
base: s.looseObject("Target branch information.", {}),
|
|
57
|
+
});
|
|
58
|
+
const commentOutput = s.looseObject("Issue comment information, including any additional CNB fields.", {
|
|
59
|
+
id: s.string("Comment ID."),
|
|
60
|
+
body: s.string("Comment content."),
|
|
61
|
+
created_at: s.string("Comment creation time."),
|
|
62
|
+
});
|
|
63
|
+
export const cnbActions = [
|
|
64
|
+
defineProviderAction("cnb", {
|
|
65
|
+
name: "list_repositories",
|
|
66
|
+
operationType: "read",
|
|
67
|
+
requiredScopes: [],
|
|
68
|
+
description: "List repositories accessible to the current user. Requires account-engage:r. The default minimum role is Guest; increase page until an empty page is returned.",
|
|
69
|
+
inputSchema: s.requiredObject("Repository list filters.", {
|
|
70
|
+
...pagination,
|
|
71
|
+
search: s.optional(s.string("Filter repositories by name.")),
|
|
72
|
+
filter_type: s.optional(s.stringEnum("Repository visibility.", ["private", "public", "secret"])),
|
|
73
|
+
role: s.optional({
|
|
74
|
+
...s.stringEnum("Minimum repository role; defaults to Guest to include all accessible repositories.", [
|
|
75
|
+
"Guest",
|
|
76
|
+
"Reporter",
|
|
77
|
+
"Developer",
|
|
78
|
+
"Master",
|
|
79
|
+
"Owner",
|
|
80
|
+
]),
|
|
81
|
+
default: "Guest",
|
|
82
|
+
}),
|
|
83
|
+
flags: s.optional(s.string("Comma-separated repository flags: KnowledgeBase, NPC, Skills.")),
|
|
84
|
+
flags_match: s.optional(s.stringEnum("How multiple repository flags are matched.", ["intersection", "union"])),
|
|
85
|
+
status: s.optional(s.stringEnum("Repository status.", ["active", "archived"])),
|
|
86
|
+
order_by: s.optional(s.stringEnum("Repository sort field.", ["created_at", "last_updated_at", "stars", "slug_path", "forks"])),
|
|
87
|
+
desc: s.optional(s.boolean("Whether to sort in descending order.")),
|
|
88
|
+
}),
|
|
89
|
+
outputSchema: s.requiredObject("One page of repositories.", {
|
|
90
|
+
items: s.array("Repositories on this page.", repositoryOutput),
|
|
91
|
+
}),
|
|
92
|
+
}),
|
|
93
|
+
defineProviderAction("cnb", {
|
|
94
|
+
name: "get_repository",
|
|
95
|
+
operationType: "read",
|
|
96
|
+
requiredScopes: [],
|
|
97
|
+
description: "Get repository information. Requires repo-basic-info:r.",
|
|
98
|
+
inputSchema: s.requiredObject("Repository selection.", { repo }),
|
|
99
|
+
outputSchema: repositoryOutput,
|
|
100
|
+
}),
|
|
101
|
+
defineProviderAction("cnb", {
|
|
102
|
+
name: "list_issues",
|
|
103
|
+
operationType: "read",
|
|
104
|
+
requiredScopes: [],
|
|
105
|
+
description: "List and filter repository issues. Requires repo-issue:r. Increase page until an empty page is returned.",
|
|
106
|
+
inputSchema: s.requiredObject("Issue list filters.", {
|
|
107
|
+
repo,
|
|
108
|
+
...pagination,
|
|
109
|
+
page_size: s.optional(s.integer("Number of issues per page, at most 100.", {
|
|
110
|
+
minimum: 1,
|
|
111
|
+
maximum: 100,
|
|
112
|
+
default: 10,
|
|
113
|
+
})),
|
|
114
|
+
state,
|
|
115
|
+
keyword: s.optional(s.string("Search issue titles and content.")),
|
|
116
|
+
priority: s.optional(s.string("Comma-separated priorities: -2P, -1P, P0, P1, P2, P3.")),
|
|
117
|
+
labels,
|
|
118
|
+
labels_operator: operator,
|
|
119
|
+
authors,
|
|
120
|
+
assignees,
|
|
121
|
+
...updated,
|
|
122
|
+
close_time_begin: s.optional(s.string("Start of the issue closure date range.")),
|
|
123
|
+
close_time_end: s.optional(s.string("End of the issue closure date range.")),
|
|
124
|
+
order_by: s.optional(s.stringEnum("Issue sort field; a leading minus means descending.", [
|
|
125
|
+
"created_at",
|
|
126
|
+
"-created_at",
|
|
127
|
+
"-updated_at",
|
|
128
|
+
"-last_acted_at",
|
|
129
|
+
])),
|
|
130
|
+
}),
|
|
131
|
+
outputSchema: s.requiredObject("One page of issues.", {
|
|
132
|
+
items: s.array("Issues on this page.", issueListOutput),
|
|
133
|
+
}),
|
|
134
|
+
}),
|
|
135
|
+
defineProviderAction("cnb", {
|
|
136
|
+
name: "get_issue",
|
|
137
|
+
operationType: "read",
|
|
138
|
+
requiredScopes: [],
|
|
139
|
+
description: "Get an issue with its full description and metadata. Requires repo-issue:r.",
|
|
140
|
+
inputSchema: s.requiredObject("Issue selection.", { repo, number }),
|
|
141
|
+
outputSchema: issueOutput,
|
|
142
|
+
}),
|
|
143
|
+
defineProviderAction("cnb", {
|
|
144
|
+
name: "create_issue",
|
|
145
|
+
operationType: "write",
|
|
146
|
+
requiredScopes: [],
|
|
147
|
+
description: "Create a repository issue with optional labels, assignees, dates and priority. Requires repo-issue:rw.",
|
|
148
|
+
inputSchema: s.requiredObject("Issue creation parameters.", {
|
|
149
|
+
repo,
|
|
150
|
+
title,
|
|
151
|
+
body,
|
|
152
|
+
priority,
|
|
153
|
+
...issueDates,
|
|
154
|
+
invisible: s.optional(s.boolean("Whether the issue is private.")),
|
|
155
|
+
work_mode: s.optional(s.boolean("Whether work mode is enabled.")),
|
|
156
|
+
assignees: s.optional(s.array("Issue assignee names, at most 8.", s.string("Assignee name."), { maxItems: 8 })),
|
|
157
|
+
labels: s.optional(s.array("Issue label names, at most 10.", s.string("Label name."), { maxItems: 10 })),
|
|
158
|
+
}),
|
|
159
|
+
outputSchema: issueOutput,
|
|
160
|
+
}),
|
|
161
|
+
defineProviderAction("cnb", {
|
|
162
|
+
name: "update_issue",
|
|
163
|
+
operationType: "write",
|
|
164
|
+
requiredScopes: [],
|
|
165
|
+
description: "Update issue content, dates, visibility, priority or workflow state. Supply state and state_reason together. Requires repo-issue:rw.",
|
|
166
|
+
inputSchema: {
|
|
167
|
+
...s.object("Issue changes; omitted fields are unchanged.", {
|
|
168
|
+
repo,
|
|
169
|
+
number,
|
|
170
|
+
title: s.optional(title),
|
|
171
|
+
body,
|
|
172
|
+
priority,
|
|
173
|
+
...issueDates,
|
|
174
|
+
invisible: s.optional(s.boolean("Whether the issue is private.")),
|
|
175
|
+
state,
|
|
176
|
+
state_reason: s.optional(s.stringEnum("Issue state reason; use reopened with open, completed or not_planned with closed.", [
|
|
177
|
+
"completed",
|
|
178
|
+
"not_planned",
|
|
179
|
+
"reopened",
|
|
180
|
+
])),
|
|
181
|
+
}),
|
|
182
|
+
minProperties: 3,
|
|
183
|
+
dependentRequired: { state: ["state_reason"], state_reason: ["state"] },
|
|
184
|
+
},
|
|
185
|
+
outputSchema: issueOutput,
|
|
186
|
+
}),
|
|
187
|
+
defineProviderAction("cnb", {
|
|
188
|
+
name: "list_issue_comments",
|
|
189
|
+
operationType: "read",
|
|
190
|
+
requiredScopes: [],
|
|
191
|
+
description: "List issue comments. Requires repo-notes:r. Increase page until an empty page is returned.",
|
|
192
|
+
inputSchema: s.requiredObject("Issue comment list filters.", {
|
|
193
|
+
repo,
|
|
194
|
+
number,
|
|
195
|
+
...pagination,
|
|
196
|
+
sort: s.optional(s.stringEnum("Comment sort order; a leading minus means descending.", [
|
|
197
|
+
"created",
|
|
198
|
+
"updated",
|
|
199
|
+
"-created",
|
|
200
|
+
"-updated",
|
|
201
|
+
])),
|
|
202
|
+
}),
|
|
203
|
+
outputSchema: s.requiredObject("One page of comments.", {
|
|
204
|
+
items: s.array("Comments on this page.", commentOutput),
|
|
205
|
+
}),
|
|
206
|
+
}),
|
|
207
|
+
defineProviderAction("cnb", {
|
|
208
|
+
name: "create_issue_comment",
|
|
209
|
+
operationType: "write",
|
|
210
|
+
requiredScopes: [],
|
|
211
|
+
description: "Add a comment to an issue. Requires repo-notes:rw.",
|
|
212
|
+
inputSchema: s.requiredObject("Issue comment creation parameters.", {
|
|
213
|
+
repo,
|
|
214
|
+
number,
|
|
215
|
+
body: s.nonWhitespaceString("Comment content."),
|
|
216
|
+
work_mode: s.optional(s.boolean("Whether work mode is enabled.")),
|
|
217
|
+
}),
|
|
218
|
+
outputSchema: commentOutput,
|
|
219
|
+
}),
|
|
220
|
+
defineProviderAction("cnb", {
|
|
221
|
+
name: "list_pull_requests",
|
|
222
|
+
operationType: "read",
|
|
223
|
+
requiredScopes: [],
|
|
224
|
+
description: "List repository pull requests with filters. Requires repo-pr:r. Increase page until an empty page is returned.",
|
|
225
|
+
inputSchema: s.requiredObject("Pull request list filters.", {
|
|
226
|
+
repo,
|
|
227
|
+
...pagination,
|
|
228
|
+
state: s.optional(s.stringEnum("Pull request state filter; CNB defaults to open.", ["open", "closed", "all"])),
|
|
229
|
+
authors,
|
|
230
|
+
assignees,
|
|
231
|
+
labels,
|
|
232
|
+
assignees_operator: operator,
|
|
233
|
+
labels_operator: operator,
|
|
234
|
+
reviewers: s.optional(s.string("Comma-separated reviewer names; use - for no reviewer.")),
|
|
235
|
+
reviewers_operator: operator,
|
|
236
|
+
base_ref: s.optional(s.string("Target branch name.")),
|
|
237
|
+
...updated,
|
|
238
|
+
order_by: s.optional(s.stringEnum("Pull request sort field; a leading minus means descending.", [
|
|
239
|
+
"created_at",
|
|
240
|
+
"-created_at",
|
|
241
|
+
"-updated_at",
|
|
242
|
+
])),
|
|
243
|
+
}),
|
|
244
|
+
outputSchema: s.requiredObject("One page of pull requests.", {
|
|
245
|
+
items: s.array("Pull requests on this page.", pullOutput),
|
|
246
|
+
}),
|
|
247
|
+
}),
|
|
248
|
+
defineProviderAction("cnb", {
|
|
249
|
+
name: "get_pull_request",
|
|
250
|
+
operationType: "read",
|
|
251
|
+
requiredScopes: [],
|
|
252
|
+
description: "Get pull request details and mergeability information. Requires repo-pr:r.",
|
|
253
|
+
inputSchema: s.requiredObject("Pull request selection.", { repo, number }),
|
|
254
|
+
outputSchema: pullOutput,
|
|
255
|
+
}),
|
|
256
|
+
defineProviderAction("cnb", {
|
|
257
|
+
name: "create_pull_request",
|
|
258
|
+
operationType: "write",
|
|
259
|
+
requiredScopes: [],
|
|
260
|
+
description: "Create a pull request from a source branch into a target branch. Requires repo-pr:rw.",
|
|
261
|
+
inputSchema: s.requiredObject("Pull request creation parameters.", {
|
|
262
|
+
repo,
|
|
263
|
+
title,
|
|
264
|
+
body,
|
|
265
|
+
head: s.nonWhitespaceString("Source branch name."),
|
|
266
|
+
base: s.nonWhitespaceString("Target branch name."),
|
|
267
|
+
head_repo: s.optional(s.nonWhitespaceString("Source repository path for a cross-repository pull request.")),
|
|
268
|
+
}),
|
|
269
|
+
outputSchema: pullOutput,
|
|
270
|
+
}),
|
|
271
|
+
defineProviderAction("cnb", {
|
|
272
|
+
name: "update_pull_request",
|
|
273
|
+
operationType: "write",
|
|
274
|
+
requiredScopes: [],
|
|
275
|
+
description: "Update a pull request title, description or open/closed workflow state. Requires repo-pr:rw.",
|
|
276
|
+
inputSchema: {
|
|
277
|
+
...s.object("Pull request changes; omitted fields are unchanged.", {
|
|
278
|
+
repo,
|
|
279
|
+
number,
|
|
280
|
+
title: s.optional(title),
|
|
281
|
+
body,
|
|
282
|
+
state,
|
|
283
|
+
}),
|
|
284
|
+
minProperties: 3,
|
|
285
|
+
},
|
|
286
|
+
outputSchema: pullOutput,
|
|
287
|
+
}),
|
|
288
|
+
defineProviderAction("cnb", {
|
|
289
|
+
name: "list_builds",
|
|
290
|
+
operationType: "read",
|
|
291
|
+
requiredScopes: [],
|
|
292
|
+
description: "List pipeline build history, filtered by branch, event, commit or status. Requires repo-cnb-history:r.",
|
|
293
|
+
inputSchema: s.requiredObject("Build history filters.", {
|
|
294
|
+
repo,
|
|
295
|
+
page,
|
|
296
|
+
page_size: s.optional(s.integer("Builds per page, at most 100; defaults to 30.", {
|
|
297
|
+
minimum: 1,
|
|
298
|
+
maximum: 100,
|
|
299
|
+
default: 30,
|
|
300
|
+
})),
|
|
301
|
+
createTime: s.optional(s.string("Start date in YYYY-MM-DD format.")),
|
|
302
|
+
endTime: s.optional(s.string("End date in YYYY-MM-DD format.")),
|
|
303
|
+
event: s.optional(s.string("Build event, for example push.")),
|
|
304
|
+
sha: s.optional(s.string("Commit SHA.")),
|
|
305
|
+
sn: s.optional(s.string("Build serial number.")),
|
|
306
|
+
sourceRef: s.optional(s.string("Source branch name.")),
|
|
307
|
+
targetRef: s.optional(s.string("Target branch name.")),
|
|
308
|
+
status: s.optional(s.stringEnum("Build status filter.", ["pending", "success", "error", "cancel"])),
|
|
309
|
+
userId: s.optional(s.string("Build user ID.")),
|
|
310
|
+
userName: s.optional(s.string("Build username.")),
|
|
311
|
+
}),
|
|
312
|
+
outputSchema: s.looseObject("Build history page and total count.", {
|
|
313
|
+
data: s.array("Build records on this page.", s.looseObject("Build history record.", {
|
|
314
|
+
sn: s.string("Build serial number."),
|
|
315
|
+
status: s.string("Build status."),
|
|
316
|
+
sha: s.string("Commit SHA."),
|
|
317
|
+
buildLogUrl: s.string("Build log URL."),
|
|
318
|
+
})),
|
|
319
|
+
total: s.integer("Total number of builds matching the filters."),
|
|
320
|
+
timestamp: s.integer("Current timestamp returned by CNB."),
|
|
321
|
+
}),
|
|
322
|
+
}),
|
|
323
|
+
defineProviderAction("cnb", {
|
|
324
|
+
name: "get_build_status",
|
|
325
|
+
operationType: "read",
|
|
326
|
+
requiredScopes: [],
|
|
327
|
+
description: "Get the current state and pipeline progress of an existing build. Requires repo-cnb-trigger:r.",
|
|
328
|
+
inputSchema: s.requiredObject("Build selection.", {
|
|
329
|
+
repo,
|
|
330
|
+
sn: s.nonWhitespaceString("Build serial number."),
|
|
331
|
+
}),
|
|
332
|
+
outputSchema: s.looseObject("Build status and pipeline progress.", {
|
|
333
|
+
status: s.string("Build status."),
|
|
334
|
+
pipelinesStatus: s.record("Pipeline states keyed by pipeline ID.", s.looseObject("Pipeline progress.", {
|
|
335
|
+
id: s.string("Pipeline ID."),
|
|
336
|
+
name: s.string("Pipeline name."),
|
|
337
|
+
status: s.string("Pipeline status."),
|
|
338
|
+
})),
|
|
339
|
+
}),
|
|
340
|
+
}),
|
|
341
|
+
];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CredentialValidators, ProviderExecutors, ProviderProxyExecutor } from "../../core/types.ts";
|
|
2
|
+
export declare const executors: ProviderExecutors;
|
|
3
|
+
export declare const credentialValidators: CredentialValidators;
|
|
4
|
+
export declare const proxy: ProviderProxyExecutor;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { optionalRecord, optionalRawString } from "../../core/cast.js";
|
|
2
|
+
import { requiredInputString, requiredResponseRecord, ProviderRequestError, runProviderRequest, defineApiKeyProviderExecutors, defineProviderProxy, mapProviderActionHandlers, readProviderProxyErrorMessage, withRetryAfterSeconds, } from "../provider-runtime.js";
|
|
3
|
+
import { cnbActions } from "./actions.js";
|
|
4
|
+
const baseUrl = "https://api.cnb.cool";
|
|
5
|
+
const defaultHeaders = { accept: "application/vnd.cnb.api+json" };
|
|
6
|
+
const routes = {
|
|
7
|
+
list_repositories: { method: "GET", suffix: "/user/repos", list: true },
|
|
8
|
+
get_repository: { method: "GET", suffix: "" },
|
|
9
|
+
list_issues: { method: "GET", suffix: "/-/issues", list: true },
|
|
10
|
+
get_issue: { method: "GET", suffix: "/-/issues/{number}" },
|
|
11
|
+
create_issue: { method: "POST", suffix: "/-/issues" },
|
|
12
|
+
update_issue: { method: "PATCH", suffix: "/-/issues/{number}" },
|
|
13
|
+
list_issue_comments: { method: "GET", suffix: "/-/issues/{number}/comments", list: true },
|
|
14
|
+
create_issue_comment: { method: "POST", suffix: "/-/issues/{number}/comments" },
|
|
15
|
+
list_pull_requests: { method: "GET", suffix: "/-/pulls", list: true },
|
|
16
|
+
get_pull_request: { method: "GET", suffix: "/-/pulls/{number}" },
|
|
17
|
+
create_pull_request: { method: "POST", suffix: "/-/pulls" },
|
|
18
|
+
update_pull_request: { method: "PATCH", suffix: "/-/pulls/{number}" },
|
|
19
|
+
list_builds: { method: "GET", suffix: "/-/build/logs" },
|
|
20
|
+
get_build_status: { method: "GET", suffix: "/-/build/status/{sn}" },
|
|
21
|
+
};
|
|
22
|
+
function encodeSegment(value) {
|
|
23
|
+
if (value === "." || value === ".." || value.includes("\\") || value.length === 0) {
|
|
24
|
+
throw new ProviderRequestError(400, "Invalid CNB path segment", undefined, "invalid_input");
|
|
25
|
+
}
|
|
26
|
+
return encodeURIComponent(value);
|
|
27
|
+
}
|
|
28
|
+
function encodeRepository(value) {
|
|
29
|
+
const segments = value.split("/");
|
|
30
|
+
if (segments.length < 2) {
|
|
31
|
+
throw new ProviderRequestError(400, "CNB repo must include an organization and repository", undefined, "invalid_input");
|
|
32
|
+
}
|
|
33
|
+
return segments.map(encodeSegment).join("/");
|
|
34
|
+
}
|
|
35
|
+
async function request({ pathname, method, parameters, apiKey, fetcher, parentSignal }) {
|
|
36
|
+
return runProviderRequest({ signal: parentSignal, label: "CNB" }, async (signal) => {
|
|
37
|
+
const url = new URL(`${baseUrl}${pathname}`);
|
|
38
|
+
if (method === "GET") {
|
|
39
|
+
for (const [key, value] of Object.entries(parameters)) {
|
|
40
|
+
if (value !== undefined)
|
|
41
|
+
url.searchParams.set(key, String(value));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const response = await fetcher(url.toString(), {
|
|
45
|
+
method,
|
|
46
|
+
signal,
|
|
47
|
+
headers: {
|
|
48
|
+
...defaultHeaders,
|
|
49
|
+
authorization: `Bearer ${apiKey}`,
|
|
50
|
+
"content-type": "application/json",
|
|
51
|
+
},
|
|
52
|
+
body: method === "GET" ? undefined : JSON.stringify(parameters),
|
|
53
|
+
});
|
|
54
|
+
const text = await response.text();
|
|
55
|
+
let payload;
|
|
56
|
+
try {
|
|
57
|
+
payload = JSON.parse(text);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
payload = undefined;
|
|
61
|
+
}
|
|
62
|
+
const error = optionalRecord(payload);
|
|
63
|
+
if (!response.ok || (typeof error?.errcode === "number" && error.errcode !== 0)) {
|
|
64
|
+
const message = optionalRawString(error?.errmsg);
|
|
65
|
+
const code = typeof error?.errcode === "number" ? ` (errcode ${error.errcode})` : "";
|
|
66
|
+
const detail = (message || `HTTP ${response.status}`).split(apiKey).join("[REDACTED]");
|
|
67
|
+
throw new ProviderRequestError(response.ok ? 502 : response.status, `CNB request failed${code}: ${detail}`, undefined, response.status === 429 ? "rate_limited" : "provider_error");
|
|
68
|
+
}
|
|
69
|
+
return payload;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const handlers = mapProviderActionHandlers("cnb", cnbActions, (action) => async (dataInput, context) => {
|
|
73
|
+
const route = routes[action.name];
|
|
74
|
+
const { repo, number, ...parameters } = dataInput;
|
|
75
|
+
if (route.list || action.name === "list_builds") {
|
|
76
|
+
parameters.page ??= 1;
|
|
77
|
+
parameters.page_size ??= action.name === "list_builds" ? 30 : 10;
|
|
78
|
+
}
|
|
79
|
+
if (action.name === "list_repositories")
|
|
80
|
+
parameters.role ??= "Guest";
|
|
81
|
+
let suffix = route.suffix.replace("{number}", String(number));
|
|
82
|
+
if (action.name === "get_build_status") {
|
|
83
|
+
suffix = suffix.replace("{sn}", encodeSegment(String(parameters.sn)));
|
|
84
|
+
delete parameters.sn;
|
|
85
|
+
}
|
|
86
|
+
if (action.name === "update_issue" && parameters.state !== undefined) {
|
|
87
|
+
const valid = parameters.state === "open"
|
|
88
|
+
? parameters.state_reason === "reopened"
|
|
89
|
+
: parameters.state_reason === "completed" || parameters.state_reason === "not_planned";
|
|
90
|
+
if (!valid) {
|
|
91
|
+
throw new ProviderRequestError(400, "CNB issue state and state_reason do not match", undefined, "invalid_input");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const pathname = repo === undefined ? suffix : `/${encodeRepository(String(repo))}${suffix}`;
|
|
95
|
+
const payload = await request({
|
|
96
|
+
pathname: pathname,
|
|
97
|
+
method: route.method,
|
|
98
|
+
parameters: parameters,
|
|
99
|
+
apiKey: context.apiKey,
|
|
100
|
+
fetcher: context.fetcher,
|
|
101
|
+
parentSignal: context.signal,
|
|
102
|
+
});
|
|
103
|
+
if (route.list) {
|
|
104
|
+
if (!Array.isArray(payload)) {
|
|
105
|
+
throw new ProviderRequestError(502, "CNB returned an invalid list response", undefined, "provider_error");
|
|
106
|
+
}
|
|
107
|
+
return { items: payload };
|
|
108
|
+
}
|
|
109
|
+
return requiredResponseRecord(payload, "CNB response");
|
|
110
|
+
});
|
|
111
|
+
export const executors = defineApiKeyProviderExecutors("cnb", handlers, { skipDnsValidation: true });
|
|
112
|
+
export const credentialValidators = {
|
|
113
|
+
async apiKey(input) {
|
|
114
|
+
requiredInputString(input.apiKey, "API Key");
|
|
115
|
+
return {
|
|
116
|
+
profile: { displayName: "CNB Access Token" },
|
|
117
|
+
grantedScopes: [],
|
|
118
|
+
metadata: { apiBaseUrl: baseUrl, validationMode: "local_non_empty_key" },
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
export const proxy = defineProviderProxy({
|
|
123
|
+
service: "cnb",
|
|
124
|
+
baseUrl,
|
|
125
|
+
auth: { type: "api_key_authorization", prefix: "Bearer " },
|
|
126
|
+
skipDnsValidation: true,
|
|
127
|
+
customizeRequest({ headers }) {
|
|
128
|
+
for (const [name, value] of Object.entries({ accept: "application/vnd.cnb.api+json" }))
|
|
129
|
+
if (!headers.has(name))
|
|
130
|
+
headers.set(name, value);
|
|
131
|
+
},
|
|
132
|
+
async readError(response) {
|
|
133
|
+
return new ProviderRequestError(response.status, await readProviderProxyErrorMessage(response, "Provider request failed"), withRetryAfterSeconds(response), response.status === 429 ? "rate_limited" : "provider_error");
|
|
134
|
+
},
|
|
135
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compactObject, optionalRecord, optionalString } from "../../core/cast.js";
|
|
2
|
-
import { ProviderRequestError, providerUserAgent, requiredInputString, requiredResponseRecord, runProviderRequest, } from "../provider-runtime.js";
|
|
2
|
+
import { ProviderRequestError, providerUserAgent, requiredInputString, requiredResponseRecord, runProviderRequest, providerInputError, providerResponseError, } from "../provider-runtime.js";
|
|
3
3
|
export const coupontoolsApiBaseUrl = "https://api.coupontools.com";
|
|
4
4
|
export async function validateCoupontoolsCredential(input, fetcher, signal) {
|
|
5
5
|
await requestCoupontoolsJson({
|
|
@@ -49,7 +49,7 @@ export async function executeCoupontoolsAction(input, fetcher) {
|
|
|
49
49
|
}
|
|
50
50
|
case "create_single_use_url": {
|
|
51
51
|
if (input.input.customvalcode != null && input.input.autovalcode != null) {
|
|
52
|
-
throw
|
|
52
|
+
throw providerInputError("customvalcode and autovalcode cannot be used together");
|
|
53
53
|
}
|
|
54
54
|
const raw = await requestCoupontoolsJson({
|
|
55
55
|
path: "/v3/singleuse/create",
|
|
@@ -64,7 +64,7 @@ export async function executeCoupontoolsAction(input, fetcher) {
|
|
|
64
64
|
const singleUseUrl = optionalString(raw.single_use_url)?.trim();
|
|
65
65
|
const singleUseCode = optionalString(raw.single_use_code)?.trim();
|
|
66
66
|
if (!singleUseUrl || !singleUseCode) {
|
|
67
|
-
throw
|
|
67
|
+
throw providerResponseError("Coupontools response did not include single_use_url and single_use_code");
|
|
68
68
|
}
|
|
69
69
|
return {
|
|
70
70
|
single_use_url: singleUseUrl,
|
|
@@ -76,7 +76,7 @@ export async function executeCoupontoolsAction(input, fetcher) {
|
|
|
76
76
|
}
|
|
77
77
|
function requireCouponArray(value) {
|
|
78
78
|
if (!Array.isArray(value)) {
|
|
79
|
-
throw
|
|
79
|
+
throw providerResponseError("Coupontools coupon_info must be an array");
|
|
80
80
|
}
|
|
81
81
|
return value;
|
|
82
82
|
}
|
|
@@ -104,13 +104,13 @@ async function requestCoupontoolsJson(input) {
|
|
|
104
104
|
async function readCoupontoolsPayload(response) {
|
|
105
105
|
const text = await response.text();
|
|
106
106
|
if (!text.trim()) {
|
|
107
|
-
throw
|
|
107
|
+
throw providerResponseError("Coupontools returned an empty response");
|
|
108
108
|
}
|
|
109
109
|
try {
|
|
110
110
|
return JSON.parse(text);
|
|
111
111
|
}
|
|
112
112
|
catch {
|
|
113
|
-
throw
|
|
113
|
+
throw providerResponseError("Coupontools returned invalid JSON");
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
function hasCoupontoolsError(payload) {
|
|
@@ -125,22 +125,19 @@ function createCoupontoolsError(statusCode, payload, phase) {
|
|
|
125
125
|
optionalString(payloadRecord?.message)?.trim() ??
|
|
126
126
|
`Coupontools request failed with status ${statusCode}`;
|
|
127
127
|
if (statusCode == 429) {
|
|
128
|
-
return
|
|
128
|
+
return new ProviderRequestError(429, message);
|
|
129
129
|
}
|
|
130
130
|
if (phase == "validate" && 400 <= statusCode && statusCode < 500) {
|
|
131
|
-
return
|
|
131
|
+
return providerInputError(message);
|
|
132
132
|
}
|
|
133
133
|
if (statusCode == 401 || statusCode == 403) {
|
|
134
|
-
return
|
|
134
|
+
return new ProviderRequestError(statusCode, message);
|
|
135
135
|
}
|
|
136
136
|
if (400 <= statusCode && statusCode < 500) {
|
|
137
|
-
return
|
|
137
|
+
return new ProviderRequestError(statusCode, message);
|
|
138
138
|
}
|
|
139
|
-
return
|
|
139
|
+
return new ProviderRequestError(statusCode >= 400 ? statusCode : 502, message);
|
|
140
140
|
}
|
|
141
141
|
function requireStoredClientSecret(values) {
|
|
142
142
|
return requiredInputString(values?.clientSecret, "clientSecret");
|
|
143
143
|
}
|
|
144
|
-
function providerError(_code, message, status) {
|
|
145
|
-
return new ProviderRequestError(status, message);
|
|
146
|
-
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineProviderExecutors, defineProviderProxy } from "../provider-runtime.js";
|
|
2
|
+
import { readCrtshError } from "./runtime.js";
|
|
3
|
+
import { crtshActionHandlers, crtshApiBaseUrl } from "./runtime.js";
|
|
4
|
+
const service = "crtsh";
|
|
5
|
+
export const executors = defineProviderExecutors({
|
|
6
|
+
service,
|
|
7
|
+
handlers: crtshActionHandlers,
|
|
8
|
+
skipDnsValidation: true,
|
|
9
|
+
createContext(context, fetcher) {
|
|
10
|
+
return { fetcher, signal: context.signal };
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export const proxy = defineProviderProxy({
|
|
14
|
+
readError: readCrtshError,
|
|
15
|
+
service,
|
|
16
|
+
baseUrl: crtshApiBaseUrl,
|
|
17
|
+
auth: { type: "none" },
|
|
18
|
+
skipDnsValidation: true,
|
|
19
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProviderActionHandlers, ProviderFetch } from "../provider-runtime.ts";
|
|
2
|
+
import { ProviderRequestError } from "../provider-runtime.ts";
|
|
3
|
+
export declare const crtshApiBaseUrl = "https://crt.sh";
|
|
4
|
+
export interface CrtshRuntimeContext {
|
|
5
|
+
fetcher: ProviderFetch;
|
|
6
|
+
signal?: AbortSignal;
|
|
7
|
+
}
|
|
8
|
+
type CrtshActionHandler = (input: Record<string, unknown>, context: CrtshRuntimeContext) => Promise<unknown>;
|
|
9
|
+
export declare const crtshActionHandlers: ProviderActionHandlers<"crtsh", CrtshActionHandler>;
|
|
10
|
+
/**
|
|
11
|
+
* Map a crt.sh error onto the runtime's status conventions. crt.sh serves HTML
|
|
12
|
+
* error pages when overloaded, so surface a short excerpt instead of the page.
|
|
13
|
+
* The search endpoint needs no credentials, so an authorization failure is not
|
|
14
|
+
* something reconnecting can fix.
|
|
15
|
+
*/
|
|
16
|
+
export declare function readCrtshError(response: Response): Promise<ProviderRequestError>;
|
|
17
|
+
export {};
|