@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,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль общих CLI-опций собирает схемы bootstrap-команд поверх `icore`.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы общие схемы и преобразования значений, которые нужны
|
|
5
|
+
* нескольким request builders. Разбор argv и проверка schema-level ограничений
|
|
6
|
+
* принадлежат command mechanics `icore`.
|
|
7
|
+
*
|
|
8
|
+
* Здесь не должно быть создания SDK clients, чтения переменных окружения,
|
|
9
|
+
* сборки generated requests или форматирования provider responses.
|
|
10
|
+
*/
|
|
11
|
+
import { type MergeOptionsSchemas, type OptionsSchema } from 'icore';
|
|
12
|
+
type OptionalCommandOptionKeys<TOptions> = {
|
|
13
|
+
[TKey in keyof TOptions]: undefined extends TOptions[TKey] ? TKey : never;
|
|
14
|
+
}[keyof TOptions];
|
|
15
|
+
type RequiredCommandOptionKeys<TOptions> = Exclude<keyof TOptions, OptionalCommandOptionKeys<TOptions>>;
|
|
16
|
+
export type CommandRequestOptions<TOptions, TKeys extends keyof TOptions> = Pick<TOptions, Extract<TKeys, RequiredCommandOptionKeys<TOptions>>> & Partial<Pick<TOptions, Extract<TKeys, OptionalCommandOptionKeys<TOptions>>>>;
|
|
17
|
+
export declare const sdkOptionsSchema: {
|
|
18
|
+
readonly token: {
|
|
19
|
+
readonly type: 'string';
|
|
20
|
+
};
|
|
21
|
+
readonly endpoint: {
|
|
22
|
+
readonly type: 'string';
|
|
23
|
+
};
|
|
24
|
+
readonly 'app-name': {
|
|
25
|
+
readonly type: 'string';
|
|
26
|
+
};
|
|
27
|
+
readonly insecure: {
|
|
28
|
+
readonly type: 'boolean';
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const positiveSafeIntegerOption: {
|
|
32
|
+
readonly type: 'number';
|
|
33
|
+
readonly integer: true;
|
|
34
|
+
readonly min: 1;
|
|
35
|
+
readonly max: number;
|
|
36
|
+
};
|
|
37
|
+
export declare function withSdkOptions<const TSchemas extends readonly OptionsSchema[]>(...schemas: TSchemas): MergeOptionsSchemas<readonly [typeof sdkOptionsSchema, ...TSchemas]>;
|
|
38
|
+
export declare function parseCommaSeparatedStringListOption(value: string, name: string): string[];
|
|
39
|
+
export declare function parseDateTimeOption(value: string, name: string): Date;
|
|
40
|
+
export declare function requireStringOption(value: string | undefined, name: string): string;
|
|
41
|
+
export declare function parseRequiredDateTimeOption(value: string | undefined, name: string): Date;
|
|
42
|
+
export declare function parseOptionalNonNegativeIntegerOption(value: string | undefined, name: string): number;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль общих CLI-опций собирает схемы bootstrap-команд поверх `icore`.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы общие схемы и преобразования значений, которые нужны
|
|
6
|
+
* нескольким request builders. Разбор argv и проверка schema-level ограничений
|
|
7
|
+
* принадлежат command mechanics `icore`.
|
|
8
|
+
*
|
|
9
|
+
* Здесь не должно быть создания SDK clients, чтения переменных окружения,
|
|
10
|
+
* сборки generated requests или форматирования provider responses.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.positiveSafeIntegerOption = exports.sdkOptionsSchema = void 0;
|
|
14
|
+
exports.withSdkOptions = withSdkOptions;
|
|
15
|
+
exports.parseCommaSeparatedStringListOption = parseCommaSeparatedStringListOption;
|
|
16
|
+
exports.parseDateTimeOption = parseDateTimeOption;
|
|
17
|
+
exports.requireStringOption = requireStringOption;
|
|
18
|
+
exports.parseRequiredDateTimeOption = parseRequiredDateTimeOption;
|
|
19
|
+
exports.parseOptionalNonNegativeIntegerOption = parseOptionalNonNegativeIntegerOption;
|
|
20
|
+
const icore_1 = require("icore");
|
|
21
|
+
exports.sdkOptionsSchema = {
|
|
22
|
+
token: {
|
|
23
|
+
type: 'string'
|
|
24
|
+
},
|
|
25
|
+
endpoint: {
|
|
26
|
+
type: 'string'
|
|
27
|
+
},
|
|
28
|
+
'app-name': {
|
|
29
|
+
type: 'string'
|
|
30
|
+
},
|
|
31
|
+
insecure: {
|
|
32
|
+
type: 'boolean'
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.positiveSafeIntegerOption = {
|
|
36
|
+
type: 'number',
|
|
37
|
+
integer: true,
|
|
38
|
+
min: 1,
|
|
39
|
+
max: Number.MAX_SAFE_INTEGER
|
|
40
|
+
};
|
|
41
|
+
function withSdkOptions(...schemas) {
|
|
42
|
+
return (0, icore_1.mergeOptionsSchema)(exports.sdkOptionsSchema, ...schemas);
|
|
43
|
+
}
|
|
44
|
+
function parseCommaSeparatedStringListOption(value, name) {
|
|
45
|
+
const values = value.split(',').map((item) => item.trim());
|
|
46
|
+
if (values.some((item) => item === '')) {
|
|
47
|
+
throw new icore_1.CliUsageError(`Expected '--${name}' as comma-separated list`);
|
|
48
|
+
}
|
|
49
|
+
return values;
|
|
50
|
+
}
|
|
51
|
+
function parseDateTimeOption(value, name) {
|
|
52
|
+
const match = rfc3339DateTimePattern.exec(value);
|
|
53
|
+
if (match === null || !hasValidDateTimeParts(match)) {
|
|
54
|
+
throw new icore_1.CliUsageError(`Expected '--${name}' as date-time with explicit timezone`);
|
|
55
|
+
}
|
|
56
|
+
const date = new Date(value);
|
|
57
|
+
if (Number.isNaN(date.getTime())
|
|
58
|
+
|| date.getUTCFullYear() < 1
|
|
59
|
+
|| date.getUTCFullYear() > 9999) {
|
|
60
|
+
throw new icore_1.CliUsageError(`Expected '--${name}' as date-time with explicit timezone`);
|
|
61
|
+
}
|
|
62
|
+
return date;
|
|
63
|
+
}
|
|
64
|
+
function requireStringOption(value, name) {
|
|
65
|
+
if (value === undefined) {
|
|
66
|
+
throw new icore_1.CliUsageError(`Expected required argument '--${name}'`);
|
|
67
|
+
}
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
function parseRequiredDateTimeOption(value, name) {
|
|
71
|
+
return parseDateTimeOption(requireStringOption(value, name), name);
|
|
72
|
+
}
|
|
73
|
+
function parseOptionalNonNegativeIntegerOption(value, name) {
|
|
74
|
+
if (value === undefined) {
|
|
75
|
+
return 0;
|
|
76
|
+
}
|
|
77
|
+
if (!/^\d+$/.test(value)) {
|
|
78
|
+
throw new icore_1.CliUsageError(`Expected '--${name}' as integer greater than or equal to 0`);
|
|
79
|
+
}
|
|
80
|
+
const parsed = Number(value);
|
|
81
|
+
if (!Number.isSafeInteger(parsed)) {
|
|
82
|
+
throw new icore_1.CliUsageError(`Expected '--${name}' as integer greater than or equal to 0`);
|
|
83
|
+
}
|
|
84
|
+
return parsed;
|
|
85
|
+
}
|
|
86
|
+
const rfc3339DateTimePattern = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](\d{2}):(\d{2}))$/;
|
|
87
|
+
function hasValidDateTimeParts(match) {
|
|
88
|
+
const year = Number(match[1]);
|
|
89
|
+
const month = Number(match[2]);
|
|
90
|
+
const day = Number(match[3]);
|
|
91
|
+
const hour = Number(match[4]);
|
|
92
|
+
const minute = Number(match[5]);
|
|
93
|
+
const second = Number(match[6]);
|
|
94
|
+
const offsetHour = match[7] === undefined ? 0 : Number(match[7]);
|
|
95
|
+
const offsetMinute = match[8] === undefined ? 0 : Number(match[8]);
|
|
96
|
+
const daysInMonth = resolveDaysInMonth(year, month);
|
|
97
|
+
return daysInMonth !== undefined
|
|
98
|
+
&& day >= 1
|
|
99
|
+
&& day <= daysInMonth
|
|
100
|
+
&& hour <= 23
|
|
101
|
+
&& minute <= 59
|
|
102
|
+
&& second <= 59
|
|
103
|
+
&& offsetHour <= 23
|
|
104
|
+
&& offsetMinute <= 59;
|
|
105
|
+
}
|
|
106
|
+
function resolveDaysInMonth(year, month) {
|
|
107
|
+
const days = [
|
|
108
|
+
31,
|
|
109
|
+
isLeapYear(year) ? 29 : 28,
|
|
110
|
+
31,
|
|
111
|
+
30,
|
|
112
|
+
31,
|
|
113
|
+
30,
|
|
114
|
+
31,
|
|
115
|
+
31,
|
|
116
|
+
30,
|
|
117
|
+
31,
|
|
118
|
+
30,
|
|
119
|
+
31
|
|
120
|
+
];
|
|
121
|
+
return month >= 1 && month <= 12 ? days[month - 1] : undefined;
|
|
122
|
+
}
|
|
123
|
+
function isLeapYear(year) {
|
|
124
|
+
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
125
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { resolveSdkOptionsFromCommandOptions } from './sdk-options';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveSdkOptionsFromCommandOptions = void 0;
|
|
4
|
+
var sdk_options_1 = require("./sdk-options");
|
|
5
|
+
Object.defineProperty(exports, "resolveSdkOptionsFromCommandOptions", { enumerable: true, get: function () { return sdk_options_1.resolveSdkOptionsFromCommandOptions; } });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль instrument id CLI options хранит compatibility contract для instrument filters.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы:
|
|
5
|
+
* - канонический `--instrument-id` option schema;
|
|
6
|
+
* - deprecated `--figi` alias для старых CLI-контрактов;
|
|
7
|
+
* - единая проверка конфликта между новым и старым option names;
|
|
8
|
+
*
|
|
9
|
+
* Здесь не должно быть generated request mapping или command-specific option parsing.
|
|
10
|
+
*/
|
|
11
|
+
export declare const instrumentIdWithDeprecatedFigiOptionsSchema: {
|
|
12
|
+
readonly 'instrument-id': {
|
|
13
|
+
readonly type: 'string';
|
|
14
|
+
};
|
|
15
|
+
readonly figi: {
|
|
16
|
+
readonly type: 'string';
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type InstrumentIdAliasOptions = {
|
|
20
|
+
'instrument-id'?: string | undefined;
|
|
21
|
+
figi?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
export declare function resolveInstrumentIdOption(options: InstrumentIdAliasOptions): string;
|
|
24
|
+
export declare function resolveOptionalInstrumentIdOption(options: InstrumentIdAliasOptions): string | undefined;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль instrument id CLI options хранит compatibility contract для instrument filters.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы:
|
|
6
|
+
* - канонический `--instrument-id` option schema;
|
|
7
|
+
* - deprecated `--figi` alias для старых CLI-контрактов;
|
|
8
|
+
* - единая проверка конфликта между новым и старым option names;
|
|
9
|
+
*
|
|
10
|
+
* Здесь не должно быть generated request mapping или command-specific option parsing.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.instrumentIdWithDeprecatedFigiOptionsSchema = void 0;
|
|
14
|
+
exports.resolveInstrumentIdOption = resolveInstrumentIdOption;
|
|
15
|
+
exports.resolveOptionalInstrumentIdOption = resolveOptionalInstrumentIdOption;
|
|
16
|
+
const icore_1 = require("icore");
|
|
17
|
+
exports.instrumentIdWithDeprecatedFigiOptionsSchema = {
|
|
18
|
+
'instrument-id': {
|
|
19
|
+
type: 'string'
|
|
20
|
+
},
|
|
21
|
+
figi: {
|
|
22
|
+
type: 'string'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
function resolveInstrumentIdOption(options) {
|
|
26
|
+
return resolveInstrumentId(options, true) ?? '';
|
|
27
|
+
}
|
|
28
|
+
function resolveOptionalInstrumentIdOption(options) {
|
|
29
|
+
return resolveInstrumentId(options, false);
|
|
30
|
+
}
|
|
31
|
+
function resolveInstrumentId(options, required) {
|
|
32
|
+
const instrumentId = options['instrument-id'];
|
|
33
|
+
const figi = options.figi;
|
|
34
|
+
if (instrumentId !== undefined && figi !== undefined) {
|
|
35
|
+
throw new icore_1.CliUsageError("Use either '--instrument-id' or deprecated '--figi', not both");
|
|
36
|
+
}
|
|
37
|
+
if (instrumentId !== undefined) {
|
|
38
|
+
return instrumentId;
|
|
39
|
+
}
|
|
40
|
+
if (figi !== undefined) {
|
|
41
|
+
return figi;
|
|
42
|
+
}
|
|
43
|
+
if (required) {
|
|
44
|
+
throw new icore_1.CliUsageError("Expected '--instrument-id'");
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Общие parsers CLI-аргументов для instruments-команд.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустим только разбор shared request fragments generated
|
|
5
|
+
* InstrumentsService. Command-specific flags остаются в конкретных командах.
|
|
6
|
+
*/
|
|
7
|
+
import { InstrumentStatus } from '../../generated/common';
|
|
8
|
+
import { InstrumentIdType, type InstrumentRequest, type InstrumentsRequest } from '../../generated/instruments';
|
|
9
|
+
declare const instrumentIdTypes: {
|
|
10
|
+
readonly figi: InstrumentIdType.INSTRUMENT_ID_TYPE_FIGI;
|
|
11
|
+
readonly ticker: InstrumentIdType.INSTRUMENT_ID_TYPE_TICKER;
|
|
12
|
+
readonly uid: InstrumentIdType.INSTRUMENT_ID_TYPE_UID;
|
|
13
|
+
readonly 'position-uid': InstrumentIdType.INSTRUMENT_ID_TYPE_POSITION_UID;
|
|
14
|
+
};
|
|
15
|
+
type InstrumentIdTypeName = keyof typeof instrumentIdTypes;
|
|
16
|
+
export declare const instrumentLookupOptionsSchema: {
|
|
17
|
+
readonly 'class-code': {
|
|
18
|
+
readonly type: 'string';
|
|
19
|
+
};
|
|
20
|
+
readonly id: {
|
|
21
|
+
readonly type: 'string';
|
|
22
|
+
};
|
|
23
|
+
readonly 'id-type': {
|
|
24
|
+
readonly type: 'string';
|
|
25
|
+
readonly choices: ("figi" | "position-uid" | "ticker" | "uid")[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
declare const instrumentStatuses: {
|
|
29
|
+
readonly unspecified: InstrumentStatus.INSTRUMENT_STATUS_UNSPECIFIED;
|
|
30
|
+
readonly base: InstrumentStatus.INSTRUMENT_STATUS_BASE;
|
|
31
|
+
readonly all: InstrumentStatus.INSTRUMENT_STATUS_ALL;
|
|
32
|
+
};
|
|
33
|
+
type InstrumentStatusName = keyof typeof instrumentStatuses;
|
|
34
|
+
export declare const instrumentStatusOptionsSchema: {
|
|
35
|
+
readonly 'instrument-status': {
|
|
36
|
+
readonly type: 'string';
|
|
37
|
+
readonly choices: ("all" | "base" | "unspecified")[];
|
|
38
|
+
readonly default: 'base';
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare function createInstrumentLookupRequestFromOptions(options: {
|
|
42
|
+
id?: string | undefined;
|
|
43
|
+
'id-type'?: InstrumentIdTypeName | undefined;
|
|
44
|
+
'class-code'?: string | undefined;
|
|
45
|
+
}): InstrumentRequest;
|
|
46
|
+
export declare function createInstrumentsRequestFromOptions(options: {
|
|
47
|
+
'instrument-status': InstrumentStatusName;
|
|
48
|
+
}): InstrumentsRequest;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Общие parsers CLI-аргументов для instruments-команд.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустим только разбор shared request fragments generated
|
|
6
|
+
* InstrumentsService. Command-specific flags остаются в конкретных командах.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.instrumentStatusOptionsSchema = exports.instrumentLookupOptionsSchema = void 0;
|
|
10
|
+
exports.createInstrumentLookupRequestFromOptions = createInstrumentLookupRequestFromOptions;
|
|
11
|
+
exports.createInstrumentsRequestFromOptions = createInstrumentsRequestFromOptions;
|
|
12
|
+
const common_1 = require("../../generated/common");
|
|
13
|
+
const instruments_1 = require("../../generated/instruments");
|
|
14
|
+
const icore_1 = require("icore");
|
|
15
|
+
const instrumentIdTypes = {
|
|
16
|
+
figi: instruments_1.InstrumentIdType.INSTRUMENT_ID_TYPE_FIGI,
|
|
17
|
+
ticker: instruments_1.InstrumentIdType.INSTRUMENT_ID_TYPE_TICKER,
|
|
18
|
+
uid: instruments_1.InstrumentIdType.INSTRUMENT_ID_TYPE_UID,
|
|
19
|
+
'position-uid': instruments_1.InstrumentIdType.INSTRUMENT_ID_TYPE_POSITION_UID
|
|
20
|
+
};
|
|
21
|
+
const instrumentIdTypeNames = Object.keys(instrumentIdTypes);
|
|
22
|
+
const instrumentLookupIdOptionsSchema = {
|
|
23
|
+
id: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
required: true
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const instrumentLookupIdTypeOptionsSchema = {
|
|
29
|
+
'id-type': {
|
|
30
|
+
type: 'string',
|
|
31
|
+
choices: instrumentIdTypeNames,
|
|
32
|
+
required: true
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const instrumentLookupClassCodeOptionsSchema = {
|
|
36
|
+
'class-code': {
|
|
37
|
+
type: 'string'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.instrumentLookupOptionsSchema = {
|
|
41
|
+
id: {
|
|
42
|
+
type: 'string'
|
|
43
|
+
},
|
|
44
|
+
'id-type': {
|
|
45
|
+
type: 'string',
|
|
46
|
+
choices: instrumentIdTypeNames
|
|
47
|
+
},
|
|
48
|
+
...instrumentLookupClassCodeOptionsSchema
|
|
49
|
+
};
|
|
50
|
+
const instrumentStatuses = {
|
|
51
|
+
unspecified: common_1.InstrumentStatus.INSTRUMENT_STATUS_UNSPECIFIED,
|
|
52
|
+
base: common_1.InstrumentStatus.INSTRUMENT_STATUS_BASE,
|
|
53
|
+
all: common_1.InstrumentStatus.INSTRUMENT_STATUS_ALL
|
|
54
|
+
};
|
|
55
|
+
const instrumentStatusNames = Object.keys(instrumentStatuses);
|
|
56
|
+
exports.instrumentStatusOptionsSchema = {
|
|
57
|
+
'instrument-status': {
|
|
58
|
+
type: 'string',
|
|
59
|
+
choices: instrumentStatusNames,
|
|
60
|
+
default: 'base'
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
function createInstrumentLookupRequestFromOptions(options) {
|
|
64
|
+
const idType = (0, icore_1.parseOptions)(instrumentLookupIdTypeOptionsSchema, toDefinedRawOptionValues({ 'id-type': options['id-type'] }))['id-type'];
|
|
65
|
+
const classCode = options['class-code'] ?? '';
|
|
66
|
+
if (instrumentIdTypes[idType] === instruments_1.InstrumentIdType.INSTRUMENT_ID_TYPE_TICKER && classCode === '') {
|
|
67
|
+
throw new icore_1.CliUsageError("Expected required argument '--class-code' when '--id-type=ticker'");
|
|
68
|
+
}
|
|
69
|
+
const id = (0, icore_1.parseOptions)(instrumentLookupIdOptionsSchema, toDefinedRawOptionValues({ id: options.id })).id;
|
|
70
|
+
return {
|
|
71
|
+
id,
|
|
72
|
+
idType: instrumentIdTypes[idType],
|
|
73
|
+
classCode
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function createInstrumentsRequestFromOptions(options) {
|
|
77
|
+
return {
|
|
78
|
+
instrumentStatus: instrumentStatuses[options['instrument-status']]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function toDefinedRawOptionValues(options) {
|
|
82
|
+
const result = {};
|
|
83
|
+
for (const [name, value] of Object.entries(options)) {
|
|
84
|
+
if (value !== undefined) {
|
|
85
|
+
result[name] = value;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль SDK options CLI-слоя нормализует общие auth/runtime параметры API-команд.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы:
|
|
5
|
+
* - чтение `--token`, `--endpoint`, `--app-name`, `--insecure`;
|
|
6
|
+
* - fallback на ENV для credentials/endpoint;
|
|
7
|
+
* - возврат `TInvestOptions` для bootstrap command handlers.
|
|
8
|
+
*
|
|
9
|
+
* Здесь не должно быть создания `TInvestNodeSDK` или вызовов API.
|
|
10
|
+
*/
|
|
11
|
+
import type { TInvestOptions } from '../../application/dto/t-invest-options';
|
|
12
|
+
type SdkCommandOptions = {
|
|
13
|
+
token?: string | undefined;
|
|
14
|
+
endpoint?: string | undefined;
|
|
15
|
+
'app-name'?: string | undefined;
|
|
16
|
+
insecure?: boolean | undefined;
|
|
17
|
+
};
|
|
18
|
+
export declare function resolveSdkOptionsFromCommandOptions(options: SdkCommandOptions, env?: NodeJS.ProcessEnv): TInvestOptions;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль SDK options CLI-слоя нормализует общие auth/runtime параметры API-команд.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы:
|
|
6
|
+
* - чтение `--token`, `--endpoint`, `--app-name`, `--insecure`;
|
|
7
|
+
* - fallback на ENV для credentials/endpoint;
|
|
8
|
+
* - возврат `TInvestOptions` для bootstrap command handlers.
|
|
9
|
+
*
|
|
10
|
+
* Здесь не должно быть создания `TInvestNodeSDK` или вызовов API.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.resolveSdkOptionsFromCommandOptions = resolveSdkOptionsFromCommandOptions;
|
|
14
|
+
const icore_1 = require("icore");
|
|
15
|
+
function stringFromEnv(env, name) {
|
|
16
|
+
const value = env[name];
|
|
17
|
+
if (value === undefined || value.trim() === '') {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
function requiredCliOrEnvValue(cliValue, env, envName, optionName) {
|
|
23
|
+
const value = cliValue ?? stringFromEnv(env, envName);
|
|
24
|
+
if (value === undefined || value.trim() === '') {
|
|
25
|
+
throw new icore_1.CliUsageError(`Expected '--${optionName}' or ${envName}`);
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
function resolveSdkOptionsFromCommandOptions(options, env = process.env) {
|
|
30
|
+
const token = requiredCliOrEnvValue(options.token, env, 'T_INVEST_TOKEN', 'token');
|
|
31
|
+
const endpoint = requiredCliOrEnvValue(options.endpoint, env, 'T_INVEST_ENDPOINT', 'endpoint');
|
|
32
|
+
const appName = options['app-name'];
|
|
33
|
+
const insecure = options.insecure;
|
|
34
|
+
return {
|
|
35
|
+
token,
|
|
36
|
+
endpoint,
|
|
37
|
+
...(appName === undefined ? {} : { appName }),
|
|
38
|
+
...(insecure === true ? { useSsl: false } : {})
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль side-effect command args хранит общую защиту mutating CLI-команд.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы:
|
|
5
|
+
* - общий `--confirm` contract;
|
|
6
|
+
* - применение package config policy для side-effect confirmation;
|
|
7
|
+
* - parsing денежных decimal values для generated quotation;
|
|
8
|
+
* - ошибки, останавливающие side-effect command до SDK call;
|
|
9
|
+
*
|
|
10
|
+
* Здесь не должно быть конкретных order/sandbox request mappings.
|
|
11
|
+
*/
|
|
12
|
+
import type { Quotation } from '../../generated/common';
|
|
13
|
+
export declare const sideEffectConfirmationOptionsSchema: {
|
|
14
|
+
readonly confirm: {
|
|
15
|
+
readonly type: 'boolean';
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare function assertSideEffectConfirmed(confirm: boolean | undefined, requireConfirmation?: boolean): void;
|
|
19
|
+
export declare function parsePositiveQuotationOption(value: string, name: string): Quotation;
|
|
20
|
+
export declare function parseOptionalPositiveQuotationOption(value: string | undefined, name: string): Quotation | undefined;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль side-effect command args хранит общую защиту mutating CLI-команд.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы:
|
|
6
|
+
* - общий `--confirm` contract;
|
|
7
|
+
* - применение package config policy для side-effect confirmation;
|
|
8
|
+
* - parsing денежных decimal values для generated quotation;
|
|
9
|
+
* - ошибки, останавливающие side-effect command до SDK call;
|
|
10
|
+
*
|
|
11
|
+
* Здесь не должно быть конкретных order/sandbox request mappings.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.sideEffectConfirmationOptionsSchema = void 0;
|
|
15
|
+
exports.assertSideEffectConfirmed = assertSideEffectConfirmed;
|
|
16
|
+
exports.parsePositiveQuotationOption = parsePositiveQuotationOption;
|
|
17
|
+
exports.parseOptionalPositiveQuotationOption = parseOptionalPositiveQuotationOption;
|
|
18
|
+
const icore_1 = require("icore");
|
|
19
|
+
const sdk_config_1 = require("../sdk-config");
|
|
20
|
+
exports.sideEffectConfirmationOptionsSchema = {
|
|
21
|
+
confirm: {
|
|
22
|
+
type: 'boolean'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
function assertSideEffectConfirmed(confirm, requireConfirmation = sdk_config_1.defaultConfig.requireSideEffectConfirmation) {
|
|
26
|
+
if (requireConfirmation && confirm !== true) {
|
|
27
|
+
throw new icore_1.CliUsageError("Expected '--confirm' to execute side-effect command");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function parsePositiveQuotationOption(value, name) {
|
|
31
|
+
if (!/^(?:0|[1-9]\d*)(?:\.\d{1,9})?$/.test(value)) {
|
|
32
|
+
throw new icore_1.CliUsageError(decimalErrorMessage(name));
|
|
33
|
+
}
|
|
34
|
+
const [unitsText, fractionText = ''] = value.split('.');
|
|
35
|
+
const units = Number(unitsText);
|
|
36
|
+
const nano = Number(fractionText.padEnd(9, '0'));
|
|
37
|
+
if (!Number.isSafeInteger(units) || units === 0 && nano === 0) {
|
|
38
|
+
throw new icore_1.CliUsageError(decimalErrorMessage(name));
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
units,
|
|
42
|
+
nano
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function parseOptionalPositiveQuotationOption(value, name) {
|
|
46
|
+
return value === undefined ? undefined : parsePositiveQuotationOption(value, name);
|
|
47
|
+
}
|
|
48
|
+
function decimalErrorMessage(name) {
|
|
49
|
+
return `Expected '--${name}' as decimal greater than 0 with up to 9 fractional digits`;
|
|
50
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль CLI command facade закрепляет единую форму объявления bootstrap-команд.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы:
|
|
5
|
+
* - создание pre-bound фасада command mechanics из icore;
|
|
6
|
+
* - закрепление общих context, result и metadata типов bootstrap-команд;
|
|
7
|
+
* - экспорт фасада для command modules;
|
|
8
|
+
*
|
|
9
|
+
* Здесь не должно быть command-specific path, option schema или handler logic.
|
|
10
|
+
*/
|
|
11
|
+
import { type TerminalCommandOutput } from 'icore';
|
|
12
|
+
export declare const command: import("icore").BoundCommand<{
|
|
13
|
+
context: undefined;
|
|
14
|
+
result: TerminalCommandOutput;
|
|
15
|
+
metadata: undefined;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль CLI command facade закрепляет единую форму объявления bootstrap-команд.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы:
|
|
6
|
+
* - создание pre-bound фасада command mechanics из icore;
|
|
7
|
+
* - закрепление общих context, result и metadata типов bootstrap-команд;
|
|
8
|
+
* - экспорт фасада для command modules;
|
|
9
|
+
*
|
|
10
|
+
* Здесь не должно быть command-specific path, option schema или handler logic.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.command = void 0;
|
|
14
|
+
const icore_1 = require("icore");
|
|
15
|
+
exports.command = icore_1.createCommand.withTypes();
|