@woodger/t-invest-node-sdk 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +611 -0
- package/LICENSE +21 -0
- package/THIRD_PARTY_NOTICES.md +307 -0
- package/certificates/russian-trusted-root-ca.pem +33 -0
- package/dist/application/dto/t-invest-options.d.ts +30 -0
- package/dist/application/dto/t-invest-options.js +11 -0
- package/dist/application/dto/t-invest-services.d.ts +168 -0
- package/dist/application/dto/t-invest-services.js +12 -0
- package/dist/application/errors/sdk-error.d.ts +47 -0
- package/dist/application/errors/sdk-error.js +84 -0
- package/dist/application/reports/accounts.report.d.ts +26 -0
- package/dist/application/reports/accounts.report.js +11 -0
- package/dist/application/reports/accrued-interests.report.d.ts +22 -0
- package/dist/application/reports/accrued-interests.report.js +11 -0
- package/dist/application/reports/asset.report.d.ts +72 -0
- package/dist/application/reports/asset.report.js +11 -0
- package/dist/application/reports/bond-coupons.report.d.ts +31 -0
- package/dist/application/reports/bond-coupons.report.js +11 -0
- package/dist/application/reports/bond.report.d.ts +82 -0
- package/dist/application/reports/bond.report.js +11 -0
- package/dist/application/reports/brands.report.d.ts +24 -0
- package/dist/application/reports/brands.report.js +11 -0
- package/dist/application/reports/broker-report.report.d.ts +74 -0
- package/dist/application/reports/broker-report.report.js +11 -0
- package/dist/application/reports/cancel-order.report.d.ts +14 -0
- package/dist/application/reports/cancel-order.report.js +11 -0
- package/dist/application/reports/cancel-stop-order.report.d.ts +14 -0
- package/dist/application/reports/cancel-stop-order.report.js +11 -0
- package/dist/application/reports/candles.report.d.ts +26 -0
- package/dist/application/reports/candles.report.js +11 -0
- package/dist/application/reports/close-prices.report.d.ts +20 -0
- package/dist/application/reports/close-prices.report.js +11 -0
- package/dist/application/reports/countries.report.d.ts +20 -0
- package/dist/application/reports/countries.report.js +11 -0
- package/dist/application/reports/currency.report.d.ts +58 -0
- package/dist/application/reports/currency.report.js +11 -0
- package/dist/application/reports/dividends-foreign-issuer.report.d.ts +51 -0
- package/dist/application/reports/dividends-foreign-issuer.report.js +11 -0
- package/dist/application/reports/dividends.report.d.ts +33 -0
- package/dist/application/reports/dividends.report.js +11 -0
- package/dist/application/reports/etf.report.d.ts +62 -0
- package/dist/application/reports/etf.report.js +11 -0
- package/dist/application/reports/favorites.report.d.ts +24 -0
- package/dist/application/reports/favorites.report.js +11 -0
- package/dist/application/reports/find-instrument.report.d.ts +34 -0
- package/dist/application/reports/find-instrument.report.js +11 -0
- package/dist/application/reports/future.report.d.ts +66 -0
- package/dist/application/reports/future.report.js +11 -0
- package/dist/application/reports/futures-margin.report.d.ts +21 -0
- package/dist/application/reports/futures-margin.report.js +11 -0
- package/dist/application/reports/index.d.ts +50 -0
- package/dist/application/reports/index.js +66 -0
- package/dist/application/reports/instrument.report.d.ts +47 -0
- package/dist/application/reports/instrument.report.js +11 -0
- package/dist/application/reports/last-prices.report.d.ts +20 -0
- package/dist/application/reports/last-prices.report.js +11 -0
- package/dist/application/reports/last-trades.report.d.ts +24 -0
- package/dist/application/reports/last-trades.report.js +11 -0
- package/dist/application/reports/margin-attributes.report.d.ts +25 -0
- package/dist/application/reports/margin-attributes.report.js +11 -0
- package/dist/application/reports/money.report.d.ts +15 -0
- package/dist/application/reports/money.report.js +11 -0
- package/dist/application/reports/operations-by-cursor.report.d.ts +65 -0
- package/dist/application/reports/operations-by-cursor.report.js +11 -0
- package/dist/application/reports/operations.report.d.ts +40 -0
- package/dist/application/reports/operations.report.js +11 -0
- package/dist/application/reports/option.report.d.ts +76 -0
- package/dist/application/reports/option.report.js +11 -0
- package/dist/application/reports/order-book.report.d.ts +38 -0
- package/dist/application/reports/order-book.report.js +11 -0
- package/dist/application/reports/order-mutation.report.d.ts +45 -0
- package/dist/application/reports/order-mutation.report.js +11 -0
- package/dist/application/reports/order-state.report.d.ts +12 -0
- package/dist/application/reports/order-state.report.js +11 -0
- package/dist/application/reports/orders.report.d.ts +53 -0
- package/dist/application/reports/orders.report.js +11 -0
- package/dist/application/reports/portfolio.report.d.ts +54 -0
- package/dist/application/reports/portfolio.report.js +11 -0
- package/dist/application/reports/positions.report.d.ts +45 -0
- package/dist/application/reports/positions.report.js +11 -0
- package/dist/application/reports/post-stop-order.report.d.ts +14 -0
- package/dist/application/reports/post-stop-order.report.js +11 -0
- package/dist/application/reports/sandbox-account.report.d.ts +20 -0
- package/dist/application/reports/sandbox-account.report.js +11 -0
- package/dist/application/reports/share.report.d.ts +66 -0
- package/dist/application/reports/share.report.js +11 -0
- package/dist/application/reports/stop-orders.report.d.ts +34 -0
- package/dist/application/reports/stop-orders.report.js +11 -0
- package/dist/application/reports/trading-schedules.report.d.ts +44 -0
- package/dist/application/reports/trading-schedules.report.js +11 -0
- package/dist/application/reports/trading-status.report.d.ts +19 -0
- package/dist/application/reports/trading-status.report.js +11 -0
- package/dist/application/reports/trading-statuses.report.d.ts +12 -0
- package/dist/application/reports/trading-statuses.report.js +11 -0
- package/dist/application/reports/user-info.report.d.ts +16 -0
- package/dist/application/reports/user-info.report.js +11 -0
- package/dist/application/reports/user-tariff.report.d.ts +28 -0
- package/dist/application/reports/user-tariff.report.js +11 -0
- package/dist/application/reports/withdraw-limits.report.d.ts +16 -0
- package/dist/application/reports/withdraw-limits.report.js +11 -0
- package/dist/application/services/unary-limiter.d.ts +44 -0
- package/dist/application/services/unary-limiter.js +138 -0
- package/dist/bootstrap/args/command-options.d.ts +43 -0
- package/dist/bootstrap/args/command-options.js +125 -0
- package/dist/bootstrap/args/index.d.ts +1 -0
- package/dist/bootstrap/args/index.js +5 -0
- package/dist/bootstrap/args/instrument-id-options.d.ts +24 -0
- package/dist/bootstrap/args/instrument-id-options.js +47 -0
- package/dist/bootstrap/args/instruments-args.d.ts +49 -0
- package/dist/bootstrap/args/instruments-args.js +89 -0
- package/dist/bootstrap/args/sdk-options.d.ts +19 -0
- package/dist/bootstrap/args/sdk-options.js +40 -0
- package/dist/bootstrap/args/side-effect-args.d.ts +20 -0
- package/dist/bootstrap/args/side-effect-args.js +50 -0
- package/dist/bootstrap/cli/contract.d.ts +16 -0
- package/dist/bootstrap/cli/contract.js +15 -0
- package/dist/bootstrap/cli/domains.d.ts +260 -0
- package/dist/bootstrap/cli/domains.js +631 -0
- package/dist/bootstrap/cli/error.d.ts +15 -0
- package/dist/bootstrap/cli/error.js +40 -0
- package/dist/bootstrap/cli/help.d.ts +751 -0
- package/dist/bootstrap/cli/help.js +1789 -0
- package/dist/bootstrap/cli/registry.d.ts +2102 -0
- package/dist/bootstrap/cli/registry.js +186 -0
- package/dist/bootstrap/cli/runner.d.ts +10 -0
- package/dist/bootstrap/cli/runner.js +151 -0
- package/dist/bootstrap/cli/version.d.ts +17 -0
- package/dist/bootstrap/cli/version.js +26 -0
- package/dist/bootstrap/commands/accounts/cli.d.ts +63 -0
- package/dist/bootstrap/commands/accounts/cli.js +50 -0
- package/dist/bootstrap/commands/accounts/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/accounts/reporter.js +50 -0
- package/dist/bootstrap/commands/accrued-interests/cli.d.ts +129 -0
- package/dist/bootstrap/commands/accrued-interests/cli.js +80 -0
- package/dist/bootstrap/commands/accrued-interests/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/accrued-interests/reporter.js +43 -0
- package/dist/bootstrap/commands/asset/cli.d.ts +99 -0
- package/dist/bootstrap/commands/asset/cli.js +64 -0
- package/dist/bootstrap/commands/asset/reporter.d.ts +16 -0
- package/dist/bootstrap/commands/asset/reporter.js +122 -0
- package/dist/bootstrap/commands/assets/cli.d.ts +102 -0
- package/dist/bootstrap/commands/assets/cli.js +78 -0
- package/dist/bootstrap/commands/assets/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/assets/reporter.js +27 -0
- package/dist/bootstrap/commands/bond/cli.d.ts +83 -0
- package/dist/bootstrap/commands/bond/cli.js +53 -0
- package/dist/bootstrap/commands/bond/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/bond/reporter.js +123 -0
- package/dist/bootstrap/commands/bond-coupons/cli.d.ts +129 -0
- package/dist/bootstrap/commands/bond-coupons/cli.js +80 -0
- package/dist/bootstrap/commands/bond-coupons/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/bond-coupons/reporter.js +64 -0
- package/dist/bootstrap/commands/bonds/cli.d.ts +73 -0
- package/dist/bootstrap/commands/bonds/cli.js +53 -0
- package/dist/bootstrap/commands/bonds/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/bonds/reporter.js +27 -0
- package/dist/bootstrap/commands/brand/cli.d.ts +99 -0
- package/dist/bootstrap/commands/brand/cli.js +64 -0
- package/dist/bootstrap/commands/brand/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/brand/reporter.js +37 -0
- package/dist/bootstrap/commands/brands/cli.d.ts +63 -0
- package/dist/bootstrap/commands/brands/cli.js +50 -0
- package/dist/bootstrap/commands/brands/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/brands/reporter.js +49 -0
- package/dist/bootstrap/commands/broker-report/cli.d.ts +132 -0
- package/dist/bootstrap/commands/broker-report/cli.js +105 -0
- package/dist/bootstrap/commands/broker-report/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/broker-report/reporter.js +123 -0
- package/dist/bootstrap/commands/cancel-order/cli.d.ts +120 -0
- package/dist/bootstrap/commands/cancel-order/cli.js +71 -0
- package/dist/bootstrap/commands/cancel-order/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/cancel-order/reporter.js +32 -0
- package/dist/bootstrap/commands/cancel-stop-order/cli.d.ts +120 -0
- package/dist/bootstrap/commands/cancel-stop-order/cli.js +71 -0
- package/dist/bootstrap/commands/cancel-stop-order/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/cancel-stop-order/reporter.js +32 -0
- package/dist/bootstrap/commands/candles/cli.d.ts +138 -0
- package/dist/bootstrap/commands/candles/cli.js +104 -0
- package/dist/bootstrap/commands/candles/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/candles/reporter.js +49 -0
- package/dist/bootstrap/commands/close-prices/cli.d.ts +99 -0
- package/dist/bootstrap/commands/close-prices/cli.js +66 -0
- package/dist/bootstrap/commands/close-prices/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/close-prices/reporter.js +43 -0
- package/dist/bootstrap/commands/compile-proto/cli.d.ts +12 -0
- package/dist/bootstrap/commands/compile-proto/cli.js +22 -0
- package/dist/bootstrap/commands/countries/cli.d.ts +63 -0
- package/dist/bootstrap/commands/countries/cli.js +50 -0
- package/dist/bootstrap/commands/countries/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/countries/reporter.js +42 -0
- package/dist/bootstrap/commands/currencies/cli.d.ts +73 -0
- package/dist/bootstrap/commands/currencies/cli.js +53 -0
- package/dist/bootstrap/commands/currencies/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/currencies/reporter.js +27 -0
- package/dist/bootstrap/commands/currency/cli.d.ts +83 -0
- package/dist/bootstrap/commands/currency/cli.js +53 -0
- package/dist/bootstrap/commands/currency/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/currency/reporter.js +104 -0
- package/dist/bootstrap/commands/dividends/cli.d.ts +129 -0
- package/dist/bootstrap/commands/dividends/cli.js +80 -0
- package/dist/bootstrap/commands/dividends/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/dividends/reporter.js +62 -0
- package/dist/bootstrap/commands/dividends-foreign-issuer/cli.d.ts +132 -0
- package/dist/bootstrap/commands/dividends-foreign-issuer/cli.js +105 -0
- package/dist/bootstrap/commands/dividends-foreign-issuer/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/dividends-foreign-issuer/reporter.js +108 -0
- package/dist/bootstrap/commands/edit-favorites/cli.d.ts +129 -0
- package/dist/bootstrap/commands/edit-favorites/cli.js +78 -0
- package/dist/bootstrap/commands/edit-favorites/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/edit-favorites/reporter.js +23 -0
- package/dist/bootstrap/commands/etf/cli.d.ts +83 -0
- package/dist/bootstrap/commands/etf/cli.js +53 -0
- package/dist/bootstrap/commands/etf/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/etf/reporter.js +109 -0
- package/dist/bootstrap/commands/etfs/cli.d.ts +73 -0
- package/dist/bootstrap/commands/etfs/cli.js +53 -0
- package/dist/bootstrap/commands/etfs/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/etfs/reporter.js +27 -0
- package/dist/bootstrap/commands/favorites/cli.d.ts +63 -0
- package/dist/bootstrap/commands/favorites/cli.js +50 -0
- package/dist/bootstrap/commands/favorites/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/favorites/reporter.js +60 -0
- package/dist/bootstrap/commands/find-instrument/cli.d.ts +126 -0
- package/dist/bootstrap/commands/find-instrument/cli.js +88 -0
- package/dist/bootstrap/commands/find-instrument/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/find-instrument/reporter.js +71 -0
- package/dist/bootstrap/commands/future/cli.d.ts +83 -0
- package/dist/bootstrap/commands/future/cli.js +53 -0
- package/dist/bootstrap/commands/future/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/future/reporter.js +116 -0
- package/dist/bootstrap/commands/futures/cli.d.ts +73 -0
- package/dist/bootstrap/commands/futures/cli.js +53 -0
- package/dist/bootstrap/commands/futures/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/futures/reporter.js +27 -0
- package/dist/bootstrap/commands/futures-margin/cli.d.ts +105 -0
- package/dist/bootstrap/commands/futures-margin/cli.js +64 -0
- package/dist/bootstrap/commands/futures-margin/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/futures-margin/reporter.js +40 -0
- package/dist/bootstrap/commands/help/cli.d.ts +13 -0
- package/dist/bootstrap/commands/help/cli.js +26 -0
- package/dist/bootstrap/commands/instrument/cli.d.ts +83 -0
- package/dist/bootstrap/commands/instrument/cli.js +53 -0
- package/dist/bootstrap/commands/instrument/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/instrument/reporter.js +91 -0
- package/dist/bootstrap/commands/last-prices/cli.d.ts +99 -0
- package/dist/bootstrap/commands/last-prices/cli.js +66 -0
- package/dist/bootstrap/commands/last-prices/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/last-prices/reporter.js +43 -0
- package/dist/bootstrap/commands/last-trades/cli.d.ts +123 -0
- package/dist/bootstrap/commands/last-trades/cli.js +82 -0
- package/dist/bootstrap/commands/last-trades/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/last-trades/reporter.js +48 -0
- package/dist/bootstrap/commands/margin-attributes/cli.d.ts +99 -0
- package/dist/bootstrap/commands/margin-attributes/cli.js +64 -0
- package/dist/bootstrap/commands/margin-attributes/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/margin-attributes/reporter.js +51 -0
- package/dist/bootstrap/commands/operations/cli.d.ts +156 -0
- package/dist/bootstrap/commands/operations/cli.js +99 -0
- package/dist/bootstrap/commands/operations/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/operations/reporter.js +78 -0
- package/dist/bootstrap/commands/operations-by-cursor/cli.d.ts +204 -0
- package/dist/bootstrap/commands/operations-by-cursor/cli.js +164 -0
- package/dist/bootstrap/commands/operations-by-cursor/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/operations-by-cursor/reporter.js +107 -0
- package/dist/bootstrap/commands/option/cli.d.ts +83 -0
- package/dist/bootstrap/commands/option/cli.js +53 -0
- package/dist/bootstrap/commands/option/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/option/reporter.js +125 -0
- package/dist/bootstrap/commands/options-by/cli.d.ts +108 -0
- package/dist/bootstrap/commands/options-by/cli.js +68 -0
- package/dist/bootstrap/commands/options-by/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/options-by/reporter.js +27 -0
- package/dist/bootstrap/commands/order-book/cli.d.ts +120 -0
- package/dist/bootstrap/commands/order-book/cli.js +73 -0
- package/dist/bootstrap/commands/order-book/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/order-book/reporter.js +60 -0
- package/dist/bootstrap/commands/order-state/cli.d.ts +111 -0
- package/dist/bootstrap/commands/order-state/cli.js +71 -0
- package/dist/bootstrap/commands/order-state/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/order-state/reporter.js +57 -0
- package/dist/bootstrap/commands/orders/cli.d.ts +99 -0
- package/dist/bootstrap/commands/orders/cli.js +64 -0
- package/dist/bootstrap/commands/orders/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/orders/reporter.js +88 -0
- package/dist/bootstrap/commands/portfolio/cli.d.ts +114 -0
- package/dist/bootstrap/commands/portfolio/cli.js +77 -0
- package/dist/bootstrap/commands/portfolio/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/portfolio/reporter.js +95 -0
- package/dist/bootstrap/commands/positions/cli.d.ts +99 -0
- package/dist/bootstrap/commands/positions/cli.js +64 -0
- package/dist/bootstrap/commands/positions/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/positions/reporter.js +116 -0
- package/dist/bootstrap/commands/post-order/cli.d.ts +192 -0
- package/dist/bootstrap/commands/post-order/cli.js +113 -0
- package/dist/bootstrap/commands/post-order/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/post-order/reporter.js +77 -0
- package/dist/bootstrap/commands/post-stop-order/cli.d.ts +216 -0
- package/dist/bootstrap/commands/post-stop-order/cli.js +145 -0
- package/dist/bootstrap/commands/post-stop-order/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/post-stop-order/reporter.js +31 -0
- package/dist/bootstrap/commands/replace-order/cli.d.ts +180 -0
- package/dist/bootstrap/commands/replace-order/cli.js +99 -0
- package/dist/bootstrap/commands/replace-order/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/replace-order/reporter.js +17 -0
- package/dist/bootstrap/commands/sandbox-accounts/cli.d.ts +64 -0
- package/dist/bootstrap/commands/sandbox-accounts/cli.js +54 -0
- package/dist/bootstrap/commands/sandbox-cancel-order/cli.d.ts +120 -0
- package/dist/bootstrap/commands/sandbox-cancel-order/cli.js +69 -0
- package/dist/bootstrap/commands/sandbox-close-account/cli.d.ts +108 -0
- package/dist/bootstrap/commands/sandbox-close-account/cli.js +66 -0
- package/dist/bootstrap/commands/sandbox-close-account/reporter.d.ts +12 -0
- package/dist/bootstrap/commands/sandbox-close-account/reporter.js +32 -0
- package/dist/bootstrap/commands/sandbox-open-account/cli.d.ts +70 -0
- package/dist/bootstrap/commands/sandbox-open-account/cli.js +57 -0
- package/dist/bootstrap/commands/sandbox-open-account/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/sandbox-open-account/reporter.js +31 -0
- package/dist/bootstrap/commands/sandbox-operations/cli.d.ts +156 -0
- package/dist/bootstrap/commands/sandbox-operations/cli.js +78 -0
- package/dist/bootstrap/commands/sandbox-operations-by-cursor/cli.d.ts +204 -0
- package/dist/bootstrap/commands/sandbox-operations-by-cursor/cli.js +98 -0
- package/dist/bootstrap/commands/sandbox-order-state/cli.d.ts +111 -0
- package/dist/bootstrap/commands/sandbox-order-state/cli.js +67 -0
- package/dist/bootstrap/commands/sandbox-orders/cli.d.ts +99 -0
- package/dist/bootstrap/commands/sandbox-orders/cli.js +63 -0
- package/dist/bootstrap/commands/sandbox-pay-in/cli.d.ts +135 -0
- package/dist/bootstrap/commands/sandbox-pay-in/cli.js +86 -0
- package/dist/bootstrap/commands/sandbox-pay-in/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/sandbox-pay-in/reporter.js +32 -0
- package/dist/bootstrap/commands/sandbox-portfolio/cli.d.ts +114 -0
- package/dist/bootstrap/commands/sandbox-portfolio/cli.js +68 -0
- package/dist/bootstrap/commands/sandbox-positions/cli.d.ts +99 -0
- package/dist/bootstrap/commands/sandbox-positions/cli.js +63 -0
- package/dist/bootstrap/commands/sandbox-post-order/cli.d.ts +192 -0
- package/dist/bootstrap/commands/sandbox-post-order/cli.js +90 -0
- package/dist/bootstrap/commands/sandbox-replace-order/cli.d.ts +180 -0
- package/dist/bootstrap/commands/sandbox-replace-order/cli.js +86 -0
- package/dist/bootstrap/commands/sandbox-withdraw-limits/cli.d.ts +99 -0
- package/dist/bootstrap/commands/sandbox-withdraw-limits/cli.js +63 -0
- package/dist/bootstrap/commands/share/cli.d.ts +83 -0
- package/dist/bootstrap/commands/share/cli.js +53 -0
- package/dist/bootstrap/commands/share/reporter.d.ts +15 -0
- package/dist/bootstrap/commands/share/reporter.js +111 -0
- package/dist/bootstrap/commands/shares/cli.d.ts +73 -0
- package/dist/bootstrap/commands/shares/cli.js +53 -0
- package/dist/bootstrap/commands/shares/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/shares/reporter.js +27 -0
- package/dist/bootstrap/commands/stop-orders/cli.d.ts +99 -0
- package/dist/bootstrap/commands/stop-orders/cli.js +68 -0
- package/dist/bootstrap/commands/stop-orders/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/stop-orders/reporter.js +69 -0
- package/dist/bootstrap/commands/stream-run/cli.d.ts +138 -0
- package/dist/bootstrap/commands/stream-run/cli.js +229 -0
- package/dist/bootstrap/commands/stream-run/config.d.ts +56 -0
- package/dist/bootstrap/commands/stream-run/config.js +468 -0
- package/dist/bootstrap/commands/stream-run/reporter.d.ts +30 -0
- package/dist/bootstrap/commands/stream-run/reporter.js +76 -0
- package/dist/bootstrap/commands/trading-schedules/cli.d.ts +120 -0
- package/dist/bootstrap/commands/trading-schedules/cli.js +79 -0
- package/dist/bootstrap/commands/trading-schedules/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/trading-schedules/reporter.js +58 -0
- package/dist/bootstrap/commands/trading-status/cli.d.ts +99 -0
- package/dist/bootstrap/commands/trading-status/cli.js +65 -0
- package/dist/bootstrap/commands/trading-status/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/trading-status/reporter.js +51 -0
- package/dist/bootstrap/commands/trading-statuses/cli.d.ts +99 -0
- package/dist/bootstrap/commands/trading-statuses/cli.js +64 -0
- package/dist/bootstrap/commands/trading-statuses/reporter.d.ts +14 -0
- package/dist/bootstrap/commands/trading-statuses/reporter.js +44 -0
- package/dist/bootstrap/commands/user-info/cli.d.ts +63 -0
- package/dist/bootstrap/commands/user-info/cli.js +50 -0
- package/dist/bootstrap/commands/user-info/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/user-info/reporter.js +39 -0
- package/dist/bootstrap/commands/user-tariff/cli.d.ts +63 -0
- package/dist/bootstrap/commands/user-tariff/cli.js +50 -0
- package/dist/bootstrap/commands/user-tariff/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/user-tariff/reporter.js +50 -0
- package/dist/bootstrap/commands/version/cli.d.ts +13 -0
- package/dist/bootstrap/commands/version/cli.js +22 -0
- package/dist/bootstrap/commands/withdraw-limits/cli.d.ts +99 -0
- package/dist/bootstrap/commands/withdraw-limits/cli.js +64 -0
- package/dist/bootstrap/commands/withdraw-limits/reporter.d.ts +13 -0
- package/dist/bootstrap/commands/withdraw-limits/reporter.js +59 -0
- package/dist/bootstrap/generated-exports.d.ts +29 -0
- package/dist/bootstrap/generated-exports.js +590 -0
- package/dist/bootstrap/index.d.ts +6 -0
- package/dist/bootstrap/index.js +22 -0
- package/dist/bootstrap/proto/compile-proto.d.ts +18 -0
- package/dist/bootstrap/proto/compile-proto.js +122 -0
- package/dist/bootstrap/sdk-config.d.ts +21 -0
- package/dist/bootstrap/sdk-config.js +152 -0
- package/dist/bootstrap/t-invest-node-sdk.d.ts +42 -0
- package/dist/bootstrap/t-invest-node-sdk.js +115 -0
- package/dist/bootstrap/unary-limit-config.d.ts +38 -0
- package/dist/bootstrap/unary-limit-config.js +130 -0
- package/dist/config.d.ts +160 -0
- package/dist/config.js +173 -0
- package/dist/config.types.d.ts +89 -0
- package/dist/config.types.js +13 -0
- package/dist/generated/common.d.ts +214 -0
- package/dist/generated/common.js +1336 -0
- package/dist/generated/google/api/field_behavior.d.ts +61 -0
- package/dist/generated/google/api/field_behavior.js +126 -0
- package/dist/generated/google/protobuf/descriptor.d.ts +1330 -0
- package/dist/generated/google/protobuf/descriptor.js +5984 -0
- package/dist/generated/google/protobuf/timestamp.d.ts +122 -0
- package/dist/generated/google/protobuf/timestamp.js +102 -0
- package/dist/generated/instruments.d.ts +3230 -0
- package/dist/generated/instruments.js +24246 -0
- package/dist/generated/marketdata.d.ts +1268 -0
- package/dist/generated/marketdata.js +8922 -0
- package/dist/generated/operations.d.ts +1165 -0
- package/dist/generated/operations.js +8625 -0
- package/dist/generated/orders.d.ts +806 -0
- package/dist/generated/orders.js +5639 -0
- package/dist/generated/sandbox.d.ts +356 -0
- package/dist/generated/sandbox.js +603 -0
- package/dist/generated/signals.d.ts +196 -0
- package/dist/generated/signals.js +1261 -0
- package/dist/generated/stoporders.d.ts +328 -0
- package/dist/generated/stoporders.js +1990 -0
- package/dist/generated/users.d.ts +453 -0
- package/dist/generated/users.js +2334 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +30 -0
- package/dist/infrastructure/interceptor/index.d.ts +1 -0
- package/dist/infrastructure/interceptor/index.js +17 -0
- package/dist/infrastructure/interceptor/warning-interceptor.d.ts +23 -0
- package/dist/infrastructure/interceptor/warning-interceptor.js +38 -0
- package/dist/infrastructure/report-values.d.ts +19 -0
- package/dist/infrastructure/report-values.js +50 -0
- package/dist/infrastructure/transport/grpc/index.d.ts +5 -0
- package/dist/infrastructure/transport/grpc/index.js +13 -0
- package/dist/infrastructure/transport/grpc/sdk-channel.d.ts +12 -0
- package/dist/infrastructure/transport/grpc/sdk-channel.js +23 -0
- package/dist/infrastructure/transport/grpc/sdk-client.d.ts +16 -0
- package/dist/infrastructure/transport/grpc/sdk-client.js +33 -0
- package/dist/infrastructure/transport/grpc/sdk-metadata.d.ts +12 -0
- package/dist/infrastructure/transport/grpc/sdk-metadata.js +22 -0
- package/dist/infrastructure/transport/grpc/sdk-middleware.d.ts +22 -0
- package/dist/infrastructure/transport/grpc/sdk-middleware.js +312 -0
- package/dist/infrastructure/transport/grpc/tls-root-certificates.d.ts +10 -0
- package/dist/infrastructure/transport/grpc/tls-root-certificates.js +20 -0
- package/dist/infrastructure/transport/grpc/unary-limit-resolver.d.ts +22 -0
- package/dist/infrastructure/transport/grpc/unary-limit-resolver.js +60 -0
- package/dist/infrastructure/transport/grpc/unary-limits.d.ts +1 -0
- package/dist/infrastructure/transport/grpc/unary-limits.js +7 -0
- package/docs/architecture.md +378 -0
- package/docs/bundled-ca.md +157 -0
- package/docs/clean-architecture/adapters.md +173 -0
- package/docs/clean-architecture/api-commands.md +487 -0
- package/docs/clean-architecture/application.md +137 -0
- package/docs/clean-architecture/cli-output-boundaries.md +256 -0
- package/docs/clean-architecture/dto.md +153 -0
- package/docs/clean-architecture/index.md +89 -0
- package/docs/cli-stream-configuration.md +305 -0
- package/docs/cli-stream-reference.md +195 -0
- package/docs/guides/custom-unary-limiter.md +552 -0
- package/docs/guides/errors-and-lifecycle.md +196 -0
- package/docs/guides/getting-started.md +100 -0
- package/docs/guides/index.md +43 -0
- package/docs/guides/streams-and-cancellation.md +177 -0
- package/docs/guides/testing-with-service-definitions.md +110 -0
- package/docs/guides/unary-calls.md +216 -0
- package/docs/index.md +86 -0
- package/docs/limits-policy.md +201 -0
- package/docs/roadmap.md +204 -0
- package/docs/tls-policy.md +62 -0
- package/package.json +62 -0
- package/readme.md +472 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль реестра команд связывает имя CLI-команды с ее handler.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы:
|
|
6
|
+
* - декларативное описание доступных CLI-команд;
|
|
7
|
+
* - валидация имени команды из positionals;
|
|
8
|
+
* - возврат canonical и matched path metadata для bootstrap CLI;
|
|
9
|
+
*
|
|
10
|
+
* Здесь не должно быть исполнения команд, разбора raw argv или форматирования help/version output.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.commandLineCommands = void 0;
|
|
14
|
+
exports.resolveCommandWarnings = resolveCommandWarnings;
|
|
15
|
+
const cli_1 = require("../commands/accounts/cli");
|
|
16
|
+
const cli_2 = require("../commands/accrued-interests/cli");
|
|
17
|
+
const cli_3 = require("../commands/asset/cli");
|
|
18
|
+
const cli_4 = require("../commands/assets/cli");
|
|
19
|
+
const cli_5 = require("../commands/bond/cli");
|
|
20
|
+
const cli_6 = require("../commands/brand/cli");
|
|
21
|
+
const cli_7 = require("../commands/brands/cli");
|
|
22
|
+
const cli_8 = require("../commands/bond-coupons/cli");
|
|
23
|
+
const cli_9 = require("../commands/bonds/cli");
|
|
24
|
+
const cli_10 = require("../commands/broker-report/cli");
|
|
25
|
+
const cli_11 = require("../commands/candles/cli");
|
|
26
|
+
const cli_12 = require("../commands/cancel-order/cli");
|
|
27
|
+
const cli_13 = require("../commands/cancel-stop-order/cli");
|
|
28
|
+
const cli_14 = require("../commands/close-prices/cli");
|
|
29
|
+
const cli_15 = require("../commands/compile-proto/cli");
|
|
30
|
+
const cli_16 = require("../commands/countries/cli");
|
|
31
|
+
const cli_17 = require("../commands/currencies/cli");
|
|
32
|
+
const cli_18 = require("../commands/currency/cli");
|
|
33
|
+
const cli_19 = require("../commands/dividends-foreign-issuer/cli");
|
|
34
|
+
const cli_20 = require("../commands/dividends/cli");
|
|
35
|
+
const cli_21 = require("../commands/edit-favorites/cli");
|
|
36
|
+
const cli_22 = require("../commands/etf/cli");
|
|
37
|
+
const cli_23 = require("../commands/etfs/cli");
|
|
38
|
+
const cli_24 = require("../commands/favorites/cli");
|
|
39
|
+
const cli_25 = require("../commands/find-instrument/cli");
|
|
40
|
+
const cli_26 = require("../commands/future/cli");
|
|
41
|
+
const cli_27 = require("../commands/futures/cli");
|
|
42
|
+
const cli_28 = require("../commands/futures-margin/cli");
|
|
43
|
+
const cli_29 = require("../commands/help/cli");
|
|
44
|
+
const cli_30 = require("../commands/instrument/cli");
|
|
45
|
+
const cli_31 = require("../commands/last-prices/cli");
|
|
46
|
+
const cli_32 = require("../commands/last-trades/cli");
|
|
47
|
+
const cli_33 = require("../commands/margin-attributes/cli");
|
|
48
|
+
const cli_34 = require("../commands/option/cli");
|
|
49
|
+
const cli_35 = require("../commands/options-by/cli");
|
|
50
|
+
const cli_36 = require("../commands/order-book/cli");
|
|
51
|
+
const cli_37 = require("../commands/order-state/cli");
|
|
52
|
+
const cli_38 = require("../commands/orders/cli");
|
|
53
|
+
const cli_39 = require("../commands/operations-by-cursor/cli");
|
|
54
|
+
const cli_40 = require("../commands/operations/cli");
|
|
55
|
+
const cli_41 = require("../commands/portfolio/cli");
|
|
56
|
+
const cli_42 = require("../commands/post-order/cli");
|
|
57
|
+
const cli_43 = require("../commands/post-stop-order/cli");
|
|
58
|
+
const cli_44 = require("../commands/positions/cli");
|
|
59
|
+
const cli_45 = require("../commands/replace-order/cli");
|
|
60
|
+
const cli_46 = require("../commands/sandbox-accounts/cli");
|
|
61
|
+
const cli_47 = require("../commands/sandbox-cancel-order/cli");
|
|
62
|
+
const cli_48 = require("../commands/sandbox-close-account/cli");
|
|
63
|
+
const cli_49 = require("../commands/sandbox-operations/cli");
|
|
64
|
+
const cli_50 = require("../commands/sandbox-operations-by-cursor/cli");
|
|
65
|
+
const cli_51 = require("../commands/sandbox-open-account/cli");
|
|
66
|
+
const cli_52 = require("../commands/sandbox-orders/cli");
|
|
67
|
+
const cli_53 = require("../commands/sandbox-order-state/cli");
|
|
68
|
+
const cli_54 = require("../commands/sandbox-pay-in/cli");
|
|
69
|
+
const cli_55 = require("../commands/sandbox-portfolio/cli");
|
|
70
|
+
const cli_56 = require("../commands/sandbox-positions/cli");
|
|
71
|
+
const cli_57 = require("../commands/sandbox-post-order/cli");
|
|
72
|
+
const cli_58 = require("../commands/sandbox-replace-order/cli");
|
|
73
|
+
const cli_59 = require("../commands/sandbox-withdraw-limits/cli");
|
|
74
|
+
const cli_60 = require("../commands/share/cli");
|
|
75
|
+
const cli_61 = require("../commands/shares/cli");
|
|
76
|
+
const cli_62 = require("../commands/stop-orders/cli");
|
|
77
|
+
const cli_63 = require("../commands/stream-run/cli");
|
|
78
|
+
const cli_64 = require("../commands/trading-schedules/cli");
|
|
79
|
+
const cli_65 = require("../commands/trading-status/cli");
|
|
80
|
+
const cli_66 = require("../commands/trading-statuses/cli");
|
|
81
|
+
const cli_67 = require("../commands/user-info/cli");
|
|
82
|
+
const cli_68 = require("../commands/user-tariff/cli");
|
|
83
|
+
const cli_69 = require("../commands/version/cli");
|
|
84
|
+
const cli_70 = require("../commands/withdraw-limits/cli");
|
|
85
|
+
const contract_1 = require("./contract");
|
|
86
|
+
const domains_1 = require("./domains");
|
|
87
|
+
const deprecatedFigiOptionCommandNames = new Set([
|
|
88
|
+
'instrument bond accrued',
|
|
89
|
+
'instrument bond coupons',
|
|
90
|
+
'instrument dividends',
|
|
91
|
+
'instrument favorite edit',
|
|
92
|
+
'instrument future margin',
|
|
93
|
+
'operation list',
|
|
94
|
+
'sandbox operation list'
|
|
95
|
+
]);
|
|
96
|
+
function resolveCommandWarnings(commandName, args) {
|
|
97
|
+
if (!deprecatedFigiOptionCommandNames.has(commandName) || !hasOption(args, 'figi')) {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
return [
|
|
101
|
+
"Warning: '--figi' is deprecated for this command; use '--instrument-id' instead.\n"
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
exports.commandLineCommands = contract_1.command.registry([
|
|
105
|
+
defineCommandLineCommand(cli_1.accountsCommand),
|
|
106
|
+
defineCommandLineCommand(cli_67.userInfoCommand),
|
|
107
|
+
defineCommandLineCommand(cli_33.marginAttributesCommand),
|
|
108
|
+
defineCommandLineCommand(cli_68.userTariffCommand),
|
|
109
|
+
defineCommandLineCommand(cli_11.candlesCommand),
|
|
110
|
+
defineCommandLineCommand(cli_38.ordersCommand),
|
|
111
|
+
defineCommandLineCommand(cli_37.orderStateCommand),
|
|
112
|
+
defineCommandLineCommand(cli_42.postOrderCommand),
|
|
113
|
+
defineCommandLineCommand(cli_12.cancelOrderCommand),
|
|
114
|
+
defineCommandLineCommand(cli_45.replaceOrderCommand),
|
|
115
|
+
defineCommandLineCommand(cli_62.stopOrdersCommand),
|
|
116
|
+
defineCommandLineCommand(cli_43.postStopOrderCommand),
|
|
117
|
+
defineCommandLineCommand(cli_13.cancelStopOrderCommand),
|
|
118
|
+
defineCommandLineCommand(cli_51.sandboxOpenAccountCommand),
|
|
119
|
+
defineCommandLineCommand(cli_46.sandboxAccountsCommand),
|
|
120
|
+
defineCommandLineCommand(cli_48.sandboxCloseAccountCommand),
|
|
121
|
+
defineCommandLineCommand(cli_57.sandboxPostOrderCommand),
|
|
122
|
+
defineCommandLineCommand(cli_58.sandboxReplaceOrderCommand),
|
|
123
|
+
defineCommandLineCommand(cli_52.sandboxOrdersCommand),
|
|
124
|
+
defineCommandLineCommand(cli_47.sandboxCancelOrderCommand),
|
|
125
|
+
defineCommandLineCommand(cli_53.sandboxOrderStateCommand),
|
|
126
|
+
defineCommandLineCommand(cli_56.sandboxPositionsCommand),
|
|
127
|
+
defineCommandLineCommand(cli_49.sandboxOperationsCommand),
|
|
128
|
+
defineCommandLineCommand(cli_50.sandboxOperationsByCursorCommand),
|
|
129
|
+
defineCommandLineCommand(cli_55.sandboxPortfolioCommand),
|
|
130
|
+
defineCommandLineCommand(cli_54.sandboxPayInCommand),
|
|
131
|
+
defineCommandLineCommand(cli_59.sandboxWithdrawLimitsCommand),
|
|
132
|
+
defineCommandLineCommand(cli_14.closePricesCommand),
|
|
133
|
+
defineCommandLineCommand(cli_31.lastPricesCommand),
|
|
134
|
+
defineCommandLineCommand(cli_32.lastTradesCommand),
|
|
135
|
+
defineCommandLineCommand(cli_36.orderBookCommand),
|
|
136
|
+
defineCommandLineCommand(cli_65.tradingStatusCommand),
|
|
137
|
+
defineCommandLineCommand(cli_66.tradingStatusesCommand),
|
|
138
|
+
defineCommandLineCommand(cli_40.operationsCommand),
|
|
139
|
+
defineCommandLineCommand(cli_39.operationsByCursorCommand),
|
|
140
|
+
defineCommandLineCommand(cli_10.brokerReportCommand),
|
|
141
|
+
defineCommandLineCommand(cli_19.dividendsForeignIssuerCommand),
|
|
142
|
+
defineCommandLineCommand(cli_41.portfolioCommand),
|
|
143
|
+
defineCommandLineCommand(cli_44.positionsCommand),
|
|
144
|
+
defineCommandLineCommand(cli_70.withdrawLimitsCommand),
|
|
145
|
+
defineCommandLineCommand(cli_7.brandsCommand),
|
|
146
|
+
defineCommandLineCommand(cli_16.countriesCommand),
|
|
147
|
+
defineCommandLineCommand(cli_17.currenciesCommand),
|
|
148
|
+
defineCommandLineCommand(cli_9.bondsCommand),
|
|
149
|
+
defineCommandLineCommand(cli_23.etfsCommand),
|
|
150
|
+
defineCommandLineCommand(cli_27.futuresCommand),
|
|
151
|
+
defineCommandLineCommand(cli_61.sharesCommand),
|
|
152
|
+
defineCommandLineCommand(cli_5.bondCommand),
|
|
153
|
+
defineCommandLineCommand(cli_22.etfCommand),
|
|
154
|
+
defineCommandLineCommand(cli_26.futureCommand),
|
|
155
|
+
defineCommandLineCommand(cli_60.shareCommand),
|
|
156
|
+
defineCommandLineCommand(cli_3.assetCommand),
|
|
157
|
+
defineCommandLineCommand(cli_6.brandCommand),
|
|
158
|
+
defineCommandLineCommand(cli_18.currencyCommand),
|
|
159
|
+
defineCommandLineCommand(cli_30.instrumentCommand),
|
|
160
|
+
defineCommandLineCommand(cli_34.optionCommand),
|
|
161
|
+
defineCommandLineCommand(cli_4.assetsCommand),
|
|
162
|
+
defineCommandLineCommand(cli_24.favoritesCommand),
|
|
163
|
+
defineCommandLineCommand(cli_21.editFavoritesCommand),
|
|
164
|
+
defineCommandLineCommand(cli_25.findInstrumentCommand),
|
|
165
|
+
defineCommandLineCommand(cli_28.futuresMarginCommand),
|
|
166
|
+
defineCommandLineCommand(cli_35.optionsByCommand),
|
|
167
|
+
defineCommandLineCommand(cli_2.accruedInterestsCommand),
|
|
168
|
+
defineCommandLineCommand(cli_8.bondCouponsCommand),
|
|
169
|
+
defineCommandLineCommand(cli_20.dividendsCommand),
|
|
170
|
+
defineCommandLineCommand(cli_64.tradingSchedulesCommand),
|
|
171
|
+
defineCommandLineCommand(cli_63.streamRunCommand),
|
|
172
|
+
defineCommandLineCommand(cli_15.compileProtoCommand),
|
|
173
|
+
defineCommandLineCommand(cli_29.helpCommand),
|
|
174
|
+
defineCommandLineCommand(cli_69.versionCommand)
|
|
175
|
+
]);
|
|
176
|
+
function defineCommandLineCommand(definition) {
|
|
177
|
+
const [, ...aliases] = (0, domains_1.commandPathAliases)(definition.path);
|
|
178
|
+
return {
|
|
179
|
+
...definition,
|
|
180
|
+
aliases
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function hasOption(args, name) {
|
|
184
|
+
const optionName = `--${name}`;
|
|
185
|
+
return args.some((arg) => arg === optionName || arg.startsWith(`${optionName}=`));
|
|
186
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI runner владеет глобальными help/version shortcuts и
|
|
3
|
+
* stdout/stderr wiring.
|
|
4
|
+
*
|
|
5
|
+
* API-команды запускаются через `icore` terminal app; этот файл не собирает
|
|
6
|
+
* промежуточный argv contract и не выполняет command-specific parsing.
|
|
7
|
+
*/
|
|
8
|
+
import { type Output } from 'icore';
|
|
9
|
+
export declare function parseCliInput(argv: readonly string[]): import("icore").ParsedArgv;
|
|
10
|
+
export declare function runCli(argv?: readonly string[], io?: Output): Promise<number>;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI runner владеет глобальными help/version shortcuts и
|
|
4
|
+
* stdout/stderr wiring.
|
|
5
|
+
*
|
|
6
|
+
* API-команды запускаются через `icore` terminal app; этот файл не собирает
|
|
7
|
+
* промежуточный argv contract и не выполняет command-specific parsing.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.parseCliInput = parseCliInput;
|
|
11
|
+
exports.runCli = runCli;
|
|
12
|
+
const icore_1 = require("icore");
|
|
13
|
+
const error_1 = require("./error");
|
|
14
|
+
const help_1 = require("./help");
|
|
15
|
+
const version_1 = require("./version");
|
|
16
|
+
const bootstrapOptionsSchema = {
|
|
17
|
+
help: {
|
|
18
|
+
type: 'boolean',
|
|
19
|
+
alias: 'h'
|
|
20
|
+
},
|
|
21
|
+
version: {
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
alias: 'v'
|
|
24
|
+
},
|
|
25
|
+
insecure: {
|
|
26
|
+
type: 'boolean'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const bootstrapOptionNames = Object.keys(bootstrapOptionsSchema);
|
|
30
|
+
// Пустой registry сохраняет единый TerminalApp error contract,
|
|
31
|
+
// не загружая API-команды для глобальных shortcuts.
|
|
32
|
+
const bootstrapCommands = (0, icore_1.createCommands)([]);
|
|
33
|
+
function parseCliInput(argv) {
|
|
34
|
+
const parsedArgv = (0, icore_1.parseArgv)(argv, bootstrapOptionsSchema);
|
|
35
|
+
rejectUndocumentedLongAliases(parsedArgv.options);
|
|
36
|
+
validateBootstrapOptions(parsedArgv.options);
|
|
37
|
+
return parsedArgv;
|
|
38
|
+
}
|
|
39
|
+
function rejectUndocumentedLongAliases(options) {
|
|
40
|
+
const replacements = {
|
|
41
|
+
h: "'--help' or '-h'",
|
|
42
|
+
'no-h': "'--help' or '-h'",
|
|
43
|
+
v: "'--version' or '-v'",
|
|
44
|
+
'no-v': "'--version' or '-v'"
|
|
45
|
+
};
|
|
46
|
+
for (const [name, replacement] of Object.entries(replacements)) {
|
|
47
|
+
if (Object.hasOwn(options, name)) {
|
|
48
|
+
throw new icore_1.CliUsageError(`Unexpected option '--${name}'; use ${replacement}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function validateBootstrapOptions(options) {
|
|
53
|
+
const bootstrapOptions = {};
|
|
54
|
+
for (const name of bootstrapOptionNames) {
|
|
55
|
+
if (Object.hasOwn(options, name)) {
|
|
56
|
+
bootstrapOptions[name] = options[name];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Опции конкретной команды намеренно остаются у terminal app `icore`:
|
|
60
|
+
// эта проверка охватывает только глобальные логические флаги runner-а.
|
|
61
|
+
(0, icore_1.parseOptions)(bootstrapOptionsSchema, bootstrapOptions);
|
|
62
|
+
}
|
|
63
|
+
async function runCli(argv = [], io = (0, icore_1.createOutput)()) {
|
|
64
|
+
const bootstrapApp = (0, icore_1.createTerminalApp)({
|
|
65
|
+
commands: bootstrapCommands,
|
|
66
|
+
output: io,
|
|
67
|
+
errorPolicy: error_1.terminalErrorPolicy
|
|
68
|
+
});
|
|
69
|
+
let parsedArgv;
|
|
70
|
+
try {
|
|
71
|
+
parsedArgv = parseCliInput(argv);
|
|
72
|
+
rejectUnsupportedShortcutOptions(parsedArgv.positionals, parsedArgv.options);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
return bootstrapApp.reportError(error, {
|
|
76
|
+
phase: 'external',
|
|
77
|
+
args: argv
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const writeBootstrapOutput = async (text) => {
|
|
81
|
+
try {
|
|
82
|
+
await bootstrapApp.output.write(text);
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return bootstrapApp.reportError(error, {
|
|
87
|
+
phase: 'external',
|
|
88
|
+
args: argv
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
// Глобальные флаги обрабатываются до запуска команды, чтобы `--help` и
|
|
93
|
+
// `--version` не требовали SDK credentials и обязательных опций команды.
|
|
94
|
+
if ((0, help_1.isHelpRequested)(parsedArgv.options)) {
|
|
95
|
+
return writeBootstrapOutput((0, help_1.renderHelp)(parsedArgv.positionals));
|
|
96
|
+
}
|
|
97
|
+
if ((0, version_1.isVersionRequested)(parsedArgv.options)) {
|
|
98
|
+
return writeBootstrapOutput((0, version_1.renderVersionInfo)());
|
|
99
|
+
}
|
|
100
|
+
if (parsedArgv.positionals.length === 0) {
|
|
101
|
+
return writeBootstrapOutput((0, help_1.renderCliHelp)());
|
|
102
|
+
}
|
|
103
|
+
let registry;
|
|
104
|
+
try {
|
|
105
|
+
registry = await import('./registry.js');
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
return bootstrapApp.reportError(error, {
|
|
109
|
+
phase: 'external',
|
|
110
|
+
args: argv
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const app = (0, icore_1.createTerminalApp)({
|
|
114
|
+
commands: registry.commandLineCommands,
|
|
115
|
+
output: io,
|
|
116
|
+
errorPolicy: error_1.terminalErrorPolicy
|
|
117
|
+
});
|
|
118
|
+
let prepared;
|
|
119
|
+
try {
|
|
120
|
+
prepared = await app.prepare(argv);
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
return app.reportError(error, {
|
|
124
|
+
phase: 'prepare',
|
|
125
|
+
args: argv
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
try {
|
|
129
|
+
for (const warning of registry.resolveCommandWarnings(prepared.name, argv)) {
|
|
130
|
+
await app.output.error(warning);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
return app.reportError(error, {
|
|
135
|
+
phase: 'write',
|
|
136
|
+
args: argv,
|
|
137
|
+
prepared
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return app.runPrepared(prepared, undefined);
|
|
141
|
+
}
|
|
142
|
+
function rejectUnsupportedShortcutOptions(positionals, options) {
|
|
143
|
+
if (positionals.length > 0 && !(0, version_1.isVersionRequested)(options)) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
for (const name of Object.keys(options)) {
|
|
147
|
+
if (!bootstrapOptionNames.includes(name)) {
|
|
148
|
+
throw new icore_1.CliUsageError(`Unexpected option '--${name}'`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version-модуль обслуживает presentation-контракт для вывода версии пакета.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы:
|
|
5
|
+
* - распознавание version-флагов;
|
|
6
|
+
* - сборка стабильного текстового ответа для CLI;
|
|
7
|
+
* - чтение package metadata без запуска SDK runtime.
|
|
8
|
+
*
|
|
9
|
+
* Здесь не должно быть bootstrap-инициализации, gRPC wiring или логики SDK-команд.
|
|
10
|
+
*/
|
|
11
|
+
type VersionOptions = {
|
|
12
|
+
version?: unknown;
|
|
13
|
+
};
|
|
14
|
+
export declare const cliName = "t-invest-node-sdk";
|
|
15
|
+
export declare function isVersionRequested(options: VersionOptions): boolean;
|
|
16
|
+
export declare function renderVersionInfo(): string;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Version-модуль обслуживает presentation-контракт для вывода версии пакета.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы:
|
|
6
|
+
* - распознавание version-флагов;
|
|
7
|
+
* - сборка стабильного текстового ответа для CLI;
|
|
8
|
+
* - чтение package metadata без запуска SDK runtime.
|
|
9
|
+
*
|
|
10
|
+
* Здесь не должно быть bootstrap-инициализации, gRPC wiring или логики SDK-команд.
|
|
11
|
+
*/
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.cliName = void 0;
|
|
17
|
+
exports.isVersionRequested = isVersionRequested;
|
|
18
|
+
exports.renderVersionInfo = renderVersionInfo;
|
|
19
|
+
const package_json_1 = __importDefault(require("../../../package.json"));
|
|
20
|
+
exports.cliName = 't-invest-node-sdk';
|
|
21
|
+
function isVersionRequested(options) {
|
|
22
|
+
return options.version === true;
|
|
23
|
+
}
|
|
24
|
+
function renderVersionInfo() {
|
|
25
|
+
return `${exports.cliName} ${package_json_1.default.version}\n`;
|
|
26
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI-команды `account list`.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы:
|
|
5
|
+
* - объявление command path и option schema;
|
|
6
|
+
* - преобразование CLI options в generated request;
|
|
7
|
+
* - создание SDK через bootstrap factory и закрытие SDK resource;
|
|
8
|
+
*
|
|
9
|
+
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
|
+
*/
|
|
11
|
+
import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
12
|
+
import type { GetAccountsResponse } from '../../../generated/users';
|
|
13
|
+
import { formatAccounts } from './reporter';
|
|
14
|
+
type AccountsSdk = {
|
|
15
|
+
users: {
|
|
16
|
+
getAccounts(request: Record<string, never>): Promise<GetAccountsResponse>;
|
|
17
|
+
};
|
|
18
|
+
close(): void;
|
|
19
|
+
};
|
|
20
|
+
type AccountsSdkFactory = (options: TInvestOptions) => AccountsSdk;
|
|
21
|
+
export declare function createAccountsCommand(createSdk?: AccountsSdkFactory): Omit<import("icore").CommandDefinition<{
|
|
22
|
+
readonly token: {
|
|
23
|
+
readonly type: 'string';
|
|
24
|
+
};
|
|
25
|
+
readonly endpoint: {
|
|
26
|
+
readonly type: 'string';
|
|
27
|
+
};
|
|
28
|
+
readonly 'app-name': {
|
|
29
|
+
readonly type: 'string';
|
|
30
|
+
};
|
|
31
|
+
readonly insecure: {
|
|
32
|
+
readonly type: 'boolean';
|
|
33
|
+
};
|
|
34
|
+
readonly format: {
|
|
35
|
+
readonly type: 'string';
|
|
36
|
+
readonly choices: readonly ["json", "table"];
|
|
37
|
+
readonly default: 'table';
|
|
38
|
+
};
|
|
39
|
+
}, undefined, string, readonly ["account", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
40
|
+
metadata?: undefined;
|
|
41
|
+
};
|
|
42
|
+
export declare const accountsCommand: Omit<import("icore").CommandDefinition<{
|
|
43
|
+
readonly token: {
|
|
44
|
+
readonly type: 'string';
|
|
45
|
+
};
|
|
46
|
+
readonly endpoint: {
|
|
47
|
+
readonly type: 'string';
|
|
48
|
+
};
|
|
49
|
+
readonly 'app-name': {
|
|
50
|
+
readonly type: 'string';
|
|
51
|
+
};
|
|
52
|
+
readonly insecure: {
|
|
53
|
+
readonly type: 'boolean';
|
|
54
|
+
};
|
|
55
|
+
readonly format: {
|
|
56
|
+
readonly type: 'string';
|
|
57
|
+
readonly choices: readonly ["json", "table"];
|
|
58
|
+
readonly default: 'table';
|
|
59
|
+
};
|
|
60
|
+
}, undefined, string, readonly ["account", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
61
|
+
metadata?: undefined;
|
|
62
|
+
};
|
|
63
|
+
export { formatAccounts };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI-команды `account list`.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы:
|
|
6
|
+
* - объявление command path и option schema;
|
|
7
|
+
* - преобразование CLI options в generated request;
|
|
8
|
+
* - создание SDK через bootstrap factory и закрытие SDK resource;
|
|
9
|
+
*
|
|
10
|
+
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.formatAccounts = exports.accountsCommand = void 0;
|
|
14
|
+
exports.createAccountsCommand = createAccountsCommand;
|
|
15
|
+
const contract_1 = require("../../cli/contract");
|
|
16
|
+
const args_1 = require("../../args");
|
|
17
|
+
const command_options_1 = require("../../args/command-options");
|
|
18
|
+
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
19
|
+
const reporter_1 = require("./reporter");
|
|
20
|
+
Object.defineProperty(exports, "formatAccounts", { enumerable: true, get: function () { return reporter_1.formatAccounts; } });
|
|
21
|
+
const accountsCommandPath = ['account', 'list'];
|
|
22
|
+
const defaultAccountsSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
23
|
+
const accountsOptionsSchema = (0, command_options_1.withSdkOptions)({
|
|
24
|
+
format: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
choices: reporter_1.accountsFormats,
|
|
27
|
+
default: 'table'
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
function createAccountsCommand(createSdk = defaultAccountsSdkFactory) {
|
|
31
|
+
return contract_1.command.define({
|
|
32
|
+
path: accountsCommandPath,
|
|
33
|
+
options: accountsOptionsSchema,
|
|
34
|
+
handle({ options }) {
|
|
35
|
+
return runAccountsCommand(options, createSdk);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.accountsCommand = createAccountsCommand();
|
|
40
|
+
async function runAccountsCommand(options, createSdk) {
|
|
41
|
+
const { format } = options;
|
|
42
|
+
const sdk = createSdk((0, args_1.resolveSdkOptionsFromCommandOptions)(options));
|
|
43
|
+
try {
|
|
44
|
+
const response = await sdk.users.getAccounts({});
|
|
45
|
+
return (0, reporter_1.formatAccounts)(response.accounts, format);
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
sdk.close();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI-репортинга команды `account list`.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы mapping generated DTO в application report contract и
|
|
5
|
+
* presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
|
|
6
|
+
*/
|
|
7
|
+
import type { AccountsReport } from '../../../application/reports';
|
|
8
|
+
import { type Account } from '../../../generated/users';
|
|
9
|
+
export declare const accountsFormats: readonly ['json', 'table'];
|
|
10
|
+
export type AccountsFormat = typeof accountsFormats[number];
|
|
11
|
+
export declare function createAccountsReport(accounts: Account[]): AccountsReport;
|
|
12
|
+
export declare function formatAccountsReport(report: AccountsReport, format: AccountsFormat): string;
|
|
13
|
+
export declare function formatAccounts(accounts: Account[], format: AccountsFormat): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI-репортинга команды `account list`.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы mapping generated DTO в application report contract и
|
|
6
|
+
* presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.accountsFormats = void 0;
|
|
10
|
+
exports.createAccountsReport = createAccountsReport;
|
|
11
|
+
exports.formatAccountsReport = formatAccountsReport;
|
|
12
|
+
exports.formatAccounts = formatAccounts;
|
|
13
|
+
const users_1 = require("../../../generated/users");
|
|
14
|
+
const report_values_1 = require("../../../infrastructure/report-values");
|
|
15
|
+
const icore_1 = require("icore");
|
|
16
|
+
exports.accountsFormats = ['json', 'table'];
|
|
17
|
+
function toReportAccount(account) {
|
|
18
|
+
return {
|
|
19
|
+
id: account.id,
|
|
20
|
+
name: account.name,
|
|
21
|
+
type: (0, users_1.accountTypeToJSON)(account.type),
|
|
22
|
+
status: (0, users_1.accountStatusToJSON)(account.status),
|
|
23
|
+
accessLevel: (0, users_1.accessLevelToJSON)(account.accessLevel),
|
|
24
|
+
openedDate: (0, report_values_1.formatReportDate)(account.openedDate),
|
|
25
|
+
closedDate: (0, report_values_1.formatReportDate)(account.closedDate)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function createAccountsReport(accounts) {
|
|
29
|
+
return accounts.map(toReportAccount);
|
|
30
|
+
}
|
|
31
|
+
function formatAccountsReport(report, format) {
|
|
32
|
+
if (format === 'json') {
|
|
33
|
+
return (0, icore_1.renderJson)(report);
|
|
34
|
+
}
|
|
35
|
+
return (0, icore_1.renderTextTable)([
|
|
36
|
+
['id', 'name', 'type', 'status', 'accessLevel', 'openedDate', 'closedDate'],
|
|
37
|
+
...report.map((account) => [
|
|
38
|
+
account.id,
|
|
39
|
+
account.name,
|
|
40
|
+
account.type,
|
|
41
|
+
account.status,
|
|
42
|
+
account.accessLevel,
|
|
43
|
+
account.openedDate,
|
|
44
|
+
account.closedDate
|
|
45
|
+
])
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
function formatAccounts(accounts, format) {
|
|
49
|
+
return formatAccountsReport(createAccountsReport(accounts), format);
|
|
50
|
+
}
|