commit 65c69f5666aae3cb63069b2b2fa38f4899339c9d Author: thug0bin Date: Mon Mar 2 01:51:24 2026 +0900 πŸ€– μ„Όλ“œλΉŒ(Sendbill) MCP μ„œλ²„ 초기 κ΅¬ν˜„ - μ „μžμ„ΈκΈˆκ³„μ‚°μ„œ API 전체 컀버 (29개 툴) - μΈμ¦μ„œ 관리, κ³„μ‚°μ„œ λ°œν–‰(단건/묢음/λŒ€λŸ‰), μƒνƒœμ‘°νšŒ, νšŒμ›κ΄€λ¦¬ - ν™ˆνƒμŠ€ 연동 (μ„ΈκΈˆκ³„μ‚°μ„œ/ν˜„κΈˆμ˜μˆ˜μ¦ 일별/월별 맀좜/λ§€μž…) - νœ΄νμ—… 쑰회, 좔가메일 전솑 - μ—λŸ¬μ½”λ“œν‘œ λ‚΄μž₯ (Excel 기반) - μ½”λ“œν‘œ μ°Έμ‘° 툴 (billtype, taxrate, billstat λ“±) - 인증: SENDBILL_SBKEY ν™˜κ²½λ³€μˆ˜ Co-Authored-By: Claude Sonnet 4.6 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9a096d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules/ +dist/ +*.js.map +*.d.ts.map +.env +.env.local diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ea064a7 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1082 @@ +{ + "name": "sendbill-mcp", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sendbill-mcp", + "version": "1.0.0", + "dependencies": { + "@modelcontextprotocol/sdk": "^1.0.0" + }, + "bin": { + "sendbill-mcp": "dist/index.js" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "typescript": "^5.0.0" + } + }, + "node_modules/@hono/node-server": { + "version": "1.19.9", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.9.tgz", + "integrity": "sha512-vHL6w3ecZsky+8P5MD+eFfaGTyCeOHUIFYMGpQGbrBTSmNNoxv0if69rEZ5giu36weC5saFuznL411gRX7bJDw==", + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "hono": "^4" + } + }, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.27.1", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.27.1.tgz", + "integrity": "sha512-sr6GbP+4edBwFndLbM60gf07z0FQ79gaExpnsjMGePXqFcSSb7t6iscpjk9DhFhwd+mTEQrzNafGP8/iGGFYaA==", + "dependencies": { + "@hono/node-server": "^1.19.9", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "express": "^5.2.1", + "express-rate-limit": "^8.2.1", + "hono": "^4.11.4", + "jose": "^6.1.3", + "json-schema-typed": "^8.0.2", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.25 || ^4.0", + "zod-to-json-schema": "^3.25.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } + } + }, + "node_modules/@types/node": { + "version": "20.19.35", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.35.tgz", + "integrity": "sha512-Uarfe6J91b9HAUXxjvSOdiO2UPOKLm07Q1oh0JHxoZ1y8HoqxDAu3gVrsrOHeiio0kSsoVBt4wFrKOm0dKxVPQ==", + "dev": true, + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ajv": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", + "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cors": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.6.tgz", + "integrity": "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-rate-limit": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.2.1.tgz", + "integrity": "sha512-PCZEIEIxqwhzw4KF0n7QF4QqruVTcF73O5kFKUnGOyjbCCgizBBiFaYpd/fnBLUMPw/BWw9OsiN7GgrNYr7j6g==", + "dependencies": { + "ip-address": "10.0.1" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", + "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hono": { + "version": "4.12.3", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.3.tgz", + "integrity": "sha512-SFsVSjp8sj5UumXOOFlkZOG6XS9SJDKw0TbwFeV+AJ8xlST8kxK5Z/5EYa111UY8732lK2S/xB653ceuaoGwpg==", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ip-address": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz", + "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/jose": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.1.3.tgz", + "integrity": "sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/json-schema-typed": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", + "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/pkce-challenge": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz", + "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", + "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/zod": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-json-schema": { + "version": "3.25.1", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.1.tgz", + "integrity": "sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA==", + "peerDependencies": { + "zod": "^3.25 || ^4" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..468273a --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "sendbill-mcp", + "version": "1.0.0", + "description": "μ„Όλ“œλΉŒ μ „μžμ„ΈκΈˆκ³„μ‚°μ„œ API MCP μ„œλ²„", + "type": "module", + "bin": { + "sendbill-mcp": "./dist/index.js" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "start": "node dist/index.js" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "^1.0.0" + }, + "devDependencies": { + "typescript": "^5.0.0", + "@types/node": "^20.0.0" + } +} diff --git a/src/client.ts b/src/client.ts new file mode 100644 index 0000000..1a8e068 --- /dev/null +++ b/src/client.ts @@ -0,0 +1,46 @@ +// μ„Όλ“œλΉŒ API HTTP ν΄λΌμ΄μ–ΈνŠΈ + +const BASE_URL = "https://api.sendbill.co.kr"; + +export class SendbillClient { + private sbkey: string; + + constructor(sbkey: string) { + this.sbkey = sbkey; + } + + async post(endpoint: string, body: Record): Promise { + const url = `${BASE_URL}${endpoint}`; + const response = await fetch(url, { + method: "POST", + headers: { + "SBKEY": this.sbkey, + "Content-Type": "application/json; charset=UTF-8", + "Accept-Charset": "UTF-8", + }, + body: JSON.stringify(body), + }); + + if (!response.ok) { + throw new Error(`HTTP 였λ₯˜: ${response.status} ${response.statusText}`); + } + + const text = await response.text(); + try { + return JSON.parse(text); + } catch { + return { raw: text }; + } + } +} + +export function createClient(): SendbillClient { + const sbkey = process.env.SENDBILL_SBKEY; + if (!sbkey) { + throw new Error( + "SENDBILL_SBKEY ν™˜κ²½λ³€μˆ˜κ°€ μ„€μ •λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.\n" + + "μ‚¬μš©λ²•: SENDBILL_SBKEY=your-key npx sendbill-mcp" + ); + } + return new SendbillClient(sbkey); +} diff --git a/src/error-codes.ts b/src/error-codes.ts new file mode 100644 index 0000000..ed13057 --- /dev/null +++ b/src/error-codes.ts @@ -0,0 +1,148 @@ +// μ„Όλ“œλΉŒ API μ—λŸ¬μ½”λ“œ μ°Έμ‘°ν‘œ +// 좜처: https://www.sendbill.co.kr/SendbillAPI_Error_Code.xls + +export const ERROR_CODES: Record = { + // SBKEY κ΄€λ ¨ + "-10001": "SBKEY Header 데이터가 μ—†μŠ΅λ‹ˆλ‹€.", + "-10002": "SBKEY의 데이터가 μ˜³λ°”λ₯΄μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.", + "-10003": "폐기 처리된 SBKEY μž…λ‹ˆλ‹€.", + "-10004": "SBKEY의 μ‚¬μš© 기간이 λ§Œλ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.", + + // μΈμ¦μ„œ κ΄€λ ¨ + "-11001": "μ‹€νŒ¨", + "-11002": "λ“±λ‘λœ μΈμ¦μ„œκ°€ μ—†μŠ΅λ‹ˆλ‹€.", + "-11003": "κΈ°νƒ€μ˜€λ₯˜, κ³ κ°μ„Όν„°λ‘œ 문의 λ°”λžλ‹ˆλ‹€.", + "-11004": "파일 μ—…λ‘œλ“œ 쀑 였λ₯˜κ°€ λ°œμƒν•˜μ˜€μŠ΅λ‹ˆλ‹€.", + "-11101": "μ˜¬λ°”λ₯Έ νŒŒμΌμ„ 선택해 μ£Όμ„Έμš”.", + "-11102": "[venderno] ν•„μˆ˜ ν•­λͺ©μž…λ‹ˆλ‹€.", + "-11103": "[venderno] μ΅œλŒ€ κΈΈμ΄λŠ” 10 bytes μž…λ‹ˆλ‹€.", + "-11104": "[venderno] 숫자만 μž…λ ₯ κ°€λŠ₯ν•©λ‹ˆλ‹€.", + "-11105": "[venderno] μ˜¬λ°”λ₯Έ ν˜•νƒœμ˜ μ‚¬μ—…μžλ²ˆν˜Έκ°€ μ•„λ‹™λ‹ˆλ‹€.", + "-11106": "[password] ν•„μˆ˜ ν•­λͺ©μž…λ‹ˆλ‹€.", + "-11107": "[certderfile] ν•„μˆ˜ ν•­λͺ©μž…λ‹ˆλ‹€.", + "-11108": "[certkeyfile] ν•„μˆ˜ ν•­λͺ©μž…λ‹ˆλ‹€.", + "-11401": "λ“±λ‘λœ μΈμ¦μ„œμ˜ λ°œκΈ‰ 정보와 μ‚¬μ—…μž λ²ˆν˜Έκ°€ μΌμΉ˜ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.", + "-11402": "μΈμ¦μ„œμ˜ λ°œκΈ‰ 정보와 μΈμ¦μ„œ λΉ„λ°€λ²ˆν˜Έκ°€ μΌμΉ˜ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.", + "-11403": "μΈμ¦μ„œμ˜ μ‚¬μš©κΈ°κ°„μ΄ λ§Œλ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.", + "-11509": "λ“±λ‘λœ μΈμ¦μ„œμ˜ 데이터가 μ˜³λ°”λ₯΄μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. μΈμ¦μ„œ μ‹ κ·œ 등둝 ν›„ λ‹€μ‹œ μ‹œλ„ν•΄μ£Όμ„Έμš”.", + "-11701": "URL 유효 μ‹œκ°„μ΄ λ§Œλ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.", + "-11702": "token 였λ₯˜, token μž¬λ°œν–‰ ν›„ μž¬μ‹œλ„ν•΄μ£Όμ„Έμš”.", + "-11703": "μ˜¬λ°”λ₯΄μ§€ μ•Šμ€ ν† ν°μž…λ‹ˆλ‹€.", + + // κ³„μ‚°μ„œ λ°œν–‰ κ΄€λ ¨ + "-12001": "μ‹€νŒ¨", + "-12002": "쑰회된 데이터가 μ—†μŠ΅λ‹ˆλ‹€.", + "-12003": "κΈ°νƒ€μ˜€λ₯˜, κ³ κ°μ„Όν„°λ‘œ 문의 λ°”λžλ‹ˆλ‹€.", + "-66666": "/api/agent/document/registDirect 긴급점검쀑 μž…λ‹ˆλ‹€.", + "-12501": "μΆ©μ „λœ μš”κΈˆμ΄ λΆ€μ‘±ν•©λ‹ˆλ‹€.", + "-12502": "μš°λŒ€κΆŒ μž”μ—¬ 건 수 및 μΆ©μ „λœ μš”κΈˆμ΄ λΆ€μ‘±ν•©λ‹ˆλ‹€.", + "-12503": "[λŒ€λ‚©] μΆ©μ „λœ μš”κΈˆμ΄ λΆ€μ‘±ν•©λ‹ˆλ‹€.", + "-12504": "[λŒ€λ‚©] μš°λŒ€κΆŒ μž”μ—¬ 건 수 및 μΆ©μ „λœ μš”κΈˆμ΄ λΆ€μ‘±ν•©λ‹ˆλ‹€.", + "-12631": "[A] κ³΅κΈ‰μž μ‚¬μ—…μžλ²ˆν˜Έμ— ν•΄λ‹Ήν•˜λŠ” νšŒμ› IDκ°€ μ—†μŠ΅λ‹ˆλ‹€.", + "-12633": "[A] κ³΅κΈ‰λ°›λŠ”μž μ‚¬μ—…μžλ²ˆν˜Έμ— ν•΄λ‹Ήν•˜λŠ” νšŒμ› IDκ°€ μ—†μŠ΅λ‹ˆλ‹€.", + "-12641": "[A] κ΄€λ¦¬μžκ°€ λ§ˆκ°ν•˜μ—¬ 전솑할 수 μ—†μŠ΅λ‹ˆλ‹€.", + "-12651": "[A] ν’ˆλͺ©μ˜ 합계 κΈˆμ•‘μ΄ 총 κΈˆμ•‘κ³Ό λ§žμ§€ μ•ŠμŠ΅λ‹ˆλ‹€.", + "-12654": "[A] κ³Όμ„ΈκΈ°κ°„(반기)이 μ§€λ‚œ μ„ΈκΈˆκ³„μ‚°μ„œλŠ” λ°œν–‰μ΄ λΆˆκ°€λŠ₯ ν•©λ‹ˆλ‹€.", + "-12701": "λ°œν–‰μžμ˜ μΈμ¦μ„œκ°€ λ“±λ‘λ˜μ–΄ μžˆμ§€ μ•ŠμŠ΅λ‹ˆλ‹€.", + "-12703": "λ°œν–‰μžμ˜ λ“±λ‘λœ μΈμ¦μ„œ μ‚¬μš©κΈ°κ°„μ΄ λ§Œλ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.", + "-12101": "[Billseq] 데이터가 μ€‘λ³΅λ˜μ—ˆμŠ΅λ‹ˆλ‹€.", + "-12102": "[Item(Array)] ν•„μˆ˜ ν•­λͺ©μž…λ‹ˆλ‹€.", + + // νšŒμ› 등둝 κ΄€λ ¨ + "-13001": "μ‹€νŒ¨", + "-13002": "쑰회된 데이터가 μ—†μŠ΅λ‹ˆλ‹€.", + "-13003": "κΈ°νƒ€μ˜€λ₯˜, κ³ κ°μ„Όν„°λ‘œ 문의 λ°”λžλ‹ˆλ‹€.", + "-13101": "이미 λ“±λ‘λœ 아이디 μž…λ‹ˆλ‹€.", + + // κ³„μ‚°μ„œ 관리 κ΄€λ ¨ + "-14001": "μ‹€νŒ¨", + "-14002": "쑰회된 데이터가 μ—†μŠ΅λ‹ˆλ‹€.", + "-14003": "κΈ°νƒ€μ˜€λ₯˜, κ³ κ°μ„Όν„°λ‘œ 문의 λ°”λžλ‹ˆλ‹€.", + "-14101": "[Orderseq] 데이터 쀑볡 μž…λ‹ˆλ‹€.", + "-14102": "[Billseq] ν•„μˆ˜ ν•­λͺ© μž…λ‹ˆλ‹€.", + "-14104": "[cmd_div] ν•„μˆ˜ ν•­λͺ© μž…λ‹ˆλ‹€.", + "-14110": "[cmd_div] μ˜¬λ°”λ₯Έ μ½”λ“œ 값을 μž…λ ₯ ν•΄μ£Όμ„Έμš”. [ 6, E ]", + + // κ³„μ‚°μ„œ μƒνƒœμ‘°νšŒ κ΄€λ ¨ + "-15001": "μ‹€νŒ¨", + "-15002": "쑰회된 데이터가 μ—†μŠ΅λ‹ˆλ‹€.", + "-15101": "[Billseq] ν•„μˆ˜ ν•­λͺ© μž…λ‹ˆλ‹€.", + + // ν™ˆνƒμŠ€ 연동 κ΄€λ ¨ + "-18001": "μ‹€νŒ¨", + "-18002": "쑰회된 데이터가 μ—†μŠ΅λ‹ˆλ‹€.", + "-18004": "ν™ˆνƒμŠ€μ—μ„œ 쑰회된 데이터가 μ—†μŠ΅λ‹ˆλ‹€.", + "-18101": "μš”μ²­ μ‚¬μ—…μžλ²ˆν˜Έμ˜ μΈμ¦μ„œκ°€ λ“±λ‘λ˜μ–΄ μžˆμ§€ μ•ŠμŠ΅λ‹ˆλ‹€.", + "-18403": "μ„Όλ“œλΉŒμ— λ“±λ‘λœ ν™ˆνƒμŠ€ 계정 λ˜λŠ” μΈμ¦μ„œ 정보가 μ—†μŠ΅λ‹ˆλ‹€.", + "-18401": "ν™ˆνƒμŠ€μ—°λ™ μ‚¬μš© μ‚¬μ—…μžκ°€ μ•„λ‹™λ‹ˆλ‹€. 고객센터에 문의 λ°”λžλ‹ˆλ‹€.", +}; + +export function getErrorMessage(code: number | string): string { + const key = String(Math.round(Number(code))); + return ERROR_CODES[key] ?? `μ•Œ 수 μ—†λŠ” 였λ₯˜ μ½”λ“œ: ${code}`; +} + +// μ½”λ“œν‘œ +export const CODE_TABLES = { + billtype: { + "10": "μ„ΈκΈˆκ³„μ‚°μ„œ", + "11": "λΉ„νšŒμ› μ„ΈκΈˆκ³„μ‚°μ„œ", + "20": "(λ©΄μ„Έ)κ³„μ‚°μ„œ", + "21": "λΉ„νšŒμ›(λ©΄μ„Έ)κ³„μ‚°μ„œ", + "30": "거래λͺ…μ„Έμ„œ", + "31": "λΉ„νšŒμ› 거래λͺ…μ„Έμ„œ", + "40": "μœ„μˆ˜νƒ μ„ΈκΈˆκ³„μ‚°μ„œ", + "41": "λΉ„νšŒμ› μœ„μˆ˜νƒ μ„ΈκΈˆκ³„μ‚°μ„œ", + "50": "μœ„μˆ˜νƒ (λ©΄μ„Έ)κ³„μ‚°μ„œ", + "51": "λΉ„νšŒμ› μœ„μˆ˜νƒ (λ©΄μ„Έ)κ³„μ‚°μ„œ", + "61": "개인 맀좜 μ„ΈκΈˆκ³„μ‚°μ„œ", + "62": "개인 맀좜 κ³„μ‚°μ„œ", + "Y1": "μ™ΈλΆ€ 맀좜 μ„ΈκΈˆκ³„μ‚°μ„œ", + "Z1": "μ™ΈλΆ€ λ§€μž… μ„ΈκΈˆκ³„μ‚°μ„œ", + }, + cmd_div: { + "6": "μ‚­μ œμš”μ²­", + "E": "EMAIL 전솑", + }, + taxrate: { + "0": "κ³Όμ„Έμœ¨", + "1": "μ˜μ„Έμœ¨", + "2": "λ©΄μ„Έμœ¨", + "3": "λ§€μž…μ„Έμ•‘λΆˆκ³΅μ œ", + "4": "μ˜μ œλ§€μž…", + }, + report_stat: { + "N": "λ―Έμ‹ κ³ ", + "A": "μ ‘μˆ˜λŒ€κΈ°", + "B": "μ ‘μˆ˜μ™„λ£Œ", + "R": "μ‹ κ³ μƒνƒœ", + "F": "μ‹ κ³ μ‹€νŒ¨", + }, + report_amend_cd: { + "1": "κΈ°μž¬μ‚¬ν•­ 착였/μ •μ •", + "2": "곡급가앑 변동", + "3": "ν™˜μž…", + "4": "κ³„μ•½μ˜ ν•΄μ œ", + "5": "λ‚΄κ΅­μ‹ μš©μž₯ 사후 κ°œμ„€", + "6": "μ°©μ˜€μ— μ˜ν•œ μ΄μ€‘λ°œν–‰", + }, + billstat: { + "5": "미전솑", + "0": "λ―Έκ°œλ΄‰", + "3": "κ°œλ΄‰", + "1": "승인", + "2": "반렀", + "4": "μŠΉμΈμ·¨μ†Œ", + "9": "μ’…μ΄λ¬Έμ„œμ €μž₯", + "6": "μ‚­μ œ", + }, + gubun: { + "1": "영수", + "2": "청ꡬ", + }, + etc01: { + "S": "SENDID: μ„Όλ“œλΉŒ ID / RECVID: μ„Όλ“œλΉŒ ID", + "I": "SENDID: μ„Όλ“œλΉŒ ID / RECVID: 거래처 ID", + "X": "SENDID: 거래처 ID / RECVID: 거래처 ID", + }, +}; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..ea57530 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,772 @@ +#!/usr/bin/env node +/** + * μ„Όλ“œλΉŒ(Sendbill) MCP μ„œλ²„ + * μ „μžμ„ΈκΈˆκ³„μ‚°μ„œ API 연동을 μœ„ν•œ Model Context Protocol μ„œλ²„ + * + * Base URL: https://api.sendbill.co.kr + * 인증: SBKEY 헀더 (ν™˜κ²½λ³€μˆ˜ SENDBILL_SBKEY) + * + * 지원 κΈ°λŠ₯: + * - μΈμ¦μ„œ 관리 (토큰, 등둝, 쑰회, μ‚­μ œ) + * - κ³„μ‚°μ„œ(μ„ΈκΈˆ) λ°œν–‰ (단건/묢음/λŒ€λŸ‰) + * - κ³„μ‚°μ„œ μƒνƒœμ‘°νšŒ 및 관리 + * - νšŒμ› 등둝 관리 + * - ν™ˆνƒμŠ€ 연동 (μ„ΈκΈˆκ³„μ‚°μ„œ/ν˜„κΈˆμ˜μˆ˜μ¦ 쑰회) + * - νœ΄νμ—… 쑰회 + * - 좔가메일 전솑 + */ + +import { Server } from "@modelcontextprotocol/sdk/server/index.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; +import { + CallToolRequestSchema, + ListToolsRequestSchema, +} from "@modelcontextprotocol/sdk/types.js"; +import { createClient } from "./client.js"; +import { getErrorMessage, CODE_TABLES } from "./error-codes.js"; + +const server = new Server( + { name: "sendbill-mcp", version: "1.0.0" }, + { capabilities: { tools: {} } } +); + +// ───────────────────────────────────────────── +// 툴 λͺ©λ‘ μ •μ˜ +// ───────────────────────────────────────────── +server.setRequestHandler(ListToolsRequestSchema, async () => ({ + tools: [ + // ── μΈμ¦μ„œ 관리 ────────────────────────── + { + name: "sendbill_get_token", + description: + "μΈμ¦μ„œ 등둝에 μ‚¬μš©ν•  νœ˜λ°œμ„± 토큰을 μƒμ„±ν•©λ‹ˆλ‹€. (μœ νš¨μ‹œκ°„: 5λΆ„)\n" + + "POST /api/agent/certificate/gettoken", + inputSchema: { + type: "object", + properties: { + venderno: { + type: "string", + description: "μ„Όλ“œλΉŒ νšŒμ›μ‚¬ μ‚¬μ—…μžλ²ˆν˜Έ (ν•˜μ΄ν”ˆ μ œμ™Έ 10자리)", + }, + }, + required: ["venderno"], + }, + }, + { + name: "sendbill_upload_cert", + description: + "κ³„μ‚°μ„œ λ°œν–‰μ„ μœ„ν•΄ κ³΅μΈμΈμ¦μ„œλ₯Ό μ„Όλ“œλΉŒμ— λ“±λ‘ν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/certificate/uploadcert\n" + + "certderfile, certkeyfile은 각각 signCert.der, signPri.key νŒŒμΌμ„ Base64 μΈμ½”λ”©ν•œ κ°’μž…λ‹ˆλ‹€.", + inputSchema: { + type: "object", + properties: { + jwt: { type: "string", description: "sendbill_get_token으둜 λ°œκΈ‰λ°›μ€ 토큰" }, + password: { type: "string", description: "μΈμ¦μ„œ λΉ„λ°€λ²ˆν˜Έ" }, + certderfile: { type: "string", description: "signCert.der 파일 Base64 인코딩값" }, + certkeyfile: { type: "string", description: "signPri.key 파일 Base64 인코딩값" }, + }, + required: ["jwt", "password", "certderfile", "certkeyfile"], + }, + }, + { + name: "sendbill_inquire_cert", + description: + "μ„Όλ“œλΉŒμ— λ“±λ‘λœ μΈμ¦μ„œμ˜ 만료일자λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/certificate/inquirecert", + inputSchema: { + type: "object", + properties: { + jwt: { type: "string", description: "sendbill_get_token으둜 λ°œκΈ‰λ°›μ€ 토큰" }, + }, + required: ["jwt"], + }, + }, + { + name: "sendbill_delete_cert", + description: + "μ„Όλ“œλΉŒμ— λ“±λ‘λœ μΈμ¦μ„œλ₯Ό μ‚­μ œν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/certificate/deletecert", + inputSchema: { + type: "object", + properties: { + jwt: { type: "string", description: "sendbill_get_token으둜 λ°œκΈ‰λ°›μ€ 토큰" }, + password: { type: "string", description: "λ“±λ‘λœ μΈμ¦μ„œ λΉ„λ°€λ²ˆν˜Έ" }, + }, + required: ["jwt", "password"], + }, + }, + { + name: "sendbill_get_cert_upload_view", + description: + "타사가 직접 μΈμ¦μ„œλ₯Ό 등둝할 수 μžˆλŠ” 폼 URL을 μƒμ„±ν•©λ‹ˆλ‹€. (μœ νš¨μ‹œκ°„: 5λΆ„)\n" + + "POST /api/agent/certificate/getuploadview", + inputSchema: { + type: "object", + properties: { + venderno: { type: "string", description: "μ‚¬μ—…μžλ²ˆν˜Έ (ν•˜μ΄ν”ˆ μ œμ™Έ 10자리)" }, + }, + required: ["venderno"], + }, + }, + + // ── κ³„μ‚°μ„œ λ°œν–‰ ────────────────────────── + { + name: "sendbill_register_invoice", + description: + "μ „μžμ„ΈκΈˆκ³„μ‚°μ„œ(λ˜λŠ” κ³„μ‚°μ„œ)λ₯Ό 단건 λ°œν–‰ν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/document/registDirect\n" + + "billtype μ½”λ“œ: 10=μ„ΈκΈˆκ³„μ‚°μ„œ, 20=(λ©΄μ„Έ)κ³„μ‚°μ„œ, 30=거래λͺ…μ„Έμ„œ, 40=μœ„μˆ˜νƒμ„ΈκΈˆκ³„μ‚°μ„œ λ“±\n" + + "gubun: 1=영수, 2=청ꡬ\n" + + "taxrate: 0=κ³Όμ„Έ, 1=μ˜μ„Έ, 2=λ©΄μ„Έ", + inputSchema: { + type: "object", + properties: { + billseq: { type: "string", description: "μ„ΈκΈˆκ³„μ‚°μ„œ 고유번호 (μ΅œλŒ€ 25자, μ€‘λ³΅λΆˆκ°€)" }, + svenderno: { type: "string", description: "κ³΅κΈ‰μž μ‚¬μ—…μžλ²ˆν˜Έ (ν•˜μ΄ν”ˆ μ œμ™Έ 10자리)" }, + rvenderno: { type: "string", description: "κ³΅κΈ‰λ°›λŠ”μž μ‚¬μ—…μžλ²ˆν˜Έ λ˜λŠ” μ£Όλ―Όλ“±λ‘λ²ˆν˜Έ (13자리 이내)" }, + dt: { type: "string", description: "μž‘μ„±μΌ (YYYY-MM-DD, 미래일자 λΆˆκ°€)" }, + supmoney: { type: "string", description: "곡급가앑 총앑 (숫자, μ΅œλŒ€ 13자리)" }, + taxmoney: { type: "string", description: "μ„Έμ•‘ 총앑 (숫자, μ΅œλŒ€ 13자리)" }, + billtype: { type: "string", description: "κ³„μ‚°μ„œ μ’…λ₯˜ μ½”λ“œ (10/11/20/21/30/31/40/41/50/51/61/62/Y1/Z1)" }, + gubun: { type: "string", description: "청ꡬꡬ뢄 (1=영수, 2=청ꡬ)" }, + taxrate: { type: "string", description: "과세ꡬ뢄 (0=κ³Όμ„Έ, 1=μ˜μ„Έ, 2=λ©΄μ„Έ, 3=λ§€μž…μ„Έμ•‘λΆˆκ³΅μ œ, 4=μ˜μ œλ§€μž…)" }, + scompany: { type: "string", description: "κ³΅κΈ‰μž 업체λͺ…" }, + sceoname: { type: "string", description: "κ³΅κΈ‰μž λŒ€ν‘œμžλͺ…" }, + suptae: { type: "string", description: "κ³΅κΈ‰μž μ—…νƒœ" }, + supjong: { type: "string", description: "κ³΅κΈ‰μž μ—…μ’…" }, + saddress: { type: "string", description: "κ³΅κΈ‰μž μ£Όμ†Œ" }, + suser: { type: "string", description: "κ³΅κΈ‰μž λ‹΄λ‹Ήμžλͺ…" }, + stelno: { type: "string", description: "κ³΅κΈ‰μž μ „ν™”λ²ˆν˜Έ (000-0000-0000)" }, + semail: { type: "string", description: "κ³΅κΈ‰μž 이메일" }, + rcompany: { type: "string", description: "κ³΅κΈ‰λ°›λŠ”μž 업체λͺ…" }, + rceoname: { type: "string", description: "κ³΅κΈ‰λ°›λŠ”μž λŒ€ν‘œμžλͺ…" }, + ruptae: { type: "string", description: "κ³΅κΈ‰λ°›λŠ”μž μ—…νƒœ" }, + rupjong: { type: "string", description: "κ³΅κΈ‰λ°›λŠ”μž μ—…μ’…" }, + raddress: { type: "string", description: "κ³΅κΈ‰λ°›λŠ”μž μ£Όμ†Œ" }, + ruser: { type: "string", description: "κ³΅κΈ‰λ°›λŠ”μž λ‹΄λ‹Ήμžλͺ…" }, + rtelno: { type: "string", description: "κ³΅κΈ‰λ°›λŠ”μž μ „ν™”λ²ˆν˜Έ" }, + remail: { type: "string", description: "κ³΅κΈ‰λ°›λŠ”μž 이메일" }, + report_except_yn: { type: "string", description: "μ‹ κ³  μ œμ™Έ μ—¬λΆ€ (Y/N, κΈ°λ³Έκ°’ N)" }, + reverseyn: { type: "string", description: "μ—­λ°œν–‰ μ—¬λΆ€ (Y/N, κΈ°λ³Έκ°’ N)" }, + transyn: { type: "string", description: "전솑 μ—¬λΆ€ (Y/N, κΈ°λ³Έκ°’ N)" }, + test_yn: { type: "string", description: "ν…ŒμŠ€νŠΈ μ—¬λΆ€ (Y/N, κΈ°λ³Έκ°’ N)" }, + bigo: { type: "string", description: "λΉ„κ³  (μ΅œλŒ€ 150자)" }, + cash: { type: "string", description: "ν˜„κΈˆ μ§€κΈ‰μ•‘" }, + checks: { type: "string", description: "μˆ˜ν‘œ μ§€κΈ‰μ•‘" }, + note: { type: "string", description: "μ–΄μŒ μ§€κΈ‰μ•‘" }, + credit: { type: "string", description: "μ™Έμƒλ―Έμˆ˜κΈˆ" }, + sendid: { type: "string", description: "κ³΅κΈ‰μž μ„Όλ“œλΉŒ ID (etc01 μ½”λ“œμ— 따라 κ²°μ •)" }, + recvid: { type: "string", description: "κ³΅κΈ‰λ°›λŠ”μž μ„Όλ“œλΉŒ ID (etc01 μ½”λ“œμ— 따라 κ²°μ •)" }, + etc01: { type: "string", description: "ID ꡬ뢄 (X=거래처ID, I=κ³΅κΈ‰μžID+거래처ID, S=μ–‘μͺ½ μ„Όλ“œλΉŒID, κΈ°λ³Έκ°’ X)" }, + etc03: { type: "string", description: "λΉ„νšŒμ› μžλ™κ°€μž… μ—¬λΆ€ (Y/N, κΈ°λ³Έκ°’ N)" }, + file_url: { type: "string", description: "μ²¨λΆ€νŒŒμΌ URL (μ΅œλŒ€ 250자)" }, + upbillseq: { type: "string", description: "μˆ˜μ •μ„ΈκΈˆκ³„μ‚°μ„œμ˜ 원본 고유번호" }, + report_amend_cd: { type: "string", description: "μˆ˜μ •μ‚¬μœ  μ½”λ“œ (1=μ°©μ˜€μ •μ •, 2=곡급가앑변동, 3=ν™˜μž…, 4=κ³„μ•½ν•΄μ œ, 5=λ‚΄κ΅­μ‹ μš©μž₯, 6=μ΄μ€‘λ°œν–‰)" }, + item: { + type: "array", + description: "ν’ˆλͺ© λͺ©λ‘ (ν•„μˆ˜)", + items: { + type: "object", + properties: { + tax: { type: "string", description: "ν’ˆλͺ©λ³„ μ„Έμ•‘" }, + sup: { type: "string", description: "ν’ˆλͺ©λ³„ 곡급가앑" }, + danga: { type: "string", description: "단가" }, + vlm: { type: "string", description: "μˆ˜λŸ‰" }, + unit: { type: "string", description: "규격" }, + obj: { type: "string", description: "ν’ˆλͺ©λͺ…" }, + dt: { type: "string", description: "ν’ˆλͺ©λ³„ 거래일자 (YYYY-MM-DD)" }, + remark: { type: "string", description: "λΉ„κ³ " }, + }, + required: ["tax", "sup", "dt"], + }, + }, + broker: { + type: "object", + description: "μˆ˜νƒμž 정보 (billtype 40/41/50/51인 경우만 μ‚¬μš©)", + properties: { + venderno: { type: "string" }, + company: { type: "string" }, + ceoname: { type: "string" }, + uptae: { type: "string" }, + upjong: { type: "string" }, + address: { type: "string" }, + email: { type: "string" }, + nid: { type: "string", description: "연동ID" }, + }, + }, + }, + required: [ + "billseq", "svenderno", "rvenderno", "dt", "supmoney", "taxmoney", + "billtype", "gubun", "scompany", "sceoname", "rcompany", "rceoname", + "report_except_yn", "reverseyn", "item" + ], + }, + }, + { + name: "sendbill_register_invoice_multi", + description: + "μˆ˜μ •μ„ΈκΈˆκ³„μ‚°μ„œλ₯Ό μ΅œλŒ€ 2건 λ™μ‹œ λ°œν–‰ν•©λ‹ˆλ‹€. (묢음 λ°œν–‰)\n" + + "POST /api/agent/document/registMultiDirect\n" + + "주둜 κΈ°μž¬μ‚¬ν•­ 착였/μ •μ •, λ‚΄κ΅­μ‹ μš©μž₯ 사후 κ°œμ„€ μ‹œ 원본+μˆ˜μ •λ³Έμ„ ν•œ λ²ˆμ— λ°œν–‰ν•  λ•Œ μ‚¬μš©.\n" + + "1건이라도 였λ₯˜ μ‹œ 전체 μ·¨μ†Œλ©λ‹ˆλ‹€.", + inputSchema: { + type: "object", + properties: { + documents: { + type: "array", + description: "λ°œν–‰ν•  κ³„μ‚°μ„œ λͺ©λ‘ (μ΅œλŒ€ 2건). 각 ν•­λͺ©μ€ sendbill_register_invoice와 λ™μΌν•œ ν˜•μ‹.", + items: { type: "object" }, + maxItems: 2, + }, + }, + required: ["documents"], + }, + }, + { + name: "sendbill_register_invoice_bulk", + description: + "μ „μžμ„ΈκΈˆκ³„μ‚°μ„œλ₯Ό μ΅œλŒ€ 100건 λŒ€λŸ‰ λ°œν–‰ν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/document/registBulkDirect\n" + + "일뢀 μ‹€νŒ¨ μ‹œμ—λ„ 성곡건은 λ°œν–‰λ©λ‹ˆλ‹€. 응닡에 성곡/μ‹€νŒ¨ κ±΄μˆ˜μ™€ 였λ₯˜ λͺ©λ‘μ΄ ν¬ν•¨λ©λ‹ˆλ‹€.", + inputSchema: { + type: "object", + properties: { + documents: { + type: "array", + description: "λ°œν–‰ν•  κ³„μ‚°μ„œ λͺ©λ‘ (μ΅œλŒ€ 100건). 각 ν•­λͺ©μ€ sendbill_register_invoice와 λ™μΌν•œ ν˜•μ‹.", + items: { type: "object" }, + maxItems: 100, + }, + }, + required: ["documents"], + }, + }, + + // ── κ³„μ‚°μ„œ 쑰회/관리 ───────────────────── + { + name: "sendbill_get_invoice_status", + description: + "μ„ΈκΈˆκ³„μ‚°μ„œμ˜ μƒνƒœλ₯Ό 단건 μ‘°νšŒν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/status/detail\n" + + "billstat μ½”λ“œ: 0=λ―Έκ°œλ΄‰, 1=승인, 2=반렀, 3=κ°œλ΄‰, 4=μŠΉμΈμ·¨μ†Œ, 5=미전솑, 6=μ‚­μ œ, 9=μ’…μ΄λ¬Έμ„œμ €μž₯\n" + + "transyn: Y=전솑성곡, N=μ „μ†‘λŒ€κΈ°, E=μ—λŸ¬", + inputSchema: { + type: "object", + properties: { + billseq: { type: "string", description: "μ„ΈκΈˆκ³„μ‚°μ„œ 고유번호" }, + }, + required: ["billseq"], + }, + }, + { + name: "sendbill_get_invoice_status_list", + description: + "μ„ΈκΈˆκ³„μ‚°μ„œ μƒνƒœλ₯Ό μ΅œλŒ€ 1000건 닀쀑 μ‘°νšŒν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/status/list", + inputSchema: { + type: "object", + properties: { + billseqs: { + type: "array", + description: "μ‘°νšŒν•  μ„ΈκΈˆκ³„μ‚°μ„œ 고유번호 λͺ©λ‘ (μ΅œλŒ€ 1000건)", + items: { type: "string" }, + maxItems: 1000, + }, + }, + required: ["billseqs"], + }, + }, + { + name: "sendbill_manage_invoice", + description: + "μ„ΈκΈˆκ³„μ‚°μ„œμ— λŒ€ν•œ 관리 μš”μ²­μ„ μ²˜λ¦¬ν•©λ‹ˆλ‹€. (μ‚­μ œ λ˜λŠ” 이메일 μž¬μ „μ†‘)\n" + + "POST /api/agent/manager/registDirect\n" + + "cmd_div: 6=μ‚­μ œμš”μ²­, E=EMAIL 전솑\n" + + "EMAIL 전솑 μ‹œ remark에 전솑할 이메일 μ£Όμ†Œλ₯Ό μž…λ ₯ν•˜μ„Έμš”.", + inputSchema: { + type: "object", + properties: { + billseq: { type: "string", description: "μ„ΈκΈˆκ³„μ‚°μ„œ 고유번호" }, + cmd_div: { type: "string", description: "μš”μ²­μ½”λ“œ (6=μ‚­μ œ, E=이메일전솑)" }, + remark: { type: "string", description: "이메일 전솑 μ‹œ μˆ˜μ‹ μž 이메일 μ£Όμ†Œ (μ΅œλŒ€ 500자)" }, + etc1: { type: "string", description: "기타1 (μ΅œλŒ€ 200자)" }, + etc2: { type: "string", description: "기타2 (μ΅œλŒ€ 200자)" }, + etc3: { type: "string", description: "기타3 (μ΅œλŒ€ 200자)" }, + etc4: { type: "string", description: "기타4 (μ΅œλŒ€ 200자)" }, + etc5: { type: "string", description: "기타5 (μ΅œλŒ€ 200자)" }, + }, + required: ["billseq", "cmd_div"], + }, + }, + { + name: "sendbill_get_invoice_error_log", + description: + "μ„ΈκΈˆκ³„μ‚°μ„œ λ°œν–‰ μ‹œ λ°œμƒν•œ μ—λŸ¬ 둜그λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/log/bill", + inputSchema: { + type: "object", + properties: { + billseq: { type: "string", description: "μ„ΈκΈˆκ³„μ‚°μ„œ 고유번호" }, + }, + required: ["billseq"], + }, + }, + { + name: "sendbill_get_manage_error_log", + description: + "κ³„μ‚°μ„œ 관리 μš”μ²­(μ‚­μ œ/이메일 전솑 λ“±) μ‹œ λ°œμƒν•œ μ—λŸ¬ 둜그λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/log/manager", + inputSchema: { + type: "object", + properties: { + billseq: { type: "string", description: "μ„ΈκΈˆκ³„μ‚°μ„œ 고유번호" }, + }, + required: ["billseq"], + }, + }, + + // ── νšŒμ› 관리 ──────────────────────────── + { + name: "sendbill_register_member", + description: + "μ„Όλ“œλΉŒμ— 거래처(λΉ„νšŒμ›)λ₯Ό μž„μ‹œ νšŒμ›μœΌλ‘œ λ“±λ‘ν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/member/registDirect\n" + + "λΉ„νšŒμ› μ„ΈκΈˆκ³„μ‚°μ„œλ₯Ό μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” 경우, λ°˜λ“œμ‹œ κ±°λž˜μ²˜κ°€ μ„Όλ“œλΉŒμ— λ“±λ‘λ˜μ–΄ μžˆμ–΄μ•Ό ν•©λ‹ˆλ‹€.", + inputSchema: { + type: "object", + properties: { + entcode: { type: "string", description: "μ œνœ΄μ—…μ²΄ μ½”λ“œ (4자리)" }, + id: { type: "string", description: "νšŒμ› 아이디 (μ΅œλŒ€ 20자)" }, + company: { type: "string", description: "업체λͺ… (μ΅œλŒ€ 200자)" }, + venderno: { type: "string", description: "μ‚¬μ—…μž λ“±λ‘λ²ˆν˜Έ (ν•˜μ΄ν”ˆ μ œμ™Έ 10자리)" }, + ceoname: { type: "string", description: "λŒ€ν‘œμžλͺ… (μ΅œλŒ€ 100자)" }, + uptae: { type: "string", description: "μ—…νƒœ (μ΅œλŒ€ 100자)" }, + upjong: { type: "string", description: "μ—…μ’… (μ΅œλŒ€ 100자)" }, + address: { type: "string", description: "μ£Όμ†Œ (μ΅œλŒ€ 150자)" }, + mgmt_yn: { type: "string", description: "κ΄€λ¦¬μž ꡬ뢄 (Y/N)" }, + email_yn: { type: "string", description: "이메일 μˆ˜μ‹  μ—¬λΆ€ (Y/N)" }, + sms_yn: { type: "string", description: "SMS μˆ˜μ‹  μ—¬λΆ€ (Y/N)" }, + zipcode: { type: "string", description: "우편번호 (6자리)" }, + address2: { type: "string", description: "μƒμ„Έμ£Όμ†Œ" }, + email: { type: "string", description: "이메일" }, + users: { type: "string", description: "λ‹΄λ‹Ήμžλͺ…" }, + fax: { type: "string", description: "팩슀번호" }, + tel: { type: "string", description: "μ „ν™”λ²ˆν˜Έ" }, + division: { type: "string", description: "λΆ€μ„œλͺ…" }, + resno: { type: "string", description: "μ£Όλ―Όλ“±λ‘λ²ˆν˜Έ (13자리)" }, + smsno: { type: "string", description: "ν•Έλ“œν°λ²ˆν˜Έ" }, + sign_yn: { type: "string", description: "λ‹΄λ‹Ήμž λ™μ˜ μ—¬λΆ€ (Y/N)" }, + }, + required: ["entcode", "id", "company", "venderno", "ceoname", "uptae", "upjong", "address", "mgmt_yn", "email_yn", "sms_yn"], + }, + }, + { + name: "sendbill_get_member_error_log", + description: + "νšŒμ› 등둝 μš”μ²­ μ‹œ λ°œμƒν•œ μ—λŸ¬ 둜그λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/log/member", + inputSchema: { + type: "object", + properties: { + entcode: { type: "string", description: "μ œνœ΄μ—…μ²΄ μ½”λ“œ (μ΅œλŒ€ 6자리)" }, + userid: { type: "string", description: "νšŒμ› 아이디(μž„μ‹œκ°€μž…) (μ΅œλŒ€ 30자)" }, + }, + required: ["entcode", "userid"], + }, + }, + + // ── ν™ˆνƒμŠ€ 연동 ────────────────────────── + { + name: "sendbill_hometax_query_tax_invoice", + description: + "ν™ˆνƒμŠ€μ—μ„œ μ„ΈκΈˆκ³„μ‚°μ„œ 맀좜/λ§€μž… 내역을 μ‘°νšŒν•©λ‹ˆλ‹€.\n" + + "direction: sales=맀좜, purchase=λ§€μž…\n" + + "period: daily=일별(basedate), monthly=월별(basemonth)\n" + + "taxtype: '01'=κ³Όμ„Έ+μ˜μ„Έ, '03'=λ©΄μ„Έ\n" + + "datetype: '01'=μž‘μ„±μΌμž, '02'=λ°œν–‰μΌμž\n" + + "orderdirection: '01'=λ‚΄λ¦Όμ°¨μˆœ, '02'=μ˜€λ¦„μ°¨μˆœ\n" + + "⚠️ ν™ˆνƒμŠ€ μ ‘κ·Όμ œμ–΄λ‘œ 30건당 5초 λ”œλ ˆμ΄κ°€ μžˆμŠ΅λ‹ˆλ‹€.", + inputSchema: { + type: "object", + properties: { + direction: { type: "string", enum: ["sales", "purchase"], description: "쑰회 λ°©ν–₯ (sales=맀좜, purchase=λ§€μž…)" }, + period: { type: "string", enum: ["daily", "monthly"], description: "쑰회 μ£ΌκΈ° (daily=일별, monthly=월별)" }, + venderno: { type: "string", description: "μ‚¬μ—…μžλ²ˆν˜Έ (10자리)" }, + taxtype: { type: "string", description: "과세ꡬ뢄 ('01'=κ³Όμ„Έ+μ˜μ„Έ, '03'=λ©΄μ„Έ)" }, + datetype: { type: "string", description: "κΈ°μ€€μΌμž μœ ν˜• ('01'=μž‘μ„±μΌμž, '02'=λ°œν–‰μΌμž)" }, + basedate: { type: "string", description: "κΈ°μ€€μΌμž (YYYYMMDD, period=daily일 λ•Œ)" }, + basemonth: { type: "string", description: "κΈ°μ€€μ›” (YYYYMM, period=monthly일 λ•Œ)" }, + orderdirection: { type: "string", description: "μ •λ ¬λ°©ν–₯ ('01'=λ‚΄λ¦Όμ°¨μˆœ, '02'=μ˜€λ¦„μ°¨μˆœ)" }, + }, + required: ["direction", "period", "venderno", "taxtype", "datetype", "orderdirection"], + }, + }, + { + name: "sendbill_hometax_query_cash_receipt", + description: + "ν™ˆνƒμŠ€μ—μ„œ ν˜„κΈˆμ˜μˆ˜μ¦ 맀좜/λ§€μž… 내역을 μ‘°νšŒν•©λ‹ˆλ‹€.\n" + + "direction: sales=맀좜, purchase=λ§€μž…\n" + + "period: daily=일별(basedate), monthly=월별(basemonth)\n" + + "orderdirection: '01'=λ‚΄λ¦Όμ°¨μˆœ, '02'=μ˜€λ¦„μ°¨μˆœ\n" + + "⚠️ ν™ˆνƒμŠ€ μ ‘κ·Όμ œμ–΄λ‘œ 30건당 5초 λ”œλ ˆμ΄κ°€ μžˆμŠ΅λ‹ˆλ‹€.", + inputSchema: { + type: "object", + properties: { + direction: { type: "string", enum: ["sales", "purchase"], description: "쑰회 λ°©ν–₯ (sales=맀좜, purchase=λ§€μž…)" }, + period: { type: "string", enum: ["daily", "monthly"], description: "쑰회 μ£ΌκΈ° (daily=일별, monthly=월별)" }, + venderno: { type: "string", description: "μ‚¬μ—…μžλ²ˆν˜Έ (10자리)" }, + basedate: { type: "string", description: "κΈ°μ€€μΌμž (YYYYMMDD, period=daily일 λ•Œ)" }, + basemonth: { type: "string", description: "κΈ°μ€€μ›” (YYYYMM, period=monthly일 λ•Œ)" }, + orderdirection: { type: "string", description: "μ •λ ¬λ°©ν–₯ ('01'=λ‚΄λ¦Όμ°¨μˆœ, '02'=μ˜€λ¦„μ°¨μˆœ)" }, + }, + required: ["direction", "period", "venderno", "orderdirection"], + }, + }, + { + name: "sendbill_hometax_register_account", + description: + "ν™ˆνƒμŠ€ 연동을 μœ„ν•œ ν™ˆνƒμŠ€ 계정을 μ„Όλ“œλΉŒμ— λ“±λ‘ν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/hometax/account/regist\n" + + "μ„ΈκΈˆκ³„μ‚°μ„œμš©κ³Ό ν˜„κΈˆμ˜μˆ˜μ¦μš© 계정을 λ³„λ„λ‘œ μ‚¬μš©ν•©λ‹ˆλ‹€.", + inputSchema: { + type: "object", + properties: { + jwt: { type: "string", description: "sendbill_get_token으둜 λ°œκΈ‰λ°›μ€ 토큰" }, + billhtid: { type: "string", description: "μ„ΈκΈˆκ³„μ‚°μ„œμš© ν™ˆνƒμŠ€ 아이디" }, + billhtpw: { type: "string", description: "μ„ΈκΈˆκ³„μ‚°μ„œμš© ν™ˆνƒμŠ€ νŒ¨μŠ€μ›Œλ“œ" }, + cashhtid: { type: "string", description: "ν˜„κΈˆμ˜μˆ˜μ¦μš© ν™ˆνƒμŠ€ 아이디" }, + cashhtpw: { type: "string", description: "ν˜„κΈˆμ˜μˆ˜μ¦μš© ν™ˆνƒμŠ€ νŒ¨μŠ€μ›Œλ“œ" }, + }, + required: ["jwt", "billhtid", "billhtpw", "cashhtid", "cashhtpw"], + }, + }, + { + name: "sendbill_hometax_delete_account", + description: + "ν™ˆνƒμŠ€ 연동계정을 μ„Όλ“œλΉŒμ—μ„œ μ‚­μ œν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/hometax/account/delete\n" + + "계정 쑴재 μœ λ¬΄μ— λŒ€ν•œ κ²°κ³ΌλŠ” λ°˜ν™˜λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.", + inputSchema: { + type: "object", + properties: { + jwt: { type: "string", description: "sendbill_get_token으둜 λ°œκΈ‰λ°›μ€ 토큰" }, + }, + required: ["jwt"], + }, + }, + { + name: "sendbill_hometax_get_register_view", + description: + "타사가 직접 ν™ˆνƒμŠ€ 연동계정을 등둝할 수 μžˆλŠ” 폼 URL을 μƒμ„±ν•©λ‹ˆλ‹€. (μœ νš¨μ‹œκ°„: 10λΆ„)\n" + + "POST /api/agent/hometax/account/getRegistView", + inputSchema: { + type: "object", + properties: { + venderno: { type: "string", description: "μ‚¬μ—…μžλ²ˆν˜Έ (ν•˜μ΄ν”ˆ μ œμ™Έ 10자리)" }, + }, + required: ["venderno"], + }, + }, + + // ── νœ΄νμ—… 쑰회 ────────────────────────── + { + name: "sendbill_company_close_search", + description: + "μ‚¬μ—…μžμ˜ νœ΄μ—…/폐업 μƒνƒœλ₯Ό μ΅œλŒ€ 100건 μ‘°νšŒν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/companyclosesearch\n" + + "κ΅­μ„Έμ²­ 데이터λ₯Ό μ‹€μ‹œκ°„μœΌλ‘œ μ‘°νšŒν•©λ‹ˆλ‹€.", + inputSchema: { + type: "object", + properties: { + venderno: { + type: "array", + description: "μ‘°νšŒν•  μ‚¬μ—…μžλ²ˆν˜Έ λͺ©λ‘ (ν•˜μ΄ν”ˆ μ œμ™Έ 10자리, μ΅œλŒ€ 100건)", + items: { type: "string" }, + maxItems: 100, + }, + }, + required: ["venderno"], + }, + }, + + // ── 좔가메일 전솑 ───────────────────────── + { + name: "sendbill_send_additional_mail", + description: + "이미 λ°œν–‰ν•œ κ³„μ‚°μ„œμ˜ 이메일을 μΆ”κ°€ μ£Όμ†Œλ‘œ μž¬μ „μ†‘ν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/additionalMail/sendAdditionalMail", + inputSchema: { + type: "object", + properties: { + billseq: { type: "string", description: "λ°œν–‰ λ¬Έμ„œ 고유번호 (μ΅œλŒ€ 19자)" }, + sendType: { type: "string", description: "μ „μ†‘νƒ€μž… μ½”λ“œ" }, + newMailAddress: { type: "string", description: "μ‹ κ·œ 전솑 메일 μ£Όμ†Œ (μ΅œλŒ€ 30자)" }, + }, + required: ["billseq", "sendType", "newMailAddress"], + }, + }, + { + name: "sendbill_get_mail_send_list", + description: + "API둜 λ°œν–‰ν•œ κ³„μ‚°μ„œμ˜ 이메일 전솑 λ‚΄μ—­κ³Ό μˆ˜μ‹  μ—¬λΆ€λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.\n" + + "POST /api/agent/additionalMail/sendMailList", + inputSchema: { + type: "object", + properties: { + billseq: { type: "string", description: "API λ°œν–‰ λ¬Έμ„œ 고유번호 (μ΅œλŒ€ 19자)" }, + }, + required: ["billseq"], + }, + }, + + // ── μ°Έμ‘° 도ꡬ ───────────────────────────── + { + name: "sendbill_get_error_message", + description: + "μ„Όλ“œλΉŒ API μ—λŸ¬μ½”λ“œμ— ν•΄λ‹Ήν•˜λŠ” ν•œκ΅­μ–΄ λ©”μ‹œμ§€λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.\n" + + "API μ‘λ‹΅μ—μ„œ 음수 Result μ½”λ“œλ₯Ό λ°›μ•˜μ„ λ•Œ μ‚¬μš©ν•˜μ„Έμš”.", + inputSchema: { + type: "object", + properties: { + code: { type: "number", description: "μ—λŸ¬μ½”λ“œ (음수, 예: -10001)" }, + }, + required: ["code"], + }, + }, + { + name: "sendbill_get_code_tables", + description: + "μ„Όλ“œλΉŒ APIμ—μ„œ μ‚¬μš©ν•˜λŠ” μ½”λ“œν‘œ 전체λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.\n" + + "billtype, cmd_div, taxrate, billstat, gubun, etc01, report_stat, report_amend_cd μ½”λ“œλ₯Ό 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.", + inputSchema: { + type: "object", + properties: { + table: { + type: "string", + enum: ["billtype", "cmd_div", "taxrate", "billstat", "gubun", "etc01", "report_stat", "report_amend_cd", "all"], + description: "μ‘°νšŒν•  μ½”λ“œν‘œ 이름 (all=전체 쑰회)", + }, + }, + required: ["table"], + }, + }, + ], +})); + +// ───────────────────────────────────────────── +// 툴 μ‹€ν–‰ ν•Έλ“€λŸ¬ +// ───────────────────────────────────────────── +server.setRequestHandler(CallToolRequestSchema, async (request) => { + const { name, arguments: args } = request.params; + + // μ°Έμ‘° λ„κ΅¬λŠ” API 호좜 μ—†μŒ + if (name === "sendbill_get_error_message") { + const code = (args as { code: number }).code; + const message = getErrorMessage(code); + return { + content: [{ type: "text", text: `μ—λŸ¬μ½”λ“œ ${code}: ${message}` }], + }; + } + + if (name === "sendbill_get_code_tables") { + const table = (args as { table: string }).table; + if (table === "all") { + return { + content: [{ type: "text", text: JSON.stringify(CODE_TABLES, null, 2) }], + }; + } + const tableData = CODE_TABLES[table as keyof typeof CODE_TABLES]; + if (!tableData) { + return { + content: [{ type: "text", text: `μ½”λ“œν‘œ '${table}'λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€.` }], + isError: true, + }; + } + return { + content: [{ type: "text", text: JSON.stringify({ [table]: tableData }, null, 2) }], + }; + } + + // API 호좜 도ꡬ + const client = createClient(); + + type EndpointMap = Record) => Record]>; + + const endpoints: EndpointMap = { + // μΈμ¦μ„œ 관리 + sendbill_get_token: ["/api/agent/certificate/gettoken", (a) => ({ venderno: a.venderno })], + sendbill_upload_cert: ["/api/agent/certificate/uploadcert", (a) => ({ + jwt: a.jwt, password: a.password, certderfile: a.certderfile, certkeyfile: a.certkeyfile + })], + sendbill_inquire_cert: ["/api/agent/certificate/inquirecert", (a) => ({ jwt: a.jwt })], + sendbill_delete_cert: ["/api/agent/certificate/deletecert", (a) => ({ jwt: a.jwt, password: a.password })], + sendbill_get_cert_upload_view: ["/api/agent/certificate/getuploadview", (a) => ({ venderno: a.venderno })], + + // κ³„μ‚°μ„œ λ°œν–‰ + sendbill_register_invoice: ["/api/agent/document/registDirect", (a) => a], + sendbill_register_invoice_multi: ["/api/agent/document/registMultiDirect", (a) => a], + sendbill_register_invoice_bulk: ["/api/agent/document/registBulkDirect", (a) => a], + + // κ³„μ‚°μ„œ 쑰회/관리 + sendbill_get_invoice_status: ["/api/agent/status/detail", (a) => ({ billseq: a.billseq })], + sendbill_get_invoice_status_list: ["/api/agent/status/list", (a) => ({ billseqs: a.billseqs })], + sendbill_manage_invoice: ["/api/agent/manager/registDirect", (a) => a], + sendbill_get_invoice_error_log: ["/api/agent/log/bill", (a) => ({ billseq: a.billseq })], + sendbill_get_manage_error_log: ["/api/agent/log/manager", (a) => ({ billseq: a.billseq })], + + // νšŒμ› 관리 + sendbill_register_member: ["/api/agent/member/registDirect", (a) => a], + sendbill_get_member_error_log: ["/api/agent/log/member", (a) => ({ entcode: a.entcode, userid: a.userid })], + + // ν™ˆνƒμŠ€ 연동 + sendbill_hometax_register_account: ["/api/agent/hometax/account/regist", (a) => a], + sendbill_hometax_delete_account: ["/api/agent/hometax/account/delete", (a) => ({ jwt: a.jwt })], + sendbill_hometax_get_register_view: ["/api/agent/hometax/account/getRegistView", (a) => ({ venderno: a.venderno })], + + // νœ΄νμ—… 쑰회 + sendbill_company_close_search: ["/api/agent/companyclosesearch", (a) => ({ venderno: a.venderno })], + + // 좔가메일 + sendbill_send_additional_mail: ["/api/agent/additionalMail/sendAdditionalMail", (a) => a], + sendbill_get_mail_send_list: ["/api/agent/additionalMail/sendMailList", (a) => ({ billseq: a.billseq })], + }; + + // ν™ˆνƒμŠ€ μ‘°νšŒλŠ” λ°©ν–₯+주기에 따라 μ—”λ“œν¬μΈνŠΈκ°€ 닀름 + if (name === "sendbill_hometax_query_tax_invoice") { + const a = args as Record; + const direction = a.direction as string; + const period = a.period as string; + + const endpointMap: Record = { + "sales-daily": "/api/agent/hometax/listDailyTaxInvoiceSales", + "sales-monthly": "/api/agent/hometax/listMonthlyTaxInvoiceSales", + "purchase-daily": "/api/agent/hometax/listDailyTaxInvoicePurchase", + "purchase-monthly": "/api/agent/hometax/listMonthlyTaxInvoicePurchase", + }; + + const endpoint = endpointMap[`${direction}-${period}`]; + if (!endpoint) { + return { content: [{ type: "text", text: "잘λͺ»λœ direction λ˜λŠ” period κ°’μž…λ‹ˆλ‹€." }], isError: true }; + } + + const body: Record = { + venderno: a.venderno, + taxtype: a.taxtype, + datetype: a.datetype, + orderdirection: a.orderdirection, + }; + if (period === "daily") body.basedate = a.basedate; + else body.basemonth = a.basemonth; + + try { + const result = await client.post(endpoint, body); + const text = formatResult(result); + return { content: [{ type: "text", text }] }; + } catch (err: unknown) { + const message = err instanceof Error ? err.message : String(err); + return { content: [{ type: "text", text: `API 였λ₯˜: ${message}` }], isError: true }; + } + } + + if (name === "sendbill_hometax_query_cash_receipt") { + const a = args as Record; + const direction = a.direction as string; + const period = a.period as string; + + const endpointMap: Record = { + "sales-daily": "/api/agent/hometax/listDailyCashBillSales", + "sales-monthly": "/api/agent/hometax/listMonthlyCashBillSales", + "purchase-daily": "/api/agent/hometax/listDailyCashBillPurchase", + "purchase-monthly": "/api/agent/hometax/listMonthlyCashBillPurchase", + }; + + const endpoint = endpointMap[`${direction}-${period}`]; + if (!endpoint) { + return { content: [{ type: "text", text: "잘λͺ»λœ direction λ˜λŠ” period κ°’μž…λ‹ˆλ‹€." }], isError: true }; + } + + const body: Record = { + venderno: a.venderno, + orderdirection: a.orderdirection, + }; + if (period === "daily") body.basedate = a.basedate; + else body.basemonth = a.basemonth; + + try { + const result = await client.post(endpoint, body); + const text = formatResult(result); + return { content: [{ type: "text", text }] }; + } catch (err: unknown) { + const message = err instanceof Error ? err.message : String(err); + return { content: [{ type: "text", text: `API 였λ₯˜: ${message}` }], isError: true }; + } + } + + // 일반 μ—”λ“œν¬μΈνŠΈ 처리 + const entry = endpoints[name]; + if (!entry) { + return { + content: [{ type: "text", text: `μ•Œ 수 μ—†λŠ” 툴: ${name}` }], + isError: true, + }; + } + + const [endpoint, buildBody] = entry; + const body = buildBody(args as Record); + + try { + const result = await client.post(endpoint, body); + const text = formatResult(result); + return { content: [{ type: "text", text }] }; + } catch (err: unknown) { + const message = err instanceof Error ? err.message : String(err); + return { content: [{ type: "text", text: `API 였λ₯˜: ${message}` }], isError: true }; + } +}); + +function formatResult(result: unknown): string { + if (typeof result !== "object" || result === null) { + return String(result); + } + const obj = result as Record; + const lines: string[] = []; + + // Result μ½”λ“œ 해석 + if ("Result" in obj || "result" in obj) { + const code = (obj.Result ?? obj.result) as number; + const msg = (obj.Message ?? obj.message) as string | undefined; + if (code < 0) { + lines.push(`❌ μ‹€νŒ¨ (Result: ${code})`); + lines.push(` 였λ₯˜: ${msg ?? getErrorMessage(code)}`); + } else { + lines.push(`βœ… 성곡 (Result: ${code})`); + if (msg) lines.push(` λ©”μ‹œμ§€: ${msg}`); + } + } + + // λ‚˜λ¨Έμ§€ 데이터 + const skip = new Set(["Result", "result", "Message", "message"]); + const rest = Object.fromEntries(Object.entries(obj).filter(([k]) => !skip.has(k))); + if (Object.keys(rest).length > 0) { + lines.push("\n데이터:"); + lines.push(JSON.stringify(rest, null, 2)); + } + + return lines.join("\n") || JSON.stringify(result, null, 2); +} + +// ───────────────────────────────────────────── +// μ„œλ²„ μ‹œμž‘ +// ───────────────────────────────────────────── +async function main() { + const transport = new StdioServerTransport(); + await server.connect(transport); + // stderrμ—λ§Œ 좜λ ₯ (stdout은 MCP ν”„λ‘œν† μ½œ μ „μš©) + process.stderr.write("μ„Όλ“œλΉŒ MCP μ„œλ²„ μ‹œμž‘λ¨\n"); +} + +main().catch((err) => { + process.stderr.write(`치λͺ…적 였λ₯˜: ${err}\n`); + process.exit(1); +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..12bf830 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ES2022", + "moduleResolution": "node", + "outDir": "./dist", + "rootDir": "./src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +}