@woodger/t-invest-node-sdk 0.5.6 → 0.5.8
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 +317 -524
- package/NOTICE +8 -8
- package/dist/application/dto/t-invest-options.d.ts +8 -6
- package/dist/application/dto/t-invest-options.js +4 -4
- package/dist/application/dto/t-invest-services.d.ts +26 -1
- package/dist/application/dto/t-invest-services.js +2 -1
- package/dist/application/errors/sdk-error.d.ts +21 -7
- package/dist/application/errors/sdk-error.js +20 -17
- package/dist/application/reports/accounts.report.d.ts +7 -2
- package/dist/application/reports/accrued-interests.report.d.ts +8 -2
- package/dist/application/reports/asset.report.d.ts +5 -0
- package/dist/application/reports/bond-coupons.report.d.ts +3 -1
- package/dist/application/reports/bond.report.d.ts +3 -1
- package/dist/application/reports/brands.report.d.ts +4 -1
- package/dist/application/reports/broker-report.report.d.ts +14 -2
- package/dist/application/reports/candles.report.d.ts +4 -1
- package/dist/application/reports/close-prices.report.d.ts +7 -2
- package/dist/application/reports/currency.report.d.ts +4 -1
- package/dist/application/reports/dividends-foreign-issuer.report.d.ts +12 -1
- package/dist/application/reports/dividends.report.d.ts +4 -1
- package/dist/application/reports/find-instrument.report.d.ts +3 -1
- package/dist/application/reports/future.report.d.ts +3 -1
- package/dist/application/reports/futures-margin.report.d.ts +10 -3
- package/dist/application/reports/instrument.report.d.ts +7 -2
- package/dist/application/reports/last-prices.report.d.ts +7 -2
- package/dist/application/reports/last-trades.report.d.ts +4 -2
- package/dist/application/reports/margin-attributes.report.d.ts +6 -2
- package/dist/application/reports/operations-by-cursor.report.d.ts +7 -2
- package/dist/application/reports/option.report.d.ts +4 -1
- package/dist/application/reports/order-book.report.d.ts +1 -1
- package/dist/application/reports/order-mutation.report.d.ts +6 -2
- package/dist/application/reports/portfolio.report.d.ts +4 -1
- package/dist/application/reports/sandbox-account.report.d.ts +6 -0
- package/dist/application/reports/stop-orders.report.d.ts +3 -1
- package/dist/application/reports/trading-schedules.report.d.ts +12 -4
- package/dist/application/reports/trading-status.report.d.ts +3 -1
- package/dist/application/reports/trading-statuses.report.d.ts +4 -1
- package/dist/application/reports/user-tariff.report.d.ts +2 -0
- package/dist/application/reports/withdraw-limits.report.d.ts +4 -1
- package/dist/application/services/unary-limiter.d.ts +18 -14
- package/dist/application/services/unary-limiter.js +91 -33
- package/dist/bootstrap/args/command-options.d.ts +5 -0
- package/dist/bootstrap/args/command-options.js +24 -15
- package/dist/bootstrap/args/instrument-id-options.d.ts +12 -6
- package/dist/bootstrap/args/instrument-id-options.js +4 -2
- package/dist/bootstrap/args/instruments-args.d.ts +2 -2
- package/dist/bootstrap/args/instruments-args.js +2 -1
- package/dist/bootstrap/args/sdk-options.d.ts +7 -3
- package/dist/bootstrap/args/sdk-options.js +3 -3
- package/dist/bootstrap/args/side-effect-args.js +7 -3
- package/dist/bootstrap/cli/contract.d.ts +2 -1
- package/dist/bootstrap/cli/contract.js +2 -1
- package/dist/bootstrap/cli/domains.d.ts +13 -10
- package/dist/bootstrap/cli/domains.js +8 -3
- package/dist/bootstrap/cli/error.d.ts +7 -1
- package/dist/bootstrap/cli/error.js +11 -3
- package/dist/bootstrap/cli/help-catalog.d.ts +4 -1
- package/dist/bootstrap/cli/help-catalog.js +5 -0
- package/dist/bootstrap/cli/help.d.ts +5 -4
- package/dist/bootstrap/cli/help.js +4 -3
- package/dist/bootstrap/cli/registry.d.ts +288 -287
- package/dist/bootstrap/cli/registry.js +4 -2
- package/dist/bootstrap/cli/runner.js +1 -1
- package/dist/bootstrap/cli/version.d.ts +2 -1
- package/dist/bootstrap/cli/version.js +2 -1
- package/dist/bootstrap/commands/accounts/cli.d.ts +6 -5
- package/dist/bootstrap/commands/accounts/cli.js +17 -22
- package/dist/bootstrap/commands/accounts/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/accounts/reporter.js +2 -1
- package/dist/bootstrap/commands/accrued-interests/cli.d.ts +16 -15
- package/dist/bootstrap/commands/accrued-interests/cli.js +14 -21
- package/dist/bootstrap/commands/accrued-interests/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/accrued-interests/reporter.js +2 -1
- package/dist/bootstrap/commands/asset/cli.d.ts +13 -12
- package/dist/bootstrap/commands/asset/cli.js +14 -21
- package/dist/bootstrap/commands/asset/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/asset/reporter.js +2 -1
- package/dist/bootstrap/commands/assets/cli.d.ts +16 -15
- package/dist/bootstrap/commands/assets/cli.js +14 -21
- package/dist/bootstrap/commands/assets/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/assets/reporter.js +2 -1
- package/dist/bootstrap/commands/bond/cli.d.ts +6 -5
- package/dist/bootstrap/commands/bond/cli.js +19 -24
- package/dist/bootstrap/commands/bond/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/bond/reporter.js +5 -2
- package/dist/bootstrap/commands/bond-coupons/cli.d.ts +16 -15
- package/dist/bootstrap/commands/bond-coupons/cli.js +14 -21
- package/dist/bootstrap/commands/bond-coupons/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/bond-coupons/reporter.js +2 -1
- package/dist/bootstrap/commands/bonds/cli.d.ts +6 -5
- package/dist/bootstrap/commands/bonds/cli.js +19 -24
- package/dist/bootstrap/commands/bonds/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/bonds/reporter.js +2 -1
- package/dist/bootstrap/commands/brand/cli.d.ts +13 -12
- package/dist/bootstrap/commands/brand/cli.js +14 -21
- package/dist/bootstrap/commands/brand/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/brand/reporter.js +2 -1
- package/dist/bootstrap/commands/brands/cli.d.ts +6 -5
- package/dist/bootstrap/commands/brands/cli.js +17 -22
- package/dist/bootstrap/commands/brands/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/brands/reporter.js +2 -1
- package/dist/bootstrap/commands/broker-report/cli.d.ts +25 -24
- package/dist/bootstrap/commands/broker-report/cli.js +14 -21
- package/dist/bootstrap/commands/broker-report/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/broker-report/reporter.js +2 -1
- package/dist/bootstrap/commands/cancel-order/cli.d.ts +10 -9
- package/dist/bootstrap/commands/cancel-order/cli.js +28 -35
- package/dist/bootstrap/commands/cancel-order/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/cancel-order/reporter.js +2 -1
- package/dist/bootstrap/commands/cancel-stop-order/cli.d.ts +16 -15
- package/dist/bootstrap/commands/cancel-stop-order/cli.js +16 -22
- package/dist/bootstrap/commands/cancel-stop-order/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/cancel-stop-order/reporter.js +2 -1
- package/dist/bootstrap/commands/candles/cli.d.ts +22 -21
- package/dist/bootstrap/commands/candles/cli.js +14 -21
- package/dist/bootstrap/commands/candles/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/candles/reporter.js +2 -1
- package/dist/bootstrap/commands/close-prices/cli.d.ts +13 -12
- package/dist/bootstrap/commands/close-prices/cli.js +14 -21
- package/dist/bootstrap/commands/close-prices/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/close-prices/reporter.js +2 -1
- package/dist/bootstrap/commands/compile-proto/cli.d.ts +2 -1
- package/dist/bootstrap/commands/compile-proto/cli.js +2 -1
- package/dist/bootstrap/commands/countries/cli.d.ts +6 -5
- package/dist/bootstrap/commands/countries/cli.js +17 -22
- package/dist/bootstrap/commands/countries/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/countries/reporter.js +2 -1
- package/dist/bootstrap/commands/currencies/cli.d.ts +6 -5
- package/dist/bootstrap/commands/currencies/cli.js +19 -24
- package/dist/bootstrap/commands/currencies/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/currencies/reporter.js +2 -1
- package/dist/bootstrap/commands/currency/cli.d.ts +6 -5
- package/dist/bootstrap/commands/currency/cli.js +19 -24
- package/dist/bootstrap/commands/currency/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/currency/reporter.js +2 -1
- package/dist/bootstrap/commands/dividends/cli.d.ts +16 -15
- package/dist/bootstrap/commands/dividends/cli.js +14 -21
- package/dist/bootstrap/commands/dividends/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/dividends/reporter.js +2 -1
- package/dist/bootstrap/commands/dividends-foreign-issuer/cli.d.ts +25 -24
- package/dist/bootstrap/commands/dividends-foreign-issuer/cli.js +14 -21
- package/dist/bootstrap/commands/dividends-foreign-issuer/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/dividends-foreign-issuer/reporter.js +2 -1
- package/dist/bootstrap/commands/edit-favorites/cli.d.ts +13 -12
- package/dist/bootstrap/commands/edit-favorites/cli.js +16 -22
- package/dist/bootstrap/commands/edit-favorites/reporter.d.ts +2 -1
- package/dist/bootstrap/commands/etf/cli.d.ts +6 -5
- package/dist/bootstrap/commands/etf/cli.js +19 -24
- package/dist/bootstrap/commands/etf/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/etf/reporter.js +5 -2
- package/dist/bootstrap/commands/etfs/cli.d.ts +6 -5
- package/dist/bootstrap/commands/etfs/cli.js +19 -24
- package/dist/bootstrap/commands/etfs/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/etfs/reporter.js +2 -1
- package/dist/bootstrap/commands/favorites/cli.d.ts +6 -5
- package/dist/bootstrap/commands/favorites/cli.js +17 -22
- package/dist/bootstrap/commands/favorites/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/favorites/reporter.js +2 -1
- package/dist/bootstrap/commands/find-instrument/cli.d.ts +22 -21
- package/dist/bootstrap/commands/find-instrument/cli.js +14 -21
- package/dist/bootstrap/commands/find-instrument/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/find-instrument/reporter.js +2 -1
- package/dist/bootstrap/commands/future/cli.d.ts +6 -5
- package/dist/bootstrap/commands/future/cli.js +19 -24
- package/dist/bootstrap/commands/future/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/future/reporter.js +2 -1
- package/dist/bootstrap/commands/futures/cli.d.ts +6 -5
- package/dist/bootstrap/commands/futures/cli.js +19 -24
- package/dist/bootstrap/commands/futures/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/futures/reporter.js +2 -1
- package/dist/bootstrap/commands/futures-margin/cli.d.ts +10 -9
- package/dist/bootstrap/commands/futures-margin/cli.js +14 -21
- package/dist/bootstrap/commands/futures-margin/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/futures-margin/reporter.js +8 -2
- package/dist/bootstrap/commands/help/cli.js +1 -4
- package/dist/bootstrap/commands/instrument/cli.d.ts +6 -5
- package/dist/bootstrap/commands/instrument/cli.js +19 -24
- package/dist/bootstrap/commands/instrument/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/instrument/reporter.js +5 -2
- package/dist/bootstrap/commands/last-prices/cli.d.ts +13 -12
- package/dist/bootstrap/commands/last-prices/cli.js +14 -21
- package/dist/bootstrap/commands/last-prices/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/last-prices/reporter.js +2 -1
- package/dist/bootstrap/commands/last-trades/cli.d.ts +19 -18
- package/dist/bootstrap/commands/last-trades/cli.js +14 -21
- package/dist/bootstrap/commands/last-trades/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/last-trades/reporter.js +2 -1
- package/dist/bootstrap/commands/margin-attributes/cli.d.ts +13 -12
- package/dist/bootstrap/commands/margin-attributes/cli.js +14 -21
- package/dist/bootstrap/commands/margin-attributes/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/margin-attributes/reporter.js +2 -1
- package/dist/bootstrap/commands/operations/cli.d.ts +22 -21
- package/dist/bootstrap/commands/operations/cli.js +42 -47
- package/dist/bootstrap/commands/operations/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/operations/reporter.js +2 -1
- package/dist/bootstrap/commands/operations/request.mapper.d.ts +6 -6
- package/dist/bootstrap/commands/operations-by-cursor/cli.d.ts +44 -43
- package/dist/bootstrap/commands/operations-by-cursor/cli.js +63 -75
- package/dist/bootstrap/commands/operations-by-cursor/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/operations-by-cursor/reporter.js +2 -1
- package/dist/bootstrap/commands/operations-by-cursor/request.mapper.d.ts +8 -7
- package/dist/bootstrap/commands/operations-by-cursor/request.mapper.js +10 -4
- package/dist/bootstrap/commands/option/cli.d.ts +6 -5
- package/dist/bootstrap/commands/option/cli.js +19 -24
- package/dist/bootstrap/commands/option/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/option/reporter.js +2 -1
- package/dist/bootstrap/commands/options-by/cli.d.ts +16 -15
- package/dist/bootstrap/commands/options-by/cli.js +14 -21
- package/dist/bootstrap/commands/options-by/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/options-by/reporter.js +2 -1
- package/dist/bootstrap/commands/order-book/cli.d.ts +22 -21
- package/dist/bootstrap/commands/order-book/cli.js +18 -28
- package/dist/bootstrap/commands/order-book/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/order-book/reporter.js +11 -2
- package/dist/bootstrap/commands/order-state/cli.d.ts +10 -9
- package/dist/bootstrap/commands/order-state/cli.js +26 -34
- package/dist/bootstrap/commands/order-state/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/order-state/reporter.js +2 -1
- package/dist/bootstrap/commands/orders/cli.d.ts +8 -7
- package/dist/bootstrap/commands/orders/cli.js +22 -30
- package/dist/bootstrap/commands/orders/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/orders/reporter.js +2 -1
- package/dist/bootstrap/commands/portfolio/cli.d.ts +12 -11
- package/dist/bootstrap/commands/portfolio/cli.js +27 -35
- package/dist/bootstrap/commands/portfolio/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/portfolio/reporter.js +2 -1
- package/dist/bootstrap/commands/portfolio/request.mapper.d.ts +6 -5
- package/dist/bootstrap/commands/portfolio/request.mapper.js +2 -1
- package/dist/bootstrap/commands/positions/cli.d.ts +8 -7
- package/dist/bootstrap/commands/positions/cli.js +22 -30
- package/dist/bootstrap/commands/positions/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/positions/reporter.js +11 -2
- package/dist/bootstrap/commands/post-order/cli.d.ts +18 -17
- package/dist/bootstrap/commands/post-order/cli.js +49 -56
- package/dist/bootstrap/commands/post-order/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/post-order/reporter.js +2 -1
- package/dist/bootstrap/commands/post-order/request.mapper.d.ts +9 -9
- package/dist/bootstrap/commands/post-stop-order/cli.d.ts +34 -33
- package/dist/bootstrap/commands/post-stop-order/cli.js +18 -23
- package/dist/bootstrap/commands/post-stop-order/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/post-stop-order/reporter.js +2 -1
- package/dist/bootstrap/commands/replace-order/cli.d.ts +16 -15
- package/dist/bootstrap/commands/replace-order/cli.js +45 -52
- package/dist/bootstrap/commands/replace-order/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/replace-order/reporter.js +2 -1
- package/dist/bootstrap/commands/replace-order/request.mapper.d.ts +4 -4
- package/dist/bootstrap/commands/sandbox-accounts/cli.d.ts +6 -6
- package/dist/bootstrap/commands/sandbox-accounts/cli.js +17 -26
- package/dist/bootstrap/commands/sandbox-cancel-order/cli.d.ts +10 -44
- package/dist/bootstrap/commands/sandbox-cancel-order/cli.js +28 -39
- package/dist/bootstrap/commands/sandbox-close-account/cli.d.ts +13 -12
- package/dist/bootstrap/commands/sandbox-close-account/cli.js +16 -22
- package/dist/bootstrap/commands/sandbox-close-account/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/sandbox-close-account/reporter.js +2 -1
- package/dist/bootstrap/commands/sandbox-open-account/cli.d.ts +6 -6
- package/dist/bootstrap/commands/sandbox-open-account/cli.js +19 -28
- package/dist/bootstrap/commands/sandbox-open-account/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/sandbox-open-account/reporter.js +2 -1
- package/dist/bootstrap/commands/sandbox-operations/cli.d.ts +18 -64
- package/dist/bootstrap/commands/sandbox-operations/cli.js +36 -48
- package/dist/bootstrap/commands/sandbox-operations-by-cursor/cli.d.ts +32 -94
- package/dist/bootstrap/commands/sandbox-operations-by-cursor/cli.js +57 -69
- package/dist/bootstrap/commands/sandbox-order-state/cli.d.ts +10 -41
- package/dist/bootstrap/commands/sandbox-order-state/cli.js +26 -38
- package/dist/bootstrap/commands/sandbox-orders/cli.d.ts +8 -35
- package/dist/bootstrap/commands/sandbox-orders/cli.js +22 -34
- package/dist/bootstrap/commands/sandbox-pay-in/cli.d.ts +22 -21
- package/dist/bootstrap/commands/sandbox-pay-in/cli.js +16 -22
- package/dist/bootstrap/commands/sandbox-pay-in/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/sandbox-pay-in/reporter.js +2 -1
- package/dist/bootstrap/commands/sandbox-portfolio/cli.d.ts +14 -46
- package/dist/bootstrap/commands/sandbox-portfolio/cli.js +27 -39
- package/dist/bootstrap/commands/sandbox-positions/cli.d.ts +8 -35
- package/dist/bootstrap/commands/sandbox-positions/cli.js +22 -34
- package/dist/bootstrap/commands/sandbox-post-order/cli.d.ts +22 -80
- package/dist/bootstrap/commands/sandbox-post-order/cli.js +49 -60
- package/dist/bootstrap/commands/sandbox-replace-order/cli.d.ts +18 -72
- package/dist/bootstrap/commands/sandbox-replace-order/cli.js +45 -56
- package/dist/bootstrap/commands/sandbox-withdraw-limits/cli.d.ts +8 -35
- package/dist/bootstrap/commands/sandbox-withdraw-limits/cli.js +22 -34
- package/dist/bootstrap/commands/share/cli.d.ts +6 -5
- package/dist/bootstrap/commands/share/cli.js +19 -24
- package/dist/bootstrap/commands/share/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/share/reporter.js +5 -2
- package/dist/bootstrap/commands/shares/cli.d.ts +6 -5
- package/dist/bootstrap/commands/shares/cli.js +19 -24
- package/dist/bootstrap/commands/shares/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/shares/reporter.js +2 -1
- package/dist/bootstrap/commands/stop-orders/cli.d.ts +13 -12
- package/dist/bootstrap/commands/stop-orders/cli.js +14 -21
- package/dist/bootstrap/commands/stop-orders/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/stop-orders/reporter.js +2 -1
- package/dist/bootstrap/commands/stream-run/cli.d.ts +6 -4
- package/dist/bootstrap/commands/stream-run/cli.js +7 -7
- package/dist/bootstrap/commands/stream-run/config.d.ts +18 -1
- package/dist/bootstrap/commands/stream-run/config.js +5 -3
- package/dist/bootstrap/commands/stream-run/reporter.d.ts +6 -1
- package/dist/bootstrap/commands/stream-run/request.mapper.js +15 -5
- package/dist/bootstrap/commands/stream-run/stream-session.d.ts +14 -0
- package/dist/bootstrap/commands/stream-run/stream-session.js +7 -2
- package/dist/bootstrap/commands/trading-schedules/cli.d.ts +19 -18
- package/dist/bootstrap/commands/trading-schedules/cli.js +14 -21
- package/dist/bootstrap/commands/trading-schedules/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/trading-schedules/reporter.js +11 -2
- package/dist/bootstrap/commands/trading-status/cli.d.ts +13 -12
- package/dist/bootstrap/commands/trading-status/cli.js +14 -21
- package/dist/bootstrap/commands/trading-status/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/trading-status/reporter.js +2 -1
- package/dist/bootstrap/commands/trading-statuses/cli.d.ts +13 -12
- package/dist/bootstrap/commands/trading-statuses/cli.js +14 -21
- package/dist/bootstrap/commands/trading-statuses/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/trading-statuses/reporter.js +2 -1
- package/dist/bootstrap/commands/user-info/cli.d.ts +6 -5
- package/dist/bootstrap/commands/user-info/cli.js +17 -22
- package/dist/bootstrap/commands/user-info/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/user-info/reporter.js +2 -1
- package/dist/bootstrap/commands/user-tariff/cli.d.ts +6 -5
- package/dist/bootstrap/commands/user-tariff/cli.js +17 -22
- package/dist/bootstrap/commands/user-tariff/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/user-tariff/reporter.js +17 -2
- package/dist/bootstrap/commands/withdraw-limits/cli.d.ts +12 -7
- package/dist/bootstrap/commands/withdraw-limits/cli.js +29 -30
- package/dist/bootstrap/commands/withdraw-limits/reporter.d.ts +4 -2
- package/dist/bootstrap/commands/withdraw-limits/reporter.js +2 -1
- package/dist/bootstrap/generated-exports.d.ts +1 -1
- package/dist/bootstrap/generated-exports.js +14 -11
- package/dist/bootstrap/index.js +5 -2
- package/dist/bootstrap/proto/compile-proto.d.ts +4 -2
- package/dist/bootstrap/proto/compile-proto.js +11 -6
- package/dist/bootstrap/sdk-config.d.ts +9 -7
- package/dist/bootstrap/sdk-config.js +8 -7
- package/dist/bootstrap/t-invest-node-sdk.d.ts +26 -6
- package/dist/bootstrap/t-invest-node-sdk.js +48 -23
- package/dist/bootstrap/unary-limit-config.d.ts +13 -14
- package/dist/bootstrap/unary-limit-config.js +12 -13
- package/dist/config.d.ts +13 -11
- package/dist/config.js +13 -11
- package/dist/config.types.d.ts +18 -19
- package/dist/config.types.js +6 -6
- package/dist/generated/common.d.ts +1 -0
- package/dist/generated/common.js +3 -2
- package/dist/generated/google/api/field_behavior.d.ts +1 -0
- package/dist/generated/google/api/field_behavior.js +3 -2
- package/dist/generated/google/protobuf/descriptor.d.ts +1 -0
- package/dist/generated/google/protobuf/descriptor.js +26 -16
- package/dist/generated/google/protobuf/timestamp.d.ts +1 -0
- package/dist/generated/google/protobuf/timestamp.js +20 -2
- package/dist/generated/instruments.d.ts +1 -0
- package/dist/generated/instruments.js +59 -55
- package/dist/generated/marketdata.d.ts +1 -0
- package/dist/generated/marketdata.js +10 -7
- package/dist/generated/operations.d.ts +1 -0
- package/dist/generated/operations.js +10 -7
- package/dist/generated/orders.d.ts +5 -2
- package/dist/generated/orders.js +29 -7
- package/dist/generated/sandbox.d.ts +1 -0
- package/dist/generated/sandbox.js +3 -2
- package/dist/generated/signals.d.ts +1 -0
- package/dist/generated/signals.js +3 -2
- package/dist/generated/stoporders.d.ts +1 -0
- package/dist/generated/stoporders.js +3 -2
- package/dist/generated/users.d.ts +1 -0
- package/dist/generated/users.js +9 -6
- package/dist/infrastructure/interceptor/warning-interceptor.d.ts +3 -1
- package/dist/infrastructure/interceptor/warning-interceptor.js +4 -3
- package/dist/infrastructure/report-values.js +8 -2
- package/dist/infrastructure/transport/grpc/call-callback-boundary.d.ts +23 -0
- package/dist/infrastructure/transport/grpc/call-callback-boundary.js +56 -0
- package/dist/infrastructure/transport/grpc/sdk-call-error.js +2 -2
- package/dist/infrastructure/transport/grpc/sdk-channel.d.ts +5 -5
- package/dist/infrastructure/transport/grpc/sdk-channel.js +5 -5
- package/dist/infrastructure/transport/grpc/sdk-client.d.ts +4 -3
- package/dist/infrastructure/transport/grpc/sdk-client.js +4 -3
- package/dist/infrastructure/transport/grpc/sdk-middleware.d.ts +20 -11
- package/dist/infrastructure/transport/grpc/sdk-middleware.js +96 -109
- package/dist/infrastructure/transport/grpc/unary-limit-resolver.d.ts +21 -3
- package/dist/infrastructure/transport/grpc/unary-limit-resolver.js +22 -6
- package/docs/architecture.md +93 -116
- package/docs/bundled-ca.md +31 -48
- package/docs/clean-architecture/adapters.md +14 -14
- package/docs/clean-architecture/api-commands.md +106 -102
- package/docs/clean-architecture/application.md +78 -94
- package/docs/clean-architecture/cli-output-boundaries.md +109 -119
- package/docs/clean-architecture/dto.md +18 -18
- package/docs/clean-architecture/index.md +9 -34
- package/docs/cli-reference.md +38 -30
- package/docs/cli-stream-configuration.md +57 -41
- package/docs/cli-stream-reference.md +51 -83
- package/docs/examples/custom-unary-limiter.md +454 -0
- package/docs/examples/deprecated-fields.md +27 -0
- package/docs/examples/errors-and-lifecycle.md +180 -0
- package/docs/examples/getting-started.md +45 -0
- package/docs/examples/index.md +43 -0
- package/docs/examples/instrument-lookup.md +38 -0
- package/docs/examples/market-data-recovery.md +327 -0
- package/docs/examples/operations-pagination.md +47 -0
- package/docs/examples/order-state-stream.md +39 -0
- package/docs/examples/sandbox-orders.md +85 -0
- package/docs/examples/streams-and-cancellation.md +218 -0
- package/docs/examples/testing-with-service-definitions.md +79 -0
- package/docs/examples/unary-calls.md +156 -0
- package/docs/examples/unary-limits.md +96 -0
- package/docs/index.md +23 -48
- package/docs/limits-policy.md +26 -48
- package/docs/roadmap.md +54 -54
- package/docs/tls-policy.md +39 -21
- package/package.json +8 -8
- package/readme.md +29 -214
- package/docs/guides/custom-unary-limiter.md +0 -500
- package/docs/guides/errors-and-lifecycle.md +0 -184
- package/docs/guides/getting-started.md +0 -86
- package/docs/guides/index.md +0 -32
- package/docs/guides/streams-and-cancellation.md +0 -162
- package/docs/guides/testing-with-service-definitions.md +0 -102
- package/docs/guides/unary-calls.md +0 -181
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Настроить потоковую команду CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Используйте этот справочник, когда `stream run` должен открыть конкретный поток с заданными подписками. Пользователь описывает поток, начальные запросы и условия завершения в JSON, а CLI проверяет файл до создания SDK. В итоге команда либо открывает выбранный поток с указанными настройками, либо завершается с ошибкой конфигурации.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Выбрать поток и подписки
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Конфигурация выбирает поток, подписки и параметры вывода. Для типовых подписок CLI сам собирает запросы по сгенерированным gRPC-контрактам.
|
|
8
8
|
|
|
9
9
|
Минимальная допустимая конфигурация:
|
|
10
10
|
|
|
11
|
+
`marketdata-stream.json`
|
|
12
|
+
|
|
11
13
|
```json
|
|
12
14
|
{
|
|
13
15
|
"stream": "marketdata.marketDataServerSideStream",
|
|
@@ -24,15 +26,15 @@ Stream config следует generated gRPC contracts и не скрывает
|
|
|
24
26
|
}
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
##
|
|
29
|
+
## Задать параметры конфигурации
|
|
28
30
|
|
|
29
31
|
| Поле | Тип | Обязательность | Назначение |
|
|
30
32
|
| --- | --- | --- | --- |
|
|
31
|
-
| `stream` | string | всегда | Выбирает
|
|
32
|
-
| `subscriptions` | object | для
|
|
33
|
-
| `requests` | object[] | для
|
|
34
|
-
| `accounts` | string[] | для потоков по счетам | Идентификаторы счетов
|
|
35
|
-
| `runtime` | object | нет | Настройки вывода и
|
|
33
|
+
| `stream` | string | всегда | Выбирает метод потокового API |
|
|
34
|
+
| `subscriptions` | object | для серверного потока рыночных данных | Подписки на рыночные данные |
|
|
35
|
+
| `requests` | object[] | для двустороннего потока рыночных данных | Статический набор начальных запросов |
|
|
36
|
+
| `accounts` | string[] | для потоков по счетам | Идентификаторы счетов в потоках операций и заявок |
|
|
37
|
+
| `runtime` | object | нет | Настройки вывода и завершения процесса |
|
|
36
38
|
|
|
37
39
|
Допустимые значения `stream`:
|
|
38
40
|
|
|
@@ -42,11 +44,15 @@ Stream config следует generated gRPC contracts и не скрывает
|
|
|
42
44
|
- `operations.positionsStream`;
|
|
43
45
|
- `orders.tradesStream`.
|
|
44
46
|
|
|
45
|
-
`marketdata.marketDataStream` использует отдельное поле `requests`, потому что это
|
|
47
|
+
`marketdata.marketDataStream` использует отдельное поле `requests`, потому что это двусторонний поток: CLI сначала отправляет заданный в конфигурации набор запросов, а затем читает события провайдера.
|
|
48
|
+
|
|
49
|
+
Поле `rawRequests` не поддерживается: проверка конфигурации отклоняет его для любого потока.
|
|
46
50
|
|
|
47
|
-
|
|
51
|
+
## Настроить запуск и вывод
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
Поле `runtime` содержит настройки запуска: формат вывода, число событий и условия завершения.
|
|
54
|
+
|
|
55
|
+
`marketdata-stream.json`
|
|
50
56
|
|
|
51
57
|
```json
|
|
52
58
|
{
|
|
@@ -66,16 +72,18 @@ Stream config следует generated gRPC contracts и не скрывает
|
|
|
66
72
|
|
|
67
73
|
- `format` — формат вывода; поддерживается только `jsonl`;
|
|
68
74
|
- `maxEvents` — завершиться после N выведенных событий;
|
|
69
|
-
- `durationMs` — завершиться через N миллисекунд после запуска
|
|
75
|
+
- `durationMs` — завершиться через N миллисекунд после запуска потока;
|
|
70
76
|
- `idleTimeoutMs` — завершиться после N миллисекунд без событий;
|
|
71
77
|
- `includePings` — включать события `ping` в `stdout`;
|
|
72
78
|
- `includeSubscriptionEvents` — включать статусы подписок в `stdout`;
|
|
73
|
-
- `raw` — выводить
|
|
79
|
+
- `raw` — выводить сгенерированный ответ без общей структуры нормализованного события.
|
|
74
80
|
|
|
75
|
-
##
|
|
81
|
+
## Подписаться на рыночные данные
|
|
76
82
|
|
|
77
83
|
Поле `subscriptions` группирует подписки по семействам событий:
|
|
78
84
|
|
|
85
|
+
`marketdata-stream.json`
|
|
86
|
+
|
|
79
87
|
```json
|
|
80
88
|
{
|
|
81
89
|
"stream": "marketdata.marketDataServerSideStream",
|
|
@@ -119,28 +127,30 @@ Stream config следует generated gRPC contracts и не скрывает
|
|
|
119
127
|
|
|
120
128
|
Значения подписок по умолчанию:
|
|
121
129
|
|
|
122
|
-
- CLI всегда подписывается через `SUBSCRIPTION_ACTION_SUBSCRIBE`; поле `action` в
|
|
130
|
+
- CLI всегда подписывается через `SUBSCRIPTION_ACTION_SUBSCRIBE`; поле `action` в конфигурации не принимается;
|
|
123
131
|
- устаревшие поля `figi` сгенерированных контрактов сохраняют значения по умолчанию protobuf и не сериализуются;
|
|
124
132
|
- `instrumentId` обязателен для каждого инструмента;
|
|
125
133
|
- `waitingClose` имеет значение `false`;
|
|
126
134
|
- `orderBooks[].depth` обязателен и должен быть целым числом от `1` до `2147483647` (диапазон protobuf `int32`).
|
|
127
135
|
|
|
128
|
-
Значения `waitingClose` должны совпадать у всех свечных подписок одного запроса. Для
|
|
136
|
+
Значения `waitingClose` должны совпадать у всех свечных подписок одного запроса. Для серверного потока это весь массив `subscriptions.candles`; для двустороннего — `instruments` внутри одного запроса `subscribeCandles`. Отсутствующее поле считается `false`.
|
|
129
137
|
|
|
130
138
|
Поддерживаемые алиасы интервала свечей:
|
|
131
139
|
|
|
132
140
|
- `1min`;
|
|
133
141
|
- `5min`.
|
|
134
142
|
|
|
135
|
-
Другие
|
|
143
|
+
Другие псевдонимы из CLI-команды получения исторических свечей здесь не принимаются: сгенерированный `SubscriptionInterval` для потока содержит только интервалы в одну и пять минут.
|
|
136
144
|
|
|
137
|
-
##
|
|
145
|
+
## Выбрать поток Market Data
|
|
138
146
|
|
|
139
147
|
`marketdata.marketDataServerSideStream` отправляет один начальный запрос, собранный из поля `subscriptions`, а затем читает события.
|
|
140
148
|
|
|
141
|
-
`marketdata.marketDataStream` —
|
|
149
|
+
`marketdata.marketDataStream` — двусторонний поток. `stream run` поддерживает только статический набор типизированных начальных запросов из конфигурации и не читает дополнительные запросы из `stdin`, файлов, таймеров или интерактивного ввода.
|
|
142
150
|
|
|
143
|
-
Типизированная
|
|
151
|
+
Типизированная форма двустороннего потока:
|
|
152
|
+
|
|
153
|
+
`marketdata-bidirectional.json`
|
|
144
154
|
|
|
145
155
|
```json
|
|
146
156
|
{
|
|
@@ -174,19 +184,21 @@ Stream config следует generated gRPC contracts и не скрывает
|
|
|
174
184
|
- `subscribeLastPrice`;
|
|
175
185
|
- `getMySubscriptions`.
|
|
176
186
|
|
|
177
|
-
Элементы запроса используют те же поля инструмента, что и
|
|
187
|
+
Элементы запроса используют те же поля инструмента, что и подписки серверного потока рыночных данных:
|
|
178
188
|
|
|
179
189
|
- `subscribeCandles` требует `instrumentId` и `interval`; `waitingClose` необязателен;
|
|
180
190
|
- `subscribeOrderBook` требует `instrumentId` и `depth`;
|
|
181
191
|
- `subscribeTrades`, `subscribeInfo` и `subscribeLastPrice` требуют `instrumentId`;
|
|
182
192
|
- `getMySubscriptions` не принимает `instruments`.
|
|
183
193
|
|
|
184
|
-
|
|
194
|
+
Отправка произвольных запросов двустороннего потока не поддерживается. Используйте поле `requests` и перечисленные выше типизированные варианты.
|
|
185
195
|
|
|
186
|
-
##
|
|
196
|
+
## Подписаться на события счёта
|
|
187
197
|
|
|
188
198
|
Поток портфеля:
|
|
189
199
|
|
|
200
|
+
`portfolio-stream.json`
|
|
201
|
+
|
|
190
202
|
```json
|
|
191
203
|
{
|
|
192
204
|
"stream": "operations.portfolioStream",
|
|
@@ -200,6 +212,8 @@ Stream config следует generated gRPC contracts и не скрывает
|
|
|
200
212
|
|
|
201
213
|
Поток позиций:
|
|
202
214
|
|
|
215
|
+
`positions-stream.json`
|
|
216
|
+
|
|
203
217
|
```json
|
|
204
218
|
{
|
|
205
219
|
"stream": "operations.positionsStream",
|
|
@@ -213,6 +227,8 @@ Stream config следует generated gRPC contracts и не скрывает
|
|
|
213
227
|
|
|
214
228
|
Поток сделок по поручениям:
|
|
215
229
|
|
|
230
|
+
`order-trades-stream.json`
|
|
231
|
+
|
|
216
232
|
```json
|
|
217
233
|
{
|
|
218
234
|
"stream": "orders.tradesStream",
|
|
@@ -227,30 +243,30 @@ Stream config следует generated gRPC contracts и не скрывает
|
|
|
227
243
|
Правила:
|
|
228
244
|
|
|
229
245
|
- `accounts` должен содержать хотя бы один идентификатор счёта;
|
|
230
|
-
- идентификаторы передаются в поле `accounts`
|
|
246
|
+
- идентификаторы передаются в поле `accounts` сгенерированного запроса;
|
|
231
247
|
- потоки по счетам не используют `subscriptions`;
|
|
232
248
|
- неизвестные поля отклоняются до создания SDK.
|
|
233
249
|
|
|
234
|
-
##
|
|
250
|
+
## Проверить конфигурацию до запуска
|
|
235
251
|
|
|
236
|
-
|
|
252
|
+
Проверка конфигурации отклоняет:
|
|
237
253
|
|
|
238
254
|
- неизвестные значения `stream`;
|
|
239
255
|
- отсутствие `accounts` для потоков по счетам;
|
|
240
|
-
- пустой `subscriptions` для
|
|
256
|
+
- пустой `subscriptions` для серверного потока рыночных данных;
|
|
241
257
|
- отсутствующий или пустой `requests` для `marketdata.marketDataStream`;
|
|
242
258
|
- неизвестные поля верхнего уровня;
|
|
243
259
|
- неподдерживаемое поле `rawRequests`;
|
|
244
260
|
- неподдерживаемый `runtime.format`;
|
|
245
|
-
- неположительные числовые runtime
|
|
261
|
+
- неположительные числовые ограничения в `runtime`;
|
|
246
262
|
- элементы Market Data без `instrumentId`;
|
|
247
|
-
-
|
|
263
|
+
- имена сгенерированных перечислений и псевдонимы, которые не поддерживает преобразователь конфигурации.
|
|
248
264
|
|
|
249
|
-
CLI проверяет
|
|
265
|
+
CLI проверяет конфигурацию до создания `TInvestNodeSDK`.
|
|
250
266
|
|
|
251
|
-
##
|
|
267
|
+
## Переопределить настройки через CLI
|
|
252
268
|
|
|
253
|
-
|
|
269
|
+
Настройки из `runtime` можно переопределить CLI-флагами:
|
|
254
270
|
|
|
255
271
|
```bash
|
|
256
272
|
t-invest-node-sdk stream run \
|
|
@@ -259,11 +275,11 @@ t-invest-node-sdk stream run \
|
|
|
259
275
|
--include-pings
|
|
260
276
|
```
|
|
261
277
|
|
|
262
|
-
|
|
278
|
+
Доступные флаги и правила переопределения логических значений описаны в [настройках runtime потокового CLI](./cli-stream-reference.md#настроить-запуск-и-вывод).
|
|
263
279
|
|
|
264
|
-
Подписки и выбор счетов задаются только в
|
|
280
|
+
Подписки и выбор счетов задаются только в конфигурации. Это позволяет использовать одну команду для разных потоков без отдельного набора флагов для каждого метода.
|
|
265
281
|
|
|
266
|
-
##
|
|
282
|
+
## Выбрать формат вывода
|
|
267
283
|
|
|
268
284
|
Нормализованное событие по умолчанию:
|
|
269
285
|
|
|
@@ -277,9 +293,9 @@ Raw-событие при `runtime.raw: true`:
|
|
|
277
293
|
{"orderTrades":{"orderId":"..."}}
|
|
278
294
|
```
|
|
279
295
|
|
|
280
|
-
По умолчанию CLI выводит нормализованные события в
|
|
296
|
+
По умолчанию CLI выводит нормализованные события в единой структуре для всех потоковых методов.
|
|
281
297
|
|
|
282
|
-
##
|
|
298
|
+
## Перейти к запуску команды
|
|
283
299
|
|
|
284
|
-
- [
|
|
285
|
-
- [
|
|
300
|
+
- [Запустить потоковую команду CLI](./cli-stream-reference.md) — прочитать формат событий и коды завершения.
|
|
301
|
+
- [Выполнить команду CLI](./cli-reference.md) — передать общие аргументы.
|
|
@@ -1,84 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Запустить потоковую команду CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Используйте этот справочник, когда нужно получать события T-Invest через `stream run`. Пользователь выбирает поток и подписки в JSON-конфигурации, а CLI открывает соединение, записывает события в `stdout` и ошибки в `stderr`. В итоге поток завершается по заданному условию, сигналу или ошибке провайдера с определённым кодом процесса.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Запустить поток
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```text
|
|
10
|
-
t-invest-node-sdk <domain> <command> [options]
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Для Stream API нужен отдельный контракт: команда не возвращает один response и не завершается сразу. Она открывает долгоживущий stream, печатает события и завершает работу по лимиту, таймауту, сигналу или ошибке provider-а.
|
|
14
|
-
|
|
15
|
-
Текущая точка входа:
|
|
7
|
+
Команда `stream run` открывает долгоживущий поток, печатает события и завершает работу по лимиту, таймауту, сигналу или ошибке провайдера:
|
|
16
8
|
|
|
17
9
|
```bash
|
|
18
10
|
t-invest-node-sdk stream run --config=PATH [runtime options]
|
|
19
11
|
```
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Текущая реализация поддерживает:
|
|
13
|
+
Метод и начальные запросы выбираются в [файле конфигурации](./cli-stream-configuration.md). Поддерживаемые методы перечислены в таблице ниже.
|
|
24
14
|
|
|
25
|
-
|
|
26
|
-
- `marketdata.marketDataServerSideStream`;
|
|
27
|
-
- `operations.portfolioStream`;
|
|
28
|
-
- `operations.positionsStream`;
|
|
29
|
-
- `orders.tradesStream`.
|
|
15
|
+
## Выбрать поток
|
|
30
16
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## Доступные stream methods
|
|
34
|
-
|
|
35
|
-
| Значение `stream` в config | SDK method | gRPC method | Тип stream |
|
|
17
|
+
| Значение `stream` в конфигурации | Метод SDK | Метод gRPC | Тип потока |
|
|
36
18
|
| --- | --- | --- | --- |
|
|
37
|
-
| `marketdata.marketDataStream` | `sdk.marketdataStream.marketDataStream` | `MarketDataStreamService/MarketDataStream` |
|
|
38
|
-
| `marketdata.marketDataServerSideStream` | `sdk.marketdataStream.marketDataServerSideStream` | `MarketDataStreamService/MarketDataServerSideStream` |
|
|
39
|
-
| `operations.portfolioStream` | `sdk.operationsStream.portfolioStream` | `OperationsStreamService/PortfolioStream` |
|
|
40
|
-
| `operations.positionsStream` | `sdk.operationsStream.positionsStream` | `OperationsStreamService/PositionsStream` |
|
|
41
|
-
| `orders.tradesStream` | `sdk.ordersStream.tradesStream` | `OrdersStreamService/TradesStream` |
|
|
42
|
-
|
|
43
|
-
## Runtime-модель
|
|
19
|
+
| `marketdata.marketDataStream` | `sdk.marketdataStream.marketDataStream` | `MarketDataStreamService/MarketDataStream` | двусторонний, статические начальные запросы |
|
|
20
|
+
| `marketdata.marketDataServerSideStream` | `sdk.marketdataStream.marketDataServerSideStream` | `MarketDataStreamService/MarketDataServerSideStream` | серверный |
|
|
21
|
+
| `operations.portfolioStream` | `sdk.operationsStream.portfolioStream` | `OperationsStreamService/PortfolioStream` | серверный |
|
|
22
|
+
| `operations.positionsStream` | `sdk.operationsStream.positionsStream` | `OperationsStreamService/PositionsStream` | серверный |
|
|
23
|
+
| `orders.tradesStream` | `sdk.ordersStream.tradesStream` | `OrdersStreamService/TradesStream` | серверный |
|
|
44
24
|
|
|
45
|
-
|
|
25
|
+
## Выполнить команду
|
|
46
26
|
|
|
47
|
-
|
|
48
|
-
2. применить CLI runtime overrides;
|
|
49
|
-
3. создать `TInvestNodeSDK`;
|
|
50
|
-
4. создать initial request для server-side stream или конечный initial request iterator для `marketdata.marketDataStream`;
|
|
51
|
-
5. открыть stream;
|
|
52
|
-
6. писать события в `stdout`;
|
|
53
|
-
7. писать diagnostics/errors/status в `stderr`;
|
|
54
|
-
8. завершиться по `maxEvents`, `durationMs`, `idleTimeoutMs`, закрытию stream или provider error;
|
|
55
|
-
9. закрыть SDK channel в `finally`.
|
|
27
|
+
За один запуск `stream run` открывает одну сессию с настройками из конфигурации и переопределениями CLI. Лимиты `maxEvents`, `durationMs` и `idleTimeoutMs` приводят к штатному завершению; ошибка провайдера, возникшая до таймаута, не маскируется.
|
|
56
28
|
|
|
57
|
-
|
|
29
|
+
Порядок отмены чтения, завершения итератора и закрытия SDK описан в [архитектуре потоковой сессии](./clean-architecture/api-commands.md#запустить-потоковую-сессию).
|
|
58
30
|
|
|
59
|
-
|
|
31
|
+
## Записать события и ошибки
|
|
60
32
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Базовый формат stream output - `jsonl`. Каждое событие печатается отдельной строкой JSON:
|
|
33
|
+
Базовый формат вывода потока — `jsonl`. Каждое событие печатается отдельной строкой JSON:
|
|
64
34
|
|
|
65
35
|
```json
|
|
66
36
|
{"stream":"marketdata.marketDataServerSideStream","sequence":1,"receivedAt":"2026-06-29T12:00:00.000Z","type":"candle","payload":{"instrumentUid":"..."}}
|
|
67
37
|
```
|
|
68
38
|
|
|
69
|
-
Обязательные поля
|
|
39
|
+
Обязательные поля структуры события:
|
|
70
40
|
|
|
71
|
-
- `stream` - имя
|
|
72
|
-
- `sequence` - порядковый номер события в
|
|
41
|
+
- `stream` - имя потока из конфигурации;
|
|
42
|
+
- `sequence` - порядковый номер события в текущем процессе;
|
|
73
43
|
- `receivedAt` - время получения события CLI-процессом в ISO-формате;
|
|
74
44
|
- `type` - нормализованный тип события;
|
|
75
|
-
- `payload` -
|
|
45
|
+
- `payload` - данные события.
|
|
76
46
|
|
|
77
|
-
CLI пишет в `stdout` только события. Ошибки чтения
|
|
47
|
+
CLI пишет в `stdout` только события. Ошибки чтения конфигурации, транспорта, провайдера и вывода направляются в `stderr`. Статусы подписок, включая отклонённые подписки, выводятся как события в `stdout`; при `runtime.includeSubscriptionEvents: false` эти события не выводятся.
|
|
78
48
|
|
|
79
|
-
##
|
|
49
|
+
## Распознать тип события
|
|
80
50
|
|
|
81
|
-
`marketdata
|
|
51
|
+
События `marketdata.*`:
|
|
82
52
|
|
|
83
53
|
- `subscribeCandlesResponse`;
|
|
84
54
|
- `subscribeOrderBookResponse`;
|
|
@@ -92,19 +62,19 @@ CLI пишет в `stdout` только события. Ошибки чтени
|
|
|
92
62
|
- `lastPrice`;
|
|
93
63
|
- `ping`.
|
|
94
64
|
|
|
95
|
-
`operations.portfolioStream
|
|
65
|
+
События `operations.portfolioStream`:
|
|
96
66
|
|
|
97
67
|
- `subscriptions`;
|
|
98
68
|
- `portfolio`;
|
|
99
69
|
- `ping`.
|
|
100
70
|
|
|
101
|
-
`operations.positionsStream
|
|
71
|
+
События `operations.positionsStream`:
|
|
102
72
|
|
|
103
73
|
- `subscriptions`;
|
|
104
74
|
- `position`;
|
|
105
75
|
- `ping`.
|
|
106
76
|
|
|
107
|
-
`orders.tradesStream
|
|
77
|
+
События `orders.tradesStream`:
|
|
108
78
|
|
|
109
79
|
- `subscription`;
|
|
110
80
|
- `orderTrades`;
|
|
@@ -112,9 +82,9 @@ CLI пишет в `stdout` только события. Ошибки чтени
|
|
|
112
82
|
|
|
113
83
|
По умолчанию `ping` события не печатаются в `stdout`, если `runtime.includePings` не равен `true`.
|
|
114
84
|
|
|
115
|
-
##
|
|
85
|
+
## Настроить запуск и вывод
|
|
116
86
|
|
|
117
|
-
|
|
87
|
+
Поле `runtime` задаёт настройки запуска: формат вывода и условия завершения. CLI-флаги могут переопределить эти настройки; подписки задаются только в файле:
|
|
118
88
|
|
|
119
89
|
```bash
|
|
120
90
|
t-invest-node-sdk stream run \
|
|
@@ -124,47 +94,45 @@ t-invest-node-sdk stream run \
|
|
|
124
94
|
--include-pings
|
|
125
95
|
```
|
|
126
96
|
|
|
127
|
-
Настройки
|
|
97
|
+
Настройки запуска:
|
|
128
98
|
|
|
129
|
-
- `--config=PATH` — обязательный путь к JSON
|
|
99
|
+
- `--config=PATH` — обязательный путь к JSON-файлу конфигурации;
|
|
130
100
|
- `--max-events=N` — завершиться после N выведенных событий;
|
|
131
101
|
- `--duration-ms=N` — завершиться через N миллисекунд;
|
|
132
102
|
- `--idle-timeout-ms=N` — завершиться, если события отсутствуют N миллисекунд;
|
|
133
103
|
- `--include-pings` — печатать события `ping` в `stdout`;
|
|
134
|
-
- `--raw` — печатать
|
|
104
|
+
- `--raw` — печатать сгенерированный ответ без общей структуры нормализованного события;
|
|
135
105
|
- `--format=jsonl` — формат вывода; поддерживается только `jsonl`.
|
|
136
106
|
|
|
137
|
-
Логические runtime
|
|
107
|
+
Логические флаги настроек `runtime` поддерживают синтаксис `--flag` / `--no-flag`. Используйте `--no-include-pings` или `--no-raw`, чтобы переопределить значение `true` из конфигурации; формы `--flag=true` и `--flag=false` не поддерживаются.
|
|
138
108
|
|
|
139
|
-
Числовые runtime
|
|
109
|
+
Числовые значения в `runtime` должны быть положительными безопасными целыми числами JavaScript.
|
|
140
110
|
|
|
141
|
-
##
|
|
111
|
+
## Проверить код завершения
|
|
142
112
|
|
|
143
|
-
- `0` -
|
|
144
|
-
- `2` - содержимое
|
|
145
|
-
- `1` - ошибка чтения
|
|
113
|
+
- `0` - поток завершился по лимиту, таймауту или нормальному закрытию;
|
|
114
|
+
- `2` - содержимое конфигурации не прошло синтаксическую или семантическую проверку;
|
|
115
|
+
- `1` - ошибка чтения файла конфигурации, провайдера или выполнения;
|
|
146
116
|
- `130` - процесс остановлен через `SIGINT`;
|
|
147
117
|
- `143` - процесс остановлен через `SIGTERM`.
|
|
148
118
|
|
|
149
|
-
При штатном завершении,
|
|
119
|
+
При штатном завершении, таймауте или обработанной ошибке команда закрывает SDK в `finally`. При `SIGINT` и `SIGTERM` встроенный CLI завершается по стандартным правилам Node.js, поэтому корректная отмена и выполнение `finally` не гарантируются.
|
|
150
120
|
|
|
151
|
-
##
|
|
121
|
+
## Учесть обратное давление
|
|
152
122
|
|
|
153
|
-
`stream run` отдаёт
|
|
123
|
+
`stream run` отдаёт результат последовательностью фрагментов и не собирает бесконечный поток в одну строку. При записи в `stdout` и `stderr` CLI учитывает обратное давление: если буфер потока заполнен, он ждёт событие `drain` или ошибку записи.
|
|
154
124
|
|
|
155
|
-
##
|
|
125
|
+
## Учесть ограничения текущей команды
|
|
156
126
|
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
127
|
+
- вывод событий потока в таблицы или CSV;
|
|
128
|
+
- автоматическое переподключение;
|
|
129
|
+
- сохранение позиции чтения в постоянном хранилище;
|
|
160
130
|
- интерактивная смена подписок после старта;
|
|
161
|
-
-
|
|
162
|
-
- агрегация событий в
|
|
163
|
-
-
|
|
164
|
-
|
|
165
|
-
Эти возможности можно добавить позднее отдельными изменениями контракта.
|
|
131
|
+
- источники запросов двустороннего потока из stdin, файлов или таймеров;
|
|
132
|
+
- агрегация событий в отчёт приложения;
|
|
133
|
+
- запись в файл вместо stdout.
|
|
166
134
|
|
|
167
|
-
##
|
|
135
|
+
## Перейти к настройке команды
|
|
168
136
|
|
|
169
|
-
- [
|
|
170
|
-
- [
|
|
137
|
+
- [Настроить потоковую команду CLI](./cli-stream-configuration.md) — выбрать поток и подписки в JSON.
|
|
138
|
+
- [Выполнить команду CLI](./cli-reference.md) — передать общие аргументы и проверить код завершения.
|