trustbase-seller-backend 0.1.5
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/.agents/skills/wechatpay-payment-integration/SKILL.md +165 -0
- package/.agents/skills/wechatpay-payment-integration/references/APIv3/346/216/245/345/217/243/345/212/250/346/200/201/346/216/222/351/232/234.md +234 -0
- package/.agents/skills/wechatpay-payment-integration/references/wechatpay-dev-cli/344/275/277/347/224/250/350/257/264/346/230/216.md +74 -0
- package/.agents/skills/wechatpay-payment-integration/references//345/237/272/347/241/200/346/246/202/345/277/265/345/217/212/344/270/232/345/212/241/344/273/213/347/273/215.md +109 -0
- package/.agents/skills/wechatpay-payment-integration/references//345/246/202/344/275/225/347/220/206/350/247/243/347/224/250/346/210/267/351/227/256/351/242/230.md +55 -0
- package/.agents/skills/wechatpay-payment-integration/references//346/216/245/345/205/245/350/264/250/351/207/217/346/243/200/346/237/245/346/270/205/345/215/225.md +70 -0
- package/.agents/skills/wechatpay-payment-integration/references//346/226/207/346/241/243/346/243/200/347/264/242/344/270/216/351/227/256/347/255/224.md +99 -0
- package/.agents/skills/wechatpay-payment-integration/scripts/bash/extract_and_sign.sh +231 -0
- package/.agents/skills/wechatpay-payment-integration/scripts/powershell/extract_and_sign.ps1 +199 -0
- package/.agents/skills/wechatpay-payment-integration/scripts/wechatpay-resource-sync.py +646 -0
- package/.env.example +70 -0
- package/MERCHANT-EDITION.md +56 -0
- package/README.md +99 -0
- package/api/__tests__/test-utils.d.ts +33 -0
- package/api/__tests__/test-utils.d.ts.map +1 -0
- package/api/__tests__/test-utils.js +90 -0
- package/api/__tests__/test-utils.js.map +1 -0
- package/api/db/case-library-types.d.ts +47 -0
- package/api/db/case-library-types.d.ts.map +1 -0
- package/api/db/case-library-types.js +105 -0
- package/api/db/case-library-types.js.map +1 -0
- package/api/db/case-library.db.d.ts +5 -0
- package/api/db/case-library.db.d.ts.map +1 -0
- package/api/db/case-library.db.js +127 -0
- package/api/db/case-library.db.js.map +1 -0
- package/api/email.d.ts +56 -0
- package/api/email.d.ts.map +1 -0
- package/api/email.js +307 -0
- package/api/email.js.map +1 -0
- package/api/index.d.ts +22 -0
- package/api/index.d.ts.map +1 -0
- package/api/index.js +41 -0
- package/api/index.js.map +1 -0
- package/api/integration-helpers.d.ts +153 -0
- package/api/integration-helpers.d.ts.map +1 -0
- package/api/integration-helpers.js +361 -0
- package/api/integration-helpers.js.map +1 -0
- package/api/lib/case-summary.d.ts +10 -0
- package/api/lib/case-summary.d.ts.map +1 -0
- package/api/lib/case-summary.js +30 -0
- package/api/lib/case-summary.js.map +1 -0
- package/api/middleware/p2p-auth.d.ts +140 -0
- package/api/middleware/p2p-auth.d.ts.map +1 -0
- package/api/middleware/p2p-auth.js +510 -0
- package/api/middleware/p2p-auth.js.map +1 -0
- package/api/middleware/tool-policy.d.ts +47 -0
- package/api/middleware/tool-policy.d.ts.map +1 -0
- package/api/middleware/tool-policy.js +156 -0
- package/api/middleware/tool-policy.js.map +1 -0
- package/api/oauth-adapters.d.ts +192 -0
- package/api/oauth-adapters.d.ts.map +1 -0
- package/api/oauth-adapters.js +456 -0
- package/api/oauth-adapters.js.map +1 -0
- package/api/oauth-bridge.d.ts +56 -0
- package/api/oauth-bridge.d.ts.map +1 -0
- package/api/oauth-bridge.js +624 -0
- package/api/oauth-bridge.js.map +1 -0
- package/api/oauth-router.d.ts +36 -0
- package/api/oauth-router.d.ts.map +1 -0
- package/api/oauth-router.js +54 -0
- package/api/oauth-router.js.map +1 -0
- package/api/p2p-mcp.d.ts +69 -0
- package/api/p2p-mcp.d.ts.map +1 -0
- package/api/p2p-mcp.js +286 -0
- package/api/p2p-mcp.js.map +1 -0
- package/api/payment-store.d.ts +56 -0
- package/api/payment-store.d.ts.map +1 -0
- package/api/payment-store.js +163 -0
- package/api/payment-store.js.map +1 -0
- package/api/payment.d.ts +14 -0
- package/api/payment.d.ts.map +1 -0
- package/api/payment.js +216 -0
- package/api/payment.js.map +1 -0
- package/api/pwa-stats.d.ts +67 -0
- package/api/pwa-stats.d.ts.map +1 -0
- package/api/pwa-stats.js +269 -0
- package/api/pwa-stats.js.map +1 -0
- package/api/riskcontrol-adapters.d.ts +114 -0
- package/api/riskcontrol-adapters.d.ts.map +1 -0
- package/api/riskcontrol-adapters.js +210 -0
- package/api/riskcontrol-adapters.js.map +1 -0
- package/api/riskcontrol-event-whitelist.d.ts +81 -0
- package/api/riskcontrol-event-whitelist.d.ts.map +1 -0
- package/api/riskcontrol-event-whitelist.js +181 -0
- package/api/riskcontrol-event-whitelist.js.map +1 -0
- package/api/riskcontrol-rules.d.ts +105 -0
- package/api/riskcontrol-rules.d.ts.map +1 -0
- package/api/riskcontrol-rules.js +399 -0
- package/api/riskcontrol-rules.js.map +1 -0
- package/api/riskcontrol-scoring.d.ts +72 -0
- package/api/riskcontrol-scoring.d.ts.map +1 -0
- package/api/riskcontrol-scoring.js +335 -0
- package/api/riskcontrol-scoring.js.map +1 -0
- package/api/riskcontrol-service.d.ts +60 -0
- package/api/riskcontrol-service.d.ts.map +1 -0
- package/api/riskcontrol-service.js +206 -0
- package/api/riskcontrol-service.js.map +1 -0
- package/api/riskcontrol-stream.d.ts +112 -0
- package/api/riskcontrol-stream.d.ts.map +1 -0
- package/api/riskcontrol-stream.js +230 -0
- package/api/riskcontrol-stream.js.map +1 -0
- package/api/riskcontrol-v5-e2e-test.d.ts +15 -0
- package/api/riskcontrol-v5-e2e-test.d.ts.map +1 -0
- package/api/riskcontrol-v5-e2e-test.js +204 -0
- package/api/riskcontrol-v5-e2e-test.js.map +1 -0
- package/api/riskcontrol-v5-router.d.ts +48 -0
- package/api/riskcontrol-v5-router.d.ts.map +1 -0
- package/api/riskcontrol-v5-router.js +226 -0
- package/api/riskcontrol-v5-router.js.map +1 -0
- package/api/riskcontrol-webhook.d.ts +88 -0
- package/api/riskcontrol-webhook.d.ts.map +1 -0
- package/api/riskcontrol-webhook.js +326 -0
- package/api/riskcontrol-webhook.js.map +1 -0
- package/api/routes/case-library.d.ts +4 -0
- package/api/routes/case-library.d.ts.map +1 -0
- package/api/routes/case-library.js +91 -0
- package/api/routes/case-library.js.map +1 -0
- package/api/seller-earnings.d.ts +23 -0
- package/api/seller-earnings.d.ts.map +1 -0
- package/api/seller-earnings.js +258 -0
- package/api/seller-earnings.js.map +1 -0
- package/api/seller-orders.d.ts +25 -0
- package/api/seller-orders.d.ts.map +1 -0
- package/api/seller-orders.js +398 -0
- package/api/seller-orders.js.map +1 -0
- package/api/seller-products-chain.d.ts +31 -0
- package/api/seller-products-chain.d.ts.map +1 -0
- package/api/seller-products-chain.js +308 -0
- package/api/seller-products-chain.js.map +1 -0
- package/api/seller-products.d.ts +30 -0
- package/api/seller-products.d.ts.map +1 -0
- package/api/seller-products.js +453 -0
- package/api/seller-products.js.map +1 -0
- package/api/seller-reputation.d.ts +21 -0
- package/api/seller-reputation.d.ts.map +1 -0
- package/api/seller-reputation.js +204 -0
- package/api/seller-reputation.js.map +1 -0
- package/api/seller-router.d.ts +33 -0
- package/api/seller-router.d.ts.map +1 -0
- package/api/seller-router.js +53 -0
- package/api/seller-router.js.map +1 -0
- package/api/seller-settings.d.ts +23 -0
- package/api/seller-settings.d.ts.map +1 -0
- package/api/seller-settings.js +279 -0
- package/api/seller-settings.js.map +1 -0
- package/api/shipping-store.d.ts +44 -0
- package/api/shipping-store.d.ts.map +1 -0
- package/api/shipping-store.js +154 -0
- package/api/shipping-store.js.map +1 -0
- package/api/shipping.d.ts +16 -0
- package/api/shipping.d.ts.map +1 -0
- package/api/shipping.js +239 -0
- package/api/shipping.js.map +1 -0
- package/api/social-endpoint-verify.d.ts +8 -0
- package/api/social-endpoint-verify.d.ts.map +1 -0
- package/api/social-endpoint-verify.js +152 -0
- package/api/social-endpoint-verify.js.map +1 -0
- package/api/social-posts.d.ts +65 -0
- package/api/social-posts.d.ts.map +1 -0
- package/api/social-posts.js +534 -0
- package/api/social-posts.js.map +1 -0
- package/api/social-router.d.ts +36 -0
- package/api/social-router.d.ts.map +1 -0
- package/api/social-router.js +56 -0
- package/api/social-router.js.map +1 -0
- package/api/social-shares.d.ts +40 -0
- package/api/social-shares.d.ts.map +1 -0
- package/api/social-shares.js +379 -0
- package/api/social-shares.js.map +1 -0
- package/api/social-whitelist.d.ts +41 -0
- package/api/social-whitelist.d.ts.map +1 -0
- package/api/social-whitelist.js +261 -0
- package/api/social-whitelist.js.map +1 -0
- package/api/storefront-orders.d.ts +23 -0
- package/api/storefront-orders.d.ts.map +1 -0
- package/api/storefront-orders.js +349 -0
- package/api/storefront-orders.js.map +1 -0
- package/api/storefront-products.d.ts +21 -0
- package/api/storefront-products.d.ts.map +1 -0
- package/api/storefront-products.js +181 -0
- package/api/storefront-products.js.map +1 -0
- package/api/storefront-router.d.ts +33 -0
- package/api/storefront-router.d.ts.map +1 -0
- package/api/storefront-router.js +47 -0
- package/api/storefront-router.js.map +1 -0
- package/api/storefront-user.d.ts +23 -0
- package/api/storefront-user.d.ts.map +1 -0
- package/api/storefront-user.js +336 -0
- package/api/storefront-user.js.map +1 -0
- package/api/test-db-helper.d.ts +29 -0
- package/api/test-db-helper.d.ts.map +1 -0
- package/api/test-db-helper.js +107 -0
- package/api/test-db-helper.js.map +1 -0
- package/api/traffic.d.ts +22 -0
- package/api/traffic.d.ts.map +1 -0
- package/api/traffic.js +112 -0
- package/api/traffic.js.map +1 -0
- package/api/wc-credentials.d.ts +34 -0
- package/api/wc-credentials.d.ts.map +1 -0
- package/api/wc-credentials.js +296 -0
- package/api/wc-credentials.js.map +1 -0
- package/api/wc-tracker-receiver.d.ts +47 -0
- package/api/wc-tracker-receiver.d.ts.map +1 -0
- package/api/wc-tracker-receiver.js +264 -0
- package/api/wc-tracker-receiver.js.map +1 -0
- package/api/wc-v3.d.ts +40 -0
- package/api/wc-v3.d.ts.map +1 -0
- package/api/wc-v3.js +694 -0
- package/api/wc-v3.js.map +1 -0
- package/bin/tb-doctor.js +32 -0
- package/bin/tb-seller-backend.js +42 -0
- package/check.d.ts +2 -0
- package/check.d.ts.map +1 -0
- package/check.js +19 -0
- package/check.js.map +1 -0
- package/config/export-import.d.ts +108 -0
- package/config/export-import.d.ts.map +1 -0
- package/config/export-import.js +234 -0
- package/config/export-import.js.map +1 -0
- package/config/manager.d.ts +73 -0
- package/config/manager.d.ts.map +1 -0
- package/config/manager.js +246 -0
- package/config/manager.js.map +1 -0
- package/config/profile.d.ts +42 -0
- package/config/profile.d.ts.map +1 -0
- package/config/profile.js +111 -0
- package/config/profile.js.map +1 -0
- package/core/address.js +23 -0
- package/core/advanced-performance.d.ts +149 -0
- package/core/advanced-performance.d.ts.map +1 -0
- package/core/advanced-performance.js +374 -0
- package/core/advanced-performance.js.map +1 -0
- package/core/alerting.d.ts +91 -0
- package/core/alerting.d.ts.map +1 -0
- package/core/alerting.js +379 -0
- package/core/alerting.js.map +1 -0
- package/core/app-store.d.ts +77 -0
- package/core/app-store.d.ts.map +1 -0
- package/core/app-store.js +207 -0
- package/core/app-store.js.map +1 -0
- package/core/boot-env.js +39 -0
- package/core/business-scope-schema.d.ts +60 -0
- package/core/business-scope-schema.d.ts.map +1 -0
- package/core/business-scope-schema.js +165 -0
- package/core/business-scope-schema.js.map +1 -0
- package/core/cache.d.ts +53 -0
- package/core/cache.d.ts.map +1 -0
- package/core/cache.js +130 -0
- package/core/cache.js.map +1 -0
- package/core/chain-listener.d.ts +47 -0
- package/core/chain-listener.d.ts.map +1 -0
- package/core/chain-listener.js +254 -0
- package/core/chain-listener.js.map +1 -0
- package/core/chain-reject.js +107 -0
- package/core/chain-signer.js +258 -0
- package/core/cleanup.d.ts +42 -0
- package/core/cleanup.d.ts.map +1 -0
- package/core/cleanup.js +144 -0
- package/core/cleanup.js.map +1 -0
- package/core/cluster.d.ts +78 -0
- package/core/cluster.d.ts.map +1 -0
- package/core/cluster.js +215 -0
- package/core/cluster.js.map +1 -0
- package/core/community-review.d.ts +82 -0
- package/core/community-review.d.ts.map +1 -0
- package/core/community-review.js +201 -0
- package/core/community-review.js.map +1 -0
- package/core/connection-pool.d.ts +72 -0
- package/core/connection-pool.d.ts.map +1 -0
- package/core/connection-pool.js +173 -0
- package/core/connection-pool.js.map +1 -0
- package/core/consistency.d.ts +130 -0
- package/core/consistency.d.ts.map +1 -0
- package/core/consistency.js +340 -0
- package/core/consistency.js.map +1 -0
- package/core/content-ai.d.ts +303 -0
- package/core/content-ai.d.ts.map +1 -0
- package/core/content-ai.js +344 -0
- package/core/content-ai.js.map +1 -0
- package/core/content-backfill.d.ts +55 -0
- package/core/content-backfill.d.ts.map +1 -0
- package/core/content-backfill.js +174 -0
- package/core/content-backfill.js.map +1 -0
- package/core/conversion-rate-sync.d.ts +97 -0
- package/core/conversion-rate-sync.d.ts.map +1 -0
- package/core/conversion-rate-sync.js +195 -0
- package/core/conversion-rate-sync.js.map +1 -0
- package/core/coverage-backup.d.ts +87 -0
- package/core/coverage-backup.d.ts.map +1 -0
- package/core/coverage-backup.js +265 -0
- package/core/coverage-backup.js.map +1 -0
- package/core/db-installer.d.ts +108 -0
- package/core/db-installer.d.ts.map +1 -0
- package/core/db-installer.js +414 -0
- package/core/db-installer.js.map +1 -0
- package/core/device-analyzer.d.ts +96 -0
- package/core/device-analyzer.d.ts.map +1 -0
- package/core/device-analyzer.js +235 -0
- package/core/device-analyzer.js.map +1 -0
- package/core/discovery.d.ts +165 -0
- package/core/discovery.d.ts.map +1 -0
- package/core/discovery.js +363 -0
- package/core/discovery.js.map +1 -0
- package/core/distributed.d.ts +172 -0
- package/core/distributed.d.ts.map +1 -0
- package/core/distributed.js +422 -0
- package/core/distributed.js.map +1 -0
- package/core/doctor.js +249 -0
- package/core/enforcement.d.ts +57 -0
- package/core/enforcement.d.ts.map +1 -0
- package/core/enforcement.js +115 -0
- package/core/enforcement.js.map +1 -0
- package/core/error-handler.d.ts +131 -0
- package/core/error-handler.d.ts.map +1 -0
- package/core/error-handler.js +291 -0
- package/core/error-handler.js.map +1 -0
- package/core/federated-learning.d.ts +124 -0
- package/core/federated-learning.d.ts.map +1 -0
- package/core/federated-learning.js +338 -0
- package/core/federated-learning.js.map +1 -0
- package/core/fingerprint.d.ts +95 -0
- package/core/fingerprint.d.ts.map +1 -0
- package/core/fingerprint.js +313 -0
- package/core/fingerprint.js.map +1 -0
- package/core/geoip.d.ts +67 -0
- package/core/geoip.d.ts.map +1 -0
- package/core/geoip.js +174 -0
- package/core/geoip.js.map +1 -0
- package/core/gossip.d.ts +141 -0
- package/core/gossip.d.ts.map +1 -0
- package/core/gossip.js +372 -0
- package/core/gossip.js.map +1 -0
- package/core/governance.d.ts +147 -0
- package/core/governance.d.ts.map +1 -0
- package/core/governance.js +351 -0
- package/core/governance.js.map +1 -0
- package/core/indexer-enhancements.d.ts +164 -0
- package/core/indexer-enhancements.d.ts.map +1 -0
- package/core/indexer-enhancements.js +429 -0
- package/core/indexer-enhancements.js.map +1 -0
- package/core/intrusion-detection.d.ts +79 -0
- package/core/intrusion-detection.d.ts.map +1 -0
- package/core/intrusion-detection.js +322 -0
- package/core/intrusion-detection.js.map +1 -0
- package/core/lifecycle.d.ts +118 -0
- package/core/lifecycle.d.ts.map +1 -0
- package/core/lifecycle.js +310 -0
- package/core/lifecycle.js.map +1 -0
- package/core/location.d.ts +99 -0
- package/core/location.d.ts.map +1 -0
- package/core/location.js +219 -0
- package/core/location.js.map +1 -0
- package/core/maxmind-integration.d.ts +68 -0
- package/core/maxmind-integration.d.ts.map +1 -0
- package/core/maxmind-integration.js +245 -0
- package/core/maxmind-integration.js.map +1 -0
- package/core/migration.d.ts +58 -0
- package/core/migration.d.ts.map +1 -0
- package/core/migration.js +223 -0
- package/core/migration.js.map +1 -0
- package/core/monitoring.d.ts +153 -0
- package/core/monitoring.d.ts.map +1 -0
- package/core/monitoring.js +406 -0
- package/core/monitoring.js.map +1 -0
- package/core/offsite-backup.d.ts +71 -0
- package/core/offsite-backup.d.ts.map +1 -0
- package/core/offsite-backup.js +341 -0
- package/core/offsite-backup.js.map +1 -0
- package/core/order-intent-store.js +83 -0
- package/core/order-intent.js +273 -0
- package/core/paths.js +116 -0
- package/core/performance.d.ts +173 -0
- package/core/performance.d.ts.map +1 -0
- package/core/performance.js +386 -0
- package/core/performance.js.map +1 -0
- package/core/product-flag.d.ts +364 -0
- package/core/product-flag.d.ts.map +1 -0
- package/core/product-flag.js +465 -0
- package/core/product-flag.js.map +1 -0
- package/core/protection.d.ts +139 -0
- package/core/protection.d.ts.map +1 -0
- package/core/protection.js +327 -0
- package/core/protection.js.map +1 -0
- package/core/region-adapter.d.ts +152 -0
- package/core/region-adapter.d.ts.map +1 -0
- package/core/region-adapter.js +505 -0
- package/core/region-adapter.js.map +1 -0
- package/core/region-configs.d.ts +12 -0
- package/core/region-configs.d.ts.map +1 -0
- package/core/region-configs.js +907 -0
- package/core/region-configs.js.map +1 -0
- package/core/review-antifraud.d.ts +80 -0
- package/core/review-antifraud.d.ts.map +1 -0
- package/core/review-antifraud.js +193 -0
- package/core/review-antifraud.js.map +1 -0
- package/core/rules-updater.d.ts +89 -0
- package/core/rules-updater.d.ts.map +1 -0
- package/core/rules-updater.js +261 -0
- package/core/rules-updater.js.map +1 -0
- package/core/runtime-data.js +203 -0
- package/core/security.d.ts +144 -0
- package/core/security.d.ts.map +1 -0
- package/core/security.js +390 -0
- package/core/security.js.map +1 -0
- package/core/seller-identity.js +78 -0
- package/core/session-manager.d.ts +93 -0
- package/core/session-manager.d.ts.map +1 -0
- package/core/session-manager.js +262 -0
- package/core/session-manager.js.map +1 -0
- package/core/state-sync.d.ts +121 -0
- package/core/state-sync.d.ts.map +1 -0
- package/core/state-sync.js +287 -0
- package/core/state-sync.js.map +1 -0
- package/core/testing.d.ts +97 -0
- package/core/testing.d.ts.map +1 -0
- package/core/testing.js +361 -0
- package/core/testing.js.map +1 -0
- package/core/trust-score.d.ts +51 -0
- package/core/trust-score.d.ts.map +1 -0
- package/core/trust-score.js +188 -0
- package/core/trust-score.js.map +1 -0
- package/core/trustworthiness.d.ts +140 -0
- package/core/trustworthiness.d.ts.map +1 -0
- package/core/trustworthiness.js +375 -0
- package/core/trustworthiness.js.map +1 -0
- package/core/types.d.ts +258 -0
- package/core/types.d.ts.map +1 -0
- package/core/types.js +9 -0
- package/core/types.js.map +1 -0
- package/core/upgrade-manager.d.ts +114 -0
- package/core/upgrade-manager.d.ts.map +1 -0
- package/core/upgrade-manager.js +264 -0
- package/core/upgrade-manager.js.map +1 -0
- package/core/upgrader.d.ts +107 -0
- package/core/upgrader.d.ts.map +1 -0
- package/core/upgrader.js +389 -0
- package/core/upgrader.js.map +1 -0
- package/core/websocket.d.ts +78 -0
- package/core/websocket.d.ts.map +1 -0
- package/core/websocket.js +292 -0
- package/core/websocket.js.map +1 -0
- package/council/hidden-weight.d.ts +45 -0
- package/council/hidden-weight.d.ts.map +1 -0
- package/council/hidden-weight.js +135 -0
- package/council/hidden-weight.js.map +1 -0
- package/db/email-migrations.sql +31 -0
- package/db/oauth-migrate.d.ts +39 -0
- package/db/oauth-migrate.d.ts.map +1 -0
- package/db/oauth-migrate.js +201 -0
- package/db/oauth-migrate.js.map +1 -0
- package/db/oauth-migrations.sql +92 -0
- package/db/social-migrate.d.ts +12 -0
- package/db/social-migrate.d.ts.map +1 -0
- package/db/social-migrate.js +102 -0
- package/db/social-migrate.js.map +1 -0
- package/db/social-migrations.sql +94 -0
- package/db/store-migrate.d.ts +33 -0
- package/db/store-migrate.d.ts.map +1 -0
- package/db/store-migrate.js +149 -0
- package/db/store-migrate.js.map +1 -0
- package/db/store-migrations.sql +242 -0
- package/debug.d.ts +2 -0
- package/debug.d.ts.map +1 -0
- package/debug.js +18 -0
- package/debug.js.map +1 -0
- package/event-listener.d.ts +93 -0
- package/event-listener.d.ts.map +1 -0
- package/event-listener.js +321 -0
- package/event-listener.js.map +1 -0
- package/event-whitelist.d.ts +79 -0
- package/event-whitelist.d.ts.map +1 -0
- package/event-whitelist.js +533 -0
- package/event-whitelist.js.map +1 -0
- package/index.d.ts +45 -0
- package/index.d.ts.map +1 -0
- package/index.js +361 -0
- package/index.js.map +1 -0
- package/init-node.d.ts +9 -0
- package/init-node.d.ts.map +1 -0
- package/init-node.js +230 -0
- package/init-node.js.map +1 -0
- package/mcp/ai-tools.d.ts +2 -0
- package/mcp/ai-tools.d.ts.map +1 -0
- package/mcp/ai-tools.js +266 -0
- package/mcp/ai-tools.js.map +1 -0
- package/mcp/auto-dispatch-tools.d.ts +2 -0
- package/mcp/auto-dispatch-tools.d.ts.map +1 -0
- package/mcp/auto-dispatch-tools.js +348 -0
- package/mcp/auto-dispatch-tools.js.map +1 -0
- package/mcp/business-scope-tools.d.ts +11 -0
- package/mcp/business-scope-tools.d.ts.map +1 -0
- package/mcp/business-scope-tools.js +179 -0
- package/mcp/business-scope-tools.js.map +1 -0
- package/mcp/buyer-tools.d.ts +67 -0
- package/mcp/buyer-tools.d.ts.map +1 -0
- package/mcp/buyer-tools.js +445 -0
- package/mcp/buyer-tools.js.map +1 -0
- package/mcp/interfaces.d.ts +1058 -0
- package/mcp/interfaces.d.ts.map +1 -0
- package/mcp/interfaces.js +13 -0
- package/mcp/interfaces.js.map +1 -0
- package/mcp/m2m-chat-tool.d.ts +50 -0
- package/mcp/m2m-chat-tool.d.ts.map +1 -0
- package/mcp/m2m-chat-tool.js +432 -0
- package/mcp/m2m-chat-tool.js.map +1 -0
- package/mcp/migrations.d.ts +30 -0
- package/mcp/migrations.d.ts.map +1 -0
- package/mcp/migrations.js +391 -0
- package/mcp/migrations.js.map +1 -0
- package/mcp/peer-tools.d.ts +163 -0
- package/mcp/peer-tools.d.ts.map +1 -0
- package/mcp/peer-tools.js +532 -0
- package/mcp/peer-tools.js.map +1 -0
- package/mcp/plugin-management-tools.d.ts +2 -0
- package/mcp/plugin-management-tools.d.ts.map +1 -0
- package/mcp/plugin-management-tools.js +327 -0
- package/mcp/plugin-management-tools.js.map +1 -0
- package/mcp/product-type-tools.d.ts +2 -0
- package/mcp/product-type-tools.d.ts.map +1 -0
- package/mcp/product-type-tools.js +470 -0
- package/mcp/product-type-tools.js.map +1 -0
- package/mcp/security-tools.d.ts +2 -0
- package/mcp/security-tools.d.ts.map +1 -0
- package/mcp/security-tools.js +313 -0
- package/mcp/security-tools.js.map +1 -0
- package/mcp/seller-query-tools.d.ts +2 -0
- package/mcp/seller-query-tools.d.ts.map +1 -0
- package/mcp/seller-query-tools.js +179 -0
- package/mcp/seller-query-tools.js.map +1 -0
- package/mcp/server.d.ts +11 -0
- package/mcp/server.d.ts.map +1 -0
- package/mcp/server.js +68 -0
- package/mcp/server.js.map +1 -0
- package/mcp/standalone-server.d.ts +34 -0
- package/mcp/standalone-server.d.ts.map +1 -0
- package/mcp/standalone-server.js +261 -0
- package/mcp/standalone-server.js.map +1 -0
- package/mcp/tools-integration.d.ts +31 -0
- package/mcp/tools-integration.d.ts.map +1 -0
- package/mcp/tools-integration.js +288 -0
- package/mcp/tools-integration.js.map +1 -0
- package/mcp/web-panel.d.ts +18 -0
- package/mcp/web-panel.d.ts.map +1 -0
- package/mcp/web-panel.js +1657 -0
- package/mcp/web-panel.js.map +1 -0
- package/middleware/api-key-auth.d.ts +64 -0
- package/middleware/api-key-auth.d.ts.map +1 -0
- package/middleware/api-key-auth.js +255 -0
- package/middleware/api-key-auth.js.map +1 -0
- package/middleware/scope-auth.d.ts +54 -0
- package/middleware/scope-auth.d.ts.map +1 -0
- package/middleware/scope-auth.js +153 -0
- package/middleware/scope-auth.js.map +1 -0
- package/middleware/security.d.ts +48 -0
- package/middleware/security.d.ts.map +1 -0
- package/middleware/security.js +217 -0
- package/middleware/security.js.map +1 -0
- package/middleware/wallet-auth.d.ts +54 -0
- package/middleware/wallet-auth.d.ts.map +1 -0
- package/middleware/wallet-auth.js +158 -0
- package/middleware/wallet-auth.js.map +1 -0
- package/oauth/chain-revocation-sink.d.ts +24 -0
- package/oauth/chain-revocation-sink.d.ts.map +1 -0
- package/oauth/chain-revocation-sink.js +47 -0
- package/oauth/chain-revocation-sink.js.map +1 -0
- package/oauth/gossip-sync.d.ts +25 -0
- package/oauth/gossip-sync.d.ts.map +1 -0
- package/oauth/gossip-sync.js +62 -0
- package/oauth/gossip-sync.js.map +1 -0
- package/oauth/issuer-keys.d.ts +31 -0
- package/oauth/issuer-keys.d.ts.map +1 -0
- package/oauth/issuer-keys.js +117 -0
- package/oauth/issuer-keys.js.map +1 -0
- package/oauth/peer-resolver.d.ts +25 -0
- package/oauth/peer-resolver.d.ts.map +1 -0
- package/oauth/peer-resolver.js +81 -0
- package/oauth/peer-resolver.js.map +1 -0
- package/oauth/revocation-store.d.ts +58 -0
- package/oauth/revocation-store.d.ts.map +1 -0
- package/oauth/revocation-store.js +86 -0
- package/oauth/revocation-store.js.map +1 -0
- package/oauth/token-v2.d.ts +101 -0
- package/oauth/token-v2.d.ts.map +1 -0
- package/oauth/token-v2.js +167 -0
- package/oauth/token-v2.js.map +1 -0
- package/oracle/c5-glue.js +603 -0
- package/oracle/ops-console.js +623 -0
- package/oracle/oracle-sync.d.ts +29 -0
- package/oracle/oracle-sync.d.ts.map +1 -0
- package/oracle/oracle-sync.js +445 -0
- package/oracle/oracle-sync.js.map +1 -0
- package/oracle/registry.d.ts +30 -0
- package/oracle/registry.d.ts.map +1 -0
- package/oracle/registry.js +62 -0
- package/oracle/registry.js.map +1 -0
- package/p2p/availability.d.ts +188 -0
- package/p2p/availability.d.ts.map +1 -0
- package/p2p/availability.js +574 -0
- package/p2p/availability.js.map +1 -0
- package/p2p/bootstrap.d.ts +42 -0
- package/p2p/bootstrap.d.ts.map +1 -0
- package/p2p/bootstrap.js +146 -0
- package/p2p/bootstrap.js.map +1 -0
- package/p2p/buyer-client.d.ts +98 -0
- package/p2p/buyer-client.d.ts.map +1 -0
- package/p2p/buyer-client.js +199 -0
- package/p2p/buyer-client.js.map +1 -0
- package/p2p/cdn-ddns.d.ts +208 -0
- package/p2p/cdn-ddns.d.ts.map +1 -0
- package/p2p/cdn-ddns.js +500 -0
- package/p2p/cdn-ddns.js.map +1 -0
- package/p2p/cluster-sync.d.ts +115 -0
- package/p2p/cluster-sync.d.ts.map +1 -0
- package/p2p/cluster-sync.js +330 -0
- package/p2p/cluster-sync.js.map +1 -0
- package/p2p/consistency-check.d.ts +30 -0
- package/p2p/consistency-check.d.ts.map +1 -0
- package/p2p/consistency-check.js +168 -0
- package/p2p/consistency-check.js.map +1 -0
- package/p2p/endpoint-registry.d.ts +41 -0
- package/p2p/endpoint-registry.d.ts.map +1 -0
- package/p2p/endpoint-registry.js +128 -0
- package/p2p/endpoint-registry.js.map +1 -0
- package/p2p/ipv6.d.ts +120 -0
- package/p2p/ipv6.d.ts.map +1 -0
- package/p2p/ipv6.js +425 -0
- package/p2p/ipv6.js.map +1 -0
- package/p2p/protocol.d.ts +100 -0
- package/p2p/protocol.d.ts.map +1 -0
- package/p2p/protocol.js +330 -0
- package/p2p/protocol.js.map +1 -0
- package/p2p/reliability.d.ts +56 -0
- package/p2p/reliability.d.ts.map +1 -0
- package/p2p/reliability.js +240 -0
- package/p2p/reliability.js.map +1 -0
- package/p2p/seller-service.d.ts +53 -0
- package/p2p/seller-service.d.ts.map +1 -0
- package/p2p/seller-service.js +276 -0
- package/p2p/seller-service.js.map +1 -0
- package/p2p/signing.d.ts +31 -0
- package/p2p/signing.d.ts.map +1 -0
- package/p2p/signing.js +95 -0
- package/p2p/signing.js.map +1 -0
- package/package.json +73 -0
- package/payment/api.d.ts +9 -0
- package/payment/api.d.ts.map +1 -0
- package/payment/api.js +141 -0
- package/payment/api.js.map +1 -0
- package/payment/gateway.d.ts +114 -0
- package/payment/gateway.d.ts.map +1 -0
- package/payment/gateway.js +231 -0
- package/payment/gateway.js.map +1 -0
- package/payments/alipay/index.d.ts +18 -0
- package/payments/alipay/index.d.ts.map +1 -0
- package/payments/alipay/index.js +55 -0
- package/payments/alipay/index.js.map +1 -0
- package/payments/base.d.ts +13 -0
- package/payments/base.d.ts.map +1 -0
- package/payments/base.js +28 -0
- package/payments/base.js.map +1 -0
- package/payments/index.d.ts +18 -0
- package/payments/index.d.ts.map +1 -0
- package/payments/index.js +66 -0
- package/payments/index.js.map +1 -0
- package/payments/template/index.d.ts +18 -0
- package/payments/template/index.d.ts.map +1 -0
- package/payments/template/index.js +57 -0
- package/payments/template/index.js.map +1 -0
- package/payments/types.d.ts +42 -0
- package/payments/types.d.ts.map +1 -0
- package/payments/types.js +3 -0
- package/payments/types.js.map +1 -0
- package/payments/wechat/index.d.ts +18 -0
- package/payments/wechat/index.d.ts.map +1 -0
- package/payments/wechat/index.js +54 -0
- package/payments/wechat/index.js.map +1 -0
- package/peer/chain-signer.d.ts +74 -0
- package/peer/chain-signer.d.ts.map +1 -0
- package/peer/chain-signer.js +149 -0
- package/peer/chain-signer.js.map +1 -0
- package/peer/config.d.ts +71 -0
- package/peer/config.d.ts.map +1 -0
- package/peer/config.js +61 -0
- package/peer/config.js.map +1 -0
- package/peer/index.d.ts +12 -0
- package/peer/index.d.ts.map +1 -0
- package/peer/index.js +46 -0
- package/peer/index.js.map +1 -0
- package/peer/key-store.d.ts +66 -0
- package/peer/key-store.d.ts.map +1 -0
- package/peer/key-store.js +163 -0
- package/peer/key-store.js.map +1 -0
- package/peer/proto-codec.d.ts +103 -0
- package/peer/proto-codec.d.ts.map +1 -0
- package/peer/proto-codec.js +423 -0
- package/peer/proto-codec.js.map +1 -0
- package/peer/registrar.d.ts +88 -0
- package/peer/registrar.d.ts.map +1 -0
- package/peer/registrar.js +271 -0
- package/peer/registrar.js.map +1 -0
- package/peer/registry.d.ts +31 -0
- package/peer/registry.d.ts.map +1 -0
- package/peer/registry.js +143 -0
- package/peer/registry.js.map +1 -0
- package/plugins/auth.d.ts +193 -0
- package/plugins/auth.d.ts.map +1 -0
- package/plugins/auth.js +923 -0
- package/plugins/auth.js.map +1 -0
- package/plugins/manager.d.ts +37 -0
- package/plugins/manager.d.ts.map +1 -0
- package/plugins/manager.js +83 -0
- package/plugins/manager.js.map +1 -0
- package/plugins/oauth.d.ts +249 -0
- package/plugins/oauth.d.ts.map +1 -0
- package/plugins/oauth.js +979 -0
- package/plugins/oauth.js.map +1 -0
- package/plugins/p2p-message.d.ts +133 -0
- package/plugins/p2p-message.d.ts.map +1 -0
- package/plugins/p2p-message.js +443 -0
- package/plugins/p2p-message.js.map +1 -0
- package/plugins/postgresql.d.ts +54 -0
- package/plugins/postgresql.d.ts.map +1 -0
- package/plugins/postgresql.js +743 -0
- package/plugins/postgresql.js.map +1 -0
- package/plugins/relationship.d.ts +141 -0
- package/plugins/relationship.d.ts.map +1 -0
- package/plugins/relationship.js +395 -0
- package/plugins/relationship.js.map +1 -0
- package/plugins/sqlite.d.ts +200 -0
- package/plugins/sqlite.d.ts.map +1 -0
- package/plugins/sqlite.js +2412 -0
- package/plugins/sqlite.js.map +1 -0
- package/port-manager/disguise/ssh.d.ts +19 -0
- package/port-manager/disguise/ssh.d.ts.map +1 -0
- package/port-manager/disguise/ssh.js +104 -0
- package/port-manager/disguise/ssh.js.map +1 -0
- package/port-manager/port-manager.d.ts +65 -0
- package/port-manager/port-manager.d.ts.map +1 -0
- package/port-manager/port-manager.js +164 -0
- package/port-manager/port-manager.js.map +1 -0
- package/port-manager/port-scanner.d.ts +22 -0
- package/port-manager/port-scanner.d.ts.map +1 -0
- package/port-manager/port-scanner.js +187 -0
- package/port-manager/port-scanner.js.map +1 -0
- package/port-manager/types.d.ts +51 -0
- package/port-manager/types.d.ts.map +1 -0
- package/port-manager/types.js +6 -0
- package/port-manager/types.js.map +1 -0
- package/proto/amino/amino.proto +84 -0
- package/proto/cosmos/base/v1beta1/coin.proto +61 -0
- package/proto/cosmos/msg/v1/msg.proto +30 -0
- package/proto/cosmos_proto/cosmos.proto +112 -0
- package/proto/gogoproto/gogo.proto +145 -0
- package/proto/google/protobuf/descriptor.proto +1218 -0
- package/proto/trustchain/economy/v1/params.proto +133 -0
- package/proto/trustchain/economy/v1/tx.proto +162 -0
- package/proto/trustchain/marketplace/v1/params.proto +64 -0
- package/proto/trustchain/marketplace/v1/product.proto +21 -0
- package/proto/trustchain/marketplace/v1/tx.proto +131 -0
- package/proto/trustchain/order/v1/params.proto +94 -0
- package/proto/trustchain/order/v1/tx.proto +156 -0
- package/proto/trustchain/serviceprovider/v1/paymentfact.proto +32 -0
- package/proto/trustchain/serviceprovider/v1/serviceprovider.proto +38 -0
- package/proto/trustchain/serviceprovider/v1/tx.proto +106 -0
- package/proto/trustchain/subchain/v1/params.proto +26 -0
- package/proto/trustchain/subchain/v1/pool.proto +53 -0
- package/proto/trustchain/subchain/v1/tx.proto +159 -0
- package/proto/trustchain/trustcoin/v1/business_scope.proto +126 -0
- package/proto/trustchain/trustcoin/v1/genesis.proto +33 -0
- package/proto/trustchain/trustcoin/v1/params.proto +86 -0
- package/proto/trustchain/trustcoin/v1/query.proto +95 -0
- package/proto/trustchain/trustcoin/v1/tx.proto +160 -0
- package/proto/trustchain/verification/v1/params.proto +46 -0
- package/proto/trustchain/verification/v1/tx.proto +126 -0
- package/proto/trustchain/verification/v1/verification.proto +105 -0
- package/relationship-chain-api.d.ts +13 -0
- package/relationship-chain-api.d.ts.map +1 -0
- package/relationship-chain-api.js +139 -0
- package/relationship-chain-api.js.map +1 -0
- package/relationship-chain.d.ts +90 -0
- package/relationship-chain.d.ts.map +1 -0
- package/relationship-chain.js +201 -0
- package/relationship-chain.js.map +1 -0
- package/routes/agent-pay.js +419 -0
- package/routes/agent-serviceprovider.js +183 -0
- package/routes/ai.d.ts +54 -0
- package/routes/ai.d.ts.map +1 -0
- package/routes/ai.js +293 -0
- package/routes/ai.js.map +1 -0
- package/routes/api-keys.d.ts +12 -0
- package/routes/api-keys.d.ts.map +1 -0
- package/routes/api-keys.js +163 -0
- package/routes/api-keys.js.map +1 -0
- package/routes/app-store.d.ts +12 -0
- package/routes/app-store.d.ts.map +1 -0
- package/routes/app-store.js +207 -0
- package/routes/app-store.js.map +1 -0
- package/routes/auth-management.d.ts +17 -0
- package/routes/auth-management.d.ts.map +1 -0
- package/routes/auth-management.js +257 -0
- package/routes/auth-management.js.map +1 -0
- package/routes/auth.d.ts +9 -0
- package/routes/auth.d.ts.map +1 -0
- package/routes/auth.js +846 -0
- package/routes/auth.js.map +1 -0
- package/routes/brand.d.ts +3 -0
- package/routes/brand.d.ts.map +1 -0
- package/routes/brand.js +109 -0
- package/routes/brand.js.map +1 -0
- package/routes/chain-registry.d.ts +11 -0
- package/routes/chain-registry.d.ts.map +1 -0
- package/routes/chain-registry.js +51 -0
- package/routes/chain-registry.js.map +1 -0
- package/routes/chain-writes-insurance.d.ts +17 -0
- package/routes/chain-writes-insurance.d.ts.map +1 -0
- package/routes/chain-writes-insurance.js +69 -0
- package/routes/chain-writes-insurance.js.map +1 -0
- package/routes/chain-writes-pledge.d.ts +34 -0
- package/routes/chain-writes-pledge.d.ts.map +1 -0
- package/routes/chain-writes-pledge.js +206 -0
- package/routes/chain-writes-pledge.js.map +1 -0
- package/routes/chain-writes-products.d.ts +66 -0
- package/routes/chain-writes-products.d.ts.map +1 -0
- package/routes/chain-writes-products.js +394 -0
- package/routes/chain-writes-products.js.map +1 -0
- package/routes/chain-writes.d.ts +78 -0
- package/routes/chain-writes.d.ts.map +1 -0
- package/routes/chain-writes.js +658 -0
- package/routes/chain-writes.js.map +1 -0
- package/routes/chain.d.ts +10 -0
- package/routes/chain.d.ts.map +1 -0
- package/routes/chain.js +45 -0
- package/routes/chain.js.map +1 -0
- package/routes/compliance.d.ts +3 -0
- package/routes/compliance.d.ts.map +1 -0
- package/routes/compliance.js +53 -0
- package/routes/compliance.js.map +1 -0
- package/routes/council.d.ts +3 -0
- package/routes/council.d.ts.map +1 -0
- package/routes/council.js +477 -0
- package/routes/council.js.map +1 -0
- package/routes/crosschain.d.ts +11 -0
- package/routes/crosschain.d.ts.map +1 -0
- package/routes/crosschain.js +39 -0
- package/routes/crosschain.js.map +1 -0
- package/routes/device.d.ts +3 -0
- package/routes/device.d.ts.map +1 -0
- package/routes/device.js +73 -0
- package/routes/device.js.map +1 -0
- package/routes/devreward.d.ts +54 -0
- package/routes/devreward.d.ts.map +1 -0
- package/routes/devreward.js +129 -0
- package/routes/devreward.js.map +1 -0
- package/routes/economy.d.ts +50 -0
- package/routes/economy.d.ts.map +1 -0
- package/routes/economy.js +273 -0
- package/routes/economy.js.map +1 -0
- package/routes/flowback.d.ts +32 -0
- package/routes/flowback.d.ts.map +1 -0
- package/routes/flowback.js +97 -0
- package/routes/flowback.js.map +1 -0
- package/routes/insurance.d.ts +10 -0
- package/routes/insurance.d.ts.map +1 -0
- package/routes/insurance.js +70 -0
- package/routes/insurance.js.map +1 -0
- package/routes/m2m-viewer.js +195 -0
- package/routes/m2m.d.ts +10 -0
- package/routes/m2m.d.ts.map +1 -0
- package/routes/m2m.js +31 -0
- package/routes/m2m.js.map +1 -0
- package/routes/marketplace.d.ts +15 -0
- package/routes/marketplace.d.ts.map +1 -0
- package/routes/marketplace.js +396 -0
- package/routes/marketplace.js.map +1 -0
- package/routes/node-config.d.ts +6 -0
- package/routes/node-config.d.ts.map +1 -0
- package/routes/node-config.js +500 -0
- package/routes/node-config.js.map +1 -0
- package/routes/oauth-revocation.d.ts +42 -0
- package/routes/oauth-revocation.d.ts.map +1 -0
- package/routes/oauth-revocation.js +99 -0
- package/routes/oauth-revocation.js.map +1 -0
- package/routes/oauth.d.ts +17 -0
- package/routes/oauth.d.ts.map +1 -0
- package/routes/oauth.js +700 -0
- package/routes/oauth.js.map +1 -0
- package/routes/onboard.html +352 -0
- package/routes/onboard.js +435 -0
- package/routes/order.d.ts +8 -0
- package/routes/order.d.ts.map +1 -0
- package/routes/order.js +607 -0
- package/routes/order.js.map +1 -0
- package/routes/p2p-api.d.ts +33 -0
- package/routes/p2p-api.d.ts.map +1 -0
- package/routes/p2p-api.js +274 -0
- package/routes/p2p-api.js.map +1 -0
- package/routes/p2p-message.d.ts +20 -0
- package/routes/p2p-message.d.ts.map +1 -0
- package/routes/p2p-message.js +237 -0
- package/routes/p2p-message.js.map +1 -0
- package/routes/peer.d.ts +22 -0
- package/routes/peer.d.ts.map +1 -0
- package/routes/peer.js +220 -0
- package/routes/peer.js.map +1 -0
- package/routes/plugins.d.ts +4 -0
- package/routes/plugins.d.ts.map +1 -0
- package/routes/plugins.js +138 -0
- package/routes/plugins.js.map +1 -0
- package/routes/port-manager.d.ts +6 -0
- package/routes/port-manager.d.ts.map +1 -0
- package/routes/port-manager.js +212 -0
- package/routes/port-manager.js.map +1 -0
- package/routes/relationship.d.ts +7 -0
- package/routes/relationship.d.ts.map +1 -0
- package/routes/relationship.js +314 -0
- package/routes/relationship.js.map +1 -0
- package/routes/relay.d.ts +3 -0
- package/routes/relay.d.ts.map +1 -0
- package/routes/relay.js +182 -0
- package/routes/relay.js.map +1 -0
- package/routes/reputation.d.ts +10 -0
- package/routes/reputation.d.ts.map +1 -0
- package/routes/reputation.js +141 -0
- package/routes/reputation.js.map +1 -0
- package/routes/reward.d.ts +3 -0
- package/routes/reward.d.ts.map +1 -0
- package/routes/reward.js +130 -0
- package/routes/reward.js.map +1 -0
- package/routes/security-monitoring.d.ts +12 -0
- package/routes/security-monitoring.d.ts.map +1 -0
- package/routes/security-monitoring.js +373 -0
- package/routes/security-monitoring.js.map +1 -0
- package/routes/shop.d.ts +8 -0
- package/routes/shop.d.ts.map +1 -0
- package/routes/shop.js +164 -0
- package/routes/shop.js.map +1 -0
- package/routes/social.d.ts +22 -0
- package/routes/social.d.ts.map +1 -0
- package/routes/social.js +95 -0
- package/routes/social.js.map +1 -0
- package/routes/subchain.d.ts +18 -0
- package/routes/subchain.d.ts.map +1 -0
- package/routes/subchain.js +106 -0
- package/routes/subchain.js.map +1 -0
- package/routes/trustcoin.d.ts +17 -0
- package/routes/trustcoin.d.ts.map +1 -0
- package/routes/trustcoin.js +149 -0
- package/routes/trustcoin.js.map +1 -0
- package/routes/twofa.d.ts +7 -0
- package/routes/twofa.d.ts.map +1 -0
- package/routes/twofa.js +105 -0
- package/routes/twofa.js.map +1 -0
- package/routes/verification.d.ts +8 -0
- package/routes/verification.d.ts.map +1 -0
- package/routes/verification.js +234 -0
- package/routes/verification.js.map +1 -0
- package/routes/wallet.d.ts +4 -0
- package/routes/wallet.d.ts.map +1 -0
- package/routes/wallet.js +770 -0
- package/routes/wallet.js.map +1 -0
- package/run-auth.d.ts +8 -0
- package/run-auth.d.ts.map +1 -0
- package/run-auth.js +82 -0
- package/run-auth.js.map +1 -0
- package/run-p2p-message.d.ts +8 -0
- package/run-p2p-message.d.ts.map +1 -0
- package/run-p2p-message.js +82 -0
- package/run-p2p-message.js.map +1 -0
- package/run-relationship.d.ts +12 -0
- package/run-relationship.d.ts.map +1 -0
- package/run-relationship.js +182 -0
- package/run-relationship.js.map +1 -0
- package/run-unified.d.ts +13 -0
- package/run-unified.d.ts.map +1 -0
- package/run-unified.js +1067 -0
- package/run-unified.js.map +1 -0
- package/run.d.ts +12 -0
- package/run.d.ts.map +1 -0
- package/run.js +889 -0
- package/run.js.map +1 -0
- package/search/ranking.d.ts +55 -0
- package/search/ranking.d.ts.map +1 -0
- package/search/ranking.js +67 -0
- package/search/ranking.js.map +1 -0
- package/shipping/base.d.ts +15 -0
- package/shipping/base.d.ts.map +1 -0
- package/shipping/base.js +39 -0
- package/shipping/base.js.map +1 -0
- package/shipping/index.d.ts +19 -0
- package/shipping/index.d.ts.map +1 -0
- package/shipping/index.js +72 -0
- package/shipping/index.js.map +1 -0
- package/shipping/sf-express/index.d.ts +23 -0
- package/shipping/sf-express/index.d.ts.map +1 -0
- package/shipping/sf-express/index.js +71 -0
- package/shipping/sf-express/index.js.map +1 -0
- package/shipping/template/index.d.ts +20 -0
- package/shipping/template/index.d.ts.map +1 -0
- package/shipping/template/index.js +74 -0
- package/shipping/template/index.js.map +1 -0
- package/shipping/types.d.ts +71 -0
- package/shipping/types.d.ts.map +1 -0
- package/shipping/types.js +6 -0
- package/shipping/types.js.map +1 -0
- package/shipping/virtual/index.d.ts +19 -0
- package/shipping/virtual/index.d.ts.map +1 -0
- package/shipping/virtual/index.js +54 -0
- package/shipping/virtual/index.js.map +1 -0
- package/shipping/yto/index.d.ts +18 -0
- package/shipping/yto/index.d.ts.map +1 -0
- package/shipping/yto/index.js +59 -0
- package/shipping/yto/index.js.map +1 -0
- package/shipping/zto/index.d.ts +18 -0
- package/shipping/zto/index.d.ts.map +1 -0
- package/shipping/zto/index.js +59 -0
- package/shipping/zto/index.js.map +1 -0
- package/skills-lock.json +11 -0
- package/src/db/email-migrations.sql +31 -0
- package/src/db/oauth-migrations.sql +92 -0
- package/src/db/social-migrations.sql +94 -0
- package/src/db/store-migrations.sql +242 -0
- package/test-api-key-revoke.js +167 -0
- package/test-auth-register-ratelimit.js +132 -0
- package/test-auth-tv2.d.ts +2 -0
- package/test-auth-tv2.d.ts.map +1 -0
- package/test-auth-tv2.js +174 -0
- package/test-auth-tv2.js.map +1 -0
- package/test-canonsign-cross.d.ts +2 -0
- package/test-canonsign-cross.d.ts.map +1 -0
- package/test-canonsign-cross.js +32 -0
- package/test-canonsign-cross.js.map +1 -0
- package/test-chain-signer.js +127 -0
- package/test-env-truthy.js +50 -0
- package/test-onboard-contract.js +94 -0
- package/test-ops-console-boundary.js +147 -0
- package/test-oracle-glue.js +232 -0
- package/test-order-create-v394.js +358 -0
- package/test-order-intent.js +245 -0
- package/test-order-lifecycle-v394.js +528 -0
- package/test-p2p-message.d.ts +13 -0
- package/test-p2p-message.d.ts.map +1 -0
- package/test-p2p-message.js +106 -0
- package/test-p2p-message.js.map +1 -0
- package/test-relationship-chain.d.ts +13 -0
- package/test-relationship-chain.d.ts.map +1 -0
- package/test-relationship-chain.js +103 -0
- package/test-relationship-chain.js.map +1 -0
- package/test-runtime-data-path.js +217 -0
- package/test-seller-identity.js +74 -0
- package/test-signing-paths.js +104 -0
- package/test-token-v2.d.ts +2 -0
- package/test-token-v2.d.ts.map +1 -0
- package/test-token-v2.js +172 -0
- package/test-token-v2.js.map +1 -0
- package/test-wallet-auth-nonce.d.ts +12 -0
- package/test-wallet-auth-nonce.d.ts.map +1 -0
- package/test-wallet-auth-nonce.js +126 -0
- package/test-wallet-auth-nonce.js.map +1 -0
- package/test-wallet-submatch.d.ts +13 -0
- package/test-wallet-submatch.d.ts.map +1 -0
- package/test-wallet-submatch.js +86 -0
- package/test-wallet-submatch.js.map +1 -0
- package/tls/self-signed.d.ts +12 -0
- package/tls/self-signed.d.ts.map +1 -0
- package/tls/self-signed.js +63 -0
- package/tls/self-signed.js.map +1 -0
- package/tools/brand.d.ts +11 -0
- package/tools/brand.d.ts.map +1 -0
- package/tools/brand.js +75 -0
- package/tools/brand.js.map +1 -0
- package/tools/chainregistry.d.ts +18 -0
- package/tools/chainregistry.d.ts.map +1 -0
- package/tools/chainregistry.js +175 -0
- package/tools/chainregistry.js.map +1 -0
- package/tools/compliance.d.ts +14 -0
- package/tools/compliance.d.ts.map +1 -0
- package/tools/compliance.js +45 -0
- package/tools/compliance.js.map +1 -0
- package/tools/council.d.ts +17 -0
- package/tools/council.d.ts.map +1 -0
- package/tools/council.js +75 -0
- package/tools/council.js.map +1 -0
- package/tools/device.d.ts +13 -0
- package/tools/device.d.ts.map +1 -0
- package/tools/device.js +45 -0
- package/tools/device.js.map +1 -0
- package/tools/devreward.d.ts +15 -0
- package/tools/devreward.d.ts.map +1 -0
- package/tools/devreward.js +190 -0
- package/tools/devreward.js.map +1 -0
- package/tools/economy.d.ts +14 -0
- package/tools/economy.d.ts.map +1 -0
- package/tools/economy.js +172 -0
- package/tools/economy.js.map +1 -0
- package/tools/flowback.d.ts +14 -0
- package/tools/flowback.d.ts.map +1 -0
- package/tools/flowback.js +146 -0
- package/tools/flowback.js.map +1 -0
- package/tools/insurance.d.ts +13 -0
- package/tools/insurance.d.ts.map +1 -0
- package/tools/insurance.js +45 -0
- package/tools/insurance.js.map +1 -0
- package/tools/marketplace.d.ts +12 -0
- package/tools/marketplace.d.ts.map +1 -0
- package/tools/marketplace.js +124 -0
- package/tools/marketplace.js.map +1 -0
- package/tools/order.d.ts +12 -0
- package/tools/order.d.ts.map +1 -0
- package/tools/order.js +94 -0
- package/tools/order.js.map +1 -0
- package/tools/recovery.d.ts +14 -0
- package/tools/recovery.d.ts.map +1 -0
- package/tools/recovery.js +158 -0
- package/tools/recovery.js.map +1 -0
- package/tools/relay.d.ts +15 -0
- package/tools/relay.d.ts.map +1 -0
- package/tools/relay.js +152 -0
- package/tools/relay.js.map +1 -0
- package/tools/reputation.d.ts +20 -0
- package/tools/reputation.d.ts.map +1 -0
- package/tools/reputation.js +50 -0
- package/tools/reputation.js.map +1 -0
- package/tools/reputation_seller_credit.d.ts +16 -0
- package/tools/reputation_seller_credit.d.ts.map +1 -0
- package/tools/reputation_seller_credit.js +106 -0
- package/tools/reputation_seller_credit.js.map +1 -0
- package/tools/reward.d.ts +14 -0
- package/tools/reward.d.ts.map +1 -0
- package/tools/reward.js +76 -0
- package/tools/reward.js.map +1 -0
- package/tools/shop.d.ts +14 -0
- package/tools/shop.d.ts.map +1 -0
- package/tools/shop.js +95 -0
- package/tools/shop.js.map +1 -0
- package/tools/verification.d.ts +12 -0
- package/tools/verification.d.ts.map +1 -0
- package/tools/verification.js +89 -0
- package/tools/verification.js.map +1 -0
- package/types/store.d.ts +255 -0
- package/types/store.d.ts.map +1 -0
- package/types/store.js +19 -0
- package/types/store.js.map +1 -0
- package/utils/aes-gcm.d.ts +63 -0
- package/utils/aes-gcm.d.ts.map +1 -0
- package/utils/aes-gcm.js +179 -0
- package/utils/aes-gcm.js.map +1 -0
- package/utils/api-response.d.ts +51 -0
- package/utils/api-response.d.ts.map +1 -0
- package/utils/api-response.js +65 -0
- package/utils/api-response.js.map +1 -0
- package/utils/base32.d.ts +5 -0
- package/utils/base32.d.ts.map +1 -0
- package/utils/base32.js +20 -0
- package/utils/base32.js.map +1 -0
- package/utils/crypto.d.ts +77 -0
- package/utils/crypto.d.ts.map +1 -0
- package/utils/crypto.js +164 -0
- package/utils/crypto.js.map +1 -0
- package/utils/encryption.d.ts +81 -0
- package/utils/encryption.d.ts.map +1 -0
- package/utils/encryption.js +247 -0
- package/utils/encryption.js.map +1 -0
- package/utils/env.js +20 -0
- package/utils/jwt.d.ts +110 -0
- package/utils/jwt.d.ts.map +1 -0
- package/utils/jwt.js +275 -0
- package/utils/jwt.js.map +1 -0
- package/utils/qrcode-reader.d.ts +22 -0
- package/utils/qrcode-reader.d.ts.map +1 -0
- package/utils/qrcode-reader.js +90 -0
- package/utils/qrcode-reader.js.map +1 -0
- package/utils/qrcode.d.ts +26 -0
- package/utils/qrcode.d.ts.map +1 -0
- package/utils/qrcode.js +92 -0
- package/utils/qrcode.js.map +1 -0
- package/utils/totp.d.ts +3 -0
- package/utils/totp.d.ts.map +1 -0
- package/utils/totp.js +58 -0
- package/utils/totp.js.map +1 -0
- package/utils/two-factor-auth.d.ts +16 -0
- package/utils/two-factor-auth.d.ts.map +1 -0
- package/utils/two-factor-auth.js +150 -0
- package/utils/two-factor-auth.js.map +1 -0
- package/verifyer/hsm.d.ts +70 -0
- package/verifyer/hsm.d.ts.map +1 -0
- package/verifyer/hsm.js +482 -0
- package/verifyer/hsm.js.map +1 -0
- package/verifyer/index.d.ts +81 -0
- package/verifyer/index.d.ts.map +1 -0
- package/verifyer/index.js +372 -0
- package/verifyer/index.js.map +1 -0
- package/ws/peer-monitor-broadcaster.d.ts +24 -0
- package/ws/peer-monitor-broadcaster.d.ts.map +1 -0
- package/ws/peer-monitor-broadcaster.js +56 -0
- package/ws/peer-monitor-broadcaster.js.map +1 -0
package/routes/peer.js
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Peer API Routes (PRD-F Phase 2 §6 Web UI)
|
|
4
|
+
*
|
|
5
|
+
* 6 个 REST 接口:
|
|
6
|
+
* GET /api/peer/endpoints — 链上 IndexerEndpoint 列表(按 chain_id)
|
|
7
|
+
* GET /api/peer/trust — 本地 peer_trust 全部行
|
|
8
|
+
* POST /api/peer/trust — 加白名单(INSERT OR REPLACE)
|
|
9
|
+
* PATCH /api/peer/trust/:nodeId — 改 trust_level / note
|
|
10
|
+
* DELETE /api/peer/trust/:nodeId — 删除白名单
|
|
11
|
+
* GET /api/peer/call-log?limit=N — 最近 P2P 调用流水
|
|
12
|
+
*
|
|
13
|
+
* 鉴权:复用现有 requireAuth 中间件(与 /api/auth/me 同级)。
|
|
14
|
+
* 失败统一返 { ok: false, error: 'xxx' } + HTTP 4xx/5xx。
|
|
15
|
+
* 所有 INSERT/UPDATE 用 prepared statement 防注入。
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.createPeerRouter = createPeerRouter;
|
|
19
|
+
const express_1 = require("express");
|
|
20
|
+
const peer_tools_1 = require("../mcp/peer-tools");
|
|
21
|
+
function isTrustLevel(s) {
|
|
22
|
+
return s === 'read' || s === 'write' || s === 'admin';
|
|
23
|
+
}
|
|
24
|
+
/** Pull the SQLite handle off the indexer plugin. */
|
|
25
|
+
function resolveDb(deps) {
|
|
26
|
+
const idx = deps.indexer;
|
|
27
|
+
if (typeof idx.getRawDb !== 'function')
|
|
28
|
+
return null;
|
|
29
|
+
try {
|
|
30
|
+
return idx.getRawDb() ?? null;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function createPeerRouter(deps) {
|
|
37
|
+
const router = (0, express_1.Router)();
|
|
38
|
+
/**
|
|
39
|
+
* GET /api/peer/endpoints
|
|
40
|
+
* 链上 IndexerEndpoint 列表。透传 discoverEndpoints(by:'chain_id')
|
|
41
|
+
* Query: chain_id=trustchain-1&limit=20&offset=0
|
|
42
|
+
*/
|
|
43
|
+
router.get('/endpoints', async (req, res) => {
|
|
44
|
+
try {
|
|
45
|
+
const chainId = req.query.chain_id ||
|
|
46
|
+
process.env.CHAIN_ID ||
|
|
47
|
+
'trustchain-1';
|
|
48
|
+
const limit = Math.max(1, Math.min(100, parseInt(req.query.limit || '20', 10) || 20));
|
|
49
|
+
const offset = Math.max(0, parseInt(req.query.offset || '0', 10) || 0);
|
|
50
|
+
const result = await (0, peer_tools_1.discoverEndpoints)({ by: 'chain_id', value: chainId, limit, offset });
|
|
51
|
+
res.json({ ok: true, total: result.total, endpoints: result.endpoints });
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.error('[PeerAPI] endpoints error:', error?.message ?? error);
|
|
55
|
+
res.status(500).json({ ok: false, error: error?.message || 'discover-failed' });
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* GET /api/peer/trust
|
|
60
|
+
* 本地 peer_trust 全部行。monitor/peer-trust 页的列表源。
|
|
61
|
+
*/
|
|
62
|
+
router.get('/trust', async (_req, res) => {
|
|
63
|
+
const db = resolveDb(deps);
|
|
64
|
+
if (!db)
|
|
65
|
+
return res.status(500).json({ ok: false, error: 'no-database-handle' });
|
|
66
|
+
try {
|
|
67
|
+
const rows = db
|
|
68
|
+
.prepare('SELECT peer_node_id, trust_level, added_at, added_by, note FROM peer_trust ORDER BY added_at DESC')
|
|
69
|
+
.all();
|
|
70
|
+
res.json({ ok: true, total: rows.length, trusted: rows });
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
console.error('[PeerAPI] list trust error:', error?.message ?? error);
|
|
74
|
+
res.status(500).json({ ok: false, error: error?.message || 'list-trust-failed' });
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* POST /api/peer/trust
|
|
79
|
+
* 加白名单。body: { peer_node_id, trust_level, note? }
|
|
80
|
+
* added_at = Date.now() ms, added_by = req.user?.address || 'web-ui'
|
|
81
|
+
* 用 INSERT OR REPLACE — 同 node_id 覆盖。
|
|
82
|
+
*/
|
|
83
|
+
router.post('/trust', async (req, res) => {
|
|
84
|
+
const db = resolveDb(deps);
|
|
85
|
+
if (!db)
|
|
86
|
+
return res.status(500).json({ ok: false, error: 'no-database-handle' });
|
|
87
|
+
const { peer_node_id, trust_level, note } = req.body || {};
|
|
88
|
+
if (!peer_node_id || typeof peer_node_id !== 'string') {
|
|
89
|
+
return res.status(400).json({ ok: false, error: 'missing-peer-node-id' });
|
|
90
|
+
}
|
|
91
|
+
if (!isTrustLevel(trust_level)) {
|
|
92
|
+
return res.status(400).json({ ok: false, error: 'invalid-trust-level' });
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
const addedAt = Date.now();
|
|
96
|
+
const user = req.user;
|
|
97
|
+
const addedBy = user?.address || 'web-ui';
|
|
98
|
+
db.prepare(`INSERT INTO peer_trust (peer_node_id, trust_level, added_at, added_by, note)
|
|
99
|
+
VALUES (?, ?, ?, ?, ?)
|
|
100
|
+
ON CONFLICT(peer_node_id) DO UPDATE SET
|
|
101
|
+
trust_level = excluded.trust_level,
|
|
102
|
+
added_at = excluded.added_at,
|
|
103
|
+
added_by = excluded.added_by,
|
|
104
|
+
note = excluded.note`).run(peer_node_id, trust_level, addedAt, addedBy, note ?? null);
|
|
105
|
+
res.json({ ok: true, peer_node_id, trust_level, added_at: addedAt, added_by: addedBy });
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
console.error('[PeerAPI] add trust error:', error?.message ?? error);
|
|
109
|
+
res.status(500).json({ ok: false, error: error?.message || 'add-trust-failed' });
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
/**
|
|
113
|
+
* PATCH /api/peer/trust/:nodeId
|
|
114
|
+
* 改 trust_level / note。body: { trust_level?, note? }
|
|
115
|
+
*/
|
|
116
|
+
router.patch('/trust/:nodeId', async (req, res) => {
|
|
117
|
+
const db = resolveDb(deps);
|
|
118
|
+
if (!db)
|
|
119
|
+
return res.status(500).json({ ok: false, error: 'no-database-handle' });
|
|
120
|
+
const rawNodeId = req.params.nodeId;
|
|
121
|
+
const nodeId = decodeURIComponent(Array.isArray(rawNodeId) ? rawNodeId[0] : rawNodeId || '');
|
|
122
|
+
if (!nodeId)
|
|
123
|
+
return res.status(400).json({ ok: false, error: 'missing-peer-node-id' });
|
|
124
|
+
const { trust_level, note } = req.body || {};
|
|
125
|
+
if (trust_level === undefined && note === undefined) {
|
|
126
|
+
return res.status(400).json({ ok: false, error: 'no-fields-to-update' });
|
|
127
|
+
}
|
|
128
|
+
if (trust_level !== undefined && !isTrustLevel(trust_level)) {
|
|
129
|
+
return res.status(400).json({ ok: false, error: 'invalid-trust-level' });
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
// Build dynamic SET clause
|
|
133
|
+
const sets = [];
|
|
134
|
+
const args = [];
|
|
135
|
+
if (trust_level !== undefined) {
|
|
136
|
+
sets.push('trust_level = ?');
|
|
137
|
+
args.push(trust_level);
|
|
138
|
+
}
|
|
139
|
+
if (note !== undefined) {
|
|
140
|
+
sets.push('note = ?');
|
|
141
|
+
args.push(note ?? null);
|
|
142
|
+
}
|
|
143
|
+
args.push(nodeId);
|
|
144
|
+
const result = db
|
|
145
|
+
.prepare(`UPDATE peer_trust SET ${sets.join(', ')} WHERE peer_node_id = ?`)
|
|
146
|
+
.run(...args);
|
|
147
|
+
if (result.changes === 0) {
|
|
148
|
+
return res.status(404).json({ ok: false, error: 'peer-not-found' });
|
|
149
|
+
}
|
|
150
|
+
res.json({ ok: true, updated: result.changes });
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
console.error('[PeerAPI] patch trust error:', error?.message ?? error);
|
|
154
|
+
res.status(500).json({ ok: false, error: error?.message || 'update-trust-failed' });
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
/**
|
|
158
|
+
* DELETE /api/peer/trust/:nodeId
|
|
159
|
+
* 删除白名单。{ ok, removed: 0|1 }
|
|
160
|
+
*/
|
|
161
|
+
router.delete('/trust/:nodeId', async (req, res) => {
|
|
162
|
+
const db = resolveDb(deps);
|
|
163
|
+
if (!db)
|
|
164
|
+
return res.status(500).json({ ok: false, error: 'no-database-handle' });
|
|
165
|
+
const rawNodeId = req.params.nodeId;
|
|
166
|
+
const nodeId = decodeURIComponent(Array.isArray(rawNodeId) ? rawNodeId[0] : rawNodeId || '');
|
|
167
|
+
if (!nodeId)
|
|
168
|
+
return res.status(400).json({ ok: false, error: 'missing-peer-node-id' });
|
|
169
|
+
try {
|
|
170
|
+
const result = db.prepare('DELETE FROM peer_trust WHERE peer_node_id = ?').run(nodeId);
|
|
171
|
+
res.json({ ok: true, removed: result.changes });
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
console.error('[PeerAPI] delete trust error:', error?.message ?? error);
|
|
175
|
+
res.status(500).json({ ok: false, error: error?.message || 'delete-trust-failed' });
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
/**
|
|
179
|
+
* GET /api/peer/call-log?limit=100
|
|
180
|
+
* 最近 P2P 调用流水(默认 100,上限 1000)。monitor 页初始数据。
|
|
181
|
+
* PRD-F §6.1: 返回字段新增 request_body / response_body,超过 2000 chars 在
|
|
182
|
+
* 末尾加 '... [truncated]' 防止前端一屏炸裂;底层入库时已截断到 10KB。
|
|
183
|
+
*/
|
|
184
|
+
router.get('/call-log', async (req, res) => {
|
|
185
|
+
const db = resolveDb(deps);
|
|
186
|
+
if (!db)
|
|
187
|
+
return res.status(500).json({ ok: false, error: 'no-database-handle' });
|
|
188
|
+
const limit = Math.max(1, Math.min(1000, parseInt(req.query.limit || '100', 10) || 100));
|
|
189
|
+
const BODY_PREVIEW_LIMIT = 2000;
|
|
190
|
+
const TRUNCATED_SUFFIX = '... [truncated]';
|
|
191
|
+
try {
|
|
192
|
+
const rows = db
|
|
193
|
+
.prepare(`SELECT id, ts, direction, remote_node_id, remote_ip, method, path,
|
|
194
|
+
tool_name, status, error, rtt_ms, trust_level,
|
|
195
|
+
request_body, response_body
|
|
196
|
+
FROM peer_call_log ORDER BY ts DESC LIMIT ?`)
|
|
197
|
+
.all(limit);
|
|
198
|
+
const preview = (s) => {
|
|
199
|
+
if (s === null || s === undefined)
|
|
200
|
+
return null;
|
|
201
|
+
const str = typeof s === 'string' ? s : String(s);
|
|
202
|
+
if (str.length <= BODY_PREVIEW_LIMIT)
|
|
203
|
+
return str;
|
|
204
|
+
return str.slice(0, BODY_PREVIEW_LIMIT) + TRUNCATED_SUFFIX;
|
|
205
|
+
};
|
|
206
|
+
const logs = rows.map((r) => ({
|
|
207
|
+
...r,
|
|
208
|
+
request_body: preview(r.request_body),
|
|
209
|
+
response_body: preview(r.response_body),
|
|
210
|
+
}));
|
|
211
|
+
res.json({ ok: true, total: logs.length, logs });
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
console.error('[PeerAPI] call-log error:', error?.message ?? error);
|
|
215
|
+
res.status(500).json({ ok: false, error: error?.message || 'call-log-failed' });
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
return router;
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=peer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peer.js","sourceRoot":"","sources":["../../src/routes/peer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AA4BH,4CAyMC;AAnOD,qCAAoD;AAEpD,kDAAsD;AAStD,SAAS,YAAY,CAAC,CAAU;IAC9B,OAAO,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,OAAO,CAAC;AACxD,CAAC;AAED,qDAAqD;AACrD,SAAS,SAAS,CAAC,IAA0B;IAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAmE,CAAC;IACrF,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IACpD,IAAI,CAAC;QACH,OAAO,GAAG,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAgB,gBAAgB,CAAC,IAA0B;IACzD,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;IAExB;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,YA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Y,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;gBACrC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;aACxC,CAAC,CAAC,CAAC;YAEJ,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,EAAE,OAAO,IAAI,KAAK,CAAC,CAAC;YACpE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,IAAI,iBAAiB,EAAE,CAAC,CAAC;QAClF,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/routes/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CA6JlE"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPluginsRoutes = createPluginsRoutes;
|
|
4
|
+
const express_1 = require("express");
|
|
5
|
+
function createPluginsRoutes(authPlugin) {
|
|
6
|
+
const router = (0, express_1.Router)();
|
|
7
|
+
/**
|
|
8
|
+
* 获取插件列表
|
|
9
|
+
* GET /api/plugins
|
|
10
|
+
*/
|
|
11
|
+
router.get('/', async (req, res) => {
|
|
12
|
+
try {
|
|
13
|
+
const authHeader = req.headers.authorization;
|
|
14
|
+
if (!authHeader || !authHeader.startsWith('Bearer ')) {
|
|
15
|
+
return res.status(401).json({ error: 'Missing authorization header' });
|
|
16
|
+
}
|
|
17
|
+
const token = authHeader.substring(7);
|
|
18
|
+
const tokenData = await authPlugin.verifyToken(token);
|
|
19
|
+
if (!tokenData) {
|
|
20
|
+
return res.status(401).json({ error: 'Invalid token' });
|
|
21
|
+
}
|
|
22
|
+
// TODO: 从数据库或文件系统查询插件列表
|
|
23
|
+
const plugins = [
|
|
24
|
+
{
|
|
25
|
+
id: 'plugin-1',
|
|
26
|
+
name: 'Example Plugin',
|
|
27
|
+
version: '1.0.0',
|
|
28
|
+
description: 'An example plugin',
|
|
29
|
+
enabled: true,
|
|
30
|
+
status: 'running'
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
res.json({ success: true, plugins });
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error('[PluginsAPI] Get plugins error:', error);
|
|
37
|
+
res.status(400).json({ error: error.message });
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* 启动插件
|
|
42
|
+
* POST /api/plugins/:id/start
|
|
43
|
+
*/
|
|
44
|
+
router.post('/:id/start', async (req, res) => {
|
|
45
|
+
try {
|
|
46
|
+
const authHeader = req.headers.authorization;
|
|
47
|
+
if (!authHeader || !authHeader.startsWith('Bearer ')) {
|
|
48
|
+
return res.status(401).json({ error: 'Missing authorization header' });
|
|
49
|
+
}
|
|
50
|
+
const token = authHeader.substring(7);
|
|
51
|
+
const tokenData = await authPlugin.verifyToken(token);
|
|
52
|
+
if (!tokenData) {
|
|
53
|
+
return res.status(401).json({ error: 'Invalid token' });
|
|
54
|
+
}
|
|
55
|
+
const { id } = req.params;
|
|
56
|
+
// TODO: 实现插件启动逻辑
|
|
57
|
+
res.json({ success: true, message: `Plugin ${id} started` });
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.error('[PluginsAPI] Start plugin error:', error);
|
|
61
|
+
res.status(400).json({ error: error.message });
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* 停止插件
|
|
66
|
+
* POST /api/plugins/:id/stop
|
|
67
|
+
*/
|
|
68
|
+
router.post('/:id/stop', async (req, res) => {
|
|
69
|
+
try {
|
|
70
|
+
const authHeader = req.headers.authorization;
|
|
71
|
+
if (!authHeader || !authHeader.startsWith('Bearer ')) {
|
|
72
|
+
return res.status(401).json({ error: 'Missing authorization header' });
|
|
73
|
+
}
|
|
74
|
+
const token = authHeader.substring(7);
|
|
75
|
+
const tokenData = await authPlugin.verifyToken(token);
|
|
76
|
+
if (!tokenData) {
|
|
77
|
+
return res.status(401).json({ error: 'Invalid token' });
|
|
78
|
+
}
|
|
79
|
+
const { id } = req.params;
|
|
80
|
+
// TODO: 实现插件停止逻辑
|
|
81
|
+
res.json({ success: true, message: `Plugin ${id} stopped` });
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
console.error('[PluginsAPI] Stop plugin error:', error);
|
|
85
|
+
res.status(400).json({ error: error.message });
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
/**
|
|
89
|
+
* 启用插件
|
|
90
|
+
* POST /api/plugins/:id/enable
|
|
91
|
+
*/
|
|
92
|
+
router.post('/:id/enable', async (req, res) => {
|
|
93
|
+
try {
|
|
94
|
+
const authHeader = req.headers.authorization;
|
|
95
|
+
if (!authHeader || !authHeader.startsWith('Bearer ')) {
|
|
96
|
+
return res.status(401).json({ error: 'Missing authorization header' });
|
|
97
|
+
}
|
|
98
|
+
const token = authHeader.substring(7);
|
|
99
|
+
const tokenData = await authPlugin.verifyToken(token);
|
|
100
|
+
if (!tokenData) {
|
|
101
|
+
return res.status(401).json({ error: 'Invalid token' });
|
|
102
|
+
}
|
|
103
|
+
const { id } = req.params;
|
|
104
|
+
// TODO: 实现插件启用逻辑
|
|
105
|
+
res.json({ success: true, message: `Plugin ${id} enabled` });
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
console.error('[PluginsAPI] Enable plugin error:', error);
|
|
109
|
+
res.status(400).json({ error: error.message });
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
/**
|
|
113
|
+
* 卸载插件
|
|
114
|
+
* DELETE /api/plugins/:id
|
|
115
|
+
*/
|
|
116
|
+
router.delete('/:id', async (req, res) => {
|
|
117
|
+
try {
|
|
118
|
+
const authHeader = req.headers.authorization;
|
|
119
|
+
if (!authHeader || !authHeader.startsWith('Bearer ')) {
|
|
120
|
+
return res.status(401).json({ error: 'Missing authorization header' });
|
|
121
|
+
}
|
|
122
|
+
const token = authHeader.substring(7);
|
|
123
|
+
const tokenData = await authPlugin.verifyToken(token);
|
|
124
|
+
if (!tokenData) {
|
|
125
|
+
return res.status(401).json({ error: 'Invalid token' });
|
|
126
|
+
}
|
|
127
|
+
const { id } = req.params;
|
|
128
|
+
// TODO: 实现插件卸载逻辑
|
|
129
|
+
res.json({ success: true, message: `Plugin ${id} uninstalled` });
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
console.error('[PluginsAPI] Uninstall plugin error:', error);
|
|
133
|
+
res.status(400).json({ error: error.message });
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return router;
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/routes/plugins.ts"],"names":[],"mappings":";;AAGA,kDA6JC;AAhKD,qCAAoD;AAGpD,SAAgB,mBAAmB,CAAC,UAAsB;IACxD,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,EAAE;QACpD,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,GAA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AM,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAEtD,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;YAC1D,CAAC;YAED,MAAM,EAAE,EAAE,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;YAE1B,iBAAiB;YAEjB,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC,CAAC;QACnE,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;YAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACjD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"port-manager.d.ts","sourceRoot":"","sources":["../../src/routes/port-manager.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,QAAA,MAAM,MAAM,4CAAW,CAAC;AA8MxB,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 端口管理 API 路由
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const express_1 = require("express");
|
|
7
|
+
const port_manager_1 = require("../port-manager/port-manager");
|
|
8
|
+
const port_scanner_1 = require("../port-manager/port-scanner");
|
|
9
|
+
const ssh_1 = require("../port-manager/disguise/ssh");
|
|
10
|
+
const router = (0, express_1.Router)();
|
|
11
|
+
/**
|
|
12
|
+
* GET /api/port-manager/scan
|
|
13
|
+
* 扫描所有端口
|
|
14
|
+
*/
|
|
15
|
+
router.get('/scan', async (_req, res) => {
|
|
16
|
+
try {
|
|
17
|
+
const results = await port_manager_1.portManager.scanPorts();
|
|
18
|
+
res.json({ ports: results, total: results.length });
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
res.status(500).json({ error: error.message });
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* POST /api/port-manager/test/:port
|
|
26
|
+
* 测试单个端口
|
|
27
|
+
*/
|
|
28
|
+
router.post('/test/:port', async (req, res) => {
|
|
29
|
+
try {
|
|
30
|
+
const port = parseInt(String(req.params.port), 10);
|
|
31
|
+
const portInfo = port_scanner_1.TEST_PORTS.find(p => p.port === port);
|
|
32
|
+
if (!portInfo) {
|
|
33
|
+
return res.status(404).json({ error: `Port ${port} not in test list` });
|
|
34
|
+
}
|
|
35
|
+
const result = await (0, port_scanner_1.testPort)(portInfo);
|
|
36
|
+
res.json(result);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
res.status(500).json({ error: error.message });
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* GET /api/port-manager/config
|
|
44
|
+
* 获取发现配置
|
|
45
|
+
*/
|
|
46
|
+
router.get('/config', (_req, res) => {
|
|
47
|
+
try {
|
|
48
|
+
const config = port_manager_1.portManager.getDiscoveryConfig();
|
|
49
|
+
res.json(config);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
res.status(500).json({ error: error.message });
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* POST /api/port-manager/config
|
|
57
|
+
* 设置发现配置
|
|
58
|
+
*/
|
|
59
|
+
router.post('/config', (req, res) => {
|
|
60
|
+
try {
|
|
61
|
+
const { primary, fallbacks } = req.body || {};
|
|
62
|
+
const config = port_manager_1.portManager.setDiscoveryConfig(primary || null, fallbacks || []);
|
|
63
|
+
res.json({ success: true, config });
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
res.status(500).json({ error: error.message });
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* GET /api/port-manager/apps
|
|
71
|
+
* 列出已安装应用
|
|
72
|
+
*/
|
|
73
|
+
router.get('/apps', (_req, res) => {
|
|
74
|
+
try {
|
|
75
|
+
const apps = port_manager_1.portManager.listApps();
|
|
76
|
+
res.json({ apps, total: apps.length });
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
res.status(500).json({ error: error.message });
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
/**
|
|
83
|
+
* POST /api/port-manager/apps/install
|
|
84
|
+
* 安装应用
|
|
85
|
+
*/
|
|
86
|
+
router.post('/apps/install', async (req, res) => {
|
|
87
|
+
try {
|
|
88
|
+
const { app_id, name, default_port, fallback_ports, protocol, config } = req.body;
|
|
89
|
+
if (!app_id || !name || !default_port) {
|
|
90
|
+
return res.status(400).json({ error: 'app_id, name, default_port are required' });
|
|
91
|
+
}
|
|
92
|
+
const app = await port_manager_1.portManager.installApp({
|
|
93
|
+
app_id,
|
|
94
|
+
name,
|
|
95
|
+
default_port,
|
|
96
|
+
fallback_ports: fallback_ports || [],
|
|
97
|
+
protocol: protocol || 'tcp',
|
|
98
|
+
config: config || {},
|
|
99
|
+
});
|
|
100
|
+
res.json({ success: true, app });
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
res.status(500).json({ error: error.message });
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
/**
|
|
107
|
+
* DELETE /api/port-manager/apps/:app_id
|
|
108
|
+
* 卸载应用
|
|
109
|
+
*/
|
|
110
|
+
router.delete('/apps/:app_id', async (req, res) => {
|
|
111
|
+
try {
|
|
112
|
+
const { app_id } = req.params;
|
|
113
|
+
const success = await port_manager_1.portManager.uninstallApp(app_id);
|
|
114
|
+
res.json({ success });
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
res.status(500).json({ error: error.message });
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
/**
|
|
121
|
+
* POST /api/port-manager/apps/:app_id/start
|
|
122
|
+
* 启动应用
|
|
123
|
+
*/
|
|
124
|
+
router.post('/apps/:app_id/start', async (req, res) => {
|
|
125
|
+
try {
|
|
126
|
+
const { app_id } = req.params;
|
|
127
|
+
const app = await port_manager_1.portManager.startApp(app_id);
|
|
128
|
+
if (!app) {
|
|
129
|
+
return res.status(404).json({ error: 'App not found' });
|
|
130
|
+
}
|
|
131
|
+
res.json({ success: true, app });
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
res.status(500).json({ error: error.message });
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
/**
|
|
138
|
+
* POST /api/port-manager/apps/:app_id/stop
|
|
139
|
+
* 停止应用
|
|
140
|
+
*/
|
|
141
|
+
router.post('/apps/:app_id/stop', async (req, res) => {
|
|
142
|
+
try {
|
|
143
|
+
const { app_id } = req.params;
|
|
144
|
+
const app = await port_manager_1.portManager.stopApp(app_id);
|
|
145
|
+
if (!app) {
|
|
146
|
+
return res.status(404).json({ error: 'App not found' });
|
|
147
|
+
}
|
|
148
|
+
res.json({ success: true, app });
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
res.status(500).json({ error: error.message });
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
/**
|
|
155
|
+
* POST /api/port-manager/apps/:app_id/restart
|
|
156
|
+
* 重启应用
|
|
157
|
+
*/
|
|
158
|
+
router.post('/apps/:app_id/restart', async (req, res) => {
|
|
159
|
+
try {
|
|
160
|
+
const { app_id } = req.params;
|
|
161
|
+
const app = await port_manager_1.portManager.restartApp(app_id);
|
|
162
|
+
if (!app) {
|
|
163
|
+
return res.status(404).json({ error: 'App not found' });
|
|
164
|
+
}
|
|
165
|
+
res.json({ success: true, app });
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
res.status(500).json({ error: error.message });
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
/**
|
|
172
|
+
* GET /api/port-manager/ports
|
|
173
|
+
* 获取端口使用情况
|
|
174
|
+
*/
|
|
175
|
+
router.get('/ports', (_req, res) => {
|
|
176
|
+
try {
|
|
177
|
+
const ports = port_manager_1.portManager.getPortsStatus();
|
|
178
|
+
res.json({ ports, total: ports.length });
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
res.status(500).json({ error: error.message });
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
/**
|
|
185
|
+
* POST /api/port-manager/disguise/ssh
|
|
186
|
+
* 启动 SSH 伪装(MVP 测试用)
|
|
187
|
+
*/
|
|
188
|
+
router.post('/disguise/ssh', async (req, res) => {
|
|
189
|
+
try {
|
|
190
|
+
const { port = 22 } = req.body;
|
|
191
|
+
const server = await (0, ssh_1.startSSHDisguise)(port);
|
|
192
|
+
res.json({
|
|
193
|
+
success: true,
|
|
194
|
+
message: `SSH disguise started on port ${port}`,
|
|
195
|
+
// 不返回 server 对象(不可序列化)
|
|
196
|
+
});
|
|
197
|
+
// 保持 server 运行
|
|
198
|
+
void server;
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
res.status(500).json({ error: error.message });
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
/**
|
|
205
|
+
* GET /api/port-manager/test-ports
|
|
206
|
+
* 获取测试端口列表
|
|
207
|
+
*/
|
|
208
|
+
router.get('/test-ports', (_req, res) => {
|
|
209
|
+
res.json({ ports: port_scanner_1.TEST_PORTS });
|
|
210
|
+
});
|
|
211
|
+
exports.default = router;
|
|
212
|
+
//# sourceMappingURL=port-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"port-manager.js","sourceRoot":"","sources":["../../src/routes/port-manager.ts"],"names":[],"mappings":";AAAA;;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;GAGG;AACH,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,IAAa,EAAE,GAAa,EAAE,EAAE;IACzD,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,yBAAU,EAAE,CAAC,CAAC;AAClC,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relationship API Routes - 统一关注系统 API
|
|
3
|
+
*/
|
|
4
|
+
import { Router } from 'express';
|
|
5
|
+
import { RelationshipPlugin } from '../plugins/relationship';
|
|
6
|
+
export declare function createRelationshipRoutes(relationshipPlugin: RelationshipPlugin): Router;
|
|
7
|
+
//# sourceMappingURL=relationship.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relationship.d.ts","sourceRoot":"","sources":["../../src/routes/relationship.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,wBAAgB,wBAAwB,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,MAAM,CAgUvF"}
|