@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,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Модуль proto compiler запускает генерацию TypeScript contracts из локальных
|
|
3
|
+
* Модуль proto compiler запускает генерацию TypeScript contracts из локальных
|
|
4
|
+
* proto-файлов.
|
|
4
5
|
*
|
|
5
6
|
* Здесь допустимы:
|
|
6
7
|
* - чтение локальных generation paths из proto upstream manifest;
|
|
@@ -8,7 +9,8 @@
|
|
|
8
9
|
* - вызов закреплённого локального `protoc` с текущими ts-proto options;
|
|
9
10
|
* - проверка обязательных tool/runtime prerequisites перед генерацией;
|
|
10
11
|
*
|
|
11
|
-
* Здесь не должно быть post-processing generated sources или SDK runtime
|
|
12
|
+
* Здесь не должно быть post-processing generated sources или SDK runtime
|
|
13
|
+
* wiring.
|
|
12
14
|
*/
|
|
13
15
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
16
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -82,10 +84,11 @@ function assertProtoCompilerReady(contractsDir) {
|
|
|
82
84
|
throw new Error(`Missing ts-proto plugin at ${pluginPath}`);
|
|
83
85
|
}
|
|
84
86
|
// npm-пакет предоставляет Node.js launcher над локальным native binary;
|
|
85
|
-
// process.execPath позволяет не искать compiler через shell или системный
|
|
87
|
+
// process.execPath позволяет не искать compiler через shell или системный
|
|
88
|
+
// PATH.
|
|
86
89
|
(0, node_child_process_1.execFileSync)(process.execPath, [compilerLauncherPath, '--version'], {
|
|
87
90
|
cwd: pwd_fs_1.pfs.pwd,
|
|
88
|
-
stdio: ['ignore', 'ignore', 'inherit']
|
|
91
|
+
stdio: ['ignore', 'ignore', 'inherit']
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
94
|
function runProtoCompiler(protoFiles, paths) {
|
|
@@ -97,10 +100,12 @@ function runProtoCompiler(protoFiles, paths) {
|
|
|
97
100
|
'--ts_proto_opt=outputServices=nice-grpc,outputServices=generic-definitions,useExactTypes=false',
|
|
98
101
|
'--ts_proto_opt=env=node',
|
|
99
102
|
'--ts_proto_opt=esModuleInterop=true',
|
|
100
|
-
|
|
103
|
+
// Сохраняем объектный JSON публичного Timestamp при обновлении ts-proto.
|
|
104
|
+
'--ts_proto_opt=useJsonTimestamp=raw',
|
|
105
|
+
...protoFiles
|
|
101
106
|
], {
|
|
102
107
|
cwd: pwd_fs_1.pfs.pwd,
|
|
103
|
-
stdio: 'inherit'
|
|
108
|
+
stdio: 'inherit'
|
|
104
109
|
});
|
|
105
110
|
}
|
|
106
111
|
function requireManifestPath(local, name, manifestPath) {
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Модуль
|
|
2
|
+
* Модуль собирает настройки экземпляра SDK из значений модуля и параметров
|
|
3
|
+
* создания.
|
|
3
4
|
*
|
|
4
5
|
* Здесь допустимы:
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
7
|
-
* - согласование
|
|
8
|
-
* - проверка
|
|
6
|
+
* - подготовка публичного `defaultConfig`;
|
|
7
|
+
* - применение переопределений unary-квот экземпляра;
|
|
8
|
+
* - согласование переопределений с группами общих квот;
|
|
9
|
+
* - проверка итоговых настроек перед созданием транспорта.
|
|
9
10
|
*
|
|
10
|
-
* Здесь не должно быть
|
|
11
|
-
*
|
|
11
|
+
* Здесь не должно быть создания транспорта, обновления тарифа провайдера или
|
|
12
|
+
* состояния ограничителя.
|
|
12
13
|
*/
|
|
13
14
|
import type { TInvestOptions } from '../application/dto/t-invest-options';
|
|
14
15
|
import type { TInvestNodeSDKConfig, UnaryLimits } from '../config.types';
|
|
15
16
|
import type { UnaryLimitConfig } from './unary-limit-config';
|
|
17
|
+
/** Параметры экземпляра после проверки и применения значения useSsl по умолчанию. */
|
|
16
18
|
export type ResolvedTInvestOptions = Omit<TInvestOptions, 'useSsl'> & {
|
|
17
19
|
useSsl: boolean;
|
|
18
20
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Модуль
|
|
3
|
+
* Модуль собирает настройки экземпляра SDK из значений модуля и параметров
|
|
4
|
+
* создания.
|
|
4
5
|
*
|
|
5
6
|
* Здесь допустимы:
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
* - согласование
|
|
9
|
-
* - проверка
|
|
7
|
+
* - подготовка публичного `defaultConfig`;
|
|
8
|
+
* - применение переопределений unary-квот экземпляра;
|
|
9
|
+
* - согласование переопределений с группами общих квот;
|
|
10
|
+
* - проверка итоговых настроек перед созданием транспорта.
|
|
10
11
|
*
|
|
11
|
-
* Здесь не должно быть
|
|
12
|
-
*
|
|
12
|
+
* Здесь не должно быть создания транспорта, обновления тарифа провайдера или
|
|
13
|
+
* состояния ограничителя.
|
|
13
14
|
*/
|
|
14
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
16
|
exports.defaultConfig = void 0;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Модуль
|
|
2
|
+
* Модуль реализует публичный класс `TInvestNodeSDK`.
|
|
3
3
|
*
|
|
4
4
|
* Здесь допустимы:
|
|
5
|
-
* -
|
|
6
|
-
* - владение
|
|
7
|
-
* - подключение
|
|
5
|
+
* - ленивое создание сгенерированных клиентов сервисов;
|
|
6
|
+
* - владение общими каналом gRPC и метаданными;
|
|
7
|
+
* - подключение ограничителя unary-запросов, переданного приложением;
|
|
8
8
|
*
|
|
9
|
-
* Здесь не должно быть CLI
|
|
9
|
+
* Здесь не должно быть логики CLI или преобразования сгенерированных DTO.
|
|
10
10
|
*/
|
|
11
11
|
import type { TInvestOptions } from '../application/dto/t-invest-options';
|
|
12
12
|
import type { InstrumentsService, MarketDataService, MarketDataStreamService, OperationsService, OperationsStreamService, OrdersService, OrdersStreamService, SandboxService, SignalService, StopOrdersService, UsersService } from '../application/dto/t-invest-services';
|
|
@@ -33,10 +33,30 @@ export declare class TInvestNodeSDK {
|
|
|
33
33
|
get users(): UsersService;
|
|
34
34
|
/**
|
|
35
35
|
* Идемпотентно закрывает shared channel и запрещает новые SDK-вызовы.
|
|
36
|
-
* Уже переданные transport-у операции нужно завершать их собственным
|
|
36
|
+
* Уже переданные transport-у операции нужно завершать их собственным
|
|
37
|
+
* AbortSignal.
|
|
37
38
|
*/
|
|
38
39
|
close(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Лениво создаёт и кеширует клиент service definition с общим channel и
|
|
42
|
+
* middleware SDK.
|
|
43
|
+
* Доступ после закрытия SDK отклоняется, включая возврат ранее созданного
|
|
44
|
+
* клиента.
|
|
45
|
+
*/
|
|
39
46
|
private getOrCreateServiceClient;
|
|
47
|
+
/**
|
|
48
|
+
* Останавливает доступ к сервисам и новые RPC с SDK_CLOSED после закрытия
|
|
49
|
+
* SDK.
|
|
50
|
+
*/
|
|
40
51
|
private assertOpen;
|
|
52
|
+
/**
|
|
53
|
+
* Задаёт lifecycle-ошибку для отказа в новом вызове и причины отмены ожиданий
|
|
54
|
+
* limiter-а.
|
|
55
|
+
*/
|
|
41
56
|
private createClosedError;
|
|
57
|
+
/**
|
|
58
|
+
* Отклоняет доступ через прежние имена сервисов с ошибкой и подсказкой для
|
|
59
|
+
* миграции.
|
|
60
|
+
*/
|
|
61
|
+
private static throwDeprecatedServiceGetter;
|
|
42
62
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Модуль
|
|
3
|
+
* Модуль реализует публичный класс `TInvestNodeSDK`.
|
|
4
4
|
*
|
|
5
5
|
* Здесь допустимы:
|
|
6
|
-
* -
|
|
7
|
-
* - владение
|
|
8
|
-
* - подключение
|
|
6
|
+
* - ленивое создание сгенерированных клиентов сервисов;
|
|
7
|
+
* - владение общими каналом gRPC и метаданными;
|
|
8
|
+
* - подключение ограничителя unary-запросов, переданного приложением;
|
|
9
9
|
*
|
|
10
|
-
* Здесь не должно быть CLI
|
|
10
|
+
* Здесь не должно быть логики CLI или преобразования сгенерированных DTO.
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.TInvestNodeSDK = void 0;
|
|
@@ -75,7 +75,8 @@ class TInvestNodeSDK {
|
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* Идемпотентно закрывает shared channel и запрещает новые SDK-вызовы.
|
|
78
|
-
* Уже переданные transport-у операции нужно завершать их собственным
|
|
78
|
+
* Уже переданные transport-у операции нужно завершать их собственным
|
|
79
|
+
* AbortSignal.
|
|
79
80
|
*/
|
|
80
81
|
close() {
|
|
81
82
|
if (this.closed) {
|
|
@@ -85,6 +86,12 @@ class TInvestNodeSDK {
|
|
|
85
86
|
this.lifecycleController.abort(this.createClosedError());
|
|
86
87
|
this.channel.close();
|
|
87
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Лениво создаёт и кеширует клиент service definition с общим channel и
|
|
91
|
+
* middleware SDK.
|
|
92
|
+
* Доступ после закрытия SDK отклоняется, включая возврат ранее созданного
|
|
93
|
+
* клиента.
|
|
94
|
+
*/
|
|
88
95
|
getOrCreateServiceClient(serviceDefinition) {
|
|
89
96
|
this.assertOpen();
|
|
90
97
|
const cachedClient = this.clientsByServiceDefinition.get(serviceDefinition);
|
|
@@ -93,40 +100,58 @@ class TInvestNodeSDK {
|
|
|
93
100
|
return cachedClient;
|
|
94
101
|
}
|
|
95
102
|
const client = (0, grpc_1.createSdkClient)(serviceDefinition, this.channel, this.metadata, this.options.unaryLimiter, this.unaryLimitResolver, {
|
|
96
|
-
useSsl: this.options.useSsl,
|
|
97
|
-
maxReceiveMessageLength: this.maxReceiveMessageLength,
|
|
98
103
|
signal: this.lifecycleController.signal,
|
|
99
104
|
assertOpen: () => {
|
|
100
105
|
this.assertOpen();
|
|
101
106
|
}
|
|
107
|
+
}, {
|
|
108
|
+
useSsl: this.options.useSsl,
|
|
109
|
+
maxReceiveMessageLength: this.maxReceiveMessageLength
|
|
102
110
|
});
|
|
103
111
|
this.clientsByServiceDefinition.set(serviceDefinition, client);
|
|
104
112
|
return client;
|
|
105
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Останавливает доступ к сервисам и новые RPC с SDK_CLOSED после закрытия
|
|
116
|
+
* SDK.
|
|
117
|
+
*/
|
|
106
118
|
assertOpen() {
|
|
107
119
|
if (this.closed) {
|
|
108
120
|
throw this.createClosedError();
|
|
109
121
|
}
|
|
110
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Задаёт lifecycle-ошибку для отказа в новом вызове и причины отмены ожиданий
|
|
125
|
+
* limiter-а.
|
|
126
|
+
*/
|
|
111
127
|
createClosedError() {
|
|
112
128
|
return new sdk_error_1.SdkError(sdk_error_1.SdkErrorCode.SdkClosed, 'TInvestNodeSDK is closed', {
|
|
113
129
|
source: 'lifecycle'
|
|
114
130
|
});
|
|
115
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Отклоняет доступ через прежние имена сервисов с ошибкой и подсказкой для
|
|
134
|
+
* миграции.
|
|
135
|
+
*/
|
|
136
|
+
static throwDeprecatedServiceGetter() {
|
|
137
|
+
throw new sdk_error_1.SdkError(sdk_error_1.SdkErrorCode.InvalidArgument, 'Прежние sdk.marketdata и sdk.stoporders не используйте: они устарели. Используйте вместо них sdk.marketData и sdk.stopOrders.', {
|
|
138
|
+
source: 'sdk'
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
// Прежние имена регистрируются при загрузке класса только в runtime,
|
|
142
|
+
// чтобы сохранить диагностику без включения этих getters в публичные
|
|
143
|
+
// TypeScript-типы.
|
|
144
|
+
static {
|
|
145
|
+
Object.defineProperties(this.prototype, {
|
|
146
|
+
marketdata: {
|
|
147
|
+
configurable: true,
|
|
148
|
+
get: this.throwDeprecatedServiceGetter
|
|
149
|
+
},
|
|
150
|
+
stoporders: {
|
|
151
|
+
configurable: true,
|
|
152
|
+
get: this.throwDeprecatedServiceGetter
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
116
156
|
}
|
|
117
157
|
exports.TInvestNodeSDK = TInvestNodeSDK;
|
|
118
|
-
function throwDeprecatedServiceGetter() {
|
|
119
|
-
throw new sdk_error_1.SdkError(sdk_error_1.SdkErrorCode.InvalidArgument, 'Прежние sdk.marketdata и sdk.stoporders не используйте: они устарели. Используйте вместо них sdk.marketData и sdk.stopOrders.', {
|
|
120
|
-
source: 'sdk'
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
Object.defineProperties(TInvestNodeSDK.prototype, {
|
|
124
|
-
marketdata: {
|
|
125
|
-
configurable: true,
|
|
126
|
-
get: throwDeprecatedServiceGetter
|
|
127
|
-
},
|
|
128
|
-
stoporders: {
|
|
129
|
-
configurable: true,
|
|
130
|
-
get: throwDeprecatedServiceGetter
|
|
131
|
-
}
|
|
132
|
-
});
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Модуль
|
|
3
|
-
* runtime-квоты для Consumer-owned limiter-а.
|
|
2
|
+
* Модуль преобразует декларацию unary-квот в таблицы правил для gRPC-вызовов.
|
|
4
3
|
*
|
|
5
4
|
* Здесь допустимы:
|
|
6
|
-
* - построение полных gRPC
|
|
7
|
-
* - сборка
|
|
8
|
-
* - проверка
|
|
9
|
-
* -
|
|
5
|
+
* - построение полных путей gRPC-методов;
|
|
6
|
+
* - сборка групп общих квот и проверка декларации;
|
|
7
|
+
* - проверка таблиц квот после объединения значений;
|
|
8
|
+
* - преобразование переопределений экземпляра в плоскую таблицу.
|
|
10
9
|
*
|
|
11
|
-
* Здесь не должно быть
|
|
12
|
-
*
|
|
10
|
+
* Здесь не должно быть значений по умолчанию модуля, состояния ограничителя
|
|
11
|
+
* или обновления тарифа провайдера.
|
|
13
12
|
*/
|
|
14
13
|
import type { TInvestUnaryLimit } from '../application/services/unary-limiter';
|
|
15
14
|
import type { UnaryLimits, UnaryLimitsConfig, UnaryLimitsDefinition } from '../config.types';
|
|
16
|
-
/**
|
|
15
|
+
/** Таблицы квот по ключам правил и группам общих квот для транспорта. */
|
|
17
16
|
export interface UnaryLimitConfig {
|
|
18
17
|
buckets: Record<string, string>;
|
|
19
18
|
limits: UnaryLimits;
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
|
-
*
|
|
23
|
-
* полные gRPC
|
|
24
|
-
*
|
|
21
|
+
* Значения по умолчанию сервиса сохраняются под короткими ключами, а правила
|
|
22
|
+
* методов получают полные пути gRPC. Значения модуля и группы общих квот не
|
|
23
|
+
* добавляются.
|
|
25
24
|
*/
|
|
26
25
|
export declare function defineUnaryLimits(definition: UnaryLimitsDefinition): UnaryLimits;
|
|
27
26
|
/**
|
|
@@ -30,8 +29,8 @@ export declare function defineUnaryLimits(definition: UnaryLimitsDefinition): Un
|
|
|
30
29
|
*/
|
|
31
30
|
export declare function compileUnaryLimits(definition: UnaryLimitsConfig): UnaryLimitConfig;
|
|
32
31
|
/**
|
|
33
|
-
* Проверяет
|
|
34
|
-
*
|
|
32
|
+
* Проверяет таблицы квот и группы общих квот после применения значений по
|
|
33
|
+
* умолчанию и переопределений экземпляра, до создания транспорта.
|
|
35
34
|
*/
|
|
36
35
|
export declare function assertUnaryLimitConfig(config: UnaryLimitConfig): void;
|
|
37
36
|
export declare function cloneUnaryLimits(limits: UnaryLimits): UnaryLimits;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Модуль
|
|
4
|
-
* runtime-квоты для Consumer-owned limiter-а.
|
|
3
|
+
* Модуль преобразует декларацию unary-квот в таблицы правил для gRPC-вызовов.
|
|
5
4
|
*
|
|
6
5
|
* Здесь допустимы:
|
|
7
|
-
* - построение полных gRPC
|
|
8
|
-
* - сборка
|
|
9
|
-
* - проверка
|
|
10
|
-
* -
|
|
6
|
+
* - построение полных путей gRPC-методов;
|
|
7
|
+
* - сборка групп общих квот и проверка декларации;
|
|
8
|
+
* - проверка таблиц квот после объединения значений;
|
|
9
|
+
* - преобразование переопределений экземпляра в плоскую таблицу.
|
|
11
10
|
*
|
|
12
|
-
* Здесь не должно быть
|
|
13
|
-
*
|
|
11
|
+
* Здесь не должно быть значений по умолчанию модуля, состояния ограничителя
|
|
12
|
+
* или обновления тарифа провайдера.
|
|
14
13
|
*/
|
|
15
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
15
|
exports.defineUnaryLimits = defineUnaryLimits;
|
|
@@ -20,9 +19,9 @@ exports.cloneUnaryLimits = cloneUnaryLimits;
|
|
|
20
19
|
exports.sameUnaryLimit = sameUnaryLimit;
|
|
21
20
|
const unary_method_path_1 = require("../infrastructure/transport/grpc/unary-method-path");
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
24
|
-
* полные gRPC
|
|
25
|
-
*
|
|
22
|
+
* Значения по умолчанию сервиса сохраняются под короткими ключами, а правила
|
|
23
|
+
* методов получают полные пути gRPC. Значения модуля и группы общих квот не
|
|
24
|
+
* добавляются.
|
|
26
25
|
*/
|
|
27
26
|
function defineUnaryLimits(definition) {
|
|
28
27
|
const limits = {};
|
|
@@ -79,8 +78,8 @@ function compileUnaryLimits(definition) {
|
|
|
79
78
|
return compiled;
|
|
80
79
|
}
|
|
81
80
|
/**
|
|
82
|
-
* Проверяет
|
|
83
|
-
*
|
|
81
|
+
* Проверяет таблицы квот и группы общих квот после применения значений по
|
|
82
|
+
* умолчанию и переопределений экземпляра, до создания транспорта.
|
|
84
83
|
*/
|
|
85
84
|
function assertUnaryLimitConfig(config) {
|
|
86
85
|
const limitsByBucket = new Map();
|
package/dist/config.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Модуль
|
|
3
|
-
* policies SDK.
|
|
2
|
+
* Модуль хранит значения по умолчанию и правила работы SDK.
|
|
4
3
|
*
|
|
5
4
|
* Здесь допустимы:
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
* - unary
|
|
9
|
-
* -
|
|
5
|
+
* - значения по умолчанию модуля;
|
|
6
|
+
* - правила настройки общего gRPC-канала;
|
|
7
|
+
* - квоты unary-вызовов по сервисам и RPC;
|
|
8
|
+
* - правило подтверждения CLI-команд с побочными эффектами.
|
|
10
9
|
*
|
|
11
|
-
* Здесь не должно быть
|
|
12
|
-
*
|
|
10
|
+
* Здесь не должно быть секретов, чтения окружения, значений развёртывания или
|
|
11
|
+
* преобразований при создании SDK.
|
|
13
12
|
*/
|
|
14
13
|
export declare const packageConfig: {
|
|
15
14
|
readonly sdk: {
|
|
16
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* TLS включён, если приложение не передало `useSsl` для экземпляра SDK.
|
|
17
|
+
*/
|
|
17
18
|
readonly useSsl: true;
|
|
18
19
|
};
|
|
19
20
|
readonly grpc: {
|
|
@@ -21,11 +22,12 @@ export declare const packageConfig: {
|
|
|
21
22
|
* SDK фиксирует 4 MiB как собственную transport policy и не зависит от
|
|
22
23
|
* неявного default grpc-js, который может измениться при upgrade.
|
|
23
24
|
*/
|
|
24
|
-
readonly maxReceiveMessageLength:
|
|
25
|
+
readonly maxReceiveMessageLength: 4194304;
|
|
25
26
|
};
|
|
26
27
|
readonly unaryLimits: {
|
|
27
28
|
/**
|
|
28
|
-
* Fallback 200 запросов в минуту применяется к RPC без более специфичного
|
|
29
|
+
* Fallback 200 запросов в минуту применяется к RPC без более специфичного
|
|
30
|
+
* rule.
|
|
29
31
|
* Шесть list RPC расходуют одну общую квоту 15 запросов в минуту, поэтому
|
|
30
32
|
* перечислены в одной group с единственным значением limit.
|
|
31
33
|
*/
|
package/dist/config.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Модуль
|
|
4
|
-
* policies SDK.
|
|
3
|
+
* Модуль хранит значения по умолчанию и правила работы SDK.
|
|
5
4
|
*
|
|
6
5
|
* Здесь допустимы:
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
* - unary
|
|
10
|
-
* -
|
|
6
|
+
* - значения по умолчанию модуля;
|
|
7
|
+
* - правила настройки общего gRPC-канала;
|
|
8
|
+
* - квоты unary-вызовов по сервисам и RPC;
|
|
9
|
+
* - правило подтверждения CLI-команд с побочными эффектами.
|
|
11
10
|
*
|
|
12
|
-
* Здесь не должно быть
|
|
13
|
-
*
|
|
11
|
+
* Здесь не должно быть секретов, чтения окружения, значений развёртывания или
|
|
12
|
+
* преобразований при создании SDK.
|
|
14
13
|
*/
|
|
15
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
15
|
exports.packageConfig = void 0;
|
|
17
16
|
exports.packageConfig = {
|
|
18
17
|
sdk: {
|
|
19
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* TLS включён, если приложение не передало `useSsl` для экземпляра SDK.
|
|
20
|
+
*/
|
|
20
21
|
useSsl: true
|
|
21
22
|
},
|
|
22
23
|
grpc: {
|
|
@@ -24,11 +25,12 @@ exports.packageConfig = {
|
|
|
24
25
|
* SDK фиксирует 4 MiB как собственную transport policy и не зависит от
|
|
25
26
|
* неявного default grpc-js, который может измениться при upgrade.
|
|
26
27
|
*/
|
|
27
|
-
maxReceiveMessageLength:
|
|
28
|
+
maxReceiveMessageLength: 4_194_304
|
|
28
29
|
},
|
|
29
30
|
unaryLimits: {
|
|
30
31
|
/**
|
|
31
|
-
* Fallback 200 запросов в минуту применяется к RPC без более специфичного
|
|
32
|
+
* Fallback 200 запросов в минуту применяется к RPC без более специфичного
|
|
33
|
+
* rule.
|
|
32
34
|
* Шесть list RPC расходуют одну общую квоту 15 запросов в минуту, поэтому
|
|
33
35
|
* перечислены в одной group с единственным значением limit.
|
|
34
36
|
*/
|
package/dist/config.types.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Модуль
|
|
3
|
-
*
|
|
2
|
+
* Модуль описывает типы исходных настроек модуля и публичных значений по
|
|
3
|
+
* умолчанию.
|
|
4
4
|
*
|
|
5
5
|
* Здесь допустимы:
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
* - переиспользование
|
|
6
|
+
* - типы публичных настроек;
|
|
7
|
+
* - проверка формы исходных настроек при компиляции;
|
|
8
|
+
* - переиспользование интерфейсов сервисов приложения.
|
|
9
9
|
*
|
|
10
|
-
* Здесь не должно быть
|
|
10
|
+
* Здесь не должно быть значений по умолчанию или проверок при создании SDK.
|
|
11
11
|
*/
|
|
12
12
|
import type { InstrumentsService, MarketDataService, OperationsService, OrdersService, SandboxService, SignalService, StopOrdersService, UsersService } from './application/dto/t-invest-services';
|
|
13
13
|
import type { TInvestUnaryLimit, TInvestUnaryLimits } from './application/services/unary-limiter';
|
|
14
14
|
type GrpcMethodName<Service> = Capitalize<Extract<keyof Service, string>>;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Плоская таблица квот unary-вызовов. Ключ — имя сгенерированного сервиса или
|
|
17
|
+
* полный путь gRPC-метода, значение — число запросов и размер окна.
|
|
18
18
|
*/
|
|
19
19
|
export type UnaryLimits = TInvestUnaryLimits;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Переопределения квот для одного экземпляра без групп общих квот.
|
|
22
|
+
* Значения по умолчанию модуля добавляются при создании SDK.
|
|
23
23
|
*/
|
|
24
24
|
export type UnaryLimitsDefinition = {
|
|
25
25
|
[Service in keyof PackageUnaryLimitsConfig]?: {
|
|
@@ -48,9 +48,8 @@ export interface UnaryServiceLimitsConfig<Method extends string = string> {
|
|
|
48
48
|
/** Человекочитаемая unary policy, сгруппированная по generated services. */
|
|
49
49
|
export type UnaryLimitsConfig = Readonly<Record<string, UnaryServiceLimitsConfig>>;
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
52
|
-
* Допустимые RPC
|
|
53
|
-
* contracts.
|
|
51
|
+
* Настройки квот модуля для всех поддерживаемых unary-сервисов.
|
|
52
|
+
* Допустимые имена RPC выводятся из синхронизированных интерфейсов сервисов.
|
|
54
53
|
*/
|
|
55
54
|
export type PackageUnaryLimitsConfig = {
|
|
56
55
|
InstrumentsService: UnaryServiceLimitsConfig<GrpcMethodName<InstrumentsService>>;
|
|
@@ -62,26 +61,26 @@ export type PackageUnaryLimitsConfig = {
|
|
|
62
61
|
StopOrdersService: UnaryServiceLimitsConfig<GrpcMethodName<StopOrdersService>>;
|
|
63
62
|
UsersService: UnaryServiceLimitsConfig<GrpcMethodName<UsersService>>;
|
|
64
63
|
};
|
|
65
|
-
/**
|
|
64
|
+
/** Тип исходных настроек модуля без преобразований при создании SDK. */
|
|
66
65
|
export interface PackageConfigDefinition {
|
|
67
|
-
/**
|
|
66
|
+
/** Значения по умолчанию для параметров экземпляра SDK. */
|
|
68
67
|
sdk: {
|
|
69
68
|
/** Использовать TLS, если instance option не задан. */
|
|
70
69
|
useSsl: boolean;
|
|
71
70
|
};
|
|
72
|
-
/**
|
|
71
|
+
/** Настройки общего gRPC-канала. */
|
|
73
72
|
grpc: {
|
|
74
73
|
/** Максимальный размер одного входящего gRPC-сообщения в байтах. */
|
|
75
74
|
maxReceiveMessageLength: number;
|
|
76
75
|
};
|
|
77
|
-
/**
|
|
76
|
+
/** Квоты провайдера и группы общих квот. */
|
|
78
77
|
unaryLimits: PackageUnaryLimitsConfig;
|
|
79
78
|
/** CLI safety policy для команд с необратимыми или торговыми side effects. */
|
|
80
79
|
requireSideEffectConfirmation: boolean;
|
|
81
80
|
}
|
|
82
|
-
/**
|
|
81
|
+
/** Публичные значения по умолчанию, подготовленные из настроек модуля. */
|
|
83
82
|
export interface TInvestNodeSDKConfig {
|
|
84
|
-
/**
|
|
83
|
+
/** Плоская таблица квот, доступная для чтения и переопределения. */
|
|
85
84
|
unaryLimits: UnaryLimits;
|
|
86
85
|
/** Требует явное подтверждение CLI-команд с side effects. */
|
|
87
86
|
requireSideEffectConfirmation: boolean;
|
package/dist/config.types.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Модуль
|
|
4
|
-
*
|
|
3
|
+
* Модуль описывает типы исходных настроек модуля и публичных значений по
|
|
4
|
+
* умолчанию.
|
|
5
5
|
*
|
|
6
6
|
* Здесь допустимы:
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
* - переиспользование
|
|
7
|
+
* - типы публичных настроек;
|
|
8
|
+
* - проверка формы исходных настроек при компиляции;
|
|
9
|
+
* - переиспользование интерфейсов сервисов приложения.
|
|
10
10
|
*
|
|
11
|
-
* Здесь не должно быть
|
|
11
|
+
* Здесь не должно быть значений по умолчанию или проверок при создании SDK.
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
export declare const protobufPackage = "tinkoff.public.invest.api.contract.v1";
|
|
3
|
+
export declare const protobufFileName = "common.proto";
|
|
3
4
|
/** Тип инструмента. */
|
|
4
5
|
export declare enum InstrumentType {
|
|
5
6
|
INSTRUMENT_TYPE_UNSPECIFIED = 0,
|
package/dist/generated/common.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
+
// protoc-gen-ts_proto v2.18.0
|
|
5
5
|
// protoc v7.36.2
|
|
6
6
|
// source: common.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ErrorDetail = exports.BrandData = exports.ResponseMetadata = exports.PageResponse = exports.Page = exports.Ping = exports.PingDelaySettings = exports.PingRequest = exports.Quotation = exports.MoneyValue = exports.RealExchange = exports.ResultSubscriptionStatus = exports.PriceType = exports.SecurityTradingStatus = exports.InstrumentStatus = exports.InstrumentType = exports.protobufPackage = void 0;
|
|
8
|
+
exports.ErrorDetail = exports.BrandData = exports.ResponseMetadata = exports.PageResponse = exports.Page = exports.Ping = exports.PingDelaySettings = exports.PingRequest = exports.Quotation = exports.MoneyValue = exports.RealExchange = exports.ResultSubscriptionStatus = exports.PriceType = exports.SecurityTradingStatus = exports.InstrumentStatus = exports.InstrumentType = exports.protobufFileName = exports.protobufPackage = void 0;
|
|
9
9
|
exports.instrumentTypeFromJSON = instrumentTypeFromJSON;
|
|
10
10
|
exports.instrumentTypeToJSON = instrumentTypeToJSON;
|
|
11
11
|
exports.instrumentStatusFromJSON = instrumentStatusFromJSON;
|
|
@@ -22,6 +22,7 @@ exports.realExchangeToJSON = realExchangeToJSON;
|
|
|
22
22
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
23
23
|
const timestamp_1 = require("./google/protobuf/timestamp");
|
|
24
24
|
exports.protobufPackage = "tinkoff.public.invest.api.contract.v1";
|
|
25
|
+
exports.protobufFileName = "common.proto";
|
|
25
26
|
/** Тип инструмента. */
|
|
26
27
|
var InstrumentType;
|
|
27
28
|
(function (InstrumentType) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const protobufPackage = "google.api";
|
|
2
|
+
export declare const protobufFileName = "google/api/field_behavior.proto";
|
|
2
3
|
/**
|
|
3
4
|
* An indicator of the behavior of a given field (for example, that a field
|
|
4
5
|
* is required in requests, or given as output but ignored as input).
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
+
// protoc-gen-ts_proto v2.18.0
|
|
5
5
|
// protoc v7.36.2
|
|
6
6
|
// source: google/api/field_behavior.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.FieldBehavior = exports.protobufPackage = void 0;
|
|
8
|
+
exports.FieldBehavior = exports.protobufFileName = exports.protobufPackage = void 0;
|
|
9
9
|
exports.fieldBehaviorFromJSON = fieldBehaviorFromJSON;
|
|
10
10
|
exports.fieldBehaviorToJSON = fieldBehaviorToJSON;
|
|
11
11
|
/* eslint-disable */
|
|
12
12
|
exports.protobufPackage = "google.api";
|
|
13
|
+
exports.protobufFileName = "google/api/field_behavior.proto";
|
|
13
14
|
/**
|
|
14
15
|
* An indicator of the behavior of a given field (for example, that a field
|
|
15
16
|
* is required in requests, or given as output but ignored as input).
|