@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,124 @@
|
|
|
1
|
+
import { jsonSchema as s } from "../../core/json-schema.js";
|
|
2
|
+
import { defineProviderAction } from "../../core/provider-definition.js";
|
|
3
|
+
const stockFields = {
|
|
4
|
+
stock_code: s.string("Stock code returned by FTShare."),
|
|
5
|
+
stock_name: s.string("Stock name."),
|
|
6
|
+
};
|
|
7
|
+
const reportFields = {
|
|
8
|
+
...stockFields,
|
|
9
|
+
year: s.integer("Report year."),
|
|
10
|
+
report_type: s.string("Report period type."),
|
|
11
|
+
report_type_cn: s.string("Chinese report period name."),
|
|
12
|
+
publish_date: s.string("Publication date in YYYY-MM-DD format."),
|
|
13
|
+
};
|
|
14
|
+
function reportInput(allowHalfYear) {
|
|
15
|
+
return {
|
|
16
|
+
...s.object("Choose either one stock's full history or a paginated market report period.", {
|
|
17
|
+
stock_code: s.string("Six-digit A-share code with exchange suffix, for example 000001.SZ. Returns all historical periods without pagination.", { pattern: "^[0-9]{6}\\.[A-Z]+$" }),
|
|
18
|
+
year: s.integer("Report year, required for market-wide queries."),
|
|
19
|
+
report_type: s.stringEnum("Report period: q1, q2 (half-year), q3, or annual. Income and balance sheets also accept h1 as q2.", allowHalfYear ? ["q1", "q2", "q3", "annual", "h1"] : ["q1", "q2", "q3", "annual"]),
|
|
20
|
+
page: s.integer("Market query page, starting at 1; defaults to 1.", { minimum: 1 }),
|
|
21
|
+
page_size: s.integer("Market query page size; defaults to 50, maximum 500.", {
|
|
22
|
+
minimum: 1,
|
|
23
|
+
maximum: 500,
|
|
24
|
+
}),
|
|
25
|
+
}, { required: [] }),
|
|
26
|
+
oneOf: [
|
|
27
|
+
{
|
|
28
|
+
required: ["stock_code"],
|
|
29
|
+
not: {
|
|
30
|
+
anyOf: ["year", "report_type", "page", "page_size"].map((key) => ({ required: [key] })),
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{ required: ["year", "report_type"], not: { required: ["stock_code"] } },
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function envelope(data) {
|
|
38
|
+
return s.looseObject("FTShare response envelope; upstream extension fields are preserved.", {
|
|
39
|
+
code: s.integer("Upstream status code; 200 indicates success."),
|
|
40
|
+
message: s.string("Upstream status message."),
|
|
41
|
+
data,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function report(name, description, fields, allowHalfYear = false) {
|
|
45
|
+
return defineProviderAction("ftshare", {
|
|
46
|
+
name,
|
|
47
|
+
description,
|
|
48
|
+
operationType: "read",
|
|
49
|
+
requiredScopes: [],
|
|
50
|
+
inputSchema: reportInput(allowHalfYear),
|
|
51
|
+
outputSchema: envelope(s.looseObject("Report records and pagination totals.", {
|
|
52
|
+
items: s.array("Records, retaining financial strings, nulls, and additional upstream fields.", s.looseObject("One report record with provider-defined financial fields.", {
|
|
53
|
+
...reportFields,
|
|
54
|
+
...fields,
|
|
55
|
+
})),
|
|
56
|
+
total_items: s.integer("Total matching records."),
|
|
57
|
+
total_pages: s.integer("Total result pages."),
|
|
58
|
+
})),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
export const ftshareActions = [
|
|
62
|
+
defineProviderAction("ftshare", {
|
|
63
|
+
name: "list_companies",
|
|
64
|
+
description: "List company snapshots with optional exact stock name and unsuffixed stock code filters.",
|
|
65
|
+
operationType: "read",
|
|
66
|
+
requiredScopes: [],
|
|
67
|
+
inputSchema: s.object("Company filters and pagination.", {
|
|
68
|
+
stock_code: s.nonEmptyString("Exact stock code without exchange suffix, for example 000001."),
|
|
69
|
+
stock_name: s.nonEmptyString("Exact stock name."),
|
|
70
|
+
page: s.integer("Page number; defaults to 1.", { minimum: 1 }),
|
|
71
|
+
page_size: s.integer("Page size; defaults to 50, maximum 200.", {
|
|
72
|
+
minimum: 1,
|
|
73
|
+
maximum: 200,
|
|
74
|
+
}),
|
|
75
|
+
}, { required: [] }),
|
|
76
|
+
outputSchema: envelope(s.looseObject("Company result page.", {
|
|
77
|
+
pageNum: s.integer("Current page number."),
|
|
78
|
+
pageSize: s.integer("Current page size."),
|
|
79
|
+
total: s.integer("Total matching companies."),
|
|
80
|
+
pages: s.integer("Total result pages."),
|
|
81
|
+
records: s.array("Company snapshots.", s.looseObject("Company details; additional upstream fields are preserved.", {
|
|
82
|
+
...stockFields,
|
|
83
|
+
company_code: s.string("Company code."),
|
|
84
|
+
main_business: s.nullableString("Main business activities."),
|
|
85
|
+
company_profile: s.nullableString("Company profile."),
|
|
86
|
+
total_market_value: s.nullableString("Total market capitalization as reported by FTShare."),
|
|
87
|
+
})),
|
|
88
|
+
})),
|
|
89
|
+
}),
|
|
90
|
+
report("get_income_statements", "Read A-share income statements for one stock's full history or one market-wide report period.", {
|
|
91
|
+
report_form_type: s.string("Statement consolidation and adjustment type."),
|
|
92
|
+
t_revenue: s.nullableString("Total revenue."),
|
|
93
|
+
n_profit: s.nullableString("Net profit including minority interests."),
|
|
94
|
+
parcomp_n_profit: s.nullableString("Net profit attributable to the parent company."),
|
|
95
|
+
}, true),
|
|
96
|
+
report("get_balance_sheets", "Read A-share balance sheets for one stock's full history or one market-wide report period.", {
|
|
97
|
+
report_form_type: s.string("Statement consolidation and adjustment type."),
|
|
98
|
+
t_assets: s.nullableString("Total assets."),
|
|
99
|
+
t_liability: s.nullableString("Total liabilities."),
|
|
100
|
+
t_equity: s.nullableString("Total equity."),
|
|
101
|
+
}, true),
|
|
102
|
+
report("get_cashflow_statements", "Read A-share cash flow statements for one stock's full history or one market-wide report period.", {
|
|
103
|
+
detail_report_type: s.string("Detailed statement consolidation and adjustment type."),
|
|
104
|
+
net_oper_cash_flow: s.nullableString("Net cash flow from operating activities."),
|
|
105
|
+
net_invest_cash_flow: s.nullableString("Net cash flow from investing activities."),
|
|
106
|
+
net_fin_cash_flow: s.nullableString("Net cash flow from financing activities."),
|
|
107
|
+
}),
|
|
108
|
+
report("get_earnings_reports", "Read A-share earnings express reports by stock or market report period, preserving multiple disclosures and corrections.", {
|
|
109
|
+
eps: s.nullableString("Earnings per share."),
|
|
110
|
+
total_revenue: s.nullableString("Total revenue."),
|
|
111
|
+
net_profit: s.nullableString("Net profit."),
|
|
112
|
+
roe: s.nullableString("Return on equity."),
|
|
113
|
+
}),
|
|
114
|
+
report("get_earnings_forecasts", "Read A-share earnings forecasts by stock or market report period, including forecast ranges and year-over-year changes.", {
|
|
115
|
+
forecast_subject: s.string("Forecast financial metric."),
|
|
116
|
+
forecast_type: s.string("Forecast category reported by FTShare."),
|
|
117
|
+
forecast_value_min: s.nullableString("Lower forecast value."),
|
|
118
|
+
forecast_value_max: s.nullableString("Upper forecast value."),
|
|
119
|
+
unit: s.string("Forecast value unit."),
|
|
120
|
+
yoy_change_min: s.nullableString("Lower year-over-year percentage change."),
|
|
121
|
+
yoy_change_max: s.nullableString("Upper year-over-year percentage change."),
|
|
122
|
+
last_year_value: s.nullableString("Value for the same period last year."),
|
|
123
|
+
}),
|
|
124
|
+
];
|
|
@@ -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 { optionalRecord, optionalRawString, optionalNumber } from "../../core/cast.js";
|
|
2
|
+
import { requiredInputString, requiredResponseRecord, ProviderRequestError, runProviderRequest, defineApiKeyProviderExecutors, defineProviderProxy, mapProviderActionHandlers, readProviderProxyErrorMessage, withRetryAfterSeconds, } from "../provider-runtime.js";
|
|
3
|
+
import { ftshareActions } from "./actions.js";
|
|
4
|
+
const baseUrl = "https://market.ft.tech/gateway";
|
|
5
|
+
const defaultHeaders = { accept: "application/json", "content-type": "application/json" };
|
|
6
|
+
const routes = {
|
|
7
|
+
list_companies: "/api/v1/market/data/company-list",
|
|
8
|
+
get_income_statements: "/api/v1/market/data/finance/income",
|
|
9
|
+
get_balance_sheets: "/api/v1/market/data/finance/balance",
|
|
10
|
+
get_cashflow_statements: "/api/v1/market/data/finance/cashflow",
|
|
11
|
+
get_earnings_reports: "/api/v1/market/data/finance/stock-performance-express",
|
|
12
|
+
get_earnings_forecasts: "/api/v1/market/data/finance/stock-performance-forecast",
|
|
13
|
+
};
|
|
14
|
+
async function request({ route, input, apiKey, fetcher, parentSignal }) {
|
|
15
|
+
try {
|
|
16
|
+
return await runProviderRequest({ signal: parentSignal, label: "FTShare" }, async (signal) => {
|
|
17
|
+
const url = new URL(`${baseUrl}${route}`);
|
|
18
|
+
for (const [key, value] of Object.entries(input)) {
|
|
19
|
+
if (value != null)
|
|
20
|
+
url.searchParams.set(key, String(value));
|
|
21
|
+
}
|
|
22
|
+
const response = await fetcher(url.toString(), {
|
|
23
|
+
method: "GET",
|
|
24
|
+
headers: { ...defaultHeaders, FTSHARE_API_KEY: apiKey },
|
|
25
|
+
signal,
|
|
26
|
+
});
|
|
27
|
+
const text = await response.text();
|
|
28
|
+
let payload;
|
|
29
|
+
try {
|
|
30
|
+
payload = JSON.parse(text);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
payload = undefined;
|
|
34
|
+
}
|
|
35
|
+
const body = optionalRecord(payload);
|
|
36
|
+
if (!response.ok || (body?.code != null && body.code !== 200)) {
|
|
37
|
+
const code = optionalRawString(body?.code) ?? optionalNumber(body?.code);
|
|
38
|
+
const detail = [
|
|
39
|
+
code,
|
|
40
|
+
optionalRawString(body?.msg),
|
|
41
|
+
optionalRawString(body?.message),
|
|
42
|
+
optionalRawString(optionalRecord(body?.data)?.reason),
|
|
43
|
+
]
|
|
44
|
+
.filter((value) => value != null && value !== "")
|
|
45
|
+
.join(": ") || `HTTP ${response.status}`;
|
|
46
|
+
throw new ProviderRequestError(response.ok ? 502 : response.status, `FTShare request failed: ${detail}`, undefined, response.status === 429 ? "rate_limited" : "provider_error");
|
|
47
|
+
}
|
|
48
|
+
return requiredResponseRecord(payload, "FTShare response");
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
if (error instanceof ProviderRequestError)
|
|
53
|
+
error.message = error.message.split(apiKey).join("[REDACTED]");
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const handlers = mapProviderActionHandlers("ftshare", ftshareActions, (action) => async (dataInput, context) => {
|
|
58
|
+
const route = routes[action.name];
|
|
59
|
+
const query = { ...dataInput };
|
|
60
|
+
if (action.name === "list_companies" || query.stock_code == null) {
|
|
61
|
+
query.page ??= 1;
|
|
62
|
+
query.page_size ??= 50;
|
|
63
|
+
}
|
|
64
|
+
if (query.report_type === "h1")
|
|
65
|
+
query.report_type = "q2";
|
|
66
|
+
return request({
|
|
67
|
+
route: route,
|
|
68
|
+
input: query,
|
|
69
|
+
apiKey: context.apiKey,
|
|
70
|
+
fetcher: context.fetcher,
|
|
71
|
+
parentSignal: context.signal,
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
export const executors = defineApiKeyProviderExecutors("ftshare", handlers, {
|
|
75
|
+
skipDnsValidation: true,
|
|
76
|
+
});
|
|
77
|
+
export const credentialValidators = {
|
|
78
|
+
async apiKey(input, { fetcher, signal }) {
|
|
79
|
+
await request({
|
|
80
|
+
route: routes.list_companies,
|
|
81
|
+
input: { page: 1, page_size: 1 },
|
|
82
|
+
apiKey: requiredInputString(input.apiKey, "API Key"),
|
|
83
|
+
fetcher: fetcher,
|
|
84
|
+
parentSignal: signal,
|
|
85
|
+
});
|
|
86
|
+
return { profile: { displayName: "FTShare API Key" }, grantedScopes: [], metadata: { apiBaseUrl: baseUrl } };
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
export const proxy = defineProviderProxy({
|
|
90
|
+
service: "ftshare",
|
|
91
|
+
baseUrl,
|
|
92
|
+
auth: { type: "api_key_header", name: "FTSHARE_API_KEY" },
|
|
93
|
+
skipDnsValidation: true,
|
|
94
|
+
customizeRequest({ headers }) {
|
|
95
|
+
for (const [name, value] of Object.entries({ accept: "application/json", "content-type": "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
|
+
});
|
|
@@ -1,4 +1,41 @@
|
|
|
1
1
|
export const fusionApiOperations = [
|
|
2
|
+
{
|
|
3
|
+
actionName: "oomol_ocr_submit",
|
|
4
|
+
operationType: "write",
|
|
5
|
+
method: "POST",
|
|
6
|
+
path: "/v1/oomol-ocr/submit",
|
|
7
|
+
tag: "oomol-ocr",
|
|
8
|
+
description: "Recognize image text and suggest corrections for Chinese typos",
|
|
9
|
+
successStatuses: [200],
|
|
10
|
+
pathParams: [],
|
|
11
|
+
inputFields: [
|
|
12
|
+
{
|
|
13
|
+
name: "imageURL",
|
|
14
|
+
kind: "string",
|
|
15
|
+
required: true,
|
|
16
|
+
description: "Publicly accessible image URL.",
|
|
17
|
+
format: "uri",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "correct",
|
|
21
|
+
kind: "boolean",
|
|
22
|
+
required: false,
|
|
23
|
+
description: "Generate Chinese typo correction suggestions after text recognition.",
|
|
24
|
+
defaultValue: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
actionName: "oomol_ocr_result",
|
|
30
|
+
operationType: "read",
|
|
31
|
+
method: "GET",
|
|
32
|
+
path: "/v1/oomol-ocr/result/{sessionID}",
|
|
33
|
+
tag: "oomol-ocr",
|
|
34
|
+
description: "Get image text recognition and Chinese typo correction results",
|
|
35
|
+
successStatuses: [200, 202, 404],
|
|
36
|
+
pathParams: ["sessionID"],
|
|
37
|
+
inputFields: [{ name: "sessionID", kind: "string", required: true, description: "Session ID" }],
|
|
38
|
+
},
|
|
2
39
|
{
|
|
3
40
|
actionName: "cphone_nano_banana_result",
|
|
4
41
|
operationType: "read",
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsonSchema as s } from "../../core/json-schema.js";
|
|
2
|
+
import { defineProviderAction } from "../../core/provider-definition.js";
|
|
3
|
+
const reportId = s.integer("Report ID returned by search_reports.");
|
|
4
|
+
const raw = s.looseObject("Original upstream response, including additional fields.", {});
|
|
5
|
+
const paragraph = s.looseObject("A matching report paragraph.", {
|
|
6
|
+
content: s.string("Paragraph text, possibly containing highlight markup."),
|
|
7
|
+
pageNum: s.integer("Page number within the report."),
|
|
8
|
+
});
|
|
9
|
+
export const fxbaogaoActions = [
|
|
10
|
+
defineProviderAction("fxbaogao", {
|
|
11
|
+
name: "search_reports",
|
|
12
|
+
description: "Search research reports by keywords, institutions, and publication time. Provide keywords or at least one institution; pages range from 1 to 10.",
|
|
13
|
+
operationType: "read",
|
|
14
|
+
requiredScopes: [],
|
|
15
|
+
inputSchema: {
|
|
16
|
+
...s.object("Report search filters.", {
|
|
17
|
+
keywords: s.nonEmptyString("Search keywords; required unless orgNames contains an institution."),
|
|
18
|
+
orgNames: s.array("Institution names; required unless keywords is provided.", s.nonEmptyString("Institution name.")),
|
|
19
|
+
startTime: s.string("Start time as a millisecond timestamp string or last3day, last7day, last1mon, last3mon, last1year."),
|
|
20
|
+
endTime: s.string("End time as a millisecond timestamp string."),
|
|
21
|
+
pageNum: s.integer("Result page from 1 to 10; defaults to 1.", { minimum: 1, maximum: 10 }),
|
|
22
|
+
}, { required: [] }),
|
|
23
|
+
anyOf: [{ required: ["keywords"] }, { required: ["orgNames"], properties: { orgNames: { minItems: 1 } } }],
|
|
24
|
+
},
|
|
25
|
+
outputSchema: s.requiredObject("Search results with the original response retained.", {
|
|
26
|
+
reports: s.array("Matching research reports.", s.looseObject("Report metadata with upstream extension fields preserved.", {
|
|
27
|
+
reportId,
|
|
28
|
+
title: s.string("Report title, possibly containing highlight markup."),
|
|
29
|
+
orgName: s.string("Publishing institution, possibly containing highlight markup."),
|
|
30
|
+
pubTime: s.unknown("Publication timestamp as returned by the provider."),
|
|
31
|
+
pubTimeStr: s.string("Formatted publication date."),
|
|
32
|
+
industryName: s.string("Industry name."),
|
|
33
|
+
pageNum: s.integer("Number of pages in the report."),
|
|
34
|
+
paragraphs: s.array("Matching text excerpts.", paragraph),
|
|
35
|
+
reportUrl: s.string("Official report reading URL."),
|
|
36
|
+
})),
|
|
37
|
+
raw,
|
|
38
|
+
}),
|
|
39
|
+
}),
|
|
40
|
+
defineProviderAction("fxbaogao", {
|
|
41
|
+
name: "get_paragraphs",
|
|
42
|
+
description: "Read a report's summary and matching paragraphs. Use the PDF for full reading and original-source citations.",
|
|
43
|
+
operationType: "read",
|
|
44
|
+
requiredScopes: [],
|
|
45
|
+
inputSchema: s.object("Report and optional context keyword.", {
|
|
46
|
+
reportId,
|
|
47
|
+
keyword: s.string("Keyword used to locate relevant context within the report."),
|
|
48
|
+
}, { optional: ["keyword"] }),
|
|
49
|
+
outputSchema: s.object("Original report paragraph response.", {
|
|
50
|
+
code: s.integer("Upstream result code; zero indicates success."),
|
|
51
|
+
msg: s.string("Upstream message."),
|
|
52
|
+
data: s.looseObject("Report summary and matching passages.", {
|
|
53
|
+
title: s.string("Report title."),
|
|
54
|
+
summary: s.string("Report summary."),
|
|
55
|
+
paragraphs: s.array("Matching report paragraphs.", paragraph),
|
|
56
|
+
}),
|
|
57
|
+
}, { required: ["code", "data"], additionalProperties: true }),
|
|
58
|
+
}),
|
|
59
|
+
defineProviderAction("fxbaogao", {
|
|
60
|
+
name: "get_pdf_url",
|
|
61
|
+
description: "Get downloadable PDF URLs for a report without transferring binary content through the action response.",
|
|
62
|
+
operationType: "read",
|
|
63
|
+
requiredScopes: [],
|
|
64
|
+
inputSchema: s.requiredObject("Report to download.", { reportId }),
|
|
65
|
+
outputSchema: s.requiredObject("PDF resources and original upstream response.", {
|
|
66
|
+
reportId,
|
|
67
|
+
resources: s.array("Available PDF resources; empty when upstream returns no download URL.", s.requiredObject("A PDF resource.", {
|
|
68
|
+
field: s.string("Upstream field containing this resource."),
|
|
69
|
+
url: s.string("Absolute PDF download URL; it may expire."),
|
|
70
|
+
})),
|
|
71
|
+
raw,
|
|
72
|
+
}),
|
|
73
|
+
}),
|
|
74
|
+
];
|
|
@@ -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,155 @@
|
|
|
1
|
+
import { optionalRecord, optionalRawString, optionalNumber } from "../../core/cast.js";
|
|
2
|
+
import { requiredInputString, requiredResponseRecord, ProviderRequestError, runProviderRequest, defineApiKeyProviderExecutors, defineProviderProxy, mapProviderActionHandlers, readProviderProxyErrorMessage, withRetryAfterSeconds, } from "../provider-runtime.js";
|
|
3
|
+
import { fxbaogaoActions } from "./actions.js";
|
|
4
|
+
const baseUrl = "https://api.fxbaogao.com";
|
|
5
|
+
const defaultHeaders = { accept: "application/json", "content-type": "application/json" };
|
|
6
|
+
const routes = {
|
|
7
|
+
search_reports: "/mofoun/agent/search",
|
|
8
|
+
get_paragraphs: "/mofoun/agent/paragraph",
|
|
9
|
+
get_pdf_url: "/mofoun/agent/download",
|
|
10
|
+
};
|
|
11
|
+
async function request({ route, input, apiKey, fetcher, parentSignal }) {
|
|
12
|
+
try {
|
|
13
|
+
return await runProviderRequest({ signal: parentSignal, label: "Fxbaogao" }, async (signal) => {
|
|
14
|
+
const download = route === routes.get_pdf_url;
|
|
15
|
+
const url = new URL(`${baseUrl}${route}`);
|
|
16
|
+
if (download)
|
|
17
|
+
url.searchParams.set("reportId", String(input.reportId));
|
|
18
|
+
const response = await fetcher(url.toString(), {
|
|
19
|
+
method: download ? "GET" : "POST",
|
|
20
|
+
headers: { ...defaultHeaders, authorization: `Bearer ${apiKey}` },
|
|
21
|
+
body: download ? undefined : JSON.stringify(input),
|
|
22
|
+
signal,
|
|
23
|
+
});
|
|
24
|
+
const text = await response.text();
|
|
25
|
+
let payload;
|
|
26
|
+
try {
|
|
27
|
+
payload = JSON.parse(text);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
payload = undefined;
|
|
31
|
+
}
|
|
32
|
+
const body = optionalRecord(payload);
|
|
33
|
+
if (!response.ok || (body?.code != null && body.code !== 0)) {
|
|
34
|
+
const detail = [
|
|
35
|
+
optionalRawString(body?.code) ?? optionalNumber(body?.code),
|
|
36
|
+
optionalRawString(body?.msg) ?? optionalRawString(body?.message),
|
|
37
|
+
]
|
|
38
|
+
.filter((value) => value != null && value !== "")
|
|
39
|
+
.join(": ") || `HTTP ${response.status}`;
|
|
40
|
+
throw new ProviderRequestError(response.ok ? 502 : response.status, `Fxbaogao request failed: ${detail}`, undefined, response.status === 429 ? "rate_limited" : "provider_error");
|
|
41
|
+
}
|
|
42
|
+
return requiredResponseRecord(payload, "Fxbaogao response");
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (error instanceof ProviderRequestError)
|
|
47
|
+
error.message = error.message.split(apiKey).join("[REDACTED]");
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function extractPdfResources(payload) {
|
|
52
|
+
const resources = [];
|
|
53
|
+
const seen = new Set();
|
|
54
|
+
const urlKeys = new Set(["pdfurl", "url", "fileurl", "downloadurl"]);
|
|
55
|
+
function walk(value) {
|
|
56
|
+
if (Array.isArray(value)) {
|
|
57
|
+
for (const item of value)
|
|
58
|
+
walk(item);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const object = optionalRecord(value);
|
|
62
|
+
if (!object)
|
|
63
|
+
return;
|
|
64
|
+
for (const [field, child] of Object.entries(object)) {
|
|
65
|
+
if (typeof child !== "string") {
|
|
66
|
+
walk(child);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const key = field.toLowerCase();
|
|
70
|
+
const reference = child.trim();
|
|
71
|
+
if (!reference ||
|
|
72
|
+
!(urlKeys.has(key) ||
|
|
73
|
+
(key === "data" &&
|
|
74
|
+
(reference.startsWith("http://") ||
|
|
75
|
+
reference.startsWith("https://") ||
|
|
76
|
+
reference.startsWith("/") ||
|
|
77
|
+
reference.toLowerCase().includes(".pdf")))))
|
|
78
|
+
continue;
|
|
79
|
+
try {
|
|
80
|
+
const url = new URL(reference, "https://dr.fxbaogao.com/");
|
|
81
|
+
if ((url.protocol === "https:" || url.protocol === "http:") && !seen.has(url.href)) {
|
|
82
|
+
seen.add(url.href);
|
|
83
|
+
resources.push({ field, url: url.href });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
/* 忽略上游不可解析的下载地址。 */
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
walk(payload);
|
|
92
|
+
return resources;
|
|
93
|
+
}
|
|
94
|
+
const handlers = mapProviderActionHandlers("fxbaogao", fxbaogaoActions, (action) => async (dataInput, context) => {
|
|
95
|
+
const route = routes[action.name];
|
|
96
|
+
const query = dataInput;
|
|
97
|
+
const body = action.name === "search_reports"
|
|
98
|
+
? {
|
|
99
|
+
...query,
|
|
100
|
+
keywords: query.keywords ?? "",
|
|
101
|
+
orgNames: query.orgNames ?? [],
|
|
102
|
+
pageNum: query.pageNum ?? 1,
|
|
103
|
+
}
|
|
104
|
+
: query;
|
|
105
|
+
const raw = await request({
|
|
106
|
+
route: route,
|
|
107
|
+
input: body,
|
|
108
|
+
apiKey: context.apiKey,
|
|
109
|
+
fetcher: context.fetcher,
|
|
110
|
+
parentSignal: context.signal,
|
|
111
|
+
});
|
|
112
|
+
if (action.name === "search_reports") {
|
|
113
|
+
const reports = Array.isArray(raw.data) ? raw.data : optionalRecord(raw.data)?.dataList;
|
|
114
|
+
if (!Array.isArray(reports))
|
|
115
|
+
throw new ProviderRequestError(502, "Fxbaogao search response is missing its report list", undefined, "provider_error");
|
|
116
|
+
return {
|
|
117
|
+
reports: reports.map((value) => {
|
|
118
|
+
const report = optionalRecord(value);
|
|
119
|
+
if (!report || report.reportId == null)
|
|
120
|
+
return value;
|
|
121
|
+
return {
|
|
122
|
+
...report,
|
|
123
|
+
reportUrl: `https://www.fxbaogao.com/view?id=${encodeURIComponent(String(report.reportId))}`,
|
|
124
|
+
};
|
|
125
|
+
}),
|
|
126
|
+
raw,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
if (action.name === "get_pdf_url")
|
|
130
|
+
return { reportId: query.reportId, resources: extractPdfResources(raw), raw };
|
|
131
|
+
return raw;
|
|
132
|
+
});
|
|
133
|
+
export const executors = defineApiKeyProviderExecutors("fxbaogao", handlers, {
|
|
134
|
+
skipDnsValidation: true,
|
|
135
|
+
});
|
|
136
|
+
export const credentialValidators = {
|
|
137
|
+
async apiKey(input) {
|
|
138
|
+
requiredInputString(input.apiKey, "API Key");
|
|
139
|
+
return { profile: { displayName: "Fxbaogao API Key" }, grantedScopes: [], metadata: { apiBaseUrl: baseUrl } };
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
export const proxy = defineProviderProxy({
|
|
143
|
+
service: "fxbaogao",
|
|
144
|
+
baseUrl,
|
|
145
|
+
auth: { type: "api_key_authorization", prefix: "Bearer " },
|
|
146
|
+
skipDnsValidation: true,
|
|
147
|
+
customizeRequest({ headers }) {
|
|
148
|
+
for (const [name, value] of Object.entries({ accept: "application/json", "content-type": "application/json" }))
|
|
149
|
+
if (!headers.has(name))
|
|
150
|
+
headers.set(name, value);
|
|
151
|
+
},
|
|
152
|
+
async readError(response) {
|
|
153
|
+
return new ProviderRequestError(response.status, await readProviderProxyErrorMessage(response, "Provider request failed"), withRetryAfterSeconds(response), response.status === 429 ? "rate_limited" : "provider_error");
|
|
154
|
+
},
|
|
155
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface GitHubAppInstallationCredential {
|
|
2
|
+
appId: string;
|
|
3
|
+
installationId: string;
|
|
4
|
+
/** PKCS#8 PEM, converted from the PKCS#1 PEM GitHub downloads when needed. */
|
|
5
|
+
privateKey: string;
|
|
6
|
+
}
|
|
7
|
+
interface GitHubInstallationToken {
|
|
8
|
+
token: string;
|
|
9
|
+
/** ISO timestamp from GitHub; tokens live one hour. */
|
|
10
|
+
expiresAt: string;
|
|
11
|
+
permissions: Record<string, string>;
|
|
12
|
+
repositorySelection: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface GitHubAppInstallation {
|
|
15
|
+
id: number;
|
|
16
|
+
account: Record<string, unknown>;
|
|
17
|
+
permissions: Record<string, string>;
|
|
18
|
+
repository_selection: string;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export declare function readGitHubAppInstallationCredential(values: Record<string, string>): GitHubAppInstallationCredential;
|
|
22
|
+
/**
|
|
23
|
+
* Wrap a PKCS#1 RSAPrivateKey in the PKCS#8 PrivateKeyInfo structure WebCrypto
|
|
24
|
+
* imports. The wrapper is fixed for RSA: version 0, the rsaEncryption algorithm
|
|
25
|
+
* identifier with a NULL parameter, then the PKCS#1 DER as an OCTET STRING.
|
|
26
|
+
*/
|
|
27
|
+
export declare function pkcs1ToPkcs8Pem(pkcs1Pem: string): string;
|
|
28
|
+
/** Sign the App JWT GitHub's App endpoints and the token mint take as bearer. */
|
|
29
|
+
export declare function signGitHubAppJwt(credential: GitHubAppInstallationCredential): Promise<string>;
|
|
30
|
+
/** Describe the installation the credential names, authenticated as the App. */
|
|
31
|
+
export declare function fetchGitHubAppInstallation(credential: GitHubAppInstallationCredential, fetcher: typeof fetch, signal?: AbortSignal): Promise<GitHubAppInstallation>;
|
|
32
|
+
/** Mint an installation access token with the App's full granted permissions. */
|
|
33
|
+
export declare function mintGitHubInstallationToken(credential: GitHubAppInstallationCredential, fetcher: typeof fetch, signal?: AbortSignal): Promise<GitHubInstallationToken>;
|
|
34
|
+
export declare function clearGitHubInstallationTokenCache(): void;
|
|
35
|
+
/** Resolve installation tokens without letting one caller cancel a shared mint. */
|
|
36
|
+
export declare function createGitHubInstallationTokenResolver(values: Record<string, string>, fetcher: typeof fetch): (signal?: AbortSignal) => Promise<string>;
|
|
37
|
+
export {};
|