@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,138 @@
|
|
|
1
|
+
import { jsonSchema as s } from "../../core/json-schema.js";
|
|
2
|
+
import { defineProviderAction } from "../../core/provider-definition.js";
|
|
3
|
+
const taskId = s.nonEmptyString("Task ID returned by submit_task.");
|
|
4
|
+
const profileId = s.nonEmptyString("Browser profile ID.");
|
|
5
|
+
const taskOutput = {
|
|
6
|
+
...s.looseObject("Task status, result and upstream metadata.", {
|
|
7
|
+
id: taskId,
|
|
8
|
+
status: s.string("Task state: waiting, running, done, failed or cancelled."),
|
|
9
|
+
output: s.unknown("Task output, optionally matching response_model."),
|
|
10
|
+
credits_used: s.nullable(s.integer("Credits used by the task.")),
|
|
11
|
+
device: s.nullable(s.string("Browser device type.")),
|
|
12
|
+
live_url: s.nullable(s.string("URL for live browser access.")),
|
|
13
|
+
recording_url: s.nullable(s.string("URL for the task recording.")),
|
|
14
|
+
downloads_url: s.nullable(s.string("URL for downloaded files.")),
|
|
15
|
+
created_at: s.nullable(s.integer("Task creation Unix timestamp.")),
|
|
16
|
+
events: s.nullable(s.array("New task events.", s.looseObject("Upstream event payload."))),
|
|
17
|
+
}),
|
|
18
|
+
required: ["id", "status"],
|
|
19
|
+
};
|
|
20
|
+
const profileOutput = s.looseRequiredObject("Browser profile.", { id: profileId });
|
|
21
|
+
const success = s.requiredObject("Operation result.", {
|
|
22
|
+
success: s.boolean("Whether the operation succeeded."),
|
|
23
|
+
});
|
|
24
|
+
const taskOptions = {
|
|
25
|
+
response_model: s.nullable(s.looseObject("JSON Schema for the desired task output.")),
|
|
26
|
+
url: s.nullable(s.string("Starting URL visited by Smooth.", { format: "uri" })),
|
|
27
|
+
metadata: s.nullable({
|
|
28
|
+
...s.record("Agent variables; at most 16 keys and 2048 characters per string value.", s.anyOf("Variable value.", [
|
|
29
|
+
s.string("Text value.", { maxLength: 2048 }),
|
|
30
|
+
s.number("Numeric value."),
|
|
31
|
+
s.boolean("Boolean value."),
|
|
32
|
+
])),
|
|
33
|
+
maxProperties: 16,
|
|
34
|
+
}),
|
|
35
|
+
files: s.nullable(s.array("Previously uploaded file IDs.", s.string("File ID."))),
|
|
36
|
+
agent: s.stringEnum("Agent model; defaults to smooth.", ["smooth", "smooth-lite"]),
|
|
37
|
+
max_steps: s.integer("Maximum agent steps; defaults to 32.", { minimum: 2, maximum: 128 }),
|
|
38
|
+
device: s.stringEnum("Browser device; defaults to desktop.", ["desktop", "mobile", "desktop-lg"]),
|
|
39
|
+
allowed_urls: s.nullable(s.array("Allowed URL glob patterns; omitted means unrestricted.", s.string("URL glob pattern, such as https://**.example.com/**."))),
|
|
40
|
+
enable_recording: s.boolean("Record the task; defaults to true."),
|
|
41
|
+
profile_id: s.nullable(profileId),
|
|
42
|
+
profile_read_only: s.boolean("Do not save browser changes to the profile; defaults to false."),
|
|
43
|
+
stealth_mode: s.boolean("Enable stealth mode; defaults to false."),
|
|
44
|
+
proxy_server: s.nullable(s.string("Remote proxy URL. Local self tunnels require a separate Smooth client.")),
|
|
45
|
+
proxy_username: s.nullable(s.string("Proxy authentication username.")),
|
|
46
|
+
proxy_password: s.nullable(s.string("Proxy authentication password.")),
|
|
47
|
+
certificates: s.nullable(s.array("Client certificates for secure websites.", s.object("Client certificate.", {
|
|
48
|
+
file: s.string("Base64-encoded p12 certificate."),
|
|
49
|
+
password: s.nullable(s.string("Certificate password.")),
|
|
50
|
+
}, { optional: ["password"] }))),
|
|
51
|
+
use_adblock: s.nullable(s.boolean("Enable ad blocking; defaults to true.")),
|
|
52
|
+
additional_tools: s.nullable(s.record("Built-in tool configurations, such as screenshot, hover or print_page.", s.nullable(s.looseObject("Tool configuration, or null for defaults.")))),
|
|
53
|
+
experimental_features: s.nullable(s.looseObject("Upstream experimental feature configuration.")),
|
|
54
|
+
extensions: s.nullable(s.array("Previously uploaded browser extension IDs.", s.string("Extension ID."))),
|
|
55
|
+
show_cursor: s.boolean("Show the mouse cursor; defaults to false."),
|
|
56
|
+
};
|
|
57
|
+
export const smoothActions = [
|
|
58
|
+
defineProviderAction("smooth", {
|
|
59
|
+
name: "submit_task",
|
|
60
|
+
operationType: "destructive",
|
|
61
|
+
requiredScopes: [],
|
|
62
|
+
description: "Submit a natural-language browser task to Smooth. The task may modify or delete data on visited sites. Uses account credits; returns immediately for result polling.",
|
|
63
|
+
asyncLifecycle: {
|
|
64
|
+
startActionId: "smooth.submit_task",
|
|
65
|
+
statusActionId: "smooth.get_task",
|
|
66
|
+
cancelActionId: "smooth.cancel_task",
|
|
67
|
+
},
|
|
68
|
+
inputSchema: s.object("One-shot browser task parameters.", {
|
|
69
|
+
task: s.nonEmptyString("Natural-language task to execute. Interactive sessions and custom tool callbacks are not supported by this action."),
|
|
70
|
+
...taskOptions,
|
|
71
|
+
}, { optional: Object.keys(taskOptions) }),
|
|
72
|
+
outputSchema: taskOutput,
|
|
73
|
+
}),
|
|
74
|
+
defineProviderAction("smooth", {
|
|
75
|
+
name: "get_task",
|
|
76
|
+
operationType: "read",
|
|
77
|
+
requiredScopes: [],
|
|
78
|
+
description: "Get task status and results, including optional download URLs and events after a timestamp.",
|
|
79
|
+
asyncLifecycle: {
|
|
80
|
+
startActionId: "smooth.submit_task",
|
|
81
|
+
statusActionId: "smooth.get_task",
|
|
82
|
+
cancelActionId: "smooth.cancel_task",
|
|
83
|
+
},
|
|
84
|
+
inputSchema: s.object("Task lookup parameters.", {
|
|
85
|
+
task_id: taskId,
|
|
86
|
+
event_t: s.integer("Return events after this timestamp; defaults to zero."),
|
|
87
|
+
downloads: s.boolean("Include the download URL; defaults to false."),
|
|
88
|
+
}, { optional: ["event_t", "downloads"] }),
|
|
89
|
+
outputSchema: taskOutput,
|
|
90
|
+
}),
|
|
91
|
+
defineProviderAction("smooth", {
|
|
92
|
+
name: "list_tasks",
|
|
93
|
+
operationType: "read",
|
|
94
|
+
requiredScopes: [],
|
|
95
|
+
description: "List tasks, optionally paging to tasks created before a timestamp.",
|
|
96
|
+
inputSchema: s.object("Task list parameters.", {
|
|
97
|
+
t: s.integer("Return tasks created before this timestamp."),
|
|
98
|
+
l: s.integer("Result limit; defaults to 32.", { minimum: 1, maximum: 128 }),
|
|
99
|
+
}, { optional: ["t", "l"] }),
|
|
100
|
+
outputSchema: s.requiredObject("Task list.", {
|
|
101
|
+
tasks: s.array("Tasks in upstream order.", taskOutput),
|
|
102
|
+
}),
|
|
103
|
+
}),
|
|
104
|
+
defineProviderAction("smooth", {
|
|
105
|
+
name: "cancel_task",
|
|
106
|
+
operationType: "destructive",
|
|
107
|
+
requiredScopes: [],
|
|
108
|
+
description: "Cancel a running Smooth task.",
|
|
109
|
+
inputSchema: s.requiredObject("Task to cancel.", { task_id: taskId }),
|
|
110
|
+
outputSchema: success,
|
|
111
|
+
}),
|
|
112
|
+
defineProviderAction("smooth", {
|
|
113
|
+
name: "list_profiles",
|
|
114
|
+
operationType: "read",
|
|
115
|
+
requiredScopes: [],
|
|
116
|
+
description: "List reusable browser profiles.",
|
|
117
|
+
inputSchema: s.requiredObject("Profile list parameters.", {}),
|
|
118
|
+
outputSchema: s.requiredObject("Profile list.", {
|
|
119
|
+
profiles: s.array("Browser profiles.", profileOutput),
|
|
120
|
+
}),
|
|
121
|
+
}),
|
|
122
|
+
defineProviderAction("smooth", {
|
|
123
|
+
name: "create_profile",
|
|
124
|
+
operationType: "write",
|
|
125
|
+
requiredScopes: [],
|
|
126
|
+
description: "Create a browser profile to persist cookies and authentication across tasks.",
|
|
127
|
+
inputSchema: s.object("Profile creation parameters.", { id: s.nullable(profileId) }, { optional: ["id"] }),
|
|
128
|
+
outputSchema: profileOutput,
|
|
129
|
+
}),
|
|
130
|
+
defineProviderAction("smooth", {
|
|
131
|
+
name: "delete_profile",
|
|
132
|
+
operationType: "destructive",
|
|
133
|
+
requiredScopes: [],
|
|
134
|
+
description: "Delete a browser profile and its persisted browser state.",
|
|
135
|
+
inputSchema: s.requiredObject("Profile to delete.", { profile_id: profileId }),
|
|
136
|
+
outputSchema: success,
|
|
137
|
+
}),
|
|
138
|
+
];
|
|
@@ -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,102 @@
|
|
|
1
|
+
import { optionalRawString } from "../../core/cast.js";
|
|
2
|
+
import { requiredInputString, requiredResponseRecord, ProviderRequestError, runProviderRequest, isAbortLikeError, defineApiKeyProviderExecutors, defineProviderProxy, mapProviderActionHandlers, readProviderProxyErrorMessage, withRetryAfterSeconds, } from "../provider-runtime.js";
|
|
3
|
+
import { smoothActions } from "./actions.js";
|
|
4
|
+
const baseUrl = "https://api.smooth.sh/api/v1";
|
|
5
|
+
const defaultHeaders = { accept: "application/json" };
|
|
6
|
+
async function request({ url, method, apiKey, body, fetcher, parentSignal }) {
|
|
7
|
+
return runProviderRequest({ signal: parentSignal, label: "Smooth" }, async (signal) => {
|
|
8
|
+
const response = await fetcher(url.toString(), {
|
|
9
|
+
method,
|
|
10
|
+
headers: { ...defaultHeaders, apikey: apiKey, "content-type": "application/json" },
|
|
11
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
12
|
+
signal,
|
|
13
|
+
});
|
|
14
|
+
let payload;
|
|
15
|
+
try {
|
|
16
|
+
payload = requiredResponseRecord(await response.json(), "Smooth response");
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (isAbortLikeError(error))
|
|
20
|
+
throw error;
|
|
21
|
+
throw new ProviderRequestError(response.ok ? 502 : response.status, "Smooth returned an invalid JSON response", undefined, "provider_error");
|
|
22
|
+
}
|
|
23
|
+
if (!response.ok) {
|
|
24
|
+
const detail = optionalRawString(payload.detail);
|
|
25
|
+
throw new ProviderRequestError(response.status, `Smooth request failed${detail ? `: ${detail.split(apiKey).join("[REDACTED]")}` : ""}`, undefined, "provider_error");
|
|
26
|
+
}
|
|
27
|
+
return payload.r;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const handlers = mapProviderActionHandlers("smooth", smoothActions, (action) => async (dataInput, context) => {
|
|
31
|
+
const values = dataInput;
|
|
32
|
+
const url = new URL(`${baseUrl}/${action.name.endsWith("profile") || action.name.endsWith("profiles") ? "profile" : "task"}`);
|
|
33
|
+
const id = values.task_id ?? values.profile_id;
|
|
34
|
+
if (action.name === "get_task" || action.name === "cancel_task" || action.name === "delete_profile") {
|
|
35
|
+
const segment = String(id);
|
|
36
|
+
if (segment === "." || segment === "..")
|
|
37
|
+
throw new ProviderRequestError(400, "Resource ID must not be a dot segment", undefined, "invalid_input");
|
|
38
|
+
url.pathname += `/${encodeURIComponent(segment)}`;
|
|
39
|
+
}
|
|
40
|
+
const method = action.name === "submit_task" || action.name === "create_profile"
|
|
41
|
+
? "POST"
|
|
42
|
+
: action.name === "cancel_task" || action.name === "delete_profile"
|
|
43
|
+
? "DELETE"
|
|
44
|
+
: "GET";
|
|
45
|
+
if (action.name === "get_task" || action.name === "list_tasks") {
|
|
46
|
+
for (const key of action.name === "get_task" ? ["event_t", "downloads"] : ["t", "l"]) {
|
|
47
|
+
if (values[key] !== undefined)
|
|
48
|
+
url.searchParams.set(key, String(values[key]));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const result = await request({
|
|
52
|
+
url: url,
|
|
53
|
+
method: method,
|
|
54
|
+
apiKey: context.apiKey,
|
|
55
|
+
body: method === "POST" ? values : undefined,
|
|
56
|
+
fetcher: context.fetcher,
|
|
57
|
+
parentSignal: context.signal,
|
|
58
|
+
});
|
|
59
|
+
if (action.name === "list_tasks" || action.name === "list_profiles") {
|
|
60
|
+
if (!Array.isArray(result))
|
|
61
|
+
throw new ProviderRequestError(502, "Smooth returned an invalid list", undefined, "provider_error");
|
|
62
|
+
return action.name === "list_tasks" ? { tasks: result } : { profiles: result };
|
|
63
|
+
}
|
|
64
|
+
if (method === "DELETE") {
|
|
65
|
+
if (typeof result !== "boolean")
|
|
66
|
+
throw new ProviderRequestError(502, "Smooth returned an invalid operation result", undefined, "provider_error");
|
|
67
|
+
return { success: result };
|
|
68
|
+
}
|
|
69
|
+
const object = requiredResponseRecord(result, "Smooth response result");
|
|
70
|
+
if (!optionalRawString(object.id)?.trim())
|
|
71
|
+
throw new ProviderRequestError(502, "Smooth response is missing an ID", undefined, "provider_error");
|
|
72
|
+
if (action.name !== "create_profile" && !optionalRawString(object.status)?.trim())
|
|
73
|
+
throw new ProviderRequestError(502, "Smooth task is missing status", undefined, "provider_error");
|
|
74
|
+
return object;
|
|
75
|
+
});
|
|
76
|
+
export const executors = defineApiKeyProviderExecutors("smooth", handlers, {
|
|
77
|
+
skipDnsValidation: true,
|
|
78
|
+
});
|
|
79
|
+
export const credentialValidators = {
|
|
80
|
+
async apiKey(input) {
|
|
81
|
+
requiredInputString(input.apiKey, "API Key");
|
|
82
|
+
return {
|
|
83
|
+
profile: { displayName: "Smooth API Key" },
|
|
84
|
+
grantedScopes: [],
|
|
85
|
+
metadata: { apiBaseUrl: baseUrl, validationMode: "local_non_empty_key" },
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
export const proxy = defineProviderProxy({
|
|
90
|
+
service: "smooth",
|
|
91
|
+
baseUrl,
|
|
92
|
+
auth: { type: "api_key_header", name: "apikey" },
|
|
93
|
+
skipDnsValidation: true,
|
|
94
|
+
customizeRequest({ headers }) {
|
|
95
|
+
for (const [name, value] of Object.entries({ accept: "application/json" }))
|
|
96
|
+
if (!headers.has(name))
|
|
97
|
+
headers.set(name, value);
|
|
98
|
+
},
|
|
99
|
+
async readError(response) {
|
|
100
|
+
return new ProviderRequestError(response.status, await readProviderProxyErrorMessage(response, "Provider request failed"), withRetryAfterSeconds(response), response.status === 429 ? "rate_limited" : "provider_error");
|
|
101
|
+
},
|
|
102
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsonSchema as s } from "../../core/json-schema.js";
|
|
2
|
+
import { defineProviderAction } from "../../core/provider-definition.js";
|
|
3
|
+
export const tapdFamilies = [
|
|
4
|
+
{
|
|
5
|
+
name: "stories",
|
|
6
|
+
path: "stories",
|
|
7
|
+
wrapper: "Story",
|
|
8
|
+
filters: "id, name, status, owner, iteration_id, priority_label, created, modified, custom_field_* and custom_plan_field_*",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "bugs",
|
|
12
|
+
path: "bugs",
|
|
13
|
+
wrapper: "Bug",
|
|
14
|
+
filters: "id, title, status, severity, current_owner, iteration_id, module, priority_label, created, modified, custom_field_* and custom_plan_field_*",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "tasks",
|
|
18
|
+
path: "tasks",
|
|
19
|
+
wrapper: "Task",
|
|
20
|
+
filters: "id, name, status, owner, story_id, iteration_id, priority_label, created, modified and custom_field_*",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "iterations",
|
|
24
|
+
path: "iterations",
|
|
25
|
+
wrapper: "Iteration",
|
|
26
|
+
filters: "id, name, status, creator, startdate, enddate, workitem_type_id, plan_app_id, created, modified and custom_field_*",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "wikis",
|
|
30
|
+
path: "tapd_wikis",
|
|
31
|
+
wrapper: "Wiki",
|
|
32
|
+
filters: "name, modifier, creator, note, view_count, created and modified; id is supported only by list_wikis",
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
const workspaceId = s.nonEmptyString("TAPD project ID, supplied as a string to preserve precision.");
|
|
36
|
+
const itemsOutput = s.requiredObject("Requested TAPD records.", {
|
|
37
|
+
items: s.array("Records with the TAPD entity wrapper removed.", s.looseObject("TAPD record, including custom fields and future upstream fields.")),
|
|
38
|
+
});
|
|
39
|
+
export const tapdActions = [
|
|
40
|
+
defineProviderAction("tapd", {
|
|
41
|
+
name: "list_projects",
|
|
42
|
+
operationType: "read",
|
|
43
|
+
requiredScopes: [],
|
|
44
|
+
description: "List all projects in a TAPD company. This endpoint does not paginate.",
|
|
45
|
+
inputSchema: s.requiredObject("Company project query.", {
|
|
46
|
+
company_id: s.nonEmptyString("TAPD company ID."),
|
|
47
|
+
category: s.optional(s.string("Project categories, comma-separated: organization, product, project, mini_project or program.")),
|
|
48
|
+
with_extends: s.optional(s.integer("Set to 1 to include custom project fields.", { minimum: 0, maximum: 1 })),
|
|
49
|
+
}),
|
|
50
|
+
outputSchema: itemsOutput,
|
|
51
|
+
}),
|
|
52
|
+
defineProviderAction("tapd", {
|
|
53
|
+
name: "get_project",
|
|
54
|
+
operationType: "read",
|
|
55
|
+
requiredScopes: [],
|
|
56
|
+
description: "Retrieve a TAPD project by its workspace ID.",
|
|
57
|
+
inputSchema: s.requiredObject("Project lookup.", { workspace_id: workspaceId }),
|
|
58
|
+
outputSchema: s.requiredObject("Project lookup result.", {
|
|
59
|
+
project: s.looseObject("TAPD project, including its ID, name and provider-defined fields."),
|
|
60
|
+
}),
|
|
61
|
+
}),
|
|
62
|
+
];
|
|
63
|
+
for (const family of tapdFamilies) {
|
|
64
|
+
const filters = s.optional(s.record(`Official TAPD query filters, including ${family.filters}. Values use upstream query syntax, such as comma-separated IDs or >2026-01-01 timestamps. Do not pre-encode values. Pagination, fields, order, workspace_id and format cannot be set here.`, s.string("Upstream filter value; use strings for IDs, numbers and date expressions.")));
|
|
65
|
+
tapdActions.push(defineProviderAction("tapd", {
|
|
66
|
+
name: `list_${family.name}`,
|
|
67
|
+
operationType: "read",
|
|
68
|
+
requiredScopes: [],
|
|
69
|
+
description: `Query one page of TAPD ${family.name}. Filter by id to retrieve specific records. Continue with the next page until an empty page is returned.`,
|
|
70
|
+
inputSchema: s.requiredObject("Paginated project records query.", {
|
|
71
|
+
workspace_id: workspaceId,
|
|
72
|
+
filters,
|
|
73
|
+
page: s.optional(s.integer("Page number, starting at 1. Defaults to 1.", { minimum: 1 })),
|
|
74
|
+
limit: s.optional(s.integer("Records per page. Defaults to 30; maximum 200.", { minimum: 1, maximum: 200 })),
|
|
75
|
+
fields: s.optional(s.nonEmptyString("Comma-separated upstream field names to return.")),
|
|
76
|
+
order: s.optional(s.nonEmptyString("Upstream sort expression, for example created desc. Do not URL-encode.")),
|
|
77
|
+
}),
|
|
78
|
+
outputSchema: itemsOutput,
|
|
79
|
+
}), defineProviderAction("tapd", {
|
|
80
|
+
name: `count_${family.name}`,
|
|
81
|
+
operationType: "read",
|
|
82
|
+
requiredScopes: [],
|
|
83
|
+
description: `Count TAPD ${family.name} matching the supplied project and filters.`,
|
|
84
|
+
inputSchema: s.requiredObject("Project records count query.", { workspace_id: workspaceId, filters }),
|
|
85
|
+
outputSchema: s.requiredObject("Matching record count.", {
|
|
86
|
+
count: s.integer("Number of matching records.", { minimum: 0 }),
|
|
87
|
+
}),
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
@@ -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,137 @@
|
|
|
1
|
+
import { optionalRecord, optionalRawString } from "../../core/cast.js";
|
|
2
|
+
import { requiredInputString, requiredResponseRecord, providerUserAgent, ProviderRequestError, runProviderRequest, isAbortLikeError, basicAuthorizationHeader, defineProviderExecutors, requireApiKeyCredential, defineProviderProxy, mapProviderActionHandlers, readProviderProxyErrorMessage, withRetryAfterSeconds, } from "../provider-runtime.js";
|
|
3
|
+
import { tapdActions, tapdFamilies } from "./actions.js";
|
|
4
|
+
const baseUrl = "https://api.tapd.cn";
|
|
5
|
+
const reservedFilters = new Set(["workspace_id", "page", "limit", "fields", "order", "format"]);
|
|
6
|
+
function authorization(input) {
|
|
7
|
+
const username = requiredInputString(input.values?.apiUser, "apiUser");
|
|
8
|
+
if (username.includes(":"))
|
|
9
|
+
throw new ProviderRequestError(400, "apiUser must not contain a colon", undefined, "invalid_input");
|
|
10
|
+
return basicAuthorizationHeader(`${username}:${requiredInputString(input.apiKey, "API Key")}`);
|
|
11
|
+
}
|
|
12
|
+
function unwrap(value, wrapper) {
|
|
13
|
+
const record = requiredResponseRecord(value, "TAPD record wrapper");
|
|
14
|
+
return requiredResponseRecord(record[wrapper], `TAPD ${wrapper}`);
|
|
15
|
+
}
|
|
16
|
+
async function request({ path, query, auth, fetcher, parentSignal }) {
|
|
17
|
+
return runProviderRequest({ signal: parentSignal, label: "TAPD" }, async (signal) => {
|
|
18
|
+
const url = new URL(path, baseUrl);
|
|
19
|
+
url.search = query.toString();
|
|
20
|
+
const response = await fetcher(url.toString(), {
|
|
21
|
+
method: "GET",
|
|
22
|
+
headers: {
|
|
23
|
+
authorization: auth,
|
|
24
|
+
accept: "application/json",
|
|
25
|
+
"user-agent": providerUserAgent,
|
|
26
|
+
},
|
|
27
|
+
signal,
|
|
28
|
+
});
|
|
29
|
+
let payload;
|
|
30
|
+
try {
|
|
31
|
+
payload = requiredResponseRecord(await response.json(), "TAPD response");
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
if (isAbortLikeError(error))
|
|
35
|
+
throw error;
|
|
36
|
+
throw new ProviderRequestError(response.ok ? 502 : response.status, "TAPD returned an invalid JSON response", undefined, "provider_error");
|
|
37
|
+
}
|
|
38
|
+
if (!response.ok || payload.status !== 1) {
|
|
39
|
+
const detail = path === "/quickstart/testauth" ? undefined : optionalRawString(payload.info);
|
|
40
|
+
throw new ProviderRequestError(response.ok ? 502 : response.status, `TAPD request failed${detail ? `: ${detail}` : ""}`, undefined, "provider_error");
|
|
41
|
+
}
|
|
42
|
+
return payload;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const handlers = mapProviderActionHandlers("tapd", tapdActions, (action) => async (dataInput, context) => {
|
|
46
|
+
const values = dataInput;
|
|
47
|
+
const query = new URLSearchParams();
|
|
48
|
+
const filters = optionalRecord(values.filters) ?? {};
|
|
49
|
+
for (const [key, value] of Object.entries(filters)) {
|
|
50
|
+
if (reservedFilters.has(key))
|
|
51
|
+
throw new ProviderRequestError(400, `filters must not contain ${key}`, undefined, "invalid_input");
|
|
52
|
+
query.set(key, String(value));
|
|
53
|
+
}
|
|
54
|
+
for (const [key, value] of Object.entries(values)) {
|
|
55
|
+
if (key !== "filters" && value != null)
|
|
56
|
+
query.set(key, String(value));
|
|
57
|
+
}
|
|
58
|
+
let path;
|
|
59
|
+
let wrapper;
|
|
60
|
+
const count = action.name.startsWith("count_");
|
|
61
|
+
if (action.name === "list_projects") {
|
|
62
|
+
path = "/workspaces/projects";
|
|
63
|
+
wrapper = "Workspace";
|
|
64
|
+
}
|
|
65
|
+
else if (action.name === "get_project") {
|
|
66
|
+
path = "/workspaces/get_workspace_info";
|
|
67
|
+
wrapper = "Workspace";
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const family = tapdFamilies.find((item) => action.name === `list_${item.name}` || action.name === `count_${item.name}`);
|
|
71
|
+
path = `/${family.path}${count ? "/count" : ""}`;
|
|
72
|
+
wrapper = family.wrapper;
|
|
73
|
+
if (!count) {
|
|
74
|
+
query.set("page", String(values.page ?? 1));
|
|
75
|
+
query.set("limit", String(values.limit ?? 30));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const payload = await request({
|
|
79
|
+
path: path,
|
|
80
|
+
query: query,
|
|
81
|
+
auth: authorization(context),
|
|
82
|
+
fetcher: context.fetcher,
|
|
83
|
+
parentSignal: context.signal,
|
|
84
|
+
});
|
|
85
|
+
if (count) {
|
|
86
|
+
const result = requiredResponseRecord(payload.data, "TAPD count");
|
|
87
|
+
const countValue = typeof result.count === "string" && result.count.trim() !== "" ? Number(result.count) : result.count;
|
|
88
|
+
if (typeof countValue !== "number" || !Number.isInteger(countValue) || countValue < 0)
|
|
89
|
+
throw new ProviderRequestError(502, "TAPD returned an invalid count", undefined, "provider_error");
|
|
90
|
+
return { count: countValue };
|
|
91
|
+
}
|
|
92
|
+
if (action.name === "get_project")
|
|
93
|
+
return { project: unwrap(payload.data, wrapper) };
|
|
94
|
+
if (!Array.isArray(payload.data))
|
|
95
|
+
throw new ProviderRequestError(502, "TAPD returned an invalid record list", undefined, "provider_error");
|
|
96
|
+
return { items: payload.data.map((item) => unwrap(item, wrapper)) };
|
|
97
|
+
});
|
|
98
|
+
export const executors = defineProviderExecutors({
|
|
99
|
+
service: "tapd",
|
|
100
|
+
handlers,
|
|
101
|
+
skipDnsValidation: true,
|
|
102
|
+
async createContext(context, fetcher) {
|
|
103
|
+
const credential = await requireApiKeyCredential(context, "tapd");
|
|
104
|
+
return { apiKey: credential.apiKey, values: credential.values, fetcher, signal: context.signal };
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
export const credentialValidators = {
|
|
108
|
+
async apiKey(input, { fetcher, signal }) {
|
|
109
|
+
await request({
|
|
110
|
+
path: "/quickstart/testauth",
|
|
111
|
+
query: new URLSearchParams(),
|
|
112
|
+
auth: authorization({ apiKey: input.apiKey, values: input.values }),
|
|
113
|
+
fetcher: fetcher,
|
|
114
|
+
parentSignal: signal,
|
|
115
|
+
});
|
|
116
|
+
return {
|
|
117
|
+
profile: { displayName: "TAPD API Account" },
|
|
118
|
+
grantedScopes: [],
|
|
119
|
+
metadata: { apiBaseUrl: baseUrl, validationEndpoint: "/quickstart/testauth" },
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
export const proxy = defineProviderProxy({
|
|
124
|
+
service: "tapd",
|
|
125
|
+
baseUrl,
|
|
126
|
+
auth: { type: "none" },
|
|
127
|
+
skipDnsValidation: true,
|
|
128
|
+
async customizeRequest({ context, headers }) {
|
|
129
|
+
const credential = await requireApiKeyCredential(context, "tapd");
|
|
130
|
+
headers.set("authorization", authorization(credential));
|
|
131
|
+
if (!headers.has("accept"))
|
|
132
|
+
headers.set("accept", "application/json");
|
|
133
|
+
},
|
|
134
|
+
async readError(response) {
|
|
135
|
+
return new ProviderRequestError(response.status, await readProviderProxyErrorMessage(response, "TAPD request failed"), withRetryAfterSeconds(response), "provider_error");
|
|
136
|
+
},
|
|
137
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compactObject, nullableString, objectArray, optionalBoolean, optionalInteger, optionalRecord, optionalString, } from "../../core/cast.js";
|
|
2
|
-
import { providerUserAgent, ProviderRequestError } from "../provider-runtime.js";
|
|
2
|
+
import { providerUserAgent, ProviderRequestError, providerInputError, providerResponseError, } from "../provider-runtime.js";
|
|
3
3
|
export const teableApiBaseUrl = "https://app.teable.cn/api";
|
|
4
4
|
const teableCurrentUserPath = "/auth/user";
|
|
5
5
|
export const teableActionHandlers = {
|
|
@@ -47,9 +47,6 @@ async function executeGetCurrentUser(context) {
|
|
|
47
47
|
});
|
|
48
48
|
return parseCurrentUser(payload);
|
|
49
49
|
}
|
|
50
|
-
function providerError(_code, message, status) {
|
|
51
|
-
return new ProviderRequestError(status, message);
|
|
52
|
-
}
|
|
53
50
|
async function executeListSpaces(context) {
|
|
54
51
|
const payload = await teableRequest("/space", {
|
|
55
52
|
...context,
|
|
@@ -160,7 +157,7 @@ async function teableRequest(path, input) {
|
|
|
160
157
|
if (error instanceof ProviderRequestError) {
|
|
161
158
|
throw error;
|
|
162
159
|
}
|
|
163
|
-
throw
|
|
160
|
+
throw providerResponseError(error instanceof Error ? `Teable request failed: ${error.message}` : "Teable request failed");
|
|
164
161
|
}
|
|
165
162
|
if (!response.ok) {
|
|
166
163
|
throw createTeableError(response, payload, input.phase);
|
|
@@ -188,7 +185,7 @@ async function readTeablePayload(response) {
|
|
|
188
185
|
}
|
|
189
186
|
catch (error) {
|
|
190
187
|
if (response.ok) {
|
|
191
|
-
throw
|
|
188
|
+
throw providerResponseError(error instanceof Error ? `Teable returned malformed JSON: ${error.message}` : "Teable returned malformed JSON");
|
|
192
189
|
}
|
|
193
190
|
return text;
|
|
194
191
|
}
|
|
@@ -196,21 +193,21 @@ async function readTeablePayload(response) {
|
|
|
196
193
|
function createTeableError(response, payload, phase) {
|
|
197
194
|
const message = extractTeableErrorMessage(payload) || response.statusText || "Teable request failed";
|
|
198
195
|
if (response.status === 429) {
|
|
199
|
-
return
|
|
196
|
+
return new ProviderRequestError(429, message);
|
|
200
197
|
}
|
|
201
198
|
if (phase === "validate" && (response.status === 401 || response.status === 403)) {
|
|
202
|
-
return
|
|
199
|
+
return providerInputError(message);
|
|
203
200
|
}
|
|
204
201
|
if (phase === "execute" && response.status === 401) {
|
|
205
|
-
return
|
|
202
|
+
return new ProviderRequestError(401, message);
|
|
206
203
|
}
|
|
207
204
|
if (phase === "execute" && response.status === 403) {
|
|
208
|
-
return
|
|
205
|
+
return new ProviderRequestError(403, message);
|
|
209
206
|
}
|
|
210
207
|
if (phase === "execute" && [400, 404, 422].includes(response.status)) {
|
|
211
|
-
return
|
|
208
|
+
return providerInputError(message);
|
|
212
209
|
}
|
|
213
|
-
return
|
|
210
|
+
return new ProviderRequestError(response.status || 500, message);
|
|
214
211
|
}
|
|
215
212
|
function extractTeableErrorMessage(payload) {
|
|
216
213
|
const root = optionalRecord(payload);
|
|
@@ -224,7 +221,7 @@ function parseCurrentUser(payload) {
|
|
|
224
221
|
const id = optionalString(user.id);
|
|
225
222
|
const name = optionalString(user.name);
|
|
226
223
|
if (!id || !name) {
|
|
227
|
-
throw
|
|
224
|
+
throw providerResponseError("Teable current user response did not include id and name");
|
|
228
225
|
}
|
|
229
226
|
return compactObject({
|
|
230
227
|
id,
|
|
@@ -236,7 +233,7 @@ function parseCurrentUser(payload) {
|
|
|
236
233
|
function requireObject(payload, label) {
|
|
237
234
|
const value = optionalRecord(payload);
|
|
238
235
|
if (!value) {
|
|
239
|
-
throw
|
|
236
|
+
throw providerResponseError(`Teable returned an invalid ${label} response`);
|
|
240
237
|
}
|
|
241
238
|
return value;
|
|
242
239
|
}
|
|
@@ -245,7 +242,7 @@ function requireObjectArray(payload, label) {
|
|
|
245
242
|
return objectArray(payload, label);
|
|
246
243
|
}
|
|
247
244
|
catch {
|
|
248
|
-
throw
|
|
245
|
+
throw providerResponseError(`Teable returned an invalid ${label} response`);
|
|
249
246
|
}
|
|
250
247
|
}
|
|
251
248
|
function recordReadSearchParams(input) {
|