snaptrade-typescript-sdk 9.0.200 → 10.0.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 (427) hide show
  1. package/README.md +40 -2
  2. package/dist/chunk-e9Ob2GDo.mjs +26 -0
  3. package/dist/index.cjs +6594 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +1 -0
  6. package/dist/index.d.mts +10422 -0
  7. package/dist/index.d.ts +1 -5
  8. package/dist/index.mjs +6527 -0
  9. package/dist/index.mjs.map +1 -0
  10. package/package.json +27 -13
  11. package/dist/api/account-information-api-generated.d.ts +0 -950
  12. package/dist/api/account-information-api-generated.js +0 -1372
  13. package/dist/api/account-information-api.d.ts +0 -4
  14. package/dist/api/account-information-api.js +0 -22
  15. package/dist/api/api-status-api-generated.d.ts +0 -59
  16. package/dist/api/api-status-api-generated.js +0 -133
  17. package/dist/api/api-status-api.d.ts +0 -4
  18. package/dist/api/api-status-api.js +0 -22
  19. package/dist/api/authentication-api-generated.d.ts +0 -241
  20. package/dist/api/authentication-api-generated.js +0 -482
  21. package/dist/api/authentication-api.d.ts +0 -4
  22. package/dist/api/authentication-api.js +0 -22
  23. package/dist/api/connections-api-generated.d.ts +0 -576
  24. package/dist/api/connections-api-generated.js +0 -868
  25. package/dist/api/connections-api.d.ts +0 -4
  26. package/dist/api/connections-api.js +0 -22
  27. package/dist/api/options-api-generated.d.ts +0 -90
  28. package/dist/api/options-api-generated.js +0 -158
  29. package/dist/api/options-api.d.ts +0 -4
  30. package/dist/api/options-api.js +0 -22
  31. package/dist/api/reference-data-api-generated.d.ts +0 -497
  32. package/dist/api/reference-data-api-generated.js +0 -973
  33. package/dist/api/reference-data-api.d.ts +0 -4
  34. package/dist/api/reference-data-api.js +0 -22
  35. package/dist/api/trading-api-generated.d.ts +0 -1058
  36. package/dist/api/trading-api-generated.js +0 -1688
  37. package/dist/api/trading-api.d.ts +0 -4
  38. package/dist/api/trading-api.js +0 -22
  39. package/dist/api/transactions-and-reporting-api-generated.d.ts +0 -215
  40. package/dist/api/transactions-and-reporting-api-generated.js +0 -299
  41. package/dist/api/transactions-and-reporting-api.d.ts +0 -4
  42. package/dist/api/transactions-and-reporting-api.js +0 -22
  43. package/dist/api.d.ts +0 -8
  44. package/dist/api.js +0 -36
  45. package/dist/base.d.ts +0 -44
  46. package/dist/base.js +0 -60
  47. package/dist/browser.js +0 -2
  48. package/dist/browser.js.LICENSE.txt +0 -1
  49. package/dist/client-custom.d.ts +0 -4
  50. package/dist/client-custom.js +0 -7
  51. package/dist/client.d.ts +0 -14
  52. package/dist/client.js +0 -31
  53. package/dist/common.d.ts +0 -61
  54. package/dist/common.js +0 -220
  55. package/dist/configuration.d.ts +0 -98
  56. package/dist/configuration.js +0 -53
  57. package/dist/error.d.ts +0 -46
  58. package/dist/error.js +0 -105
  59. package/dist/index.js +0 -33
  60. package/dist/jest.config.d.ts +0 -3
  61. package/dist/jest.config.js +0 -13
  62. package/dist/mock.test.d.ts +0 -1
  63. package/dist/mock.test.js +0 -29
  64. package/dist/models/account-balance-total.d.ts +0 -19
  65. package/dist/models/account-balance-total.js +0 -2
  66. package/dist/models/account-balance.d.ts +0 -14
  67. package/dist/models/account-balance.js +0 -2
  68. package/dist/models/account-holdings-account.d.ts +0 -51
  69. package/dist/models/account-holdings-account.js +0 -2
  70. package/dist/models/account-holdings.d.ts +0 -37
  71. package/dist/models/account-holdings.js +0 -2
  72. package/dist/models/account-information-get-user-account-order-detail-request.d.ts +0 -13
  73. package/dist/models/account-information-get-user-account-order-detail-request.js +0 -2
  74. package/dist/models/account-order-record-child-brokerage-order-ids.d.ts +0 -19
  75. package/dist/models/account-order-record-child-brokerage-order-ids.js +0 -2
  76. package/dist/models/account-order-record-leg-instrument.d.ts +0 -38
  77. package/dist/models/account-order-record-leg-instrument.js +0 -2
  78. package/dist/models/account-order-record-leg.d.ts +0 -58
  79. package/dist/models/account-order-record-leg.js +0 -2
  80. package/dist/models/account-order-record-option-symbol.d.ts +0 -52
  81. package/dist/models/account-order-record-option-symbol.js +0 -2
  82. package/dist/models/account-order-record-quote-currency.d.ts +0 -25
  83. package/dist/models/account-order-record-quote-currency.js +0 -2
  84. package/dist/models/account-order-record-quote-universal-symbol.d.ts +0 -73
  85. package/dist/models/account-order-record-quote-universal-symbol.js +0 -2
  86. package/dist/models/account-order-record-status-v2.d.ts +0 -6
  87. package/dist/models/account-order-record-status-v2.js +0 -2
  88. package/dist/models/account-order-record-status.d.ts +0 -6
  89. package/dist/models/account-order-record-status.js +0 -2
  90. package/dist/models/account-order-record-trailing-stop.d.ts +0 -21
  91. package/dist/models/account-order-record-trailing-stop.js +0 -2
  92. package/dist/models/account-order-record-universal-symbol.d.ts +0 -73
  93. package/dist/models/account-order-record-universal-symbol.js +0 -2
  94. package/dist/models/account-order-record-v2.d.ts +0 -97
  95. package/dist/models/account-order-record-v2.js +0 -2
  96. package/dist/models/account-order-record.d.ts +0 -168
  97. package/dist/models/account-order-record.js +0 -2
  98. package/dist/models/account-orders-v2-response.d.ts +0 -15
  99. package/dist/models/account-orders-v2-response.js +0 -2
  100. package/dist/models/account-position.d.ts +0 -52
  101. package/dist/models/account-position.js +0 -2
  102. package/dist/models/account-simple.d.ts +0 -39
  103. package/dist/models/account-simple.js +0 -2
  104. package/dist/models/account-sync-status.d.ts +0 -21
  105. package/dist/models/account-sync-status.js +0 -2
  106. package/dist/models/account-universal-activity-currency.d.ts +0 -25
  107. package/dist/models/account-universal-activity-currency.js +0 -2
  108. package/dist/models/account-universal-activity-option-symbol.d.ts +0 -52
  109. package/dist/models/account-universal-activity-option-symbol.js +0 -2
  110. package/dist/models/account-universal-activity-symbol.d.ts +0 -65
  111. package/dist/models/account-universal-activity-symbol.js +0 -2
  112. package/dist/models/account-universal-activity.d.ts +0 -107
  113. package/dist/models/account-universal-activity.js +0 -2
  114. package/dist/models/account-value-history-item.d.ts +0 -20
  115. package/dist/models/account-value-history-item.js +0 -2
  116. package/dist/models/account-value-history-response.d.ts +0 -21
  117. package/dist/models/account-value-history-response.js +0 -2
  118. package/dist/models/account.d.ts +0 -126
  119. package/dist/models/account.js +0 -2
  120. package/dist/models/action-strict-with-options.d.ts +0 -6
  121. package/dist/models/action-strict-with-options.js +0 -2
  122. package/dist/models/action-strict.d.ts +0 -6
  123. package/dist/models/action-strict.js +0 -2
  124. package/dist/models/adr-instrument.d.ts +0 -59
  125. package/dist/models/adr-instrument.js +0 -2
  126. package/dist/models/all-account-positions-response.d.ts +0 -15
  127. package/dist/models/all-account-positions-response.js +0 -2
  128. package/dist/models/authentication-login-snap-trade-user200-response.d.ts +0 -7
  129. package/dist/models/authentication-login-snap-trade-user200-response.js +0 -2
  130. package/dist/models/balance-currency.d.ts +0 -25
  131. package/dist/models/balance-currency.js +0 -2
  132. package/dist/models/balance.d.ts +0 -27
  133. package/dist/models/balance.js +0 -2
  134. package/dist/models/brokerage-authorization-disabled-confirmation.d.ts +0 -14
  135. package/dist/models/brokerage-authorization-disabled-confirmation.js +0 -2
  136. package/dist/models/brokerage-authorization-refresh-confirmation.d.ts +0 -14
  137. package/dist/models/brokerage-authorization-refresh-confirmation.js +0 -2
  138. package/dist/models/brokerage-authorization-transactions-sync-confirmation.d.ts +0 -14
  139. package/dist/models/brokerage-authorization-transactions-sync-confirmation.js +0 -2
  140. package/dist/models/brokerage-authorization-type-read-only-brokerage.d.ts +0 -26
  141. package/dist/models/brokerage-authorization-type-read-only-brokerage.js +0 -2
  142. package/dist/models/brokerage-authorization-type-read-only.d.ts +0 -36
  143. package/dist/models/brokerage-authorization-type-read-only.js +0 -2
  144. package/dist/models/brokerage-authorization.d.ts +0 -73
  145. package/dist/models/brokerage-authorization.js +0 -2
  146. package/dist/models/brokerage-instrument.d.ts +0 -38
  147. package/dist/models/brokerage-instrument.js +0 -2
  148. package/dist/models/brokerage-instruments-response.d.ts +0 -15
  149. package/dist/models/brokerage-instruments-response.js +0 -2
  150. package/dist/models/brokerage-type.d.ts +0 -20
  151. package/dist/models/brokerage-type.js +0 -2
  152. package/dist/models/brokerage.d.ts +0 -122
  153. package/dist/models/brokerage.js +0 -2
  154. package/dist/models/cancel-order-response.d.ts +0 -22
  155. package/dist/models/cancel-order-response.js +0 -2
  156. package/dist/models/cef-instrument.d.ts +0 -59
  157. package/dist/models/cef-instrument.js +0 -2
  158. package/dist/models/child-brokerage-order-ids.d.ts +0 -20
  159. package/dist/models/child-brokerage-order-ids.js +0 -2
  160. package/dist/models/complex-order-leg.d.ts +0 -62
  161. package/dist/models/complex-order-leg.js +0 -2
  162. package/dist/models/complex-order-response.d.ts +0 -22
  163. package/dist/models/complex-order-response.js +0 -2
  164. package/dist/models/connections-session-events200-response-inner.d.ts +0 -6
  165. package/dist/models/connections-session-events200-response-inner.js +0 -2
  166. package/dist/models/crypto-instrument.d.ts +0 -59
  167. package/dist/models/crypto-instrument.js +0 -2
  168. package/dist/models/crypto-order-form.d.ts +0 -66
  169. package/dist/models/crypto-order-form.js +0 -2
  170. package/dist/models/crypto-order-preview-estimated-fee.d.ts +0 -20
  171. package/dist/models/crypto-order-preview-estimated-fee.js +0 -2
  172. package/dist/models/crypto-order-preview.d.ts +0 -15
  173. package/dist/models/crypto-order-preview.js +0 -2
  174. package/dist/models/crypto-trading-instrument.d.ts +0 -22
  175. package/dist/models/crypto-trading-instrument.js +0 -2
  176. package/dist/models/cryptocurrency-pair-quote.d.ts +0 -32
  177. package/dist/models/cryptocurrency-pair-quote.js +0 -2
  178. package/dist/models/cryptocurrency-pair.d.ts +0 -32
  179. package/dist/models/cryptocurrency-pair.js +0 -2
  180. package/dist/models/currency.d.ts +0 -26
  181. package/dist/models/currency.js +0 -2
  182. package/dist/models/delete-connection-confirmation.d.ts +0 -20
  183. package/dist/models/delete-connection-confirmation.js +0 -2
  184. package/dist/models/delete-user-response.d.ts +0 -26
  185. package/dist/models/delete-user-response.js +0 -2
  186. package/dist/models/dividend-at-date.d.ts +0 -26
  187. package/dist/models/dividend-at-date.js +0 -2
  188. package/dist/models/encrypted-response-encrypted-message-data.d.ts +0 -26
  189. package/dist/models/encrypted-response-encrypted-message-data.js +0 -2
  190. package/dist/models/encrypted-response.d.ts +0 -20
  191. package/dist/models/encrypted-response.js +0 -2
  192. package/dist/models/etf-instrument.d.ts +0 -59
  193. package/dist/models/etf-instrument.js +0 -2
  194. package/dist/models/exchange-rate-pairs.d.ts +0 -27
  195. package/dist/models/exchange-rate-pairs.js +0 -2
  196. package/dist/models/exchange.d.ts +0 -56
  197. package/dist/models/exchange.js +0 -2
  198. package/dist/models/figi-instrument.d.ts +0 -20
  199. package/dist/models/figi-instrument.js +0 -2
  200. package/dist/models/future-instrument.d.ts +0 -64
  201. package/dist/models/future-instrument.js +0 -2
  202. package/dist/models/holdings-status.d.ts +0 -19
  203. package/dist/models/holdings-status.js +0 -2
  204. package/dist/models/index.d.ts +0 -173
  205. package/dist/models/index.js +0 -189
  206. package/dist/models/instrument.d.ts +0 -33
  207. package/dist/models/instrument.js +0 -2
  208. package/dist/models/login-redirect-uri.d.ts +0 -19
  209. package/dist/models/login-redirect-uri.js +0 -2
  210. package/dist/models/manual-trade-and-impact.d.ts +0 -29
  211. package/dist/models/manual-trade-and-impact.js +0 -2
  212. package/dist/models/manual-trade-balance.d.ts +0 -28
  213. package/dist/models/manual-trade-balance.js +0 -2
  214. package/dist/models/manual-trade-form-bracket.d.ts +0 -67
  215. package/dist/models/manual-trade-form-bracket.js +0 -2
  216. package/dist/models/manual-trade-form-complex.d.ts +0 -28
  217. package/dist/models/manual-trade-form-complex.js +0 -2
  218. package/dist/models/manual-trade-form-notional-value.d.ts +0 -6
  219. package/dist/models/manual-trade-form-notional-value.js +0 -2
  220. package/dist/models/manual-trade-form-with-options.d.ts +0 -78
  221. package/dist/models/manual-trade-form-with-options.js +0 -2
  222. package/dist/models/manual-trade-form.d.ts +0 -65
  223. package/dist/models/manual-trade-form.js +0 -2
  224. package/dist/models/manual-trade-impact.d.ts +0 -38
  225. package/dist/models/manual-trade-impact.js +0 -2
  226. package/dist/models/manual-trade-replace-form.d.ts +0 -58
  227. package/dist/models/manual-trade-replace-form.js +0 -2
  228. package/dist/models/manual-trade-symbol.d.ts +0 -49
  229. package/dist/models/manual-trade-symbol.js +0 -2
  230. package/dist/models/manual-trade.d.ts +0 -60
  231. package/dist/models/manual-trade.js +0 -2
  232. package/dist/models/mleg-action-strict.d.ts +0 -6
  233. package/dist/models/mleg-action-strict.js +0 -2
  234. package/dist/models/mleg-instrument-type.d.ts +0 -6
  235. package/dist/models/mleg-instrument-type.js +0 -2
  236. package/dist/models/mleg-leg.d.ts +0 -28
  237. package/dist/models/mleg-leg.js +0 -2
  238. package/dist/models/mleg-order-response.d.ts +0 -21
  239. package/dist/models/mleg-order-response.js +0 -2
  240. package/dist/models/mleg-order-type-strict.d.ts +0 -6
  241. package/dist/models/mleg-order-type-strict.js +0 -2
  242. package/dist/models/mleg-price-effect-strict.d.ts +0 -6
  243. package/dist/models/mleg-price-effect-strict.js +0 -2
  244. package/dist/models/mleg-trade-form.d.ts +0 -47
  245. package/dist/models/mleg-trade-form.js +0 -2
  246. package/dist/models/mleg-trading-instrument.d.ts +0 -21
  247. package/dist/models/mleg-trading-instrument.js +0 -2
  248. package/dist/models/model400-failed-request-response.d.ts +0 -20
  249. package/dist/models/model400-failed-request-response.js +0 -2
  250. package/dist/models/model401-failed-request-response.d.ts +0 -20
  251. package/dist/models/model401-failed-request-response.js +0 -2
  252. package/dist/models/model402-brokerage-auth-already-disabled-exception.d.ts +0 -20
  253. package/dist/models/model402-brokerage-auth-already-disabled-exception.js +0 -2
  254. package/dist/models/model402-brokerage-auth-disabled-response.d.ts +0 -20
  255. package/dist/models/model402-brokerage-auth-disabled-response.js +0 -2
  256. package/dist/models/model403-failed-request-response.d.ts +0 -20
  257. package/dist/models/model403-failed-request-response.js +0 -2
  258. package/dist/models/model403-feature-not-enabled-response.d.ts +0 -20
  259. package/dist/models/model403-feature-not-enabled-response.js +0 -2
  260. package/dist/models/model404-failed-request-response.d.ts +0 -20
  261. package/dist/models/model404-failed-request-response.js +0 -2
  262. package/dist/models/model425-failed-request-response.d.ts +0 -20
  263. package/dist/models/model425-failed-request-response.js +0 -2
  264. package/dist/models/model500-unexpected-exception-response.d.ts +0 -26
  265. package/dist/models/model500-unexpected-exception-response.js +0 -2
  266. package/dist/models/monthly-dividends.d.ts +0 -21
  267. package/dist/models/monthly-dividends.js +0 -2
  268. package/dist/models/mutual-fund-instrument.d.ts +0 -59
  269. package/dist/models/mutual-fund-instrument.js +0 -2
  270. package/dist/models/net-contributions.d.ts +0 -26
  271. package/dist/models/net-contributions.js +0 -2
  272. package/dist/models/net-dividend.d.ts +0 -27
  273. package/dist/models/net-dividend.js +0 -2
  274. package/dist/models/notional-value.d.ts +0 -6
  275. package/dist/models/notional-value.js +0 -2
  276. package/dist/models/option-brokerage-symbol.d.ts +0 -29
  277. package/dist/models/option-brokerage-symbol.js +0 -2
  278. package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.d.ts +0 -26
  279. package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.js +0 -2
  280. package/dist/models/option-chain-inner-chain-per-root-inner.d.ts +0 -27
  281. package/dist/models/option-chain-inner-chain-per-root-inner.js +0 -2
  282. package/dist/models/option-chain-inner.d.ts +0 -39
  283. package/dist/models/option-chain-inner.js +0 -2
  284. package/dist/models/option-impact.d.ts +0 -28
  285. package/dist/models/option-impact.js +0 -2
  286. package/dist/models/option-instrument.d.ts +0 -60
  287. package/dist/models/option-instrument.js +0 -2
  288. package/dist/models/option-leg.d.ts +0 -28
  289. package/dist/models/option-leg.js +0 -2
  290. package/dist/models/option-quote-greeks.d.ts +0 -32
  291. package/dist/models/option-quote-greeks.js +0 -2
  292. package/dist/models/option-quote.d.ts +0 -39
  293. package/dist/models/option-quote.js +0 -2
  294. package/dist/models/option-strategy-legs-inner.d.ts +0 -31
  295. package/dist/models/option-strategy-legs-inner.js +0 -2
  296. package/dist/models/option-strategy.d.ts +0 -40
  297. package/dist/models/option-strategy.js +0 -2
  298. package/dist/models/options-position-currency.d.ts +0 -25
  299. package/dist/models/options-position-currency.js +0 -2
  300. package/dist/models/options-position.d.ts +0 -41
  301. package/dist/models/options-position.js +0 -2
  302. package/dist/models/options-symbol.d.ts +0 -53
  303. package/dist/models/options-symbol.js +0 -2
  304. package/dist/models/order-type-strict.d.ts +0 -6
  305. package/dist/models/order-type-strict.js +0 -2
  306. package/dist/models/order-updated-response-order.d.ts +0 -167
  307. package/dist/models/order-updated-response-order.js +0 -2
  308. package/dist/models/order-updated-response.d.ts +0 -21
  309. package/dist/models/order-updated-response.js +0 -2
  310. package/dist/models/other-instrument.d.ts +0 -59
  311. package/dist/models/other-instrument.js +0 -2
  312. package/dist/models/paginated-universal-activity.d.ts +0 -22
  313. package/dist/models/paginated-universal-activity.js +0 -2
  314. package/dist/models/pagination-details.d.ts +0 -26
  315. package/dist/models/pagination-details.js +0 -2
  316. package/dist/models/partner-data.d.ts +0 -82
  317. package/dist/models/partner-data.js +0 -2
  318. package/dist/models/past-value.d.ts +0 -26
  319. package/dist/models/past-value.js +0 -2
  320. package/dist/models/performance-custom.d.ts +0 -127
  321. package/dist/models/performance-custom.js +0 -2
  322. package/dist/models/position-currency.d.ts +0 -25
  323. package/dist/models/position-currency.js +0 -2
  324. package/dist/models/position-symbol.d.ts +0 -50
  325. package/dist/models/position-symbol.js +0 -2
  326. package/dist/models/position.d.ts +0 -66
  327. package/dist/models/position.js +0 -2
  328. package/dist/models/rate-of-return-object.d.ts +0 -28
  329. package/dist/models/rate-of-return-object.js +0 -2
  330. package/dist/models/rate-of-return-response.d.ts +0 -15
  331. package/dist/models/rate-of-return-response.js +0 -2
  332. package/dist/models/recent-orders-response.d.ts +0 -15
  333. package/dist/models/recent-orders-response.js +0 -2
  334. package/dist/models/security-type.d.ts +0 -33
  335. package/dist/models/security-type.js +0 -2
  336. package/dist/models/session-event.d.ts +0 -52
  337. package/dist/models/session-event.js +0 -2
  338. package/dist/models/simple-order-form.d.ts +0 -67
  339. package/dist/models/simple-order-form.js +0 -2
  340. package/dist/models/snap-trade-holdings-account.d.ts +0 -60
  341. package/dist/models/snap-trade-holdings-account.js +0 -2
  342. package/dist/models/snap-trade-holdings-total-value.d.ts +0 -20
  343. package/dist/models/snap-trade-holdings-total-value.js +0 -2
  344. package/dist/models/snap-trade-login-user-request-body.d.ts +0 -58
  345. package/dist/models/snap-trade-login-user-request-body.js +0 -2
  346. package/dist/models/snap-trade-register-user-request-body.d.ts +0 -13
  347. package/dist/models/snap-trade-register-user-request-body.js +0 -2
  348. package/dist/models/status.d.ts +0 -26
  349. package/dist/models/status.js +0 -2
  350. package/dist/models/stock-instrument-figi-instrument.d.ts +0 -19
  351. package/dist/models/stock-instrument-figi-instrument.js +0 -2
  352. package/dist/models/stock-instrument.d.ts +0 -59
  353. package/dist/models/stock-instrument.js +0 -2
  354. package/dist/models/stop-loss.d.ts +0 -20
  355. package/dist/models/stop-loss.js +0 -2
  356. package/dist/models/strategy-order-record.d.ts +0 -77
  357. package/dist/models/strategy-order-record.js +0 -2
  358. package/dist/models/strategy-quotes-greek.d.ts +0 -38
  359. package/dist/models/strategy-quotes-greek.js +0 -2
  360. package/dist/models/strategy-quotes.d.ts +0 -46
  361. package/dist/models/strategy-quotes.js +0 -2
  362. package/dist/models/sub-period-return-rate.d.ts +0 -26
  363. package/dist/models/sub-period-return-rate.js +0 -2
  364. package/dist/models/symbol-currency.d.ts +0 -25
  365. package/dist/models/symbol-currency.js +0 -2
  366. package/dist/models/symbol-exchange.d.ts +0 -55
  367. package/dist/models/symbol-exchange.js +0 -2
  368. package/dist/models/symbol-query.d.ts +0 -13
  369. package/dist/models/symbol-query.js +0 -2
  370. package/dist/models/symbol.d.ts +0 -66
  371. package/dist/models/symbol.js +0 -2
  372. package/dist/models/symbols-quotes-inner.d.ts +0 -44
  373. package/dist/models/symbols-quotes-inner.js +0 -2
  374. package/dist/models/take-profit.d.ts +0 -14
  375. package/dist/models/take-profit.js +0 -2
  376. package/dist/models/tax-lot.d.ts +0 -50
  377. package/dist/models/tax-lot.js +0 -2
  378. package/dist/models/time-in-force-strict.d.ts +0 -6
  379. package/dist/models/time-in-force-strict.js +0 -2
  380. package/dist/models/trade-detection-cancel-subscription-response.d.ts +0 -14
  381. package/dist/models/trade-detection-cancel-subscription-response.js +0 -2
  382. package/dist/models/trade-detection-subscription.d.ts +0 -26
  383. package/dist/models/trade-detection-subscription.js +0 -2
  384. package/dist/models/trading-instrument.d.ts +0 -22
  385. package/dist/models/trading-instrument.js +0 -2
  386. package/dist/models/trading-search-cryptocurrency-pair-instruments200-response.d.ts +0 -15
  387. package/dist/models/trading-search-cryptocurrency-pair-instruments200-response.js +0 -2
  388. package/dist/models/trading-session.d.ts +0 -6
  389. package/dist/models/trading-session.js +0 -2
  390. package/dist/models/trailing-stop.d.ts +0 -22
  391. package/dist/models/trailing-stop.js +0 -2
  392. package/dist/models/transactions-status.d.ts +0 -25
  393. package/dist/models/transactions-status.js +0 -2
  394. package/dist/models/underlying-option-instrument.d.ts +0 -27
  395. package/dist/models/underlying-option-instrument.js +0 -2
  396. package/dist/models/underlying-symbol-exchange.d.ts +0 -61
  397. package/dist/models/underlying-symbol-exchange.js +0 -2
  398. package/dist/models/underlying-symbol-type.d.ts +0 -32
  399. package/dist/models/underlying-symbol-type.js +0 -2
  400. package/dist/models/underlying-symbol.d.ts +0 -74
  401. package/dist/models/underlying-symbol.js +0 -2
  402. package/dist/models/universal-activity.d.ts +0 -114
  403. package/dist/models/universal-activity.js +0 -2
  404. package/dist/models/universal-symbol.d.ts +0 -74
  405. package/dist/models/universal-symbol.js +0 -2
  406. package/dist/models/user-idand-secret.d.ts +0 -19
  407. package/dist/models/user-idand-secret.js +0 -2
  408. package/dist/models/usexchange.d.ts +0 -62
  409. package/dist/models/usexchange.js +0 -2
  410. package/dist/models/validated-trade-body.d.ts +0 -13
  411. package/dist/models/validated-trade-body.js +0 -2
  412. package/dist/operationParameterMap.d.ts +0 -8
  413. package/dist/operationParameterMap.js +0 -966
  414. package/dist/pagination/page-types.d.ts +0 -16
  415. package/dist/pagination/page-types.js +0 -12
  416. package/dist/pagination/page.d.ts +0 -25
  417. package/dist/pagination/page.js +0 -32
  418. package/dist/pagination/pageable.d.ts +0 -47
  419. package/dist/pagination/pageable.js +0 -70
  420. package/dist/pagination/paginate.d.ts +0 -6
  421. package/dist/pagination/paginate.js +0 -39
  422. package/dist/requestAfterHook.d.ts +0 -8
  423. package/dist/requestAfterHook.js +0 -82
  424. package/dist/requestBeforeHook.d.ts +0 -10
  425. package/dist/requestBeforeHook.js +0 -8
  426. package/dist/requestBeforeUrlHook.d.ts +0 -7
  427. package/dist/requestBeforeUrlHook.js +0 -5
package/dist/client.js DELETED
@@ -1,31 +0,0 @@
1
- "use strict";
2
- /*
3
- SnapTrade
4
-
5
- Connect brokerage accounts to your app for live positions and trading
6
-
7
- The version of the OpenAPI document: 1.0.0
8
- Contact: api@snaptrade.com
9
-
10
- NOTE: This file is auto generated by Konfig (https://konfigthis.com).
11
- */
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.Snaptrade = void 0;
14
- const api_1 = require("./api");
15
- const configuration_1 = require("./configuration");
16
- const client_custom_1 = require("./client-custom");
17
- class Snaptrade extends client_custom_1.SnaptradeCustom {
18
- constructor(configurationParameters = {}) {
19
- super(configurationParameters);
20
- const configuration = new configuration_1.Configuration(configurationParameters);
21
- this.accountInformation = new api_1.AccountInformationApi(configuration);
22
- this.apiStatus = new api_1.ApiStatusApi(configuration);
23
- this.authentication = new api_1.AuthenticationApi(configuration);
24
- this.connections = new api_1.ConnectionsApi(configuration);
25
- this.options = new api_1.OptionsApi(configuration);
26
- this.referenceData = new api_1.ReferenceDataApi(configuration);
27
- this.trading = new api_1.TradingApi(configuration);
28
- this.transactionsAndReporting = new api_1.TransactionsAndReportingApi(configuration);
29
- }
30
- }
31
- exports.Snaptrade = Snaptrade;
package/dist/common.d.ts DELETED
@@ -1,61 +0,0 @@
1
- import { Configuration } from "./configuration";
2
- import { RequestArgs } from "./base";
3
- import { AxiosInstance, AxiosResponse } from 'axios';
4
- /**
5
- *
6
- * @export
7
- */
8
- export declare const DUMMY_BASE_URL = "https://example.com";
9
- /**
10
- *
11
- * @throws {RequiredError}
12
- * @export
13
- */
14
- export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
15
- /**
16
- *
17
- * @export
18
- */
19
- export declare const setApiKeyToObject: ({ object, key, type, keyParamName, configuration, prefix }: {
20
- object: any;
21
- key?: string | undefined;
22
- type?: "Cookie" | undefined;
23
- keyParamName: string;
24
- configuration?: Configuration | undefined;
25
- prefix?: string | undefined;
26
- }) => Promise<void>;
27
- /**
28
- *
29
- * @export
30
- */
31
- export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
32
- /**
33
- *
34
- * @export
35
- */
36
- export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
37
- /**
38
- *
39
- * @export
40
- */
41
- export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
42
- /**
43
- *
44
- * @export
45
- */
46
- export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
47
- /**
48
- *
49
- * @export
50
- */
51
- export declare const toPathString: (url: URL) => string;
52
- /**
53
- * remove trailing slash from string
54
- */
55
- export declare const removeTrailingSlash: (url: string) => string;
56
- /**
57
- *
58
- * @export
59
- */
60
- export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any, {}>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
61
- export declare function isBrowser(): boolean;
package/dist/common.js DELETED
@@ -1,220 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /*
5
- SnapTrade
6
-
7
- Connect brokerage accounts to your app for live positions and trading
8
-
9
- The version of the OpenAPI document: 1.0.0
10
- Contact: api@snaptrade.com
11
-
12
- NOTE: This file is auto generated by Konfig (https://konfigthis.com).
13
- */
14
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.isBrowser = exports.createRequestFunction = exports.removeTrailingSlash = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
25
- const base_1 = require("./base");
26
- const axios_1 = require("axios");
27
- const requestAfterHook_1 = require("./requestAfterHook");
28
- const requestBeforeUrlHook_1 = require("./requestBeforeUrlHook");
29
- const error_1 = require("./error");
30
- /**
31
- *
32
- * @export
33
- */
34
- exports.DUMMY_BASE_URL = 'https://example.com';
35
- /**
36
- *
37
- * @throws {RequiredError}
38
- * @export
39
- */
40
- const assertParamExists = function (functionName, paramName, paramValue) {
41
- if (paramValue === null || paramValue === undefined) {
42
- throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
43
- }
44
- };
45
- exports.assertParamExists = assertParamExists;
46
- /**
47
- *
48
- * @export
49
- */
50
- const setApiKeyToObject = function ({ object, key, type, keyParamName, configuration, prefix }) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- key = key ? key : keyParamName;
53
- let apiKey = null;
54
- if (configuration && configuration.apiKey) {
55
- if (typeof configuration.apiKey === 'function')
56
- apiKey = yield configuration.apiKey(keyParamName);
57
- else if (typeof configuration.apiKey === 'string')
58
- apiKey = configuration.apiKey;
59
- else if (typeof configuration.apiKey === 'object') {
60
- if (keyParamName in configuration.apiKey)
61
- apiKey = configuration.apiKey[keyParamName];
62
- }
63
- else
64
- throw Error(`Unexpected type ${typeof configuration.apiKey} for Configuration.apiKey`);
65
- }
66
- if (!apiKey)
67
- return;
68
- object[key] = prefix !== undefined ? `${prefix}${apiKey}` : apiKey;
69
- if (type === "Cookie")
70
- object[key] = `${keyParamName}=${object[key]}`;
71
- });
72
- };
73
- exports.setApiKeyToObject = setApiKeyToObject;
74
- /**
75
- *
76
- * @export
77
- */
78
- const setBasicAuthToObject = function (object, configuration) {
79
- if (configuration && (configuration.username || configuration.password)) {
80
- object["auth"] = { username: configuration.username, password: configuration.password };
81
- }
82
- };
83
- exports.setBasicAuthToObject = setBasicAuthToObject;
84
- /**
85
- *
86
- * @export
87
- */
88
- const setBearerAuthToObject = function (object, configuration) {
89
- return __awaiter(this, void 0, void 0, function* () {
90
- if (configuration && configuration.accessToken) {
91
- const accessToken = typeof configuration.accessToken === 'function'
92
- ? yield configuration.accessToken()
93
- : yield configuration.accessToken;
94
- object["Authorization"] = "Bearer " + accessToken;
95
- }
96
- });
97
- };
98
- exports.setBearerAuthToObject = setBearerAuthToObject;
99
- function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
100
- if (typeof parameter === "object") {
101
- if (Array.isArray(parameter)) {
102
- parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
103
- }
104
- else {
105
- Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
106
- }
107
- }
108
- else {
109
- if (urlSearchParams.has(key)) {
110
- urlSearchParams.append(key, parameter);
111
- }
112
- else {
113
- urlSearchParams.set(key, parameter);
114
- }
115
- }
116
- }
117
- /**
118
- *
119
- * @export
120
- */
121
- const setSearchParams = function (url, ...objects) {
122
- const searchParams = new URLSearchParams(url.search);
123
- setFlattenedQueryParams(searchParams, objects);
124
- url.search = searchParams.toString();
125
- };
126
- exports.setSearchParams = setSearchParams;
127
- /**
128
- *
129
- * @export
130
- */
131
- const serializeDataIfNeeded = function (value, requestOptions, configuration) {
132
- const nonString = typeof value !== 'string';
133
- const needsSerialization = nonString && configuration && configuration.isJsonMime
134
- ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
135
- : nonString;
136
- return needsSerialization
137
- ? JSON.stringify(value !== undefined ? value : {})
138
- : (value || "");
139
- };
140
- exports.serializeDataIfNeeded = serializeDataIfNeeded;
141
- /**
142
- *
143
- * @export
144
- */
145
- const toPathString = function (url) {
146
- return (0, exports.removeTrailingSlash)(url.pathname) + url.search + url.hash;
147
- };
148
- exports.toPathString = toPathString;
149
- /**
150
- * remove trailing slash from string
151
- */
152
- const removeTrailingSlash = function (url) {
153
- return url.replace(/\/$/, "");
154
- };
155
- exports.removeTrailingSlash = removeTrailingSlash;
156
- /**
157
- * Wrap an axios request in a try/catch block to catch network errors and parse the response body
158
- */
159
- function wrapAxiosRequest(makeRequest) {
160
- var _a, _b, _c, _d, _e, _f;
161
- return __awaiter(this, void 0, void 0, function* () {
162
- const maxAttempts = 3;
163
- let attempt = 0;
164
- let delay = 5000;
165
- while (attempt < maxAttempts) {
166
- try {
167
- return yield makeRequest();
168
- }
169
- catch (e) {
170
- if (e instanceof axios_1.AxiosError && e.isAxiosError) {
171
- if (((_a = e.response) === null || _a === void 0 ? void 0 : _a.status) == 429) {
172
- attempt++;
173
- console.log(`429 error encountered, retrying in ${delay / 1000} seconds...`);
174
- yield new Promise(resolve => setTimeout(resolve, delay));
175
- delay *= 2;
176
- continue;
177
- }
178
- try {
179
- const responseBody = ((_b = e.response) === null || _b === void 0 ? void 0 : _b.data) instanceof ReadableStream
180
- ? yield (0, error_1.readableStreamToString)(e.response.data)
181
- : (_c = e.response) === null || _c === void 0 ? void 0 : _c.data;
182
- throw new error_1.SnaptradeError(e, (0, error_1.parseIfJson)(responseBody), (_d = e.response) === null || _d === void 0 ? void 0 : _d.headers);
183
- }
184
- catch (innerError) {
185
- if (innerError instanceof ReferenceError) {
186
- // Got: "ReferenceError: ReadableStream is not defined"
187
- // This means we are in a Node environment so just throw the original error
188
- throw new error_1.SnaptradeError(e, (_e = e.response) === null || _e === void 0 ? void 0 : _e.data, (_f = e.response) === null || _f === void 0 ? void 0 : _f.headers);
189
- }
190
- if (innerError instanceof error_1.SnaptradeError) {
191
- // Got "SnaptradeError" from the above try block
192
- throw innerError;
193
- }
194
- // Something unexpected happened: propagate the error
195
- throw e;
196
- }
197
- }
198
- throw e;
199
- }
200
- }
201
- throw new Error(`Request failed after ${maxAttempts} retries due to 429 (rate limit) errors.`);
202
- });
203
- }
204
- /**
205
- *
206
- * @export
207
- */
208
- const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
209
- return (axios = globalAxios, basePath = BASE_PATH) => __awaiter(this, void 0, void 0, function* () {
210
- (0, requestBeforeUrlHook_1.requestBeforeUrlHook)({ axiosArgs, basePath, configuration });
211
- const url = ((configuration === null || configuration === void 0 ? void 0 : configuration.basePath) || basePath) + axiosArgs.url;
212
- yield (0, requestAfterHook_1.requestAfterHook)({ axiosArgs, basePath, url, configuration });
213
- return wrapAxiosRequest(() => __awaiter(this, void 0, void 0, function* () { return yield axios.request(Object.assign(Object.assign({}, axiosArgs.options), { url })); }));
214
- });
215
- };
216
- exports.createRequestFunction = createRequestFunction;
217
- function isBrowser() {
218
- return typeof window !== "undefined";
219
- }
220
- exports.isBrowser = isBrowser;
@@ -1,98 +0,0 @@
1
- type ApiKey = string | ((keyParamName: string) => string) | ((keyParamName: string) => Promise<string>) | {
2
- [apiKeyName: string]: string | undefined;
3
- };
4
- export interface ConfigurationParameters {
5
- consumerKey?: string;
6
- clientId?: string;
7
- signature?: string;
8
- timestamp?: string;
9
- /**
10
- * parameter for apiKey security
11
- * @param name security name
12
- * @memberof Configuration
13
- */
14
- apiKey?: ApiKey;
15
- username?: string;
16
- password?: string;
17
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
18
- basePath?: string;
19
- baseOptions?: any;
20
- userAgent?: string;
21
- formDataCtor?: new () => any;
22
- }
23
- export declare class Configuration {
24
- /**
25
- * Client state
26
- */
27
- consumerKey?: string;
28
- /**
29
- * parameter for apiKey security
30
- * @param name security name
31
- * @memberof Configuration
32
- */
33
- apiKey?: ApiKey;
34
- /**
35
- * parameter for basic security
36
- *
37
- * @type {string}
38
- * @memberof Configuration
39
- */
40
- username?: string;
41
- /**
42
- * parameter for basic security
43
- *
44
- * @type {string}
45
- * @memberof Configuration
46
- */
47
- password?: string;
48
- /**
49
- * parameter for oauth2 security
50
- * @param name security name
51
- * @param scopes oauth2 scope
52
- * @memberof Configuration
53
- */
54
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
55
- /**
56
- * When the access token expires, measured in Unix time in seconds
57
- */
58
- accessTokenExpiresIn?: number;
59
- /**
60
- * override base path
61
- *
62
- * @type {string}
63
- * @memberof Configuration
64
- */
65
- basePath?: string;
66
- /**
67
- * base options for axios calls
68
- *
69
- * @type {any}
70
- * @memberof Configuration
71
- */
72
- baseOptions?: any;
73
- /**
74
- * The FormData constructor that will be used to create multipart form data
75
- * requests. You can inject this here so that execution environments that
76
- * do not support the FormData class can still run the generated client.
77
- *
78
- * @type {new () => FormData}
79
- */
80
- formDataCtor?: new () => any;
81
- /**
82
- * Default User-Agent header
83
- */
84
- userAgent: string;
85
- constructor(param?: ConfigurationParameters);
86
- /**
87
- * Check if the given MIME is a JSON MIME.
88
- * JSON MIME examples:
89
- * application/json
90
- * application/json; charset=UTF8
91
- * APPLICATION/JSON
92
- * application/vnd.company+json
93
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
94
- * @return True if the given MIME is JSON, false otherwise.
95
- */
96
- isJsonMime(mime: string): boolean;
97
- }
98
- export {};
@@ -1,53 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /*
5
- SnapTrade
6
-
7
- Connect brokerage accounts to your app for live positions and trading
8
-
9
- The version of the OpenAPI document: 1.0.0
10
- Contact: api@snaptrade.com
11
-
12
- NOTE: This file is auto generated by Konfig (https://konfigthis.com).
13
- */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.Configuration = void 0;
16
- class Configuration {
17
- constructor(param = {}) {
18
- var _a;
19
- this.consumerKey = param.consumerKey;
20
- this.apiKey = param.apiKey;
21
- if (this.apiKey === undefined) {
22
- this.apiKey = {};
23
- if (param.clientId !== undefined)
24
- this.apiKey["clientId"] = param.clientId;
25
- if (param.signature !== undefined)
26
- this.apiKey["signature"] = param.signature;
27
- if (param.timestamp !== undefined)
28
- this.apiKey["timestamp"] = param.timestamp;
29
- }
30
- this.username = param.username;
31
- this.password = param.password;
32
- this.accessToken = param.accessToken;
33
- this.basePath = param.basePath;
34
- this.baseOptions = (_a = param.baseOptions) !== null && _a !== void 0 ? _a : {};
35
- this.userAgent = param.userAgent === undefined ? "Konfig/9.0.200/typescript" : param.userAgent;
36
- this.formDataCtor = param.formDataCtor;
37
- }
38
- /**
39
- * Check if the given MIME is a JSON MIME.
40
- * JSON MIME examples:
41
- * application/json
42
- * application/json; charset=UTF8
43
- * APPLICATION/JSON
44
- * application/vnd.company+json
45
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
46
- * @return True if the given MIME is JSON, false otherwise.
47
- */
48
- isJsonMime(mime) {
49
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
50
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
51
- }
52
- }
53
- exports.Configuration = Configuration;
package/dist/error.d.ts DELETED
@@ -1,46 +0,0 @@
1
- import type { AxiosError } from "axios";
2
- /**
3
- * This class provides a wrapper for network errors when making requests to SnapTrade
4
- */
5
- export declare class SnaptradeError extends Error {
6
- /**
7
- * The response body
8
- */
9
- readonly responseBody: unknown;
10
- /**
11
- * The error code provided from the underlying "axios" library which can be
12
- * more descriptive than the HTTP status descriptions.
13
- */
14
- readonly code?: string;
15
- /**
16
- * The status code from the response.
17
- * For explanations, refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
18
- */
19
- readonly status?: number;
20
- /**
21
- * The status text from the response.
22
- * For explanations, refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
23
- */
24
- readonly statusText?: string;
25
- /**
26
- * The URL that the original request was sent to
27
- */
28
- readonly url?: string;
29
- /**
30
- * HTTP request method (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)
31
- */
32
- readonly method?: string;
33
- constructor(axiosError: AxiosError, responseBody: unknown, headers: unknown);
34
- toJSON(): {
35
- name: string;
36
- message: string;
37
- method: string | undefined;
38
- url: string | undefined;
39
- code: string | undefined;
40
- status: number | undefined;
41
- statusText: string | undefined;
42
- responseBody: unknown;
43
- };
44
- }
45
- export declare function readableStreamToString(stream: ReadableStream): Promise<string>;
46
- export declare function parseIfJson(input: unknown): object | unknown;
package/dist/error.js DELETED
@@ -1,105 +0,0 @@
1
- "use strict";
2
- /*
3
- SnapTrade
4
-
5
- Connect brokerage accounts to your app for live positions and trading
6
-
7
- The version of the OpenAPI document: 1.0.0
8
- Contact: api@snaptrade.com
9
-
10
- NOTE: This file is auto generated by Konfig (https://konfigthis.com).
11
- */
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.parseIfJson = exports.readableStreamToString = exports.SnaptradeError = void 0;
23
- /**
24
- * This class provides a wrapper for network errors when making requests to SnapTrade
25
- */
26
- class SnaptradeError extends Error {
27
- constructor(axiosError, responseBody, headers) {
28
- var _a, _b, _c, _d, _e;
29
- const message = axiosError.message + "\nRESPONSE HEADERS:\n" + JSON.stringify(headers, null, 2);
30
- super(message);
31
- this.name = "SnaptradeError";
32
- this.code = axiosError.code;
33
- this.method = (_b = (_a = axiosError.config) === null || _a === void 0 ? void 0 : _a.method) === null || _b === void 0 ? void 0 : _b.toUpperCase();
34
- this.url = (_c = axiosError.config) === null || _c === void 0 ? void 0 : _c.url;
35
- this.status = (_d = axiosError.response) === null || _d === void 0 ? void 0 : _d.status;
36
- this.statusText = (_e = axiosError.response) === null || _e === void 0 ? void 0 : _e.statusText;
37
- this.responseBody = responseBody;
38
- }
39
- toJSON() {
40
- return {
41
- name: this.name,
42
- message: this.message,
43
- method: this.method,
44
- url: this.url,
45
- code: this.code,
46
- status: this.status,
47
- statusText: this.statusText,
48
- responseBody: this.responseBody,
49
- };
50
- }
51
- }
52
- exports.SnaptradeError = SnaptradeError;
53
- function readableStreamToString(stream) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- // Step 1: Create a new TextDecoder
56
- const decoder = new TextDecoder();
57
- // Step 2: Create a new ReadableStreamDefaultReader
58
- const reader = stream.getReader();
59
- // Step 3: Initialize an empty string to hold the result
60
- let result = "";
61
- try {
62
- while (true) {
63
- // Step 4: Read data from the stream
64
- const { done, value } = yield reader.read();
65
- // If there is no more data to read, break the loop
66
- if (done)
67
- break;
68
- // Convert the chunk of data to a string using the TextDecoder
69
- const chunk = decoder.decode(value, { stream: true });
70
- // Concatenate the chunk to the result
71
- result += chunk;
72
- }
73
- }
74
- finally {
75
- // Step 5: Release the ReadableStreamDefaultReader when done or in case of an error
76
- reader.releaseLock();
77
- }
78
- // Return the final result as a string
79
- return result;
80
- });
81
- }
82
- exports.readableStreamToString = readableStreamToString;
83
- function parseIfJson(input) {
84
- if (typeof input !== "string") {
85
- // If the input is not a string, return the original input
86
- return input;
87
- }
88
- try {
89
- // Attempt to parse the input as JSON
90
- const parsedJSON = JSON.parse(input);
91
- // Check if the parsed result is an object (not an array or primitive value)
92
- if (typeof parsedJSON === "object" && parsedJSON !== null) {
93
- return parsedJSON;
94
- }
95
- else {
96
- // Return the original input if the parsed result is not an object
97
- return input;
98
- }
99
- }
100
- catch (error) {
101
- // Return the original input if parsing fails (invalid JSON)
102
- return input;
103
- }
104
- }
105
- exports.parseIfJson = parseIfJson;
package/dist/index.js DELETED
@@ -1,33 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /*
5
- SnapTrade
6
-
7
- Connect brokerage accounts to your app for live positions and trading
8
-
9
- The version of the OpenAPI document: 1.0.0
10
- Contact: api@snaptrade.com
11
-
12
- NOTE: This file is auto generated by Konfig (https://konfigthis.com).
13
- */
14
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- var desc = Object.getOwnPropertyDescriptor(m, k);
17
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
- desc = { enumerable: true, get: function() { return m[k]; } };
19
- }
20
- Object.defineProperty(o, k2, desc);
21
- }) : (function(o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- }));
25
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- __exportStar(require("./api"), exports);
30
- __exportStar(require("./configuration"), exports);
31
- __exportStar(require("./models"), exports);
32
- __exportStar(require("./client"), exports);
33
- __exportStar(require("./error"), exports);
@@ -1,3 +0,0 @@
1
- import type { Config } from "@jest/types";
2
- declare const config: Config.InitialOptions;
3
- export default config;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const config = {
4
- verbose: true,
5
- preset: "ts-jest",
6
- testEnvironment: "node",
7
- testPathIgnorePatterns: ["dist/"],
8
- testTimeout: 60 * 1000,
9
- transform: {
10
- "^.+\\.ts?$": ["ts-jest", { tsconfig: "./tsconfig.test.json" }],
11
- },
12
- };
13
- exports.default = config;
@@ -1 +0,0 @@
1
- export {};