@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compactObject, optionalRecord, optionalString } from "../../core/cast.js";
|
|
2
|
-
import { ProviderRequestError, providerUserAgent, requiredResponseRecord, runProviderRequest, } from "../provider-runtime.js";
|
|
2
|
+
import { ProviderRequestError, providerUserAgent, requiredResponseRecord, runProviderRequest, providerInputError, providerResponseError, } from "../provider-runtime.js";
|
|
3
3
|
import { chuhaijiangOperations } from "./chuhaijiang-actions.js";
|
|
4
4
|
import { normalizeChuhaijiang, searchChuhaijiangImage } from "./chuhaijiang-runtime.js";
|
|
5
5
|
import { mercadoOperations } from "./mercado-actions.js";
|
|
@@ -317,7 +317,7 @@ export async function executeLinkfoxAction(actionName, input, apiKey, fetcher, p
|
|
|
317
317
|
}
|
|
318
318
|
const handler = customHandlers[actionName];
|
|
319
319
|
if (!handler) {
|
|
320
|
-
throw
|
|
320
|
+
throw providerInputError(`unknown linkfox action: ${actionName}`);
|
|
321
321
|
}
|
|
322
322
|
return handler(input, { apiKey, fetcher, signal: parentSignal });
|
|
323
323
|
}
|
|
@@ -326,70 +326,70 @@ function validateSifInput(actionName, input) {
|
|
|
326
326
|
const periodType = optionalString(input.timePieceType) ?? "latelyDay";
|
|
327
327
|
const periodValue = optionalString(input.timePieceValue);
|
|
328
328
|
if ((periodType === "month" || periodType === "week") && !periodValue) {
|
|
329
|
-
throw
|
|
329
|
+
throw providerInputError("timePieceValue is required for month or week periods");
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
const startDate = optionalString(input.startDate);
|
|
333
333
|
const endDate = optionalString(input.endDate);
|
|
334
334
|
if ((startDate && !endDate) || (!startDate && endDate)) {
|
|
335
|
-
throw
|
|
335
|
+
throw providerInputError("startDate and endDate must be provided together");
|
|
336
336
|
}
|
|
337
337
|
if ((startDate || endDate) && input.last7d !== false) {
|
|
338
|
-
throw
|
|
338
|
+
throw providerInputError("last7d must be false when a date range is provided");
|
|
339
339
|
}
|
|
340
340
|
if (startDate && endDate && startDate > endDate) {
|
|
341
|
-
throw
|
|
341
|
+
throw providerInputError("startDate must not be later than endDate");
|
|
342
342
|
}
|
|
343
343
|
if (actionName === "get_sif_asin_traffic_summary") {
|
|
344
344
|
const asins = optionalString(input.asins);
|
|
345
345
|
if (asins && asins.split(",").length > 10) {
|
|
346
|
-
throw
|
|
346
|
+
throw providerInputError("asins must contain at most 10 comma-separated ASINs");
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
function validateLinkfoxActionInput(actionName, input) {
|
|
351
351
|
if (actionName === "search_amazon_by_image" && input.deliveryZip && input.countryOrAreaCode) {
|
|
352
|
-
throw
|
|
352
|
+
throw providerInputError("deliveryZip and countryOrAreaCode cannot be used together");
|
|
353
353
|
}
|
|
354
354
|
if (actionName === "search_amazon_opportunities") {
|
|
355
355
|
const meaningful = Object.keys(input).some((key) => key !== "amazonDomain" && key !== "limit" && input[key] !== undefined);
|
|
356
356
|
if (!meaningful)
|
|
357
|
-
throw
|
|
357
|
+
throw providerInputError("Provide keyword, nicheName, or at least one opportunity metric filter");
|
|
358
358
|
}
|
|
359
359
|
if (actionName === "search_1688_products" && !input.keyWord && !input.goodsUrl && !input.productIds) {
|
|
360
|
-
throw
|
|
360
|
+
throw providerInputError("Provide keyWord, goodsUrl, or productIds");
|
|
361
361
|
}
|
|
362
362
|
if (actionName === "search_1688_by_image" && !input.imageUrl && !input.imageId) {
|
|
363
|
-
throw
|
|
363
|
+
throw providerInputError("Provide imageUrl or imageId");
|
|
364
364
|
}
|
|
365
365
|
if (actionName === "get_echotik_products")
|
|
366
366
|
validateIdentifierLists(input, "productIds", "productUrls");
|
|
367
367
|
if (actionName === "get_echotik_videos")
|
|
368
368
|
validateIdentifierLists(input, "videoIds", "videoUrls");
|
|
369
369
|
if (actionName === "search_amazon_store_orders" && Boolean(input.createdAfter) === Boolean(input.lastUpdatedAfter)) {
|
|
370
|
-
throw
|
|
370
|
+
throw providerInputError("Provide exactly one of createdAfter or lastUpdatedAfter");
|
|
371
371
|
}
|
|
372
372
|
if (actionName === "get_amazon_store_report" &&
|
|
373
373
|
!input.reportId &&
|
|
374
374
|
(!input.reportType || !Array.isArray(input.marketplaceIds) || input.marketplaceIds.length === 0)) {
|
|
375
|
-
throw
|
|
375
|
+
throw providerInputError("Provide reportId, or provide reportType and marketplaceIds to create a report");
|
|
376
376
|
}
|
|
377
377
|
if (actionName === "get_amazon_ads_report" && !input.reportId) {
|
|
378
378
|
for (const field of ["reportTypeId", "adProduct", "groupBy", "columns", "startDate", "endDate"]) {
|
|
379
379
|
const value = input[field];
|
|
380
380
|
if (value === undefined || (Array.isArray(value) && value.length === 0)) {
|
|
381
|
-
throw
|
|
381
|
+
throw providerInputError(`${field} is required when reportId is not provided`);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
if (actionName === "search_ozon_products" && !input.keyword && !input.productIds) {
|
|
386
|
-
throw
|
|
386
|
+
throw providerInputError("Provide keyword or productIds");
|
|
387
387
|
}
|
|
388
388
|
if (Array.isArray(input.filters)) {
|
|
389
389
|
for (const filter of input.filters) {
|
|
390
390
|
const record = optionalRecord(filter);
|
|
391
391
|
if (record?.op === "BETWEEN" && record.value2 === undefined) {
|
|
392
|
-
throw
|
|
392
|
+
throw providerInputError("value2 is required when op is BETWEEN");
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
}
|
|
@@ -404,22 +404,22 @@ function validateLinkfoxActionInput(actionName, input) {
|
|
|
404
404
|
].includes(actionName) &&
|
|
405
405
|
typeof input.pageSize === "number" &&
|
|
406
406
|
input.pageSize % 10 !== 0) {
|
|
407
|
-
throw
|
|
407
|
+
throw providerInputError("pageSize must be a multiple of 10");
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
function validateIdentifierLists(input, idsField, urlsField) {
|
|
411
411
|
const ids = Array.isArray(input[idsField]) ? input[idsField] : [];
|
|
412
412
|
const urls = Array.isArray(input[urlsField]) ? input[urlsField] : [];
|
|
413
413
|
if (ids.length === 0 && urls.length === 0)
|
|
414
|
-
throw
|
|
414
|
+
throw providerInputError(`${idsField} or ${urlsField} is required`);
|
|
415
415
|
if (new Set([...ids, ...urls]).size > 1000) {
|
|
416
|
-
throw
|
|
416
|
+
throw providerInputError(`The combined ${idsField} and ${urlsField} count cannot exceed 1000`);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
function validateTikTokProductInput(value) {
|
|
420
420
|
const productInput = optionalString(value);
|
|
421
421
|
if (!productInput)
|
|
422
|
-
throw
|
|
422
|
+
throw providerInputError("productInput is required");
|
|
423
423
|
if (isNineteenDigitId(productInput))
|
|
424
424
|
return;
|
|
425
425
|
try {
|
|
@@ -437,7 +437,7 @@ function validateTikTokProductInput(value) {
|
|
|
437
437
|
catch {
|
|
438
438
|
// Return the input error below for both invalid cases.
|
|
439
439
|
}
|
|
440
|
-
throw
|
|
440
|
+
throw providerInputError("productInput must be a 19-digit product ID or supported TikTok product URL");
|
|
441
441
|
}
|
|
442
442
|
function isNineteenDigitId(value) {
|
|
443
443
|
return value.length === 19 && [...value].every((character) => "0" <= character && character <= "9");
|
|
@@ -479,31 +479,31 @@ async function readJsonPayload(response) {
|
|
|
479
479
|
if (!response.ok) {
|
|
480
480
|
return text;
|
|
481
481
|
}
|
|
482
|
-
throw
|
|
482
|
+
throw providerResponseError("LinkFox returned invalid JSON");
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
function createLinkfoxError(httpStatus, businessCode, payload, phase) {
|
|
486
486
|
const code = businessCode ?? httpStatus;
|
|
487
487
|
const message = readErrorMessage(payload) ?? `LinkFox request failed with code ${code}`;
|
|
488
488
|
if (businessCode === 401) {
|
|
489
|
-
return
|
|
489
|
+
return new ProviderRequestError(phase === "validate" ? 400 : 401, message);
|
|
490
490
|
}
|
|
491
491
|
if (httpStatus === 401 || httpStatus === 403 || businessCode === 403) {
|
|
492
|
-
return
|
|
492
|
+
return new ProviderRequestError(httpStatus >= 400 ? httpStatus : 403, message);
|
|
493
493
|
}
|
|
494
494
|
if (code === 402 || httpStatus === 402) {
|
|
495
|
-
return
|
|
495
|
+
return new ProviderRequestError(402, message || "LinkFox credits are insufficient");
|
|
496
496
|
}
|
|
497
497
|
if (code === 429 || httpStatus === 429 || code === 1003) {
|
|
498
|
-
return
|
|
498
|
+
return new ProviderRequestError(429, message);
|
|
499
499
|
}
|
|
500
500
|
if (code === 501 && message.toLowerCase().includes("kalodata api http 5")) {
|
|
501
|
-
return
|
|
501
|
+
return providerResponseError(message);
|
|
502
502
|
}
|
|
503
503
|
if ((httpStatus >= 400 && httpStatus < 500) || [400, 403, 404, 422, 501, 1002, 1004, 1005].includes(code)) {
|
|
504
|
-
return
|
|
504
|
+
return providerInputError(message);
|
|
505
505
|
}
|
|
506
|
-
return
|
|
506
|
+
return new ProviderRequestError(httpStatus >= 500 ? httpStatus : 502, message);
|
|
507
507
|
}
|
|
508
508
|
function readBusinessCode(payload) {
|
|
509
509
|
const record = optionalRecord(payload);
|
|
@@ -655,7 +655,7 @@ function normalizeOpportunityReport(payload) {
|
|
|
655
655
|
const record = requireRecord(payload, "LinkFox returned an invalid opportunity report response");
|
|
656
656
|
const report = readString(record.stdout);
|
|
657
657
|
if (!report) {
|
|
658
|
-
throw
|
|
658
|
+
throw providerResponseError("LinkFox opportunity report did not include stdout");
|
|
659
659
|
}
|
|
660
660
|
return {
|
|
661
661
|
report,
|
|
@@ -667,7 +667,7 @@ function normalizeAuthorizationUrl(payload) {
|
|
|
667
667
|
const record = requireRecord(payload, "LinkFox returned an invalid authorization response");
|
|
668
668
|
const authorizeUrl = readString(record.authorizeUrl);
|
|
669
669
|
if (!authorizeUrl) {
|
|
670
|
-
throw
|
|
670
|
+
throw providerResponseError("LinkFox response did not include authorizeUrl");
|
|
671
671
|
}
|
|
672
672
|
return { authorizeUrl };
|
|
673
673
|
}
|
|
@@ -832,7 +832,7 @@ async function executeStoreReport(input, context) {
|
|
|
832
832
|
}, context);
|
|
833
833
|
reportId = readString(readDeveloperProxyBody(created).reportId);
|
|
834
834
|
if (!reportId) {
|
|
835
|
-
throw
|
|
835
|
+
throw providerResponseError("Amazon report creation did not return reportId");
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
const maxAttempts = readInteger(input.maxAttempts) ?? 20;
|
|
@@ -855,7 +855,7 @@ async function executeStoreReport(input, context) {
|
|
|
855
855
|
if (status === "DONE") {
|
|
856
856
|
const documentId = readString(statusBody.reportDocumentId);
|
|
857
857
|
if (!documentId) {
|
|
858
|
-
throw
|
|
858
|
+
throw providerResponseError("Completed Amazon report did not include reportDocumentId");
|
|
859
859
|
}
|
|
860
860
|
const documentPayload = await callDeveloperProxy("/spApi/developerProxy", {
|
|
861
861
|
region: input.region,
|
|
@@ -866,7 +866,7 @@ async function executeStoreReport(input, context) {
|
|
|
866
866
|
const document = readDeveloperProxyBody(documentPayload);
|
|
867
867
|
const downloadUrl = readString(document.url);
|
|
868
868
|
if (!downloadUrl) {
|
|
869
|
-
throw
|
|
869
|
+
throw providerResponseError("Amazon report document did not include url");
|
|
870
870
|
}
|
|
871
871
|
return {
|
|
872
872
|
reportId,
|
|
@@ -877,10 +877,10 @@ async function executeStoreReport(input, context) {
|
|
|
877
877
|
};
|
|
878
878
|
}
|
|
879
879
|
if (["FATAL", "CANCELLED"].includes(status)) {
|
|
880
|
-
throw
|
|
880
|
+
throw providerResponseError(`Amazon report generation ended with ${status}`);
|
|
881
881
|
}
|
|
882
882
|
if (!["IN_QUEUE", "IN_PROGRESS"].includes(status)) {
|
|
883
|
-
throw
|
|
883
|
+
throw providerResponseError(`Amazon report returned unknown status ${status}`);
|
|
884
884
|
}
|
|
885
885
|
if (attempt < maxAttempts && Date.now() + pollIntervalSeconds * 1000 < pollDeadline) {
|
|
886
886
|
await waitSeconds(pollIntervalSeconds);
|
|
@@ -966,7 +966,7 @@ async function executeAdsReport(input, context) {
|
|
|
966
966
|
reportId = readString(readDeveloperProxyBody(created).reportId);
|
|
967
967
|
}
|
|
968
968
|
if (!reportId) {
|
|
969
|
-
throw
|
|
969
|
+
throw providerResponseError("Amazon Ads report creation did not return reportId");
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
const maxAttempts = readInteger(input.maxAttempts) ?? 20;
|
|
@@ -989,7 +989,7 @@ async function executeAdsReport(input, context) {
|
|
|
989
989
|
if (["COMPLETED", "SUCCESS"].includes(status)) {
|
|
990
990
|
const downloadUrl = readString(statusBody.url);
|
|
991
991
|
if (!downloadUrl) {
|
|
992
|
-
throw
|
|
992
|
+
throw providerResponseError("Completed Amazon Ads report did not include url");
|
|
993
993
|
}
|
|
994
994
|
return {
|
|
995
995
|
reportId,
|
|
@@ -1001,10 +1001,10 @@ async function executeAdsReport(input, context) {
|
|
|
1001
1001
|
}
|
|
1002
1002
|
if (["FAILURE", "FAILED", "CANCELLED"].includes(status)) {
|
|
1003
1003
|
const reason = readString(statusBody.failureReason);
|
|
1004
|
-
throw
|
|
1004
|
+
throw providerResponseError(reason ? `Amazon Ads report failed: ${reason}` : `Amazon Ads report ended with ${status}`);
|
|
1005
1005
|
}
|
|
1006
1006
|
if (!["PENDING", "PROCESSING", "IN_QUEUE", "IN_PROGRESS"].includes(status)) {
|
|
1007
|
-
throw
|
|
1007
|
+
throw providerResponseError(`Amazon Ads report returned unknown status ${status}`);
|
|
1008
1008
|
}
|
|
1009
1009
|
if (attempt < maxAttempts && Date.now() + pollIntervalSeconds * 1000 < pollDeadline) {
|
|
1010
1010
|
await waitSeconds(pollIntervalSeconds);
|
|
@@ -1028,7 +1028,7 @@ async function callDeveloperProxy(path, body, context) {
|
|
|
1028
1028
|
function readDeveloperProxyBody(payload) {
|
|
1029
1029
|
const httpStatus = readInteger(payload.httpStatus);
|
|
1030
1030
|
if (httpStatus === null) {
|
|
1031
|
-
throw
|
|
1031
|
+
throw providerResponseError("LinkFox developer proxy omitted httpStatus");
|
|
1032
1032
|
}
|
|
1033
1033
|
const body = parseNestedJson(payload.body);
|
|
1034
1034
|
if (httpStatus >= 200 && httpStatus < 300) {
|
|
@@ -1036,18 +1036,18 @@ function readDeveloperProxyBody(payload) {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
const message = readErrorMessage(body) ?? `Amazon upstream request failed with status ${httpStatus}`;
|
|
1038
1038
|
if (httpStatus === 401) {
|
|
1039
|
-
throw
|
|
1039
|
+
throw new ProviderRequestError(401, message);
|
|
1040
1040
|
}
|
|
1041
1041
|
if (httpStatus === 403) {
|
|
1042
|
-
throw
|
|
1042
|
+
throw new ProviderRequestError(403, message);
|
|
1043
1043
|
}
|
|
1044
1044
|
if (httpStatus === 429) {
|
|
1045
|
-
throw
|
|
1045
|
+
throw new ProviderRequestError(429, message);
|
|
1046
1046
|
}
|
|
1047
1047
|
if (httpStatus >= 400 && httpStatus < 500) {
|
|
1048
|
-
throw
|
|
1048
|
+
throw providerInputError(message);
|
|
1049
1049
|
}
|
|
1050
|
-
throw
|
|
1050
|
+
throw new ProviderRequestError(httpStatus, message);
|
|
1051
1051
|
}
|
|
1052
1052
|
function parseNestedJson(value) {
|
|
1053
1053
|
if (typeof value !== "string") {
|
|
@@ -1060,7 +1060,7 @@ function parseNestedJson(value) {
|
|
|
1060
1060
|
return JSON.parse(value);
|
|
1061
1061
|
}
|
|
1062
1062
|
catch {
|
|
1063
|
-
throw
|
|
1063
|
+
throw providerResponseError("LinkFox developer proxy returned invalid JSON");
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
1066
|
function readDuplicateReportId(value) {
|
|
@@ -1097,7 +1097,7 @@ function appendQuery(query, name, value) {
|
|
|
1097
1097
|
function requireRecord(value, message) {
|
|
1098
1098
|
const record = optionalRecord(value);
|
|
1099
1099
|
if (!record) {
|
|
1100
|
-
throw
|
|
1100
|
+
throw providerResponseError(message);
|
|
1101
1101
|
}
|
|
1102
1102
|
return record;
|
|
1103
1103
|
}
|
|
@@ -1129,6 +1129,3 @@ function waitSeconds(seconds) {
|
|
|
1129
1129
|
setTimeout(resolve, seconds * 1000);
|
|
1130
1130
|
});
|
|
1131
1131
|
}
|
|
1132
|
-
function providerError(_code, message, status) {
|
|
1133
|
-
return new ProviderRequestError(status, message);
|
|
1134
|
-
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsonSchema as s } from "../../core/json-schema.js";
|
|
2
|
+
import { defineProviderAction } from "../../core/provider-definition.js";
|
|
3
|
+
const service = "listinggood";
|
|
4
|
+
const lang = s.stringEnum("Report language. Defaults to en.", ["en", "zh"]);
|
|
5
|
+
const result = s.requiredObject("The ListingGood response.", {
|
|
6
|
+
result: s.looseObject("The upstream JSON result, including provider-defined fields."),
|
|
7
|
+
});
|
|
8
|
+
const productFields = {
|
|
9
|
+
category: s.string("Product category name."),
|
|
10
|
+
category_code: s.string("ListingGood category code, when known."),
|
|
11
|
+
brand: s.string("Product brand."),
|
|
12
|
+
gender: s.string("Intended audience or gender."),
|
|
13
|
+
price: s.string("Product price, optionally including the currency."),
|
|
14
|
+
material_main: s.string("Main product material."),
|
|
15
|
+
material_lining: s.string("Lining material."),
|
|
16
|
+
sizes: s.string("Available sizes."),
|
|
17
|
+
colors: s.string("Available colors."),
|
|
18
|
+
season: s.string("Intended seasons."),
|
|
19
|
+
occasion: s.string("Intended occasions."),
|
|
20
|
+
keywords: s.string("Target search keywords."),
|
|
21
|
+
note: s.string("Additional factual product details."),
|
|
22
|
+
diff: s.string("Product differentiators."),
|
|
23
|
+
selling_points: s.array("Factual product selling points.", s.string("One selling point.")),
|
|
24
|
+
lang,
|
|
25
|
+
};
|
|
26
|
+
export const listinggoodActions = [
|
|
27
|
+
defineProviderAction(service, {
|
|
28
|
+
name: "ai_readiness_check",
|
|
29
|
+
operationType: "read",
|
|
30
|
+
requiredScopes: [],
|
|
31
|
+
description: "Check listing copy for AI readability and compliance signals without submitting lead contact details.",
|
|
32
|
+
inputSchema: s.object("Listing copy to check.", {
|
|
33
|
+
text: s.nonEmptyString("Listing title, bullets and description as plain text."),
|
|
34
|
+
marketplace: s.nonEmptyString("Marketplace code, such as US or DE. Defaults to US."),
|
|
35
|
+
lang,
|
|
36
|
+
}, { optional: ["marketplace", "lang"] }),
|
|
37
|
+
outputSchema: result,
|
|
38
|
+
}),
|
|
39
|
+
defineProviderAction(service, {
|
|
40
|
+
name: "compliance_check",
|
|
41
|
+
operationType: "read",
|
|
42
|
+
requiredScopes: [],
|
|
43
|
+
description: "Run a quick pre-publication check for risky listing terms and category issues.",
|
|
44
|
+
inputSchema: s.object("Listing copy for a quick check.", {
|
|
45
|
+
text: s.nonEmptyString("Listing copy to check."),
|
|
46
|
+
category: s.string("Optional category hint, such as electronics or apparel."),
|
|
47
|
+
lang,
|
|
48
|
+
}, { optional: ["category", "lang"] }),
|
|
49
|
+
outputSchema: result,
|
|
50
|
+
}),
|
|
51
|
+
defineProviderAction(service, {
|
|
52
|
+
name: "fill_from_sentence",
|
|
53
|
+
operationType: "read",
|
|
54
|
+
requiredScopes: [],
|
|
55
|
+
description: "Expand a short product description into structured fields for listing generation.",
|
|
56
|
+
inputSchema: s.object("Product description to structure.", {
|
|
57
|
+
sentence: s.string("Product description containing 4 to 1000 characters.", {
|
|
58
|
+
minLength: 4,
|
|
59
|
+
maxLength: 1000,
|
|
60
|
+
}),
|
|
61
|
+
lang,
|
|
62
|
+
}, { optional: ["lang"] }),
|
|
63
|
+
outputSchema: result,
|
|
64
|
+
}),
|
|
65
|
+
defineProviderAction(service, {
|
|
66
|
+
name: "generate_listing",
|
|
67
|
+
operationType: "write",
|
|
68
|
+
requiredScopes: [],
|
|
69
|
+
description: "Submit a text-based listing generation task for explicitly selected marketplaces. Uses account credits and saves generated copy in ListingGood; does not publish to Amazon.",
|
|
70
|
+
asyncLifecycle: { startActionId: "listinggood.generate_listing", statusActionId: "listinggood.get_task" },
|
|
71
|
+
inputSchema: s.object("Text-based listing generation parameters.", {
|
|
72
|
+
cn_name: s.nonEmptyString("Product name; the upstream field is named cn_name."),
|
|
73
|
+
sku: s.nonEmptyString("Product SKU."),
|
|
74
|
+
marketplaces: s.array("Marketplace codes to generate for. Select explicitly to avoid generating for every marketplace.", s.nonEmptyString("Marketplace code, such as US, UK or DE."), { minItems: 1, uniqueItems: true }),
|
|
75
|
+
...productFields,
|
|
76
|
+
}, { optional: Object.keys(productFields) }),
|
|
77
|
+
outputSchema: s.looseRequiredObject("Accepted generation task and upstream metadata.", {
|
|
78
|
+
task_id: s.nonEmptyString("Task identifier for get_task."),
|
|
79
|
+
}),
|
|
80
|
+
}),
|
|
81
|
+
defineProviderAction(service, {
|
|
82
|
+
name: "get_task",
|
|
83
|
+
operationType: "read",
|
|
84
|
+
requiredScopes: [],
|
|
85
|
+
description: "Retrieve a ListingGood task and its generated result, preserving upstream status and metadata.",
|
|
86
|
+
asyncLifecycle: { startActionId: "listinggood.generate_listing", statusActionId: "listinggood.get_task" },
|
|
87
|
+
inputSchema: s.requiredObject("Task lookup parameters.", {
|
|
88
|
+
task_id: s.nonEmptyString("Task identifier returned by generate_listing."),
|
|
89
|
+
}),
|
|
90
|
+
outputSchema: s.requiredObject("Task state and full upstream response.", {
|
|
91
|
+
status: s.stringEnum("Normalized task state.", ["pending", "succeeded", "failed"]),
|
|
92
|
+
task: s.looseObject("Upstream task with status, progress, message, result or error."),
|
|
93
|
+
}),
|
|
94
|
+
}),
|
|
95
|
+
];
|
|
@@ -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,99 @@
|
|
|
1
|
+
import { optionalRawString } from "../../core/cast.js";
|
|
2
|
+
import { requiredInputString, requiredResponseRecord, providerUserAgent, ProviderRequestError, runProviderRequest, isAbortLikeError, defineApiKeyProviderExecutors, defineProviderProxy, mapProviderActionHandlers, readProviderProxyErrorMessage, withRetryAfterSeconds, } from "../provider-runtime.js";
|
|
3
|
+
import { listinggoodActions } from "./actions.js";
|
|
4
|
+
const baseUrl = "https://listinggood.com/api";
|
|
5
|
+
const paths = {
|
|
6
|
+
ai_readiness_check: "/free-check",
|
|
7
|
+
compliance_check: "/compliance-check",
|
|
8
|
+
fill_from_sentence: "/fill-from-sentence",
|
|
9
|
+
generate_listing: "/generate",
|
|
10
|
+
};
|
|
11
|
+
const defaultHeaders = { accept: "application/json", "user-agent": providerUserAgent };
|
|
12
|
+
async function request({ path, apiKey, body, fetcher, parentSignal }) {
|
|
13
|
+
return runProviderRequest({ signal: parentSignal, label: "ListingGood" }, async (signal) => {
|
|
14
|
+
const response = await fetcher(`${baseUrl}${path}`, {
|
|
15
|
+
method: body ? "POST" : "GET",
|
|
16
|
+
headers: {
|
|
17
|
+
...defaultHeaders,
|
|
18
|
+
"content-type": "application/json",
|
|
19
|
+
authorization: `Bearer ${apiKey}`,
|
|
20
|
+
},
|
|
21
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
22
|
+
signal,
|
|
23
|
+
});
|
|
24
|
+
let payload;
|
|
25
|
+
try {
|
|
26
|
+
payload = requiredResponseRecord(await response.json(), "ListingGood response");
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
if (isAbortLikeError(error))
|
|
30
|
+
throw error;
|
|
31
|
+
throw new ProviderRequestError(response.ok ? 502 : response.status, "ListingGood returned an invalid JSON response", undefined, "provider_error");
|
|
32
|
+
}
|
|
33
|
+
if (!response.ok) {
|
|
34
|
+
const detail = optionalRawString(payload.error_en) ?? optionalRawString(payload.error);
|
|
35
|
+
throw new ProviderRequestError(response.status, `ListingGood request failed${detail ? `: ${detail}` : ""}`, undefined, "provider_error");
|
|
36
|
+
}
|
|
37
|
+
return payload;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const handlers = mapProviderActionHandlers("listinggood", listinggoodActions, (action) => async (dataInput, context) => {
|
|
41
|
+
const values = dataInput;
|
|
42
|
+
const isTask = action.name === "get_task";
|
|
43
|
+
const path = isTask ? `/task/${encodeURIComponent(String(values.task_id))}` : paths[action.name];
|
|
44
|
+
const payload = isTask ? undefined : { ...values, lang: values.lang ?? "en" };
|
|
45
|
+
if (action.name === "ai_readiness_check" && payload)
|
|
46
|
+
payload.marketplace ??= "US";
|
|
47
|
+
const body = await request({
|
|
48
|
+
path: path,
|
|
49
|
+
apiKey: context.apiKey,
|
|
50
|
+
body: payload,
|
|
51
|
+
fetcher: context.fetcher,
|
|
52
|
+
parentSignal: context.signal,
|
|
53
|
+
});
|
|
54
|
+
if (action.name === "generate_listing") {
|
|
55
|
+
if (!optionalRawString(body.task_id)?.trim())
|
|
56
|
+
throw new ProviderRequestError(502, "ListingGood did not return a task_id", undefined, "provider_error");
|
|
57
|
+
return body;
|
|
58
|
+
}
|
|
59
|
+
if (isTask) {
|
|
60
|
+
const state = optionalRawString(body.status);
|
|
61
|
+
if (!state?.trim())
|
|
62
|
+
throw new ProviderRequestError(502, "ListingGood task is missing status", undefined, "provider_error");
|
|
63
|
+
return {
|
|
64
|
+
status: state === "done" ? "succeeded" : state === "error" ? "failed" : "pending",
|
|
65
|
+
task: body,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return { result: body };
|
|
69
|
+
});
|
|
70
|
+
export const executors = defineApiKeyProviderExecutors("listinggood", handlers, {
|
|
71
|
+
skipDnsValidation: true,
|
|
72
|
+
});
|
|
73
|
+
export const credentialValidators = {
|
|
74
|
+
async apiKey(input) {
|
|
75
|
+
requiredInputString(input.apiKey, "API Key");
|
|
76
|
+
return {
|
|
77
|
+
profile: { displayName: "ListingGood API Key" },
|
|
78
|
+
grantedScopes: [],
|
|
79
|
+
metadata: { apiBaseUrl: baseUrl, validationMode: "local_non_empty_key" },
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
export const proxy = defineProviderProxy({
|
|
84
|
+
service: "listinggood",
|
|
85
|
+
baseUrl,
|
|
86
|
+
auth: { type: "api_key_authorization", prefix: "Bearer " },
|
|
87
|
+
skipDnsValidation: true,
|
|
88
|
+
customizeRequest({ headers }) {
|
|
89
|
+
for (const [name, value] of Object.entries({
|
|
90
|
+
accept: "application/json",
|
|
91
|
+
"user-agent": providerUserAgent,
|
|
92
|
+
}))
|
|
93
|
+
if (!headers.has(name))
|
|
94
|
+
headers.set(name, value);
|
|
95
|
+
},
|
|
96
|
+
async readError(response) {
|
|
97
|
+
return new ProviderRequestError(response.status, await readProviderProxyErrorMessage(response, "Provider request failed"), withRetryAfterSeconds(response), response.status === 429 ? "rate_limited" : "provider_error");
|
|
98
|
+
},
|
|
99
|
+
});
|
|
@@ -8,6 +8,7 @@ export interface McpToolSummary {
|
|
|
8
8
|
annotations?: ToolAnnotations;
|
|
9
9
|
inputSchema: Record<string, unknown>;
|
|
10
10
|
outputSchema?: Record<string, unknown>;
|
|
11
|
+
metadata?: Record<string, unknown>;
|
|
11
12
|
}
|
|
12
13
|
export interface McpToolOptions {
|
|
13
14
|
endpoint: string;
|
|
@@ -24,7 +25,9 @@ export interface McpToolOptions {
|
|
|
24
25
|
toolListMaxTools?: number;
|
|
25
26
|
toolListTimeoutMs?: number;
|
|
26
27
|
}
|
|
28
|
+
export declare function withMcpToolClient<T>(input: McpToolOptions, run: (client: Client) => Promise<T>): Promise<T>;
|
|
27
29
|
interface ListMcpToolsOptions {
|
|
30
|
+
includeMetadata?: boolean;
|
|
28
31
|
includeOutputSchema?: boolean;
|
|
29
32
|
includeAnnotations?: boolean;
|
|
30
33
|
}
|
|
@@ -5,7 +5,7 @@ const defaultMcpToolListMaxBytes = 16 * 1024 * 1024;
|
|
|
5
5
|
const defaultMcpToolListMaxPages = 100;
|
|
6
6
|
const defaultMcpToolListMaxTools = 10_000;
|
|
7
7
|
const defaultMcpToolListTimeoutMs = 60_000;
|
|
8
|
-
async function
|
|
8
|
+
export async function withMcpToolClient(input, run) {
|
|
9
9
|
const fetcher = input.fetcher ?? providerFetch;
|
|
10
10
|
const limitedFetcher = createLimitedMcpFetch(fetcher, input.service, input.maxResponseBytes);
|
|
11
11
|
return withMcpClient({
|
|
@@ -25,9 +25,10 @@ function createLimitedMcpFetch(fetcher, service, maxResponseBytes) {
|
|
|
25
25
|
return async (url, init) => limitMcpResponse(await fetcher(url, init), service, maxResponseBytes);
|
|
26
26
|
}
|
|
27
27
|
export async function listMcpTools(input, options = {}) {
|
|
28
|
-
return
|
|
28
|
+
return withMcpToolClient(input, async (client) => {
|
|
29
29
|
const tools = await listAllStreamableHttpMcpTools(client, input);
|
|
30
30
|
return tools.map((tool) => ({
|
|
31
|
+
metadata: options.includeMetadata ? tool._meta : undefined,
|
|
31
32
|
name: tool.name,
|
|
32
33
|
description: tool.description,
|
|
33
34
|
annotations: options.includeAnnotations ? tool.annotations : undefined,
|
|
@@ -37,7 +38,7 @@ export async function listMcpTools(input, options = {}) {
|
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
40
|
export async function callMcpTool(input) {
|
|
40
|
-
return
|
|
41
|
+
return withMcpToolClient(input, async (client) => {
|
|
41
42
|
if (input.authorizeTool) {
|
|
42
43
|
const tools = await listAllStreamableHttpMcpTools(client, input);
|
|
43
44
|
const matchingTools = tools.filter((tool) => tool.name === input.toolName);
|
|
@@ -52,7 +53,7 @@ export async function callMcpTool(input) {
|
|
|
52
53
|
result = await client.callTool({
|
|
53
54
|
name: input.toolName,
|
|
54
55
|
arguments: input.arguments,
|
|
55
|
-
}, { signal: requestTimeout.signal });
|
|
56
|
+
}, { signal: requestTimeout.signal, timeout: input.requestTimeoutMs });
|
|
56
57
|
}
|
|
57
58
|
finally {
|
|
58
59
|
requestTimeout.cleanup();
|