@woodger/t-invest-node-sdk 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (469) hide show
  1. package/CHANGELOG.md +611 -0
  2. package/LICENSE +21 -0
  3. package/THIRD_PARTY_NOTICES.md +307 -0
  4. package/certificates/russian-trusted-root-ca.pem +33 -0
  5. package/dist/application/dto/t-invest-options.d.ts +30 -0
  6. package/dist/application/dto/t-invest-options.js +11 -0
  7. package/dist/application/dto/t-invest-services.d.ts +168 -0
  8. package/dist/application/dto/t-invest-services.js +12 -0
  9. package/dist/application/errors/sdk-error.d.ts +47 -0
  10. package/dist/application/errors/sdk-error.js +84 -0
  11. package/dist/application/reports/accounts.report.d.ts +26 -0
  12. package/dist/application/reports/accounts.report.js +11 -0
  13. package/dist/application/reports/accrued-interests.report.d.ts +22 -0
  14. package/dist/application/reports/accrued-interests.report.js +11 -0
  15. package/dist/application/reports/asset.report.d.ts +72 -0
  16. package/dist/application/reports/asset.report.js +11 -0
  17. package/dist/application/reports/bond-coupons.report.d.ts +31 -0
  18. package/dist/application/reports/bond-coupons.report.js +11 -0
  19. package/dist/application/reports/bond.report.d.ts +82 -0
  20. package/dist/application/reports/bond.report.js +11 -0
  21. package/dist/application/reports/brands.report.d.ts +24 -0
  22. package/dist/application/reports/brands.report.js +11 -0
  23. package/dist/application/reports/broker-report.report.d.ts +74 -0
  24. package/dist/application/reports/broker-report.report.js +11 -0
  25. package/dist/application/reports/cancel-order.report.d.ts +14 -0
  26. package/dist/application/reports/cancel-order.report.js +11 -0
  27. package/dist/application/reports/cancel-stop-order.report.d.ts +14 -0
  28. package/dist/application/reports/cancel-stop-order.report.js +11 -0
  29. package/dist/application/reports/candles.report.d.ts +26 -0
  30. package/dist/application/reports/candles.report.js +11 -0
  31. package/dist/application/reports/close-prices.report.d.ts +20 -0
  32. package/dist/application/reports/close-prices.report.js +11 -0
  33. package/dist/application/reports/countries.report.d.ts +20 -0
  34. package/dist/application/reports/countries.report.js +11 -0
  35. package/dist/application/reports/currency.report.d.ts +58 -0
  36. package/dist/application/reports/currency.report.js +11 -0
  37. package/dist/application/reports/dividends-foreign-issuer.report.d.ts +51 -0
  38. package/dist/application/reports/dividends-foreign-issuer.report.js +11 -0
  39. package/dist/application/reports/dividends.report.d.ts +33 -0
  40. package/dist/application/reports/dividends.report.js +11 -0
  41. package/dist/application/reports/etf.report.d.ts +62 -0
  42. package/dist/application/reports/etf.report.js +11 -0
  43. package/dist/application/reports/favorites.report.d.ts +24 -0
  44. package/dist/application/reports/favorites.report.js +11 -0
  45. package/dist/application/reports/find-instrument.report.d.ts +34 -0
  46. package/dist/application/reports/find-instrument.report.js +11 -0
  47. package/dist/application/reports/future.report.d.ts +66 -0
  48. package/dist/application/reports/future.report.js +11 -0
  49. package/dist/application/reports/futures-margin.report.d.ts +21 -0
  50. package/dist/application/reports/futures-margin.report.js +11 -0
  51. package/dist/application/reports/index.d.ts +50 -0
  52. package/dist/application/reports/index.js +66 -0
  53. package/dist/application/reports/instrument.report.d.ts +47 -0
  54. package/dist/application/reports/instrument.report.js +11 -0
  55. package/dist/application/reports/last-prices.report.d.ts +20 -0
  56. package/dist/application/reports/last-prices.report.js +11 -0
  57. package/dist/application/reports/last-trades.report.d.ts +24 -0
  58. package/dist/application/reports/last-trades.report.js +11 -0
  59. package/dist/application/reports/margin-attributes.report.d.ts +25 -0
  60. package/dist/application/reports/margin-attributes.report.js +11 -0
  61. package/dist/application/reports/money.report.d.ts +15 -0
  62. package/dist/application/reports/money.report.js +11 -0
  63. package/dist/application/reports/operations-by-cursor.report.d.ts +65 -0
  64. package/dist/application/reports/operations-by-cursor.report.js +11 -0
  65. package/dist/application/reports/operations.report.d.ts +40 -0
  66. package/dist/application/reports/operations.report.js +11 -0
  67. package/dist/application/reports/option.report.d.ts +76 -0
  68. package/dist/application/reports/option.report.js +11 -0
  69. package/dist/application/reports/order-book.report.d.ts +38 -0
  70. package/dist/application/reports/order-book.report.js +11 -0
  71. package/dist/application/reports/order-mutation.report.d.ts +45 -0
  72. package/dist/application/reports/order-mutation.report.js +11 -0
  73. package/dist/application/reports/order-state.report.d.ts +12 -0
  74. package/dist/application/reports/order-state.report.js +11 -0
  75. package/dist/application/reports/orders.report.d.ts +53 -0
  76. package/dist/application/reports/orders.report.js +11 -0
  77. package/dist/application/reports/portfolio.report.d.ts +54 -0
  78. package/dist/application/reports/portfolio.report.js +11 -0
  79. package/dist/application/reports/positions.report.d.ts +45 -0
  80. package/dist/application/reports/positions.report.js +11 -0
  81. package/dist/application/reports/post-stop-order.report.d.ts +14 -0
  82. package/dist/application/reports/post-stop-order.report.js +11 -0
  83. package/dist/application/reports/sandbox-account.report.d.ts +20 -0
  84. package/dist/application/reports/sandbox-account.report.js +11 -0
  85. package/dist/application/reports/share.report.d.ts +66 -0
  86. package/dist/application/reports/share.report.js +11 -0
  87. package/dist/application/reports/stop-orders.report.d.ts +34 -0
  88. package/dist/application/reports/stop-orders.report.js +11 -0
  89. package/dist/application/reports/trading-schedules.report.d.ts +44 -0
  90. package/dist/application/reports/trading-schedules.report.js +11 -0
  91. package/dist/application/reports/trading-status.report.d.ts +19 -0
  92. package/dist/application/reports/trading-status.report.js +11 -0
  93. package/dist/application/reports/trading-statuses.report.d.ts +12 -0
  94. package/dist/application/reports/trading-statuses.report.js +11 -0
  95. package/dist/application/reports/user-info.report.d.ts +16 -0
  96. package/dist/application/reports/user-info.report.js +11 -0
  97. package/dist/application/reports/user-tariff.report.d.ts +28 -0
  98. package/dist/application/reports/user-tariff.report.js +11 -0
  99. package/dist/application/reports/withdraw-limits.report.d.ts +16 -0
  100. package/dist/application/reports/withdraw-limits.report.js +11 -0
  101. package/dist/application/services/unary-limiter.d.ts +44 -0
  102. package/dist/application/services/unary-limiter.js +138 -0
  103. package/dist/bootstrap/args/command-options.d.ts +43 -0
  104. package/dist/bootstrap/args/command-options.js +125 -0
  105. package/dist/bootstrap/args/index.d.ts +1 -0
  106. package/dist/bootstrap/args/index.js +5 -0
  107. package/dist/bootstrap/args/instrument-id-options.d.ts +24 -0
  108. package/dist/bootstrap/args/instrument-id-options.js +47 -0
  109. package/dist/bootstrap/args/instruments-args.d.ts +49 -0
  110. package/dist/bootstrap/args/instruments-args.js +89 -0
  111. package/dist/bootstrap/args/sdk-options.d.ts +19 -0
  112. package/dist/bootstrap/args/sdk-options.js +40 -0
  113. package/dist/bootstrap/args/side-effect-args.d.ts +20 -0
  114. package/dist/bootstrap/args/side-effect-args.js +50 -0
  115. package/dist/bootstrap/cli/contract.d.ts +16 -0
  116. package/dist/bootstrap/cli/contract.js +15 -0
  117. package/dist/bootstrap/cli/domains.d.ts +260 -0
  118. package/dist/bootstrap/cli/domains.js +631 -0
  119. package/dist/bootstrap/cli/error.d.ts +15 -0
  120. package/dist/bootstrap/cli/error.js +40 -0
  121. package/dist/bootstrap/cli/help.d.ts +751 -0
  122. package/dist/bootstrap/cli/help.js +1789 -0
  123. package/dist/bootstrap/cli/registry.d.ts +2102 -0
  124. package/dist/bootstrap/cli/registry.js +186 -0
  125. package/dist/bootstrap/cli/runner.d.ts +10 -0
  126. package/dist/bootstrap/cli/runner.js +151 -0
  127. package/dist/bootstrap/cli/version.d.ts +17 -0
  128. package/dist/bootstrap/cli/version.js +26 -0
  129. package/dist/bootstrap/commands/accounts/cli.d.ts +63 -0
  130. package/dist/bootstrap/commands/accounts/cli.js +50 -0
  131. package/dist/bootstrap/commands/accounts/reporter.d.ts +13 -0
  132. package/dist/bootstrap/commands/accounts/reporter.js +50 -0
  133. package/dist/bootstrap/commands/accrued-interests/cli.d.ts +129 -0
  134. package/dist/bootstrap/commands/accrued-interests/cli.js +80 -0
  135. package/dist/bootstrap/commands/accrued-interests/reporter.d.ts +13 -0
  136. package/dist/bootstrap/commands/accrued-interests/reporter.js +43 -0
  137. package/dist/bootstrap/commands/asset/cli.d.ts +99 -0
  138. package/dist/bootstrap/commands/asset/cli.js +64 -0
  139. package/dist/bootstrap/commands/asset/reporter.d.ts +16 -0
  140. package/dist/bootstrap/commands/asset/reporter.js +122 -0
  141. package/dist/bootstrap/commands/assets/cli.d.ts +102 -0
  142. package/dist/bootstrap/commands/assets/cli.js +78 -0
  143. package/dist/bootstrap/commands/assets/reporter.d.ts +14 -0
  144. package/dist/bootstrap/commands/assets/reporter.js +27 -0
  145. package/dist/bootstrap/commands/bond/cli.d.ts +83 -0
  146. package/dist/bootstrap/commands/bond/cli.js +53 -0
  147. package/dist/bootstrap/commands/bond/reporter.d.ts +15 -0
  148. package/dist/bootstrap/commands/bond/reporter.js +123 -0
  149. package/dist/bootstrap/commands/bond-coupons/cli.d.ts +129 -0
  150. package/dist/bootstrap/commands/bond-coupons/cli.js +80 -0
  151. package/dist/bootstrap/commands/bond-coupons/reporter.d.ts +13 -0
  152. package/dist/bootstrap/commands/bond-coupons/reporter.js +64 -0
  153. package/dist/bootstrap/commands/bonds/cli.d.ts +73 -0
  154. package/dist/bootstrap/commands/bonds/cli.js +53 -0
  155. package/dist/bootstrap/commands/bonds/reporter.d.ts +14 -0
  156. package/dist/bootstrap/commands/bonds/reporter.js +27 -0
  157. package/dist/bootstrap/commands/brand/cli.d.ts +99 -0
  158. package/dist/bootstrap/commands/brand/cli.js +64 -0
  159. package/dist/bootstrap/commands/brand/reporter.d.ts +14 -0
  160. package/dist/bootstrap/commands/brand/reporter.js +37 -0
  161. package/dist/bootstrap/commands/brands/cli.d.ts +63 -0
  162. package/dist/bootstrap/commands/brands/cli.js +50 -0
  163. package/dist/bootstrap/commands/brands/reporter.d.ts +14 -0
  164. package/dist/bootstrap/commands/brands/reporter.js +49 -0
  165. package/dist/bootstrap/commands/broker-report/cli.d.ts +132 -0
  166. package/dist/bootstrap/commands/broker-report/cli.js +105 -0
  167. package/dist/bootstrap/commands/broker-report/reporter.d.ts +13 -0
  168. package/dist/bootstrap/commands/broker-report/reporter.js +123 -0
  169. package/dist/bootstrap/commands/cancel-order/cli.d.ts +120 -0
  170. package/dist/bootstrap/commands/cancel-order/cli.js +71 -0
  171. package/dist/bootstrap/commands/cancel-order/reporter.d.ts +13 -0
  172. package/dist/bootstrap/commands/cancel-order/reporter.js +32 -0
  173. package/dist/bootstrap/commands/cancel-stop-order/cli.d.ts +120 -0
  174. package/dist/bootstrap/commands/cancel-stop-order/cli.js +71 -0
  175. package/dist/bootstrap/commands/cancel-stop-order/reporter.d.ts +13 -0
  176. package/dist/bootstrap/commands/cancel-stop-order/reporter.js +32 -0
  177. package/dist/bootstrap/commands/candles/cli.d.ts +138 -0
  178. package/dist/bootstrap/commands/candles/cli.js +104 -0
  179. package/dist/bootstrap/commands/candles/reporter.d.ts +13 -0
  180. package/dist/bootstrap/commands/candles/reporter.js +49 -0
  181. package/dist/bootstrap/commands/close-prices/cli.d.ts +99 -0
  182. package/dist/bootstrap/commands/close-prices/cli.js +66 -0
  183. package/dist/bootstrap/commands/close-prices/reporter.d.ts +13 -0
  184. package/dist/bootstrap/commands/close-prices/reporter.js +43 -0
  185. package/dist/bootstrap/commands/compile-proto/cli.d.ts +12 -0
  186. package/dist/bootstrap/commands/compile-proto/cli.js +22 -0
  187. package/dist/bootstrap/commands/countries/cli.d.ts +63 -0
  188. package/dist/bootstrap/commands/countries/cli.js +50 -0
  189. package/dist/bootstrap/commands/countries/reporter.d.ts +13 -0
  190. package/dist/bootstrap/commands/countries/reporter.js +42 -0
  191. package/dist/bootstrap/commands/currencies/cli.d.ts +73 -0
  192. package/dist/bootstrap/commands/currencies/cli.js +53 -0
  193. package/dist/bootstrap/commands/currencies/reporter.d.ts +14 -0
  194. package/dist/bootstrap/commands/currencies/reporter.js +27 -0
  195. package/dist/bootstrap/commands/currency/cli.d.ts +83 -0
  196. package/dist/bootstrap/commands/currency/cli.js +53 -0
  197. package/dist/bootstrap/commands/currency/reporter.d.ts +15 -0
  198. package/dist/bootstrap/commands/currency/reporter.js +104 -0
  199. package/dist/bootstrap/commands/dividends/cli.d.ts +129 -0
  200. package/dist/bootstrap/commands/dividends/cli.js +80 -0
  201. package/dist/bootstrap/commands/dividends/reporter.d.ts +13 -0
  202. package/dist/bootstrap/commands/dividends/reporter.js +62 -0
  203. package/dist/bootstrap/commands/dividends-foreign-issuer/cli.d.ts +132 -0
  204. package/dist/bootstrap/commands/dividends-foreign-issuer/cli.js +105 -0
  205. package/dist/bootstrap/commands/dividends-foreign-issuer/reporter.d.ts +13 -0
  206. package/dist/bootstrap/commands/dividends-foreign-issuer/reporter.js +108 -0
  207. package/dist/bootstrap/commands/edit-favorites/cli.d.ts +129 -0
  208. package/dist/bootstrap/commands/edit-favorites/cli.js +78 -0
  209. package/dist/bootstrap/commands/edit-favorites/reporter.d.ts +13 -0
  210. package/dist/bootstrap/commands/edit-favorites/reporter.js +23 -0
  211. package/dist/bootstrap/commands/etf/cli.d.ts +83 -0
  212. package/dist/bootstrap/commands/etf/cli.js +53 -0
  213. package/dist/bootstrap/commands/etf/reporter.d.ts +15 -0
  214. package/dist/bootstrap/commands/etf/reporter.js +109 -0
  215. package/dist/bootstrap/commands/etfs/cli.d.ts +73 -0
  216. package/dist/bootstrap/commands/etfs/cli.js +53 -0
  217. package/dist/bootstrap/commands/etfs/reporter.d.ts +14 -0
  218. package/dist/bootstrap/commands/etfs/reporter.js +27 -0
  219. package/dist/bootstrap/commands/favorites/cli.d.ts +63 -0
  220. package/dist/bootstrap/commands/favorites/cli.js +50 -0
  221. package/dist/bootstrap/commands/favorites/reporter.d.ts +13 -0
  222. package/dist/bootstrap/commands/favorites/reporter.js +60 -0
  223. package/dist/bootstrap/commands/find-instrument/cli.d.ts +126 -0
  224. package/dist/bootstrap/commands/find-instrument/cli.js +88 -0
  225. package/dist/bootstrap/commands/find-instrument/reporter.d.ts +13 -0
  226. package/dist/bootstrap/commands/find-instrument/reporter.js +71 -0
  227. package/dist/bootstrap/commands/future/cli.d.ts +83 -0
  228. package/dist/bootstrap/commands/future/cli.js +53 -0
  229. package/dist/bootstrap/commands/future/reporter.d.ts +15 -0
  230. package/dist/bootstrap/commands/future/reporter.js +116 -0
  231. package/dist/bootstrap/commands/futures/cli.d.ts +73 -0
  232. package/dist/bootstrap/commands/futures/cli.js +53 -0
  233. package/dist/bootstrap/commands/futures/reporter.d.ts +14 -0
  234. package/dist/bootstrap/commands/futures/reporter.js +27 -0
  235. package/dist/bootstrap/commands/futures-margin/cli.d.ts +105 -0
  236. package/dist/bootstrap/commands/futures-margin/cli.js +64 -0
  237. package/dist/bootstrap/commands/futures-margin/reporter.d.ts +13 -0
  238. package/dist/bootstrap/commands/futures-margin/reporter.js +40 -0
  239. package/dist/bootstrap/commands/help/cli.d.ts +13 -0
  240. package/dist/bootstrap/commands/help/cli.js +26 -0
  241. package/dist/bootstrap/commands/instrument/cli.d.ts +83 -0
  242. package/dist/bootstrap/commands/instrument/cli.js +53 -0
  243. package/dist/bootstrap/commands/instrument/reporter.d.ts +13 -0
  244. package/dist/bootstrap/commands/instrument/reporter.js +91 -0
  245. package/dist/bootstrap/commands/last-prices/cli.d.ts +99 -0
  246. package/dist/bootstrap/commands/last-prices/cli.js +66 -0
  247. package/dist/bootstrap/commands/last-prices/reporter.d.ts +13 -0
  248. package/dist/bootstrap/commands/last-prices/reporter.js +43 -0
  249. package/dist/bootstrap/commands/last-trades/cli.d.ts +123 -0
  250. package/dist/bootstrap/commands/last-trades/cli.js +82 -0
  251. package/dist/bootstrap/commands/last-trades/reporter.d.ts +13 -0
  252. package/dist/bootstrap/commands/last-trades/reporter.js +48 -0
  253. package/dist/bootstrap/commands/margin-attributes/cli.d.ts +99 -0
  254. package/dist/bootstrap/commands/margin-attributes/cli.js +64 -0
  255. package/dist/bootstrap/commands/margin-attributes/reporter.d.ts +13 -0
  256. package/dist/bootstrap/commands/margin-attributes/reporter.js +51 -0
  257. package/dist/bootstrap/commands/operations/cli.d.ts +156 -0
  258. package/dist/bootstrap/commands/operations/cli.js +99 -0
  259. package/dist/bootstrap/commands/operations/reporter.d.ts +13 -0
  260. package/dist/bootstrap/commands/operations/reporter.js +78 -0
  261. package/dist/bootstrap/commands/operations-by-cursor/cli.d.ts +204 -0
  262. package/dist/bootstrap/commands/operations-by-cursor/cli.js +164 -0
  263. package/dist/bootstrap/commands/operations-by-cursor/reporter.d.ts +13 -0
  264. package/dist/bootstrap/commands/operations-by-cursor/reporter.js +107 -0
  265. package/dist/bootstrap/commands/option/cli.d.ts +83 -0
  266. package/dist/bootstrap/commands/option/cli.js +53 -0
  267. package/dist/bootstrap/commands/option/reporter.d.ts +15 -0
  268. package/dist/bootstrap/commands/option/reporter.js +125 -0
  269. package/dist/bootstrap/commands/options-by/cli.d.ts +108 -0
  270. package/dist/bootstrap/commands/options-by/cli.js +68 -0
  271. package/dist/bootstrap/commands/options-by/reporter.d.ts +14 -0
  272. package/dist/bootstrap/commands/options-by/reporter.js +27 -0
  273. package/dist/bootstrap/commands/order-book/cli.d.ts +120 -0
  274. package/dist/bootstrap/commands/order-book/cli.js +73 -0
  275. package/dist/bootstrap/commands/order-book/reporter.d.ts +13 -0
  276. package/dist/bootstrap/commands/order-book/reporter.js +60 -0
  277. package/dist/bootstrap/commands/order-state/cli.d.ts +111 -0
  278. package/dist/bootstrap/commands/order-state/cli.js +71 -0
  279. package/dist/bootstrap/commands/order-state/reporter.d.ts +14 -0
  280. package/dist/bootstrap/commands/order-state/reporter.js +57 -0
  281. package/dist/bootstrap/commands/orders/cli.d.ts +99 -0
  282. package/dist/bootstrap/commands/orders/cli.js +64 -0
  283. package/dist/bootstrap/commands/orders/reporter.d.ts +14 -0
  284. package/dist/bootstrap/commands/orders/reporter.js +88 -0
  285. package/dist/bootstrap/commands/portfolio/cli.d.ts +114 -0
  286. package/dist/bootstrap/commands/portfolio/cli.js +77 -0
  287. package/dist/bootstrap/commands/portfolio/reporter.d.ts +13 -0
  288. package/dist/bootstrap/commands/portfolio/reporter.js +95 -0
  289. package/dist/bootstrap/commands/positions/cli.d.ts +99 -0
  290. package/dist/bootstrap/commands/positions/cli.js +64 -0
  291. package/dist/bootstrap/commands/positions/reporter.d.ts +13 -0
  292. package/dist/bootstrap/commands/positions/reporter.js +116 -0
  293. package/dist/bootstrap/commands/post-order/cli.d.ts +192 -0
  294. package/dist/bootstrap/commands/post-order/cli.js +113 -0
  295. package/dist/bootstrap/commands/post-order/reporter.d.ts +13 -0
  296. package/dist/bootstrap/commands/post-order/reporter.js +77 -0
  297. package/dist/bootstrap/commands/post-stop-order/cli.d.ts +216 -0
  298. package/dist/bootstrap/commands/post-stop-order/cli.js +145 -0
  299. package/dist/bootstrap/commands/post-stop-order/reporter.d.ts +13 -0
  300. package/dist/bootstrap/commands/post-stop-order/reporter.js +31 -0
  301. package/dist/bootstrap/commands/replace-order/cli.d.ts +180 -0
  302. package/dist/bootstrap/commands/replace-order/cli.js +99 -0
  303. package/dist/bootstrap/commands/replace-order/reporter.d.ts +13 -0
  304. package/dist/bootstrap/commands/replace-order/reporter.js +17 -0
  305. package/dist/bootstrap/commands/sandbox-accounts/cli.d.ts +64 -0
  306. package/dist/bootstrap/commands/sandbox-accounts/cli.js +54 -0
  307. package/dist/bootstrap/commands/sandbox-cancel-order/cli.d.ts +120 -0
  308. package/dist/bootstrap/commands/sandbox-cancel-order/cli.js +69 -0
  309. package/dist/bootstrap/commands/sandbox-close-account/cli.d.ts +108 -0
  310. package/dist/bootstrap/commands/sandbox-close-account/cli.js +66 -0
  311. package/dist/bootstrap/commands/sandbox-close-account/reporter.d.ts +12 -0
  312. package/dist/bootstrap/commands/sandbox-close-account/reporter.js +32 -0
  313. package/dist/bootstrap/commands/sandbox-open-account/cli.d.ts +70 -0
  314. package/dist/bootstrap/commands/sandbox-open-account/cli.js +57 -0
  315. package/dist/bootstrap/commands/sandbox-open-account/reporter.d.ts +13 -0
  316. package/dist/bootstrap/commands/sandbox-open-account/reporter.js +31 -0
  317. package/dist/bootstrap/commands/sandbox-operations/cli.d.ts +156 -0
  318. package/dist/bootstrap/commands/sandbox-operations/cli.js +78 -0
  319. package/dist/bootstrap/commands/sandbox-operations-by-cursor/cli.d.ts +204 -0
  320. package/dist/bootstrap/commands/sandbox-operations-by-cursor/cli.js +98 -0
  321. package/dist/bootstrap/commands/sandbox-order-state/cli.d.ts +111 -0
  322. package/dist/bootstrap/commands/sandbox-order-state/cli.js +67 -0
  323. package/dist/bootstrap/commands/sandbox-orders/cli.d.ts +99 -0
  324. package/dist/bootstrap/commands/sandbox-orders/cli.js +63 -0
  325. package/dist/bootstrap/commands/sandbox-pay-in/cli.d.ts +135 -0
  326. package/dist/bootstrap/commands/sandbox-pay-in/cli.js +86 -0
  327. package/dist/bootstrap/commands/sandbox-pay-in/reporter.d.ts +13 -0
  328. package/dist/bootstrap/commands/sandbox-pay-in/reporter.js +32 -0
  329. package/dist/bootstrap/commands/sandbox-portfolio/cli.d.ts +114 -0
  330. package/dist/bootstrap/commands/sandbox-portfolio/cli.js +68 -0
  331. package/dist/bootstrap/commands/sandbox-positions/cli.d.ts +99 -0
  332. package/dist/bootstrap/commands/sandbox-positions/cli.js +63 -0
  333. package/dist/bootstrap/commands/sandbox-post-order/cli.d.ts +192 -0
  334. package/dist/bootstrap/commands/sandbox-post-order/cli.js +90 -0
  335. package/dist/bootstrap/commands/sandbox-replace-order/cli.d.ts +180 -0
  336. package/dist/bootstrap/commands/sandbox-replace-order/cli.js +86 -0
  337. package/dist/bootstrap/commands/sandbox-withdraw-limits/cli.d.ts +99 -0
  338. package/dist/bootstrap/commands/sandbox-withdraw-limits/cli.js +63 -0
  339. package/dist/bootstrap/commands/share/cli.d.ts +83 -0
  340. package/dist/bootstrap/commands/share/cli.js +53 -0
  341. package/dist/bootstrap/commands/share/reporter.d.ts +15 -0
  342. package/dist/bootstrap/commands/share/reporter.js +111 -0
  343. package/dist/bootstrap/commands/shares/cli.d.ts +73 -0
  344. package/dist/bootstrap/commands/shares/cli.js +53 -0
  345. package/dist/bootstrap/commands/shares/reporter.d.ts +14 -0
  346. package/dist/bootstrap/commands/shares/reporter.js +27 -0
  347. package/dist/bootstrap/commands/stop-orders/cli.d.ts +99 -0
  348. package/dist/bootstrap/commands/stop-orders/cli.js +68 -0
  349. package/dist/bootstrap/commands/stop-orders/reporter.d.ts +13 -0
  350. package/dist/bootstrap/commands/stop-orders/reporter.js +69 -0
  351. package/dist/bootstrap/commands/stream-run/cli.d.ts +138 -0
  352. package/dist/bootstrap/commands/stream-run/cli.js +229 -0
  353. package/dist/bootstrap/commands/stream-run/config.d.ts +56 -0
  354. package/dist/bootstrap/commands/stream-run/config.js +468 -0
  355. package/dist/bootstrap/commands/stream-run/reporter.d.ts +30 -0
  356. package/dist/bootstrap/commands/stream-run/reporter.js +76 -0
  357. package/dist/bootstrap/commands/trading-schedules/cli.d.ts +120 -0
  358. package/dist/bootstrap/commands/trading-schedules/cli.js +79 -0
  359. package/dist/bootstrap/commands/trading-schedules/reporter.d.ts +13 -0
  360. package/dist/bootstrap/commands/trading-schedules/reporter.js +58 -0
  361. package/dist/bootstrap/commands/trading-status/cli.d.ts +99 -0
  362. package/dist/bootstrap/commands/trading-status/cli.js +65 -0
  363. package/dist/bootstrap/commands/trading-status/reporter.d.ts +13 -0
  364. package/dist/bootstrap/commands/trading-status/reporter.js +51 -0
  365. package/dist/bootstrap/commands/trading-statuses/cli.d.ts +99 -0
  366. package/dist/bootstrap/commands/trading-statuses/cli.js +64 -0
  367. package/dist/bootstrap/commands/trading-statuses/reporter.d.ts +14 -0
  368. package/dist/bootstrap/commands/trading-statuses/reporter.js +44 -0
  369. package/dist/bootstrap/commands/user-info/cli.d.ts +63 -0
  370. package/dist/bootstrap/commands/user-info/cli.js +50 -0
  371. package/dist/bootstrap/commands/user-info/reporter.d.ts +13 -0
  372. package/dist/bootstrap/commands/user-info/reporter.js +39 -0
  373. package/dist/bootstrap/commands/user-tariff/cli.d.ts +63 -0
  374. package/dist/bootstrap/commands/user-tariff/cli.js +50 -0
  375. package/dist/bootstrap/commands/user-tariff/reporter.d.ts +13 -0
  376. package/dist/bootstrap/commands/user-tariff/reporter.js +50 -0
  377. package/dist/bootstrap/commands/version/cli.d.ts +13 -0
  378. package/dist/bootstrap/commands/version/cli.js +22 -0
  379. package/dist/bootstrap/commands/withdraw-limits/cli.d.ts +99 -0
  380. package/dist/bootstrap/commands/withdraw-limits/cli.js +64 -0
  381. package/dist/bootstrap/commands/withdraw-limits/reporter.d.ts +13 -0
  382. package/dist/bootstrap/commands/withdraw-limits/reporter.js +59 -0
  383. package/dist/bootstrap/generated-exports.d.ts +29 -0
  384. package/dist/bootstrap/generated-exports.js +590 -0
  385. package/dist/bootstrap/index.d.ts +6 -0
  386. package/dist/bootstrap/index.js +22 -0
  387. package/dist/bootstrap/proto/compile-proto.d.ts +18 -0
  388. package/dist/bootstrap/proto/compile-proto.js +122 -0
  389. package/dist/bootstrap/sdk-config.d.ts +21 -0
  390. package/dist/bootstrap/sdk-config.js +152 -0
  391. package/dist/bootstrap/t-invest-node-sdk.d.ts +42 -0
  392. package/dist/bootstrap/t-invest-node-sdk.js +115 -0
  393. package/dist/bootstrap/unary-limit-config.d.ts +38 -0
  394. package/dist/bootstrap/unary-limit-config.js +130 -0
  395. package/dist/config.d.ts +160 -0
  396. package/dist/config.js +173 -0
  397. package/dist/config.types.d.ts +89 -0
  398. package/dist/config.types.js +13 -0
  399. package/dist/generated/common.d.ts +214 -0
  400. package/dist/generated/common.js +1336 -0
  401. package/dist/generated/google/api/field_behavior.d.ts +61 -0
  402. package/dist/generated/google/api/field_behavior.js +126 -0
  403. package/dist/generated/google/protobuf/descriptor.d.ts +1330 -0
  404. package/dist/generated/google/protobuf/descriptor.js +5984 -0
  405. package/dist/generated/google/protobuf/timestamp.d.ts +122 -0
  406. package/dist/generated/google/protobuf/timestamp.js +102 -0
  407. package/dist/generated/instruments.d.ts +3230 -0
  408. package/dist/generated/instruments.js +24246 -0
  409. package/dist/generated/marketdata.d.ts +1268 -0
  410. package/dist/generated/marketdata.js +8922 -0
  411. package/dist/generated/operations.d.ts +1165 -0
  412. package/dist/generated/operations.js +8625 -0
  413. package/dist/generated/orders.d.ts +806 -0
  414. package/dist/generated/orders.js +5639 -0
  415. package/dist/generated/sandbox.d.ts +356 -0
  416. package/dist/generated/sandbox.js +603 -0
  417. package/dist/generated/signals.d.ts +196 -0
  418. package/dist/generated/signals.js +1261 -0
  419. package/dist/generated/stoporders.d.ts +328 -0
  420. package/dist/generated/stoporders.js +1990 -0
  421. package/dist/generated/users.d.ts +453 -0
  422. package/dist/generated/users.js +2334 -0
  423. package/dist/index.d.ts +11 -0
  424. package/dist/index.js +30 -0
  425. package/dist/infrastructure/interceptor/index.d.ts +1 -0
  426. package/dist/infrastructure/interceptor/index.js +17 -0
  427. package/dist/infrastructure/interceptor/warning-interceptor.d.ts +23 -0
  428. package/dist/infrastructure/interceptor/warning-interceptor.js +38 -0
  429. package/dist/infrastructure/report-values.d.ts +19 -0
  430. package/dist/infrastructure/report-values.js +50 -0
  431. package/dist/infrastructure/transport/grpc/index.d.ts +5 -0
  432. package/dist/infrastructure/transport/grpc/index.js +13 -0
  433. package/dist/infrastructure/transport/grpc/sdk-channel.d.ts +12 -0
  434. package/dist/infrastructure/transport/grpc/sdk-channel.js +23 -0
  435. package/dist/infrastructure/transport/grpc/sdk-client.d.ts +16 -0
  436. package/dist/infrastructure/transport/grpc/sdk-client.js +33 -0
  437. package/dist/infrastructure/transport/grpc/sdk-metadata.d.ts +12 -0
  438. package/dist/infrastructure/transport/grpc/sdk-metadata.js +22 -0
  439. package/dist/infrastructure/transport/grpc/sdk-middleware.d.ts +22 -0
  440. package/dist/infrastructure/transport/grpc/sdk-middleware.js +312 -0
  441. package/dist/infrastructure/transport/grpc/tls-root-certificates.d.ts +10 -0
  442. package/dist/infrastructure/transport/grpc/tls-root-certificates.js +20 -0
  443. package/dist/infrastructure/transport/grpc/unary-limit-resolver.d.ts +22 -0
  444. package/dist/infrastructure/transport/grpc/unary-limit-resolver.js +60 -0
  445. package/dist/infrastructure/transport/grpc/unary-limits.d.ts +1 -0
  446. package/dist/infrastructure/transport/grpc/unary-limits.js +7 -0
  447. package/docs/architecture.md +378 -0
  448. package/docs/bundled-ca.md +157 -0
  449. package/docs/clean-architecture/adapters.md +173 -0
  450. package/docs/clean-architecture/api-commands.md +487 -0
  451. package/docs/clean-architecture/application.md +137 -0
  452. package/docs/clean-architecture/cli-output-boundaries.md +256 -0
  453. package/docs/clean-architecture/dto.md +153 -0
  454. package/docs/clean-architecture/index.md +89 -0
  455. package/docs/cli-stream-configuration.md +305 -0
  456. package/docs/cli-stream-reference.md +195 -0
  457. package/docs/guides/custom-unary-limiter.md +552 -0
  458. package/docs/guides/errors-and-lifecycle.md +196 -0
  459. package/docs/guides/getting-started.md +100 -0
  460. package/docs/guides/index.md +43 -0
  461. package/docs/guides/streams-and-cancellation.md +177 -0
  462. package/docs/guides/testing-with-service-definitions.md +110 -0
  463. package/docs/guides/unary-calls.md +216 -0
  464. package/docs/index.md +86 -0
  465. package/docs/limits-policy.md +201 -0
  466. package/docs/roadmap.md +204 -0
  467. package/docs/tls-policy.md +62 -0
  468. package/package.json +62 -0
  469. package/readme.md +472 -0
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Модуль CLI-команды `instrument future show`.
3
+ *
4
+ * Здесь допустимы:
5
+ * - объявление command path и option schema;
6
+ * - преобразование CLI options в generated request;
7
+ * - создание SDK через bootstrap factory и закрытие SDK resource;
8
+ *
9
+ * Здесь не должно быть ручного table/json rendering или application report contracts.
10
+ */
11
+ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
12
+ import type { FutureResponse, InstrumentRequest } from '../../../generated/instruments';
13
+ import { formatFuture } from './reporter';
14
+ type FutureSdk = {
15
+ instruments: {
16
+ futureBy(request: InstrumentRequest): Promise<FutureResponse>;
17
+ };
18
+ close(): void;
19
+ };
20
+ type FutureSdkFactory = (options: TInvestOptions) => FutureSdk;
21
+ export declare function createFutureCommand(createSdk?: FutureSdkFactory): Omit<import("icore").CommandDefinition<{
22
+ readonly token: {
23
+ readonly type: 'string';
24
+ };
25
+ readonly endpoint: {
26
+ readonly type: 'string';
27
+ };
28
+ readonly 'app-name': {
29
+ readonly type: 'string';
30
+ };
31
+ readonly insecure: {
32
+ readonly type: 'boolean';
33
+ };
34
+ readonly 'class-code': {
35
+ readonly type: 'string';
36
+ };
37
+ readonly id: {
38
+ readonly type: 'string';
39
+ };
40
+ readonly 'id-type': {
41
+ readonly type: 'string';
42
+ readonly choices: ("figi" | "position-uid" | "ticker" | "uid")[];
43
+ };
44
+ readonly format: {
45
+ readonly type: 'string';
46
+ readonly choices: readonly ["json", "table"];
47
+ readonly default: 'table';
48
+ };
49
+ }, undefined, string, readonly ["instrument", "future", "show"], undefined, void, readonly []>, "metadata"> & {
50
+ metadata?: undefined;
51
+ };
52
+ export declare const futureCommand: Omit<import("icore").CommandDefinition<{
53
+ readonly token: {
54
+ readonly type: 'string';
55
+ };
56
+ readonly endpoint: {
57
+ readonly type: 'string';
58
+ };
59
+ readonly 'app-name': {
60
+ readonly type: 'string';
61
+ };
62
+ readonly insecure: {
63
+ readonly type: 'boolean';
64
+ };
65
+ readonly 'class-code': {
66
+ readonly type: 'string';
67
+ };
68
+ readonly id: {
69
+ readonly type: 'string';
70
+ };
71
+ readonly 'id-type': {
72
+ readonly type: 'string';
73
+ readonly choices: ("figi" | "position-uid" | "ticker" | "uid")[];
74
+ };
75
+ readonly format: {
76
+ readonly type: 'string';
77
+ readonly choices: readonly ["json", "table"];
78
+ readonly default: 'table';
79
+ };
80
+ }, undefined, string, readonly ["instrument", "future", "show"], undefined, void, readonly []>, "metadata"> & {
81
+ metadata?: undefined;
82
+ };
83
+ export { formatFuture };
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * Модуль CLI-команды `instrument future show`.
4
+ *
5
+ * Здесь допустимы:
6
+ * - объявление command path и option schema;
7
+ * - преобразование CLI options в generated request;
8
+ * - создание SDK через bootstrap factory и закрытие SDK resource;
9
+ *
10
+ * Здесь не должно быть ручного table/json rendering или application report contracts.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.formatFuture = exports.futureCommand = void 0;
14
+ exports.createFutureCommand = createFutureCommand;
15
+ const contract_1 = require("../../cli/contract");
16
+ const args_1 = require("../../args");
17
+ const command_options_1 = require("../../args/command-options");
18
+ const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
19
+ const instruments_args_1 = require("../../args/instruments-args");
20
+ const reporter_1 = require("./reporter");
21
+ Object.defineProperty(exports, "formatFuture", { enumerable: true, get: function () { return reporter_1.formatFuture; } });
22
+ const futureCommandPath = ['instrument', 'future', 'show'];
23
+ const defaultFutureSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
24
+ const futureFormatOptionsSchema = {
25
+ format: {
26
+ type: 'string',
27
+ choices: reporter_1.futureFormats,
28
+ default: 'table'
29
+ }
30
+ };
31
+ const futureOptionsSchema = (0, command_options_1.withSdkOptions)(instruments_args_1.instrumentLookupOptionsSchema, futureFormatOptionsSchema);
32
+ function createFutureCommand(createSdk = defaultFutureSdkFactory) {
33
+ return contract_1.command.define({
34
+ path: futureCommandPath,
35
+ options: futureOptionsSchema,
36
+ handle({ options }) {
37
+ return runFutureCommand(options, createSdk);
38
+ }
39
+ });
40
+ }
41
+ exports.futureCommand = createFutureCommand();
42
+ async function runFutureCommand(options, createSdk) {
43
+ const { format } = options;
44
+ const request = (0, instruments_args_1.createInstrumentLookupRequestFromOptions)(options);
45
+ const sdk = createSdk((0, args_1.resolveSdkOptionsFromCommandOptions)(options));
46
+ try {
47
+ const response = await sdk.instruments.futureBy(request);
48
+ return (0, reporter_1.formatFuture)(response, format);
49
+ }
50
+ finally {
51
+ sdk.close();
52
+ }
53
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Модуль CLI-репортинга команды `instrument future show`.
3
+ *
4
+ * Здесь допустимы mapping generated DTO в application report contract и
5
+ * presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
6
+ */
7
+ import type { FutureReport, FutureReportInstrument } from '../../../application/reports';
8
+ import type { Future, FutureResponse } from '../../../generated/instruments';
9
+ export declare const futureFormats: readonly ['json', 'table'];
10
+ export type FutureFormat = typeof futureFormats[number];
11
+ export declare function createFutureReportInstrument(instrument: Future): FutureReportInstrument;
12
+ export declare function createFutureReport(response: FutureResponse): FutureReport;
13
+ export declare function renderFutureRows(report: FutureReportInstrument[]): string;
14
+ export declare function formatFutureReport(report: FutureReport, format: FutureFormat): string;
15
+ export declare function formatFuture(response: FutureResponse, format: FutureFormat): string;
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ /**
3
+ * Модуль CLI-репортинга команды `instrument future show`.
4
+ *
5
+ * Здесь допустимы mapping generated DTO в application report contract и
6
+ * presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.futureFormats = void 0;
10
+ exports.createFutureReportInstrument = createFutureReportInstrument;
11
+ exports.createFutureReport = createFutureReport;
12
+ exports.renderFutureRows = renderFutureRows;
13
+ exports.formatFutureReport = formatFutureReport;
14
+ exports.formatFuture = formatFuture;
15
+ const common_1 = require("../../../generated/common");
16
+ const report_values_1 = require("../../../infrastructure/report-values");
17
+ const icore_1 = require("icore");
18
+ exports.futureFormats = ['json', 'table'];
19
+ function createFutureReportInstrument(instrument) {
20
+ return {
21
+ figi: instrument.figi,
22
+ ticker: instrument.ticker,
23
+ classCode: instrument.classCode,
24
+ uid: instrument.uid,
25
+ positionUid: instrument.positionUid,
26
+ name: instrument.name,
27
+ currency: instrument.currency,
28
+ lot: instrument.lot,
29
+ exchange: instrument.exchange,
30
+ realExchange: (0, common_1.realExchangeToJSON)(instrument.realExchange),
31
+ sector: instrument.sector,
32
+ firstTradeDate: (0, report_values_1.formatReportDate)(instrument.firstTradeDate),
33
+ lastTradeDate: (0, report_values_1.formatReportDate)(instrument.lastTradeDate),
34
+ expirationDate: (0, report_values_1.formatReportDate)(instrument.expirationDate),
35
+ futuresType: instrument.futuresType,
36
+ assetType: instrument.assetType,
37
+ basicAsset: instrument.basicAsset,
38
+ basicAssetSize: (0, report_values_1.formatReportQuotation)(instrument.basicAssetSize),
39
+ basicAssetPositionUid: instrument.basicAssetPositionUid,
40
+ dlong: (0, report_values_1.formatReportQuotation)(instrument.dlong),
41
+ dshort: (0, report_values_1.formatReportQuotation)(instrument.dshort),
42
+ dlongMin: (0, report_values_1.formatReportQuotation)(instrument.dlongMin),
43
+ dshortMin: (0, report_values_1.formatReportQuotation)(instrument.dshortMin),
44
+ minPriceIncrement: (0, report_values_1.formatReportQuotation)(instrument.minPriceIncrement),
45
+ tradingStatus: (0, common_1.securityTradingStatusToJSON)(instrument.tradingStatus),
46
+ countryOfRisk: instrument.countryOfRisk,
47
+ countryOfRiskName: instrument.countryOfRiskName,
48
+ otcFlag: instrument.otcFlag,
49
+ buyAvailableFlag: instrument.buyAvailableFlag,
50
+ sellAvailableFlag: instrument.sellAvailableFlag,
51
+ apiTradeAvailableFlag: instrument.apiTradeAvailableFlag,
52
+ shortEnabledFlag: instrument.shortEnabledFlag,
53
+ forIisFlag: instrument.forIisFlag,
54
+ forQualInvestorFlag: instrument.forQualInvestorFlag,
55
+ weekendFlag: instrument.weekendFlag,
56
+ blockedTcaFlag: instrument.blockedTcaFlag,
57
+ first1minCandleDate: (0, report_values_1.formatReportDate)(instrument.first1minCandleDate),
58
+ first1dayCandleDate: (0, report_values_1.formatReportDate)(instrument.first1dayCandleDate)
59
+ };
60
+ }
61
+ function createFutureReport(response) {
62
+ return response.instrument === undefined
63
+ ? null
64
+ : createFutureReportInstrument(response.instrument);
65
+ }
66
+ function renderFutureRows(report) {
67
+ return (0, icore_1.renderTextTable)([
68
+ [
69
+ 'figi',
70
+ 'ticker',
71
+ 'classCode',
72
+ 'uid',
73
+ 'positionUid',
74
+ 'name',
75
+ 'currency',
76
+ 'lot',
77
+ 'exchange',
78
+ 'sector',
79
+ 'futuresType',
80
+ 'assetType',
81
+ 'expirationDate',
82
+ 'tradingStatus',
83
+ 'buyAvailableFlag',
84
+ 'sellAvailableFlag',
85
+ 'apiTradeAvailableFlag'
86
+ ],
87
+ ...report.map((instrument) => [
88
+ instrument.figi,
89
+ instrument.ticker,
90
+ instrument.classCode,
91
+ instrument.uid,
92
+ instrument.positionUid,
93
+ instrument.name,
94
+ instrument.currency,
95
+ String(instrument.lot),
96
+ instrument.exchange,
97
+ instrument.sector,
98
+ instrument.futuresType,
99
+ instrument.assetType,
100
+ instrument.expirationDate,
101
+ instrument.tradingStatus,
102
+ String(instrument.buyAvailableFlag),
103
+ String(instrument.sellAvailableFlag),
104
+ String(instrument.apiTradeAvailableFlag)
105
+ ])
106
+ ]);
107
+ }
108
+ function formatFutureReport(report, format) {
109
+ if (format === 'json') {
110
+ return (0, icore_1.renderJson)(report);
111
+ }
112
+ return renderFutureRows(report === null ? [] : [report]);
113
+ }
114
+ function formatFuture(response, format) {
115
+ return formatFutureReport(createFutureReport(response), format);
116
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Модуль CLI-команды `instrument future list`.
3
+ *
4
+ * Здесь допустимы:
5
+ * - объявление command path и option schema;
6
+ * - преобразование CLI options в generated request;
7
+ * - создание SDK через bootstrap factory и закрытие SDK resource;
8
+ *
9
+ * Здесь не должно быть ручного table/json rendering или application report contracts.
10
+ */
11
+ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
12
+ import type { FuturesResponse, InstrumentsRequest } from '../../../generated/instruments';
13
+ import { formatFutures } from './reporter';
14
+ type FuturesSdk = {
15
+ instruments: {
16
+ futures(request: InstrumentsRequest): Promise<FuturesResponse>;
17
+ };
18
+ close(): void;
19
+ };
20
+ type FuturesSdkFactory = (options: TInvestOptions) => FuturesSdk;
21
+ export declare function createFuturesCommand(createSdk?: FuturesSdkFactory): Omit<import("icore").CommandDefinition<{
22
+ readonly token: {
23
+ readonly type: 'string';
24
+ };
25
+ readonly endpoint: {
26
+ readonly type: 'string';
27
+ };
28
+ readonly 'app-name': {
29
+ readonly type: 'string';
30
+ };
31
+ readonly insecure: {
32
+ readonly type: 'boolean';
33
+ };
34
+ readonly 'instrument-status': {
35
+ readonly type: 'string';
36
+ readonly choices: ("all" | "base" | "unspecified")[];
37
+ readonly default: 'base';
38
+ };
39
+ readonly format: {
40
+ readonly type: 'string';
41
+ readonly choices: readonly ["json", "table"];
42
+ readonly default: 'table';
43
+ };
44
+ }, undefined, string, readonly ["instrument", "future", "list"], undefined, void, readonly []>, "metadata"> & {
45
+ metadata?: undefined;
46
+ };
47
+ export declare const futuresCommand: Omit<import("icore").CommandDefinition<{
48
+ readonly token: {
49
+ readonly type: 'string';
50
+ };
51
+ readonly endpoint: {
52
+ readonly type: 'string';
53
+ };
54
+ readonly 'app-name': {
55
+ readonly type: 'string';
56
+ };
57
+ readonly insecure: {
58
+ readonly type: 'boolean';
59
+ };
60
+ readonly 'instrument-status': {
61
+ readonly type: 'string';
62
+ readonly choices: ("all" | "base" | "unspecified")[];
63
+ readonly default: 'base';
64
+ };
65
+ readonly format: {
66
+ readonly type: 'string';
67
+ readonly choices: readonly ["json", "table"];
68
+ readonly default: 'table';
69
+ };
70
+ }, undefined, string, readonly ["instrument", "future", "list"], undefined, void, readonly []>, "metadata"> & {
71
+ metadata?: undefined;
72
+ };
73
+ export { formatFutures };
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * Модуль CLI-команды `instrument future list`.
4
+ *
5
+ * Здесь допустимы:
6
+ * - объявление command path и option schema;
7
+ * - преобразование CLI options в generated request;
8
+ * - создание SDK через bootstrap factory и закрытие SDK resource;
9
+ *
10
+ * Здесь не должно быть ручного table/json rendering или application report contracts.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.formatFutures = exports.futuresCommand = void 0;
14
+ exports.createFuturesCommand = createFuturesCommand;
15
+ const contract_1 = require("../../cli/contract");
16
+ const args_1 = require("../../args");
17
+ const command_options_1 = require("../../args/command-options");
18
+ const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
19
+ const instruments_args_1 = require("../../args/instruments-args");
20
+ const reporter_1 = require("./reporter");
21
+ Object.defineProperty(exports, "formatFutures", { enumerable: true, get: function () { return reporter_1.formatFutures; } });
22
+ const futuresCommandPath = ['instrument', 'future', 'list'];
23
+ const defaultFuturesSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
24
+ const futuresFormatOptionsSchema = {
25
+ format: {
26
+ type: 'string',
27
+ choices: reporter_1.futuresFormats,
28
+ default: 'table'
29
+ }
30
+ };
31
+ const futuresOptionsSchema = (0, command_options_1.withSdkOptions)(instruments_args_1.instrumentStatusOptionsSchema, futuresFormatOptionsSchema);
32
+ function createFuturesCommand(createSdk = defaultFuturesSdkFactory) {
33
+ return contract_1.command.define({
34
+ path: futuresCommandPath,
35
+ options: futuresOptionsSchema,
36
+ handle({ options }) {
37
+ return runFuturesCommand(options, createSdk);
38
+ }
39
+ });
40
+ }
41
+ exports.futuresCommand = createFuturesCommand();
42
+ async function runFuturesCommand(options, createSdk) {
43
+ const { format } = options;
44
+ const request = (0, instruments_args_1.createInstrumentsRequestFromOptions)(options);
45
+ const sdk = createSdk((0, args_1.resolveSdkOptionsFromCommandOptions)(options));
46
+ try {
47
+ const response = await sdk.instruments.futures(request);
48
+ return (0, reporter_1.formatFutures)(response.instruments, format);
49
+ }
50
+ finally {
51
+ sdk.close();
52
+ }
53
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Модуль CLI-репортинга команды `instrument future list`.
3
+ *
4
+ * Здесь допустимы mapping generated DTO в application report contract и
5
+ * presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
6
+ */
7
+ import type { FuturesReport } from '../../../application/reports';
8
+ import type { Future } from '../../../generated/instruments';
9
+ import { type FutureFormat } from '../future/reporter';
10
+ export declare const futuresFormats: readonly ["json", "table"];
11
+ export type FuturesFormat = FutureFormat;
12
+ export declare function createFuturesReport(instruments: Future[]): FuturesReport;
13
+ export declare function formatFuturesReport(report: FuturesReport, format: FuturesFormat): string;
14
+ export declare function formatFutures(instruments: Future[], format: FuturesFormat): string;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * Модуль CLI-репортинга команды `instrument future list`.
4
+ *
5
+ * Здесь допустимы mapping generated DTO в application report contract и
6
+ * presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.futuresFormats = void 0;
10
+ exports.createFuturesReport = createFuturesReport;
11
+ exports.formatFuturesReport = formatFuturesReport;
12
+ exports.formatFutures = formatFutures;
13
+ const icore_1 = require("icore");
14
+ const reporter_1 = require("../future/reporter");
15
+ exports.futuresFormats = reporter_1.futureFormats;
16
+ function createFuturesReport(instruments) {
17
+ return instruments.map(reporter_1.createFutureReportInstrument);
18
+ }
19
+ function formatFuturesReport(report, format) {
20
+ if (format === 'json') {
21
+ return (0, icore_1.renderJson)(report);
22
+ }
23
+ return (0, reporter_1.renderFutureRows)(report);
24
+ }
25
+ function formatFutures(instruments, format) {
26
+ return formatFuturesReport(createFuturesReport(instruments), format);
27
+ }
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Модуль CLI-команды `instrument future margin`.
3
+ *
4
+ * Здесь допустимы:
5
+ * - объявление command path и option schema;
6
+ * - преобразование CLI options в generated request;
7
+ * - создание SDK через bootstrap factory и закрытие SDK resource;
8
+ *
9
+ * Здесь не должно быть ручного table/json rendering или application report contracts.
10
+ */
11
+ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
12
+ import { GetFuturesMarginRequest, type GetFuturesMarginResponse } from '../../../generated/instruments';
13
+ import type { InferOptions } from 'icore';
14
+ import type { CommandRequestOptions } from '../../args/command-options';
15
+ import { formatFuturesMargin } from './reporter';
16
+ type FuturesMarginSdk = {
17
+ instruments: {
18
+ getFuturesMargin(request: GetFuturesMarginRequest): Promise<GetFuturesMarginResponse>;
19
+ };
20
+ close(): void;
21
+ };
22
+ type FuturesMarginSdkFactory = (options: TInvestOptions) => FuturesMarginSdk;
23
+ declare const futuresMarginOptionsSchema: {
24
+ readonly token: {
25
+ readonly type: 'string';
26
+ };
27
+ readonly endpoint: {
28
+ readonly type: 'string';
29
+ };
30
+ readonly 'app-name': {
31
+ readonly type: 'string';
32
+ };
33
+ readonly insecure: {
34
+ readonly type: 'boolean';
35
+ };
36
+ readonly 'instrument-id': {
37
+ readonly type: 'string';
38
+ };
39
+ readonly figi: {
40
+ readonly type: 'string';
41
+ };
42
+ readonly format: {
43
+ readonly type: 'string';
44
+ readonly choices: readonly ["json", "table"];
45
+ readonly default: 'table';
46
+ };
47
+ };
48
+ type FuturesMarginOptions = InferOptions<typeof futuresMarginOptionsSchema>;
49
+ type FuturesMarginRequestOptions = CommandRequestOptions<FuturesMarginOptions, 'instrument-id' | 'figi'>;
50
+ export declare function createFuturesMarginCommand(createSdk?: FuturesMarginSdkFactory): Omit<import("icore").CommandDefinition<{
51
+ readonly token: {
52
+ readonly type: 'string';
53
+ };
54
+ readonly endpoint: {
55
+ readonly type: 'string';
56
+ };
57
+ readonly 'app-name': {
58
+ readonly type: 'string';
59
+ };
60
+ readonly insecure: {
61
+ readonly type: 'boolean';
62
+ };
63
+ readonly 'instrument-id': {
64
+ readonly type: 'string';
65
+ };
66
+ readonly figi: {
67
+ readonly type: 'string';
68
+ };
69
+ readonly format: {
70
+ readonly type: 'string';
71
+ readonly choices: readonly ["json", "table"];
72
+ readonly default: 'table';
73
+ };
74
+ }, undefined, string, readonly ["instrument", "future", "margin"], undefined, void, readonly []>, "metadata"> & {
75
+ metadata?: undefined;
76
+ };
77
+ export declare const futuresMarginCommand: Omit<import("icore").CommandDefinition<{
78
+ readonly token: {
79
+ readonly type: 'string';
80
+ };
81
+ readonly endpoint: {
82
+ readonly type: 'string';
83
+ };
84
+ readonly 'app-name': {
85
+ readonly type: 'string';
86
+ };
87
+ readonly insecure: {
88
+ readonly type: 'boolean';
89
+ };
90
+ readonly 'instrument-id': {
91
+ readonly type: 'string';
92
+ };
93
+ readonly figi: {
94
+ readonly type: 'string';
95
+ };
96
+ readonly format: {
97
+ readonly type: 'string';
98
+ readonly choices: readonly ["json", "table"];
99
+ readonly default: 'table';
100
+ };
101
+ }, undefined, string, readonly ["instrument", "future", "margin"], undefined, void, readonly []>, "metadata"> & {
102
+ metadata?: undefined;
103
+ };
104
+ export { formatFuturesMargin };
105
+ export declare function createFuturesMarginRequest(options: FuturesMarginRequestOptions): GetFuturesMarginRequest;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ /**
3
+ * Модуль CLI-команды `instrument future margin`.
4
+ *
5
+ * Здесь допустимы:
6
+ * - объявление command path и option schema;
7
+ * - преобразование CLI options в generated request;
8
+ * - создание SDK через bootstrap factory и закрытие SDK resource;
9
+ *
10
+ * Здесь не должно быть ручного table/json rendering или application report contracts.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.formatFuturesMargin = exports.futuresMarginCommand = void 0;
14
+ exports.createFuturesMarginCommand = createFuturesMarginCommand;
15
+ exports.createFuturesMarginRequest = createFuturesMarginRequest;
16
+ const instruments_1 = require("../../../generated/instruments");
17
+ const contract_1 = require("../../cli/contract");
18
+ const args_1 = require("../../args");
19
+ const command_options_1 = require("../../args/command-options");
20
+ const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
21
+ const instrument_id_options_1 = require("../../args/instrument-id-options");
22
+ const reporter_1 = require("./reporter");
23
+ Object.defineProperty(exports, "formatFuturesMargin", { enumerable: true, get: function () { return reporter_1.formatFuturesMargin; } });
24
+ const futuresMarginCommandPath = ['instrument', 'future', 'margin'];
25
+ const defaultFuturesMarginSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
26
+ const futuresMarginRequestOptionsSchema = {
27
+ ...instrument_id_options_1.instrumentIdWithDeprecatedFigiOptionsSchema
28
+ };
29
+ const futuresMarginFormatOptionsSchema = {
30
+ format: {
31
+ type: 'string',
32
+ choices: reporter_1.futuresMarginFormats,
33
+ default: 'table'
34
+ }
35
+ };
36
+ const futuresMarginOptionsSchema = (0, command_options_1.withSdkOptions)(futuresMarginRequestOptionsSchema, futuresMarginFormatOptionsSchema);
37
+ function createFuturesMarginCommand(createSdk = defaultFuturesMarginSdkFactory) {
38
+ return contract_1.command.define({
39
+ path: futuresMarginCommandPath,
40
+ options: futuresMarginOptionsSchema,
41
+ handle({ options }) {
42
+ return runFuturesMarginCommand(options, createSdk);
43
+ }
44
+ });
45
+ }
46
+ exports.futuresMarginCommand = createFuturesMarginCommand();
47
+ async function runFuturesMarginCommand(options, createSdk) {
48
+ const request = createFuturesMarginRequest(options);
49
+ const { format } = options;
50
+ const sdk = createSdk((0, args_1.resolveSdkOptionsFromCommandOptions)(options));
51
+ try {
52
+ const response = await sdk.instruments.getFuturesMargin(request);
53
+ return (0, reporter_1.formatFuturesMargin)(response, format);
54
+ }
55
+ finally {
56
+ sdk.close();
57
+ }
58
+ }
59
+ function createFuturesMarginRequest(options) {
60
+ const instrumentId = (0, instrument_id_options_1.resolveInstrumentIdOption)(options);
61
+ return instruments_1.GetFuturesMarginRequest.create({
62
+ instrumentId
63
+ });
64
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Модуль CLI-репортинга команды `instrument future margin`.
3
+ *
4
+ * Здесь допустимы mapping generated DTO в application report contract и
5
+ * presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
6
+ */
7
+ import type { FuturesMarginReport } from '../../../application/reports';
8
+ import type { GetFuturesMarginResponse } from '../../../generated/instruments';
9
+ export declare const futuresMarginFormats: readonly ['json', 'table'];
10
+ export type FuturesMarginFormat = typeof futuresMarginFormats[number];
11
+ export declare function createFuturesMarginReport(response: GetFuturesMarginResponse): FuturesMarginReport;
12
+ export declare function formatFuturesMarginReport(report: FuturesMarginReport, format: FuturesMarginFormat): string;
13
+ export declare function formatFuturesMargin(response: GetFuturesMarginResponse, format: FuturesMarginFormat): string;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /**
3
+ * Модуль CLI-репортинга команды `instrument future margin`.
4
+ *
5
+ * Здесь допустимы mapping generated DTO в application report contract и
6
+ * presentation formatting. Разбор command options и запуск SDK остаются в `cli.ts`.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.futuresMarginFormats = void 0;
10
+ exports.createFuturesMarginReport = createFuturesMarginReport;
11
+ exports.formatFuturesMarginReport = formatFuturesMarginReport;
12
+ exports.formatFuturesMargin = formatFuturesMargin;
13
+ const report_values_1 = require("../../../infrastructure/report-values");
14
+ const icore_1 = require("icore");
15
+ exports.futuresMarginFormats = ['json', 'table'];
16
+ function createFuturesMarginReport(response) {
17
+ return {
18
+ initialMarginOnBuy: (0, report_values_1.toReportMoney)(response.initialMarginOnBuy),
19
+ initialMarginOnSell: (0, report_values_1.toReportMoney)(response.initialMarginOnSell),
20
+ minPriceIncrement: (0, report_values_1.formatReportDecimal)(response.minPriceIncrement),
21
+ minPriceIncrementAmount: (0, report_values_1.formatReportDecimal)(response.minPriceIncrementAmount)
22
+ };
23
+ }
24
+ function formatFuturesMarginReport(report, format) {
25
+ if (format === 'json') {
26
+ return (0, icore_1.renderJson)(report);
27
+ }
28
+ return (0, icore_1.renderTextTable)([
29
+ ['initialMarginOnBuy', 'initialMarginOnSell', 'minPriceIncrement', 'minPriceIncrementAmount'],
30
+ [
31
+ (0, report_values_1.formatReportMoneyText)(report.initialMarginOnBuy),
32
+ (0, report_values_1.formatReportMoneyText)(report.initialMarginOnSell),
33
+ report.minPriceIncrement,
34
+ report.minPriceIncrementAmount
35
+ ]
36
+ ]);
37
+ }
38
+ function formatFuturesMargin(response, format) {
39
+ return formatFuturesMarginReport(createFuturesMarginReport(response), format);
40
+ }