@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,286 @@
|
|
|
1
|
+
import { s } from "../../core/json-schema.js";
|
|
2
|
+
import { defineProviderAction } from "../../core/provider-definition.js";
|
|
3
|
+
import { smarthrSupplementalActions } from "./supplemental-actions.js";
|
|
4
|
+
export const smarthrActions = [
|
|
5
|
+
...smarthrSupplementalActions,
|
|
6
|
+
defineProviderAction("smarthr", {
|
|
7
|
+
name: "list_employees",
|
|
8
|
+
description: "List SmartHR employees with pagination.",
|
|
9
|
+
operationType: "read",
|
|
10
|
+
requiredScopes: [],
|
|
11
|
+
inputSchema: s.object("Parameters for listing employees.", {
|
|
12
|
+
page: s.integer("Page number, starting at 1. Defaults to 1.", { minimum: 1 }),
|
|
13
|
+
perPage: s.integer("Results per page, from 1 to 100. Defaults to 10.", {
|
|
14
|
+
minimum: 1,
|
|
15
|
+
maximum: 100,
|
|
16
|
+
}),
|
|
17
|
+
employeeCode: s.string("Filter by employee number."),
|
|
18
|
+
employmentTypeIds: s.array("Filter by employment type IDs.", s.string("One identifier or field name.", { minLength: 1 }), { minItems: 1 }),
|
|
19
|
+
employmentStatus: s.stringEnum("Filter by employment status.", ["employed", "absent", "retired"]),
|
|
20
|
+
gender: s.stringEnum("Filter by legal gender.", ["male", "female"]),
|
|
21
|
+
sort: s.string("Sort fields separated by commas; prefix a field with - for descending order."),
|
|
22
|
+
userIds: s.array("Filter by user IDs.", s.string("One identifier or field name.", { minLength: 1 }), {
|
|
23
|
+
minItems: 1,
|
|
24
|
+
}),
|
|
25
|
+
departmentIds: s.array("Filter by department IDs.", s.string("One identifier or field name.", { minLength: 1 }), { minItems: 1 }),
|
|
26
|
+
positionIds: s.array("Filter by position IDs.", s.string("One identifier or field name.", { minLength: 1 }), {
|
|
27
|
+
minItems: 1,
|
|
28
|
+
}),
|
|
29
|
+
employeeIds: s.array("Filter by employee IDs.", s.string("One identifier or field name.", { minLength: 1 }), {
|
|
30
|
+
minItems: 1,
|
|
31
|
+
}),
|
|
32
|
+
fields: s.array("Employee field names to return. Omit to use the upstream default.", s.string("One identifier or field name.", { minLength: 1 }), { minItems: 1 }),
|
|
33
|
+
query: s.string("Search names, business names, departments, and positions."),
|
|
34
|
+
preferBusinessName: s.boolean("Prefer business names when searching."),
|
|
35
|
+
enteredAtFrom: s.string("Joined on or after this date.", { format: "date" }),
|
|
36
|
+
enteredAtTo: s.string("Joined on or before this date.", { format: "date" }),
|
|
37
|
+
resignedAtFrom: s.string("Resigned on or after this date.", { format: "date" }),
|
|
38
|
+
resignedAtTo: s.string("Resigned on or before this date.", { format: "date" }),
|
|
39
|
+
}, { required: [] }),
|
|
40
|
+
outputSchema: s.object("One page of employees.", {
|
|
41
|
+
employees: s.array("Returned employees.", s.object("Employee data; fields depend on the token permissions and requested fields.", {
|
|
42
|
+
id: s.string("Employee ID."),
|
|
43
|
+
emp_code: s.string("Employee number."),
|
|
44
|
+
last_name: s.string("Family name."),
|
|
45
|
+
first_name: s.string("Given name."),
|
|
46
|
+
emp_status: s.string("Employment status."),
|
|
47
|
+
}, { required: [], additionalProperties: true })),
|
|
48
|
+
page: s.integer("Requested page number."),
|
|
49
|
+
perPage: s.integer("Requested page size."),
|
|
50
|
+
totalCount: s.nullable(s.integer("Total matching records from x-total-count, or null when unavailable.")),
|
|
51
|
+
nextPage: s.nullable(s.integer("Next page number from the Link header, or null when no next link is provided.")),
|
|
52
|
+
}, { required: ["employees", "page", "perPage", "totalCount", "nextPage"] }),
|
|
53
|
+
}),
|
|
54
|
+
defineProviderAction("smarthr", {
|
|
55
|
+
name: "list_companies",
|
|
56
|
+
description: "List SmartHR companies with pagination.",
|
|
57
|
+
operationType: "read",
|
|
58
|
+
requiredScopes: [],
|
|
59
|
+
inputSchema: s.object("Parameters for listing companies.", {
|
|
60
|
+
page: s.integer("Page number, starting at 1. Defaults to 1.", { minimum: 1 }),
|
|
61
|
+
perPage: s.integer("Results per page, from 1 to 100. Defaults to 10.", {
|
|
62
|
+
minimum: 1,
|
|
63
|
+
maximum: 100,
|
|
64
|
+
}),
|
|
65
|
+
embed: s.stringEnum("Optionally include the company owner.", ["owner"]),
|
|
66
|
+
}, { required: [] }),
|
|
67
|
+
outputSchema: s.object("One page of companies.", {
|
|
68
|
+
companies: s.array("Returned companies.", s.object("Company information.", { id: s.string("Resource ID."), name: s.string("Resource name.") }, { required: [], additionalProperties: true })),
|
|
69
|
+
page: s.integer("Requested page number."),
|
|
70
|
+
perPage: s.integer("Requested page size."),
|
|
71
|
+
totalCount: s.nullable(s.integer("Total matching records from x-total-count, or null when unavailable.")),
|
|
72
|
+
nextPage: s.nullable(s.integer("Next page number from the Link header, or null when no next link is provided.")),
|
|
73
|
+
}, { required: ["companies", "page", "perPage", "totalCount", "nextPage"] }),
|
|
74
|
+
}),
|
|
75
|
+
defineProviderAction("smarthr", {
|
|
76
|
+
name: "list_departments",
|
|
77
|
+
description: "List SmartHR departments with pagination.",
|
|
78
|
+
operationType: "read",
|
|
79
|
+
requiredScopes: [],
|
|
80
|
+
inputSchema: s.object("Parameters for listing departments.", {
|
|
81
|
+
page: s.integer("Page number, starting at 1. Defaults to 1.", { minimum: 1 }),
|
|
82
|
+
perPage: s.integer("Results per page, from 1 to 100. Defaults to 10.", {
|
|
83
|
+
minimum: 1,
|
|
84
|
+
maximum: 100,
|
|
85
|
+
}),
|
|
86
|
+
code: s.string("Filter by department code."),
|
|
87
|
+
sort: s.string("Sort fields separated by commas; prefix a field with - for descending order."),
|
|
88
|
+
}, { required: [] }),
|
|
89
|
+
outputSchema: s.object("One page of departments.", {
|
|
90
|
+
departments: s.array("Returned departments.", s.object("Department data, including any nested hierarchy returned by SmartHR.", { id: s.string("Resource ID."), name: s.string("Resource name.") }, { required: [], additionalProperties: true })),
|
|
91
|
+
page: s.integer("Requested page number."),
|
|
92
|
+
perPage: s.integer("Requested page size."),
|
|
93
|
+
totalCount: s.nullable(s.integer("Total matching records from x-total-count, or null when unavailable.")),
|
|
94
|
+
nextPage: s.nullable(s.integer("Next page number from the Link header, or null when no next link is provided.")),
|
|
95
|
+
}, { required: ["departments", "page", "perPage", "totalCount", "nextPage"] }),
|
|
96
|
+
}),
|
|
97
|
+
defineProviderAction("smarthr", {
|
|
98
|
+
name: "list_employment_types",
|
|
99
|
+
description: "List SmartHR employment types with pagination.",
|
|
100
|
+
operationType: "read",
|
|
101
|
+
requiredScopes: [],
|
|
102
|
+
inputSchema: s.object("Parameters for listing employment types.", {
|
|
103
|
+
page: s.integer("Page number, starting at 1. Defaults to 1.", { minimum: 1 }),
|
|
104
|
+
perPage: s.integer("Results per page, from 1 to 100. Defaults to 10.", {
|
|
105
|
+
minimum: 1,
|
|
106
|
+
maximum: 100,
|
|
107
|
+
}),
|
|
108
|
+
}, { required: [] }),
|
|
109
|
+
outputSchema: s.object("One page of employment types.", {
|
|
110
|
+
employmentTypes: s.array("Returned employment types.", s.object("Employment type information.", { id: s.string("Resource ID."), name: s.string("Resource name.") }, { required: [], additionalProperties: true })),
|
|
111
|
+
page: s.integer("Requested page number."),
|
|
112
|
+
perPage: s.integer("Requested page size."),
|
|
113
|
+
totalCount: s.nullable(s.integer("Total matching records from x-total-count, or null when unavailable.")),
|
|
114
|
+
nextPage: s.nullable(s.integer("Next page number from the Link header, or null when no next link is provided.")),
|
|
115
|
+
}, { required: ["employmentTypes", "page", "perPage", "totalCount", "nextPage"] }),
|
|
116
|
+
}),
|
|
117
|
+
defineProviderAction("smarthr", {
|
|
118
|
+
name: "list_custom_fields",
|
|
119
|
+
description: "List SmartHR custom employee fields with pagination.",
|
|
120
|
+
operationType: "read",
|
|
121
|
+
requiredScopes: [],
|
|
122
|
+
inputSchema: s.object("Parameters for listing custom employee fields.", {
|
|
123
|
+
page: s.integer("Page number, starting at 1. Defaults to 1.", { minimum: 1 }),
|
|
124
|
+
perPage: s.integer("Results per page, from 1 to 100. Defaults to 10.", {
|
|
125
|
+
minimum: 1,
|
|
126
|
+
maximum: 100,
|
|
127
|
+
}),
|
|
128
|
+
embed: s.stringEnum("Include the field group instead of group_id.", ["group"]),
|
|
129
|
+
}, { required: [] }),
|
|
130
|
+
outputSchema: s.object("One page of custom employee fields.", {
|
|
131
|
+
customFields: s.array("Returned custom employee fields.", s.object("Custom field definition, including type and dropdown elements when available.", { id: s.string("Resource ID."), name: s.string("Resource name.") }, { required: [], additionalProperties: true })),
|
|
132
|
+
page: s.integer("Requested page number."),
|
|
133
|
+
perPage: s.integer("Requested page size."),
|
|
134
|
+
totalCount: s.nullable(s.integer("Total matching records from x-total-count, or null when unavailable.")),
|
|
135
|
+
nextPage: s.nullable(s.integer("Next page number from the Link header, or null when no next link is provided.")),
|
|
136
|
+
}, { required: ["customFields", "page", "perPage", "totalCount", "nextPage"] }),
|
|
137
|
+
}),
|
|
138
|
+
defineProviderAction("smarthr", {
|
|
139
|
+
name: "list_custom_field_groups",
|
|
140
|
+
description: "List SmartHR custom employee field groups with pagination.",
|
|
141
|
+
operationType: "read",
|
|
142
|
+
requiredScopes: [],
|
|
143
|
+
inputSchema: s.object("Parameters for listing custom employee field groups.", {
|
|
144
|
+
page: s.integer("Page number, starting at 1. Defaults to 1.", { minimum: 1 }),
|
|
145
|
+
perPage: s.integer("Results per page, from 1 to 100. Defaults to 10.", {
|
|
146
|
+
minimum: 1,
|
|
147
|
+
maximum: 100,
|
|
148
|
+
}),
|
|
149
|
+
embed: s.stringEnum("Include the templates belonging to each group.", ["templates"]),
|
|
150
|
+
}, { required: [] }),
|
|
151
|
+
outputSchema: s.object("One page of custom employee field groups.", {
|
|
152
|
+
customFieldGroups: s.array("Returned custom employee field groups.", s.object("Custom field group information.", { id: s.string("Resource ID."), name: s.string("Resource name.") }, { required: [], additionalProperties: true })),
|
|
153
|
+
page: s.integer("Requested page number."),
|
|
154
|
+
perPage: s.integer("Requested page size."),
|
|
155
|
+
totalCount: s.nullable(s.integer("Total matching records from x-total-count, or null when unavailable.")),
|
|
156
|
+
nextPage: s.nullable(s.integer("Next page number from the Link header, or null when no next link is provided.")),
|
|
157
|
+
}, { required: ["customFieldGroups", "page", "perPage", "totalCount", "nextPage"] }),
|
|
158
|
+
}),
|
|
159
|
+
defineProviderAction("smarthr", {
|
|
160
|
+
name: "list_business_establishments",
|
|
161
|
+
description: "List SmartHR business establishments with pagination.",
|
|
162
|
+
operationType: "read",
|
|
163
|
+
requiredScopes: [],
|
|
164
|
+
inputSchema: s.object("Parameters for listing business establishments.", {
|
|
165
|
+
page: s.integer("Page number, starting at 1. Defaults to 1.", { minimum: 1 }),
|
|
166
|
+
perPage: s.integer("Results per page, from 1 to 100. Defaults to 10.", {
|
|
167
|
+
minimum: 1,
|
|
168
|
+
maximum: 100,
|
|
169
|
+
}),
|
|
170
|
+
embed: s.stringEnum("Related object to include in the response.", [
|
|
171
|
+
"soc_ins_owner",
|
|
172
|
+
"lab_ins_owner",
|
|
173
|
+
"company",
|
|
174
|
+
]),
|
|
175
|
+
}, { required: [] }),
|
|
176
|
+
outputSchema: s.object("One page of business establishments.", {
|
|
177
|
+
businessEstablishments: s.array("Returned business establishments.", s.object("Business establishment information.", { id: s.string("Resource ID."), name: s.string("Resource name.") }, { required: [], additionalProperties: true })),
|
|
178
|
+
page: s.integer("Requested page number."),
|
|
179
|
+
perPage: s.integer("Requested page size."),
|
|
180
|
+
totalCount: s.nullable(s.integer("Total matching records from x-total-count, or null when unavailable.")),
|
|
181
|
+
nextPage: s.nullable(s.integer("Next page number from the Link header, or null when no next link is provided.")),
|
|
182
|
+
}, { required: ["businessEstablishments", "page", "perPage", "totalCount", "nextPage"] }),
|
|
183
|
+
}),
|
|
184
|
+
defineProviderAction("smarthr", {
|
|
185
|
+
name: "get_employee",
|
|
186
|
+
description: "Get a SmartHR employee by ID.",
|
|
187
|
+
operationType: "read",
|
|
188
|
+
requiredScopes: [],
|
|
189
|
+
inputSchema: s.object("Resource lookup parameters.", {
|
|
190
|
+
employeeId: s.string("The employee ID.", { minLength: 1 }),
|
|
191
|
+
fields: s.array("Employee field names to return. Omit to use the upstream default.", s.string("One identifier or field name.", { minLength: 1 }), { minItems: 1 }),
|
|
192
|
+
}, { required: ["employeeId"] }),
|
|
193
|
+
outputSchema: s.object("Requested resource.", {
|
|
194
|
+
employee: s.object("Employee data; fields depend on the token permissions and requested fields.", {
|
|
195
|
+
id: s.string("Employee ID."),
|
|
196
|
+
emp_code: s.string("Employee number."),
|
|
197
|
+
last_name: s.string("Family name."),
|
|
198
|
+
first_name: s.string("Given name."),
|
|
199
|
+
emp_status: s.string("Employment status."),
|
|
200
|
+
}, { required: [], additionalProperties: true }),
|
|
201
|
+
}, { required: ["employee"] }),
|
|
202
|
+
}),
|
|
203
|
+
defineProviderAction("smarthr", {
|
|
204
|
+
name: "get_department",
|
|
205
|
+
description: "Get a SmartHR department by ID.",
|
|
206
|
+
operationType: "read",
|
|
207
|
+
requiredScopes: [],
|
|
208
|
+
inputSchema: s.object("Resource lookup parameters.", { departmentId: s.string("The department ID.", { minLength: 1 }) }, { required: ["departmentId"] }),
|
|
209
|
+
outputSchema: s.object("Requested resource.", {
|
|
210
|
+
department: s.object("Department data, including any nested hierarchy returned by SmartHR.", { id: s.string("Resource ID."), name: s.string("Resource name.") }, { required: [], additionalProperties: true }),
|
|
211
|
+
}, { required: ["department"] }),
|
|
212
|
+
}),
|
|
213
|
+
defineProviderAction("smarthr", {
|
|
214
|
+
name: "get_employment_type",
|
|
215
|
+
description: "Get a SmartHR employment type by ID.",
|
|
216
|
+
operationType: "read",
|
|
217
|
+
requiredScopes: [],
|
|
218
|
+
inputSchema: s.object("Resource lookup parameters.", { employmentTypeId: s.string("The employment type ID.", { minLength: 1 }) }, { required: ["employmentTypeId"] }),
|
|
219
|
+
outputSchema: s.object("Requested resource.", {
|
|
220
|
+
employmentType: s.object("Employment type information.", { id: s.string("Resource ID."), name: s.string("Resource name.") }, { required: [], additionalProperties: true }),
|
|
221
|
+
}, { required: ["employmentType"] }),
|
|
222
|
+
}),
|
|
223
|
+
defineProviderAction("smarthr", {
|
|
224
|
+
name: "create_department",
|
|
225
|
+
description: "Create a SmartHR department.",
|
|
226
|
+
operationType: "write",
|
|
227
|
+
requiredScopes: [],
|
|
228
|
+
inputSchema: s.object("Department write parameters.", {
|
|
229
|
+
name: s.string("Department name; must not contain a slash. Required by the official create and update schemas.", { minLength: 1, pattern: "^[^/]+$" }),
|
|
230
|
+
code: s.string("Department code."),
|
|
231
|
+
position: s.integer("Display position; automatically assigned on creation when omitted."),
|
|
232
|
+
companyId: s.string("Company ID."),
|
|
233
|
+
parentId: s.string("Parent department ID."),
|
|
234
|
+
}, { required: ["name"] }),
|
|
235
|
+
outputSchema: s.object("Department write result.", {
|
|
236
|
+
department: s.object("Department data, including any nested hierarchy returned by SmartHR.", { id: s.string("Resource ID."), name: s.string("Resource name.") }, { required: [], additionalProperties: true }),
|
|
237
|
+
}, { required: ["department"] }),
|
|
238
|
+
}),
|
|
239
|
+
defineProviderAction("smarthr", {
|
|
240
|
+
name: "update_department",
|
|
241
|
+
description: "Partially update a SmartHR department, preserving unspecified attributes. SmartHR requires name.",
|
|
242
|
+
operationType: "write",
|
|
243
|
+
requiredScopes: [],
|
|
244
|
+
inputSchema: s.object("Department write parameters.", {
|
|
245
|
+
departmentId: s.string("The department ID.", { minLength: 1 }),
|
|
246
|
+
name: s.string("Department name; must not contain a slash. Required by the official create and update schemas.", { minLength: 1, pattern: "^[^/]+$" }),
|
|
247
|
+
code: s.string("Department code."),
|
|
248
|
+
position: s.integer("Display position; automatically assigned on creation when omitted."),
|
|
249
|
+
companyId: s.string("Company ID."),
|
|
250
|
+
parentId: s.string("Parent department ID."),
|
|
251
|
+
}, { required: ["name", "departmentId"] }),
|
|
252
|
+
outputSchema: s.object("Department write result.", {
|
|
253
|
+
department: s.object("Department data, including any nested hierarchy returned by SmartHR.", { id: s.string("Resource ID."), name: s.string("Resource name.") }, { required: [], additionalProperties: true }),
|
|
254
|
+
}, { required: ["department"] }),
|
|
255
|
+
}),
|
|
256
|
+
defineProviderAction("smarthr", {
|
|
257
|
+
name: "replace_department",
|
|
258
|
+
description: "Replace a SmartHR department. Unspecified attributes are cleared by SmartHR.",
|
|
259
|
+
operationType: "write",
|
|
260
|
+
requiredScopes: [],
|
|
261
|
+
inputSchema: s.object("Department write parameters.", {
|
|
262
|
+
departmentId: s.string("The department ID.", { minLength: 1 }),
|
|
263
|
+
name: s.string("Department name; must not contain a slash. Required by the official create and update schemas.", { minLength: 1, pattern: "^[^/]+$" }),
|
|
264
|
+
code: s.string("Department code."),
|
|
265
|
+
position: s.integer("Display position; automatically assigned on creation when omitted."),
|
|
266
|
+
companyId: s.string("Company ID."),
|
|
267
|
+
parentId: s.string("Parent department ID."),
|
|
268
|
+
}, { required: ["name", "departmentId"] }),
|
|
269
|
+
outputSchema: s.object("Department write result.", {
|
|
270
|
+
department: s.object("Department data, including any nested hierarchy returned by SmartHR.", { id: s.string("Resource ID."), name: s.string("Resource name.") }, { required: [], additionalProperties: true }),
|
|
271
|
+
}, { required: ["department"] }),
|
|
272
|
+
}),
|
|
273
|
+
defineProviderAction("smarthr", {
|
|
274
|
+
name: "discontinue_department",
|
|
275
|
+
description: "Discontinue a SmartHR department on its last active date. The date must be in the past; scheduled employee changes can prevent discontinuation.",
|
|
276
|
+
operationType: "destructive",
|
|
277
|
+
requiredScopes: [],
|
|
278
|
+
inputSchema: s.object("Department discontinuation parameters.", {
|
|
279
|
+
departmentId: s.string("The department ID.", { minLength: 1 }),
|
|
280
|
+
discontinuedDate: s.string("Last date the department existed, in YYYY-MM-DD format; must be in the past.", {
|
|
281
|
+
format: "date",
|
|
282
|
+
}),
|
|
283
|
+
}, { required: ["departmentId", "discontinuedDate"] }),
|
|
284
|
+
outputSchema: s.object("Department discontinuation result.", { discontinued: s.boolean("Whether SmartHR accepted the discontinuation.") }, { required: ["discontinued"] }),
|
|
285
|
+
}),
|
|
286
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function prepareEmployeeWrite(value: unknown, fetcher: typeof fetch, signal?: AbortSignal): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { optionalRecord, optionalRawString } from "../../core/cast.js";
|
|
3
|
+
import { readBoundedResponseBytes } from "../../core/request.js";
|
|
4
|
+
import { providerInputError, requiredInputString, runProviderRequest } from "../provider-runtime.js";
|
|
5
|
+
import { employeeAttachmentFields } from "./employee-schema.js";
|
|
6
|
+
async function attachmentPayload(value, fieldName, fetcher, signal) {
|
|
7
|
+
if (value === null || value === undefined)
|
|
8
|
+
return value;
|
|
9
|
+
const attachment = optionalRecord(value);
|
|
10
|
+
const fileName = requiredInputString(attachment?.fileName, `${fieldName}.fileName`);
|
|
11
|
+
const fileUrl = requiredInputString(attachment?.fileUrl, `${fieldName}.fileUrl`);
|
|
12
|
+
const bytes = await runProviderRequest({ label: "SmartHR attachment", timeoutMs: 15_000, signal }, async (requestSignal) => {
|
|
13
|
+
const response = await fetcher(fileUrl, { signal: requestSignal });
|
|
14
|
+
if (!response.ok) {
|
|
15
|
+
await response.body?.cancel();
|
|
16
|
+
throw providerInputError(`${fieldName}.fileUrl download failed with HTTP ${response.status}`);
|
|
17
|
+
}
|
|
18
|
+
return readBoundedResponseBytes(response, {
|
|
19
|
+
maxBytes: 10 * 1024 * 1024,
|
|
20
|
+
fieldName: `${fieldName}.fileUrl`,
|
|
21
|
+
createError: providerInputError,
|
|
22
|
+
signal: requestSignal,
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
return { file_name: fileName, content: Buffer.from(bytes).toString("base64") };
|
|
26
|
+
}
|
|
27
|
+
export async function prepareEmployeeWrite(value, fetcher, signal) {
|
|
28
|
+
const employee = optionalRecord(value);
|
|
29
|
+
if (!employee)
|
|
30
|
+
throw providerInputError("employee must be an object");
|
|
31
|
+
const body = structuredClone(employee);
|
|
32
|
+
if (Array.isArray(body.bank_accounts)) {
|
|
33
|
+
const withSetting = body.bank_accounts.filter((entry) => optionalRawString(optionalRecord(entry)?.bank_account_setting_id) !== undefined).length;
|
|
34
|
+
if (withSetting !== 0 && withSetting !== body.bank_accounts.length) {
|
|
35
|
+
throw providerInputError("All bank_accounts must either supply bank_account_setting_id or omit it");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
for (const key of employeeAttachmentFields) {
|
|
39
|
+
if (body[key] !== undefined)
|
|
40
|
+
body[key] = await attachmentPayload(body[key], `employee.${key}`, fetcher, signal);
|
|
41
|
+
}
|
|
42
|
+
if (Array.isArray(body.bank_accounts)) {
|
|
43
|
+
for (const entry of body.bank_accounts) {
|
|
44
|
+
const account = optionalRecord(entry);
|
|
45
|
+
if (account?.bankbook_image !== undefined)
|
|
46
|
+
account.bankbook_image = await attachmentPayload(account.bankbook_image, "employee.bank_accounts.bankbook_image", fetcher, signal);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (Array.isArray(body.custom_fields)) {
|
|
50
|
+
for (const entry of body.custom_fields) {
|
|
51
|
+
const field = optionalRecord(entry);
|
|
52
|
+
if (field?.file !== undefined) {
|
|
53
|
+
const attachment = await attachmentPayload(field.file, "employee.custom_fields.file", fetcher, signal);
|
|
54
|
+
if (attachment) {
|
|
55
|
+
field.value = attachment.content;
|
|
56
|
+
field.file_name = attachment.file_name;
|
|
57
|
+
}
|
|
58
|
+
delete field.file;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return body;
|
|
63
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { s } from "../../core/json-schema.js";
|
|
2
|
+
const employeeFileSchema = s.object("A file downloaded by Connector and attached to SmartHR. The maximum unencoded size is 10 MiB.", {
|
|
3
|
+
fileUrl: s.url("Public HTTP(S) URL of the file."),
|
|
4
|
+
fileName: s.string("File name with extension. Supported: png, jpeg, jpg, pdf, text, txt, csv, conf, log, docx, doc, xlsx, xls, gif.", { minLength: 1 }),
|
|
5
|
+
}, { required: ["fileUrl", "fileName"] });
|
|
6
|
+
const employeeAddressSchema = s.object("Postal address.", {
|
|
7
|
+
country_number: s.string("Country code."),
|
|
8
|
+
zip_code: s.string("Postal code."),
|
|
9
|
+
pref: s.string("Prefecture or province."),
|
|
10
|
+
city: s.string("City or municipality."),
|
|
11
|
+
street: s.string("Street address."),
|
|
12
|
+
building: s.string("Building name and room number."),
|
|
13
|
+
literal_yomi: s.string("Phonetic reading of the address."),
|
|
14
|
+
}, { required: ["city"] });
|
|
15
|
+
const employeeBankAccountSchema = s.object("Employee bank account.", {
|
|
16
|
+
bank_code: s.string("Bank code."),
|
|
17
|
+
bank_branch_code: s.string("Bank branch code."),
|
|
18
|
+
account_type: s.stringEnum("Bank account type.", ["saving", "checking", "deposit"]),
|
|
19
|
+
account_number: s.string("Bank account number."),
|
|
20
|
+
account_holder_name: s.string("Account holder name in katakana."),
|
|
21
|
+
transfer_type: s.stringEnum("Transfer allocation type.", ["full", "specified", "remaining"]),
|
|
22
|
+
specified_transfer_amount: s.integer("Fixed transfer amount."),
|
|
23
|
+
transfer_category: s.stringEnum("Whether the account receives salary, bonus, or both.", [
|
|
24
|
+
"salary_and_bonus",
|
|
25
|
+
"salary",
|
|
26
|
+
"bonus",
|
|
27
|
+
]),
|
|
28
|
+
bankbook_image: s.describe(employeeFileSchema, "Bank account evidence attachment."),
|
|
29
|
+
bank_account_setting_id: s.string("Bank account setting ID."),
|
|
30
|
+
}, {
|
|
31
|
+
required: ["bank_code", "bank_branch_code", "account_type", "account_number", "account_holder_name"],
|
|
32
|
+
});
|
|
33
|
+
const employeeCustomFieldSchema = {
|
|
34
|
+
...s.object("One custom field value or file attachment.", {
|
|
35
|
+
template_id: s.string("Custom field template ID.", { minLength: 1 }),
|
|
36
|
+
value: s.nullable(s.union([s.string("Text, date, or dropdown element ID or physical name."), s.number("Numeric custom field value.")], { description: "Value matching the custom field type; null requests clearing." })),
|
|
37
|
+
file: s.describe(employeeFileSchema, "File for a custom field of type file."),
|
|
38
|
+
}, { required: ["template_id"] }),
|
|
39
|
+
not: { required: ["value", "file"] },
|
|
40
|
+
};
|
|
41
|
+
export const employeeAttachmentFields = [
|
|
42
|
+
"profile_image",
|
|
43
|
+
"resume1",
|
|
44
|
+
"resume2",
|
|
45
|
+
"identity_card_image1",
|
|
46
|
+
"identity_card_image2",
|
|
47
|
+
"address_image",
|
|
48
|
+
"emp_ins_insured_person_number_image",
|
|
49
|
+
"basic_pension_number_image",
|
|
50
|
+
"foreign_resident_card_image1",
|
|
51
|
+
"foreign_resident_card_image2",
|
|
52
|
+
"handicapped_image",
|
|
53
|
+
"student_card_image",
|
|
54
|
+
];
|
|
55
|
+
export const employeeWriteSchema = s.object("Employee fields using official SmartHR names. Omitted fields are unchanged on update. Null requests clearing, subject to SmartHR restrictions on populated identity fields.", {
|
|
56
|
+
emp_status: s.nullable(s.stringEnum("Employment status.", ["employed", "absent", "retired"])),
|
|
57
|
+
user_id: s.nullable(s.string("Associated SmartHR user ID.")),
|
|
58
|
+
biz_establishment_id: s.nullable(s.string("Business establishment ID.")),
|
|
59
|
+
emp_code: s.nullable(s.string("Employee number.")),
|
|
60
|
+
last_name: s.nullable(s.string("Legal family name.")),
|
|
61
|
+
first_name: s.nullable(s.string("Legal given name.")),
|
|
62
|
+
last_name_yomi: s.nullable(s.string("Legal family name in katakana.")),
|
|
63
|
+
first_name_yomi: s.nullable(s.string("Legal given name in katakana.")),
|
|
64
|
+
business_last_name: s.nullable(s.string("Family name used at work.")),
|
|
65
|
+
business_first_name: s.nullable(s.string("Given name used at work.")),
|
|
66
|
+
business_last_name_yomi: s.nullable(s.string("Work family name in katakana.")),
|
|
67
|
+
business_first_name_yomi: s.nullable(s.string("Work given name in katakana.")),
|
|
68
|
+
birth_at: s.nullable(s.string("Date of birth.", { format: "date" })),
|
|
69
|
+
gender: s.nullable(s.stringEnum("Legal gender.", ["male", "female"])),
|
|
70
|
+
tel_number: s.nullable(s.string("Telephone number.")),
|
|
71
|
+
address: s.nullable(s.describe(employeeAddressSchema, "Current residential address.")),
|
|
72
|
+
address_head_of_family: s.nullable(s.string("Head of household at the current address.")),
|
|
73
|
+
address_relation_name: s.nullable(s.string("Relationship to the head of household.")),
|
|
74
|
+
email: s.nullable(s.string("Employee email address; invitations are sent to this address.")),
|
|
75
|
+
emergency_relation_name: s.nullable(s.string("Relationship to the emergency contact.")),
|
|
76
|
+
emergency_last_name: s.nullable(s.string("Emergency contact family name.")),
|
|
77
|
+
emergency_first_name: s.nullable(s.string("Emergency contact given name.")),
|
|
78
|
+
emergency_last_name_yomi: s.nullable(s.string("Emergency contact family name in katakana.")),
|
|
79
|
+
emergency_first_name_yomi: s.nullable(s.string("Emergency contact given name in katakana.")),
|
|
80
|
+
emergency_tel_number: s.nullable(s.string("Emergency contact telephone number.")),
|
|
81
|
+
emergency_address: s.nullable(s.describe(employeeAddressSchema, "Emergency contact address.")),
|
|
82
|
+
resident_card_address: s.nullable(s.describe(employeeAddressSchema, "Address on the resident record.")),
|
|
83
|
+
resident_card_address_head_of_family: s.nullable(s.string("Head of household on the resident record.")),
|
|
84
|
+
resident_card_address_relation_name: s.nullable(s.string("Relationship to the head of household on the resident record.")),
|
|
85
|
+
positions: s.nullable(s.array("Job title names, not job title IDs.", s.string("One name or identifier."))),
|
|
86
|
+
grade: s.nullable(s.string("Grade name, not a grade ID.")),
|
|
87
|
+
job_category: s.nullable(s.string("Job category name, not a category ID.")),
|
|
88
|
+
occupation: s.nullable(s.string("Description of the employee's work.")),
|
|
89
|
+
entered_at: s.nullable(s.string("Employment start date.", { format: "date" })),
|
|
90
|
+
resigned_at: s.nullable(s.string("Resignation date.", { format: "date" })),
|
|
91
|
+
resigned_reason: s.nullable(s.string("Reason for resignation.")),
|
|
92
|
+
recruitment_type: s.nullable(s.string("Recruitment type name, not an ID.")),
|
|
93
|
+
emp_ins_insured_person_number: s.nullable(s.string("Employment insurance insured person number.")),
|
|
94
|
+
emp_ins_insured_person_number_unknown_reason_type: s.nullable(s.stringEnum("Reason the employment insurance number is unavailable.", [
|
|
95
|
+
"no_work_experience",
|
|
96
|
+
"never_joined",
|
|
97
|
+
"unknown",
|
|
98
|
+
])),
|
|
99
|
+
emp_ins_qualified_at: s.nullable(s.string("Employment insurance qualification date.", { format: "date" })),
|
|
100
|
+
emp_ins_disqualified_at: s.nullable(s.string("Employment insurance disqualification date.", { format: "date" })),
|
|
101
|
+
previous_workplace: s.nullable(s.string("Previous employer under employment insurance.")),
|
|
102
|
+
previous_employment_start_on: s.nullable(s.string("Start date at the previous employer under employment insurance.", {
|
|
103
|
+
format: "date",
|
|
104
|
+
})),
|
|
105
|
+
previous_employment_end_on: s.nullable(s.string("End date at the previous employer under employment insurance.", { format: "date" })),
|
|
106
|
+
soc_ins_insured_person_number: s.nullable(s.integer("Employees' pension insurance reference number.")),
|
|
107
|
+
hel_ins_insured_person_number: s.nullable(s.integer("Health insurance reference number.")),
|
|
108
|
+
basic_pension_number: s.nullable(s.string("Basic pension number.")),
|
|
109
|
+
first_enrolling_in_emp_pns_ins_flag: s.nullable(s.boolean("Whether this is the first enrollment in employees' pension insurance.")),
|
|
110
|
+
basic_pension_number_unknown_reason_type: s.nullable(s.stringEnum("Reason the basic pension number is unavailable.", ["non_pensionable", "unknown"])),
|
|
111
|
+
first_workplace: s.nullable(s.string("First employer under employees' pension insurance.")),
|
|
112
|
+
first_workplace_address_text: s.nullable(s.string("Address of the first employer under employees' pension insurance.")),
|
|
113
|
+
first_employment_start_on: s.nullable(s.string("Start date at the first employer under employees' pension insurance.", {
|
|
114
|
+
format: "date",
|
|
115
|
+
})),
|
|
116
|
+
first_employment_end_on: s.nullable(s.string("End date at the first employer under employees' pension insurance.", {
|
|
117
|
+
format: "date",
|
|
118
|
+
})),
|
|
119
|
+
last_workplace: s.nullable(s.string("Last employer under employees' pension insurance.")),
|
|
120
|
+
last_workplace_address_text: s.nullable(s.string("Address of the last employer under employees' pension insurance.")),
|
|
121
|
+
last_employment_start_on: s.nullable(s.string("Start date at the last employer under employees' pension insurance.", {
|
|
122
|
+
format: "date",
|
|
123
|
+
})),
|
|
124
|
+
last_employment_end_on: s.nullable(s.string("End date at the last employer under employees' pension insurance.", {
|
|
125
|
+
format: "date",
|
|
126
|
+
})),
|
|
127
|
+
employees_pension_insurance_qualified_at: s.nullable(s.string("Employees' pension insurance qualification date.", { format: "date" })),
|
|
128
|
+
employees_pension_insurance_disqualified_at: s.nullable(s.string("Employees' pension insurance disqualification date.", { format: "date" })),
|
|
129
|
+
health_insurance_qualified_at: s.nullable(s.string("Health insurance qualification date.", { format: "date" })),
|
|
130
|
+
health_insurance_disqualified_at: s.nullable(s.string("Health insurance disqualification date.", { format: "date" })),
|
|
131
|
+
insurance_premium_calculation_type: s.nullable(s.stringEnum("Social insurance premium calculation method used for payroll.", ["rate", "fixed"])),
|
|
132
|
+
health_insurance_premium_company: s.nullable(s.integer("Employer share of the health insurance premium.")),
|
|
133
|
+
health_insurance_premium_individual: s.nullable(s.integer("Employee share of the health insurance premium.")),
|
|
134
|
+
care_insurance_premium_company: s.nullable(s.integer("Employer share of the long-term care insurance premium.")),
|
|
135
|
+
care_insurance_premium_individual: s.nullable(s.integer("Employee share of the long-term care insurance premium.")),
|
|
136
|
+
child_care_support_fund_company: s.nullable(s.integer("Employer share of the child and childcare support fund.")),
|
|
137
|
+
child_care_support_fund_individual: s.nullable(s.integer("Employee share of the child and childcare support fund.")),
|
|
138
|
+
employees_pension_insurance_premium_company: s.nullable(s.integer("Employer share of the employees' pension insurance premium.")),
|
|
139
|
+
employees_pension_insurance_premium_individual: s.nullable(s.integer("Employee share of the employees' pension insurance premium.")),
|
|
140
|
+
child_care_contribution: s.nullable(s.integer("Childcare contribution amount.")),
|
|
141
|
+
having_spouse: s.nullable(s.boolean("Whether the employee has a spouse.")),
|
|
142
|
+
spouse_yearly_income: s.nullable(s.integer("Spouse's annual income.")),
|
|
143
|
+
monthly_income_currency: s.nullable(s.integer("Monthly remuneration paid in money.")),
|
|
144
|
+
monthly_income_goods: s.nullable(s.integer("Monthly remuneration paid in kind.")),
|
|
145
|
+
monthly_base_salary: s.nullable(s.integer("Monthly base salary.")),
|
|
146
|
+
monthly_standard_income_updated_at: s.nullable(s.string("Revision date of standard monthly remuneration.", { format: "date" })),
|
|
147
|
+
monthly_standard_income_hel: s.nullable(s.integer("Standard monthly remuneration for health insurance.")),
|
|
148
|
+
monthly_standard_income_pns: s.nullable(s.integer("Standard monthly remuneration for employees' pension insurance.")),
|
|
149
|
+
nearest_station_and_line: s.nullable(s.string("Commuting route.")),
|
|
150
|
+
commutation_1_expenses: s.nullable(s.integer("Commuting allowance 1 season-ticket cost.")),
|
|
151
|
+
commutation_1_period: s.nullable(s.stringEnum("Commuting allowance 1 ticket period.", [
|
|
152
|
+
"commutation_period_1_month",
|
|
153
|
+
"commutation_period_3_month",
|
|
154
|
+
"commutation_period_6_month",
|
|
155
|
+
])),
|
|
156
|
+
commutation_1_single_fare: s.nullable(s.integer("Commuting allowance 1 one-way fare.")),
|
|
157
|
+
commutation_2_expenses: s.nullable(s.integer("Commuting allowance 2 season-ticket cost.")),
|
|
158
|
+
commutation_2_period: s.nullable(s.stringEnum("Commuting allowance 2 ticket period.", [
|
|
159
|
+
"commutation_period_1_month",
|
|
160
|
+
"commutation_period_3_month",
|
|
161
|
+
"commutation_period_6_month",
|
|
162
|
+
])),
|
|
163
|
+
commutation_2_single_fare: s.nullable(s.integer("Commuting allowance 2 one-way fare.")),
|
|
164
|
+
foreign_resident_last_name: s.nullable(s.string("Family name in foreign residence records.")),
|
|
165
|
+
foreign_resident_first_name: s.nullable(s.string("Given name in foreign residence records.")),
|
|
166
|
+
foreign_resident_middle_name: s.nullable(s.string("Middle name in foreign residence records.")),
|
|
167
|
+
foreign_resident_card_number: s.nullable(s.string("Residence card number.")),
|
|
168
|
+
nationality_code: s.nullable(s.string("Nationality or country code.")),
|
|
169
|
+
resident_status_type: s.nullable(s.string("Residence status.")),
|
|
170
|
+
resident_status_other_reason: s.nullable(s.string("Reason the residence status is unknown.")),
|
|
171
|
+
resident_end_at: s.nullable(s.string("Residence permission expiry date.", { format: "date" })),
|
|
172
|
+
having_ex_activity_permission: s.nullable(s.stringEnum("Permission to engage in activities outside the residence status.", ["permitted", "none"])),
|
|
173
|
+
other_be_workable_type: s.nullable(s.stringEnum("Dispatch or contract work classification.", ["other_be_workable", "others"])),
|
|
174
|
+
contract_type: s.nullable(s.stringEnum("Employment contract term type.", ["unlimited", "fixed_term"])),
|
|
175
|
+
contract_start_on: s.nullable(s.string("Contract start date.", { format: "date" })),
|
|
176
|
+
contract_end_on: s.nullable(s.string("Contract end date.", { format: "date" })),
|
|
177
|
+
contract_renewal_type: s.nullable(s.stringEnum("Contract renewal policy.", ["renewal", "none", "auto_renewal"])),
|
|
178
|
+
tax_cd: s.nullable(s.stringEnum("Income tax withholding classification.", [
|
|
179
|
+
"kou",
|
|
180
|
+
"otsu",
|
|
181
|
+
"hei",
|
|
182
|
+
"reward",
|
|
183
|
+
"non_resident",
|
|
184
|
+
"no_taxation_required",
|
|
185
|
+
])),
|
|
186
|
+
handicapped_type: s.nullable(s.stringEnum("Disability classification.", ["ordinary_handicapped", "special_handicapped"])),
|
|
187
|
+
handicapped_note_type: s.nullable(s.string("Disability certificate type.")),
|
|
188
|
+
handicapped_note_delivery_at: s.nullable(s.string("Disability certificate issue date.", { format: "date" })),
|
|
189
|
+
working_student_flag: s.nullable(s.boolean("Whether the employee qualifies as a working student.")),
|
|
190
|
+
school_name: s.nullable(s.string("School attended by the working student.")),
|
|
191
|
+
enrolled_at: s.nullable(s.string("School enrollment date.", { format: "date" })),
|
|
192
|
+
working_student_income: s.nullable(s.integer("Estimated income of the working student.")),
|
|
193
|
+
employment_income_flag: s.nullable(s.boolean("Whether the employee has employment income.")),
|
|
194
|
+
business_income_flag: s.nullable(s.boolean("Whether the employee has business income.")),
|
|
195
|
+
devidend_income_flag: s.nullable(s.boolean("Whether the employee has dividend income; the upstream field spelling is preserved.")),
|
|
196
|
+
estate_income_flag: s.nullable(s.boolean("Whether the employee has real estate income.")),
|
|
197
|
+
widow_type: s.nullable(s.stringEnum("Widow or single-parent classification.", ["widow", "single_parent"])),
|
|
198
|
+
widow_reason_type: s.nullable(s.stringEnum("Reason for the widow or single-parent classification.", [
|
|
199
|
+
"divorce",
|
|
200
|
+
"bereavement",
|
|
201
|
+
"missing",
|
|
202
|
+
"unmarried",
|
|
203
|
+
])),
|
|
204
|
+
widow_memo: s.nullable(s.string("Notes about the widow or single-parent classification.")),
|
|
205
|
+
employment_type_id: s.nullable(s.string("Employment type ID.")),
|
|
206
|
+
department_ids: s.nullable(s.array("Department IDs assigned to the employee.", s.string("One name or identifier."))),
|
|
207
|
+
payment_period_id: s.nullable(s.string("Payment period ID.")),
|
|
208
|
+
profile_image: s.nullable(s.describe(employeeFileSchema, "Profile image attachment.")),
|
|
209
|
+
resume1: s.nullable(s.describe(employeeFileSchema, "Resume or work-history attachment 1.")),
|
|
210
|
+
resume2: s.nullable(s.describe(employeeFileSchema, "Resume or work-history attachment 2.")),
|
|
211
|
+
identity_card_image1: s.nullable(s.describe(employeeFileSchema, "Identity document attachment 1.")),
|
|
212
|
+
identity_card_image2: s.nullable(s.describe(employeeFileSchema, "Identity document attachment 2.")),
|
|
213
|
+
address_image: s.nullable(s.describe(employeeFileSchema, "Proof of address attachment.")),
|
|
214
|
+
emp_ins_insured_person_number_image: s.nullable(s.describe(employeeFileSchema, "Employment insurance number evidence attachment.")),
|
|
215
|
+
basic_pension_number_image: s.nullable(s.describe(employeeFileSchema, "Basic pension number evidence attachment.")),
|
|
216
|
+
foreign_resident_card_image1: s.nullable(s.describe(employeeFileSchema, "Residence card attachment 1.")),
|
|
217
|
+
foreign_resident_card_image2: s.nullable(s.describe(employeeFileSchema, "Residence card attachment 2.")),
|
|
218
|
+
handicapped_image: s.nullable(s.describe(employeeFileSchema, "Disability certificate attachment.")),
|
|
219
|
+
student_card_image: s.nullable(s.describe(employeeFileSchema, "Student ID attachment.")),
|
|
220
|
+
bank_accounts: s.nullable(s.array("Bank accounts. Either every entry supplies bank_account_setting_id, or none does; otherwise SmartHR rejects the request.", employeeBankAccountSchema)),
|
|
221
|
+
custom_fields: s.nullable(s.array("Custom field values. Dropdown values accept an element ID or physical name; file fields use file.", employeeCustomFieldSchema)),
|
|
222
|
+
}, { required: [] });
|
|
@@ -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,35 @@
|
|
|
1
|
+
import { defineProviderExecutors, defineProviderProxy, mapProviderActionHandlers, requireApiKeyCredential, } from "../provider-runtime.js";
|
|
2
|
+
import { smarthrActions } from "./actions.js";
|
|
3
|
+
import { executeSmartHrAction, smartHrBaseUrl, validateSmartHrCredential, readSmartHrError } from "./runtime.js";
|
|
4
|
+
const handlers = mapProviderActionHandlers("smarthr", smarthrActions, (action) => (input, context) => executeSmartHrAction({
|
|
5
|
+
apiKey: context.apiKey,
|
|
6
|
+
actionName: action.name,
|
|
7
|
+
input,
|
|
8
|
+
providerMetadata: context.metadata,
|
|
9
|
+
}, context.fetcher, context.signal));
|
|
10
|
+
export const executors = defineProviderExecutors({
|
|
11
|
+
service: "smarthr",
|
|
12
|
+
handlers,
|
|
13
|
+
async createContext(context, fetcher) {
|
|
14
|
+
const credential = await requireApiKeyCredential(context, "smarthr");
|
|
15
|
+
return { apiKey: credential.apiKey, metadata: credential.values, fetcher, signal: context.signal };
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
export const credentialValidators = {
|
|
19
|
+
async apiKey(input, { fetcher, signal }) {
|
|
20
|
+
const { accountId, displayName, tenant } = await validateSmartHrCredential({ ...input.values, apiKey: input.apiKey }, fetcher, signal);
|
|
21
|
+
return { profile: { accountId, displayName }, grantedScopes: [], metadata: tenant };
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export const proxy = defineProviderProxy({
|
|
25
|
+
readError: readSmartHrError,
|
|
26
|
+
service: "smarthr",
|
|
27
|
+
async baseUrl(context) {
|
|
28
|
+
const credential = await requireApiKeyCredential(context, "smarthr");
|
|
29
|
+
return smartHrBaseUrl(credential.values);
|
|
30
|
+
},
|
|
31
|
+
auth: { type: "api_key_authorization", prefix: "Bearer " },
|
|
32
|
+
customizeRequest({ headers }) {
|
|
33
|
+
headers.set("accept", "application/json");
|
|
34
|
+
},
|
|
35
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function readSmartHrNextPage(headers: Headers, requestUrl: URL): number | null;
|