adaptic-backend 1.0.307 → 1.0.308

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 (607) hide show
  1. package/Account.cjs +4 -1080
  2. package/Account.d.ts +2 -2
  3. package/Action.cjs +34 -1643
  4. package/Action.d.ts +2 -2
  5. package/Alert.cjs +215 -2533
  6. package/Alert.d.ts +2 -2
  7. package/AlpacaAccount.cjs +112 -2884
  8. package/AlpacaAccount.d.ts +2 -2
  9. package/Asset.cjs +4 -4
  10. package/Asset.d.ts +2 -2
  11. package/Authenticator.cjs +4 -1080
  12. package/Authenticator.d.ts +2 -2
  13. package/Contract.cjs +39 -1648
  14. package/Contract.d.ts +2 -2
  15. package/Customer.cjs +4 -1080
  16. package/Customer.d.ts +2 -2
  17. package/Deliverable.cjs +21 -472
  18. package/Deliverable.d.ts +2 -2
  19. package/EconomicEvent.cjs +4 -4
  20. package/EconomicEvent.d.ts +2 -2
  21. package/MarketSentiment.cjs +4 -4
  22. package/MarketSentiment.d.ts +2 -2
  23. package/NewsArticle.cjs +4 -4
  24. package/NewsArticle.d.ts +2 -2
  25. package/NewsArticleAssetSentiment.cjs +4 -4
  26. package/NewsArticleAssetSentiment.d.ts +2 -2
  27. package/Order.cjs +70 -2709
  28. package/Order.d.ts +2 -2
  29. package/Position.cjs +4 -2322
  30. package/Position.d.ts +2 -2
  31. package/ScheduledOptionOrder.cjs +4 -4
  32. package/ScheduledOptionOrder.d.ts +2 -2
  33. package/Session.cjs +4 -1029
  34. package/Session.d.ts +2 -2
  35. package/StopLoss.cjs +21 -1630
  36. package/StopLoss.d.ts +2 -2
  37. package/TakeProfit.cjs +21 -1630
  38. package/TakeProfit.d.ts +2 -2
  39. package/Trade.cjs +21 -472
  40. package/Trade.d.ts +2 -2
  41. package/User.cjs +4 -2383
  42. package/User.d.ts +2 -2
  43. package/VerificationToken.cjs +4 -4
  44. package/VerificationToken.d.ts +2 -2
  45. package/esm/Account.d.ts +2 -2
  46. package/esm/Account.d.ts.map +1 -1
  47. package/esm/Account.js.map +1 -1
  48. package/esm/Account.mjs +4 -1080
  49. package/esm/Action.d.ts +2 -2
  50. package/esm/Action.d.ts.map +1 -1
  51. package/esm/Action.js.map +1 -1
  52. package/esm/Action.mjs +34 -1643
  53. package/esm/Alert.d.ts +2 -2
  54. package/esm/Alert.d.ts.map +1 -1
  55. package/esm/Alert.js.map +1 -1
  56. package/esm/Alert.mjs +215 -2533
  57. package/esm/AlpacaAccount.d.ts +2 -2
  58. package/esm/AlpacaAccount.d.ts.map +1 -1
  59. package/esm/AlpacaAccount.js.map +1 -1
  60. package/esm/AlpacaAccount.mjs +112 -2884
  61. package/esm/Asset.d.ts +2 -2
  62. package/esm/Asset.d.ts.map +1 -1
  63. package/esm/Asset.js.map +1 -1
  64. package/esm/Asset.mjs +4 -4
  65. package/esm/Authenticator.d.ts +2 -2
  66. package/esm/Authenticator.d.ts.map +1 -1
  67. package/esm/Authenticator.js.map +1 -1
  68. package/esm/Authenticator.mjs +4 -1080
  69. package/esm/Contract.d.ts +2 -2
  70. package/esm/Contract.d.ts.map +1 -1
  71. package/esm/Contract.js.map +1 -1
  72. package/esm/Contract.mjs +39 -1648
  73. package/esm/Customer.d.ts +2 -2
  74. package/esm/Customer.d.ts.map +1 -1
  75. package/esm/Customer.js.map +1 -1
  76. package/esm/Customer.mjs +4 -1080
  77. package/esm/Deliverable.d.ts +2 -2
  78. package/esm/Deliverable.d.ts.map +1 -1
  79. package/esm/Deliverable.js.map +1 -1
  80. package/esm/Deliverable.mjs +21 -472
  81. package/esm/EconomicEvent.d.ts +2 -2
  82. package/esm/EconomicEvent.d.ts.map +1 -1
  83. package/esm/EconomicEvent.js.map +1 -1
  84. package/esm/EconomicEvent.mjs +4 -4
  85. package/esm/MarketSentiment.d.ts +2 -2
  86. package/esm/MarketSentiment.d.ts.map +1 -1
  87. package/esm/MarketSentiment.js.map +1 -1
  88. package/esm/MarketSentiment.mjs +4 -4
  89. package/esm/NewsArticle.d.ts +2 -2
  90. package/esm/NewsArticle.d.ts.map +1 -1
  91. package/esm/NewsArticle.js.map +1 -1
  92. package/esm/NewsArticle.mjs +4 -4
  93. package/esm/NewsArticleAssetSentiment.d.ts +2 -2
  94. package/esm/NewsArticleAssetSentiment.d.ts.map +1 -1
  95. package/esm/NewsArticleAssetSentiment.js.map +1 -1
  96. package/esm/NewsArticleAssetSentiment.mjs +4 -4
  97. package/esm/Order.d.ts +2 -2
  98. package/esm/Order.d.ts.map +1 -1
  99. package/esm/Order.js.map +1 -1
  100. package/esm/Order.mjs +70 -2709
  101. package/esm/Position.d.ts +2 -2
  102. package/esm/Position.d.ts.map +1 -1
  103. package/esm/Position.js.map +1 -1
  104. package/esm/Position.mjs +4 -2322
  105. package/esm/ScheduledOptionOrder.d.ts +2 -2
  106. package/esm/ScheduledOptionOrder.d.ts.map +1 -1
  107. package/esm/ScheduledOptionOrder.js.map +1 -1
  108. package/esm/ScheduledOptionOrder.mjs +4 -4
  109. package/esm/Session.d.ts +2 -2
  110. package/esm/Session.d.ts.map +1 -1
  111. package/esm/Session.js.map +1 -1
  112. package/esm/Session.mjs +4 -1029
  113. package/esm/StopLoss.d.ts +2 -2
  114. package/esm/StopLoss.d.ts.map +1 -1
  115. package/esm/StopLoss.js.map +1 -1
  116. package/esm/StopLoss.mjs +21 -1630
  117. package/esm/TakeProfit.d.ts +2 -2
  118. package/esm/TakeProfit.d.ts.map +1 -1
  119. package/esm/TakeProfit.js.map +1 -1
  120. package/esm/TakeProfit.mjs +21 -1630
  121. package/esm/Trade.d.ts +2 -2
  122. package/esm/Trade.d.ts.map +1 -1
  123. package/esm/Trade.js.map +1 -1
  124. package/esm/Trade.mjs +21 -472
  125. package/esm/User.d.ts +2 -2
  126. package/esm/User.d.ts.map +1 -1
  127. package/esm/User.js.map +1 -1
  128. package/esm/User.mjs +4 -2383
  129. package/esm/VerificationToken.d.ts +2 -2
  130. package/esm/VerificationToken.d.ts.map +1 -1
  131. package/esm/VerificationToken.js.map +1 -1
  132. package/esm/VerificationToken.mjs +4 -4
  133. package/esm/generated/selectionSets/Account.d.ts +1 -1
  134. package/esm/generated/selectionSets/Account.d.ts.map +1 -1
  135. package/esm/generated/selectionSets/Account.js.map +1 -1
  136. package/esm/generated/selectionSets/Account.mjs +0 -51
  137. package/esm/generated/selectionSets/AlpacaAccount.d.ts +1 -1
  138. package/esm/generated/selectionSets/AlpacaAccount.d.ts.map +1 -1
  139. package/esm/generated/selectionSets/AlpacaAccount.js.map +1 -1
  140. package/esm/generated/selectionSets/AlpacaAccount.mjs +0 -61
  141. package/esm/generated/selectionSets/Authenticator.d.ts +1 -1
  142. package/esm/generated/selectionSets/Authenticator.d.ts.map +1 -1
  143. package/esm/generated/selectionSets/Authenticator.js.map +1 -1
  144. package/esm/generated/selectionSets/Authenticator.mjs +0 -51
  145. package/esm/generated/selectionSets/Customer.d.ts +1 -1
  146. package/esm/generated/selectionSets/Customer.d.ts.map +1 -1
  147. package/esm/generated/selectionSets/Customer.js.map +1 -1
  148. package/esm/generated/selectionSets/Customer.mjs +0 -51
  149. package/esm/generated/selectionSets/User.d.ts +1 -1
  150. package/esm/generated/selectionSets/User.d.ts.map +1 -1
  151. package/esm/generated/selectionSets/User.js.map +1 -1
  152. package/esm/generated/selectionSets/User.mjs +0 -61
  153. package/esm/generated/typegraphql-prisma/enhance.d.ts.map +1 -1
  154. package/esm/generated/typegraphql-prisma/enhance.js.map +1 -1
  155. package/esm/generated/typegraphql-prisma/enhance.mjs +30 -50
  156. package/esm/generated/typegraphql-prisma/models/AlpacaAccount.d.ts +0 -5
  157. package/esm/generated/typegraphql-prisma/models/AlpacaAccount.d.ts.map +1 -1
  158. package/esm/generated/typegraphql-prisma/models/AlpacaAccount.js.map +1 -1
  159. package/esm/generated/typegraphql-prisma/models/AlpacaAccount.mjs +0 -4
  160. package/esm/generated/typegraphql-prisma/models/Order.d.ts +0 -5
  161. package/esm/generated/typegraphql-prisma/models/Order.d.ts.map +1 -1
  162. package/esm/generated/typegraphql-prisma/models/Order.js.map +1 -1
  163. package/esm/generated/typegraphql-prisma/models/Order.mjs +0 -4
  164. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateInput.d.ts +0 -2
  165. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateInput.d.ts.map +1 -1
  166. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateInput.js.map +1 -1
  167. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateInput.mjs +0 -8
  168. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutAlertsInput.d.ts +0 -2
  169. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutAlertsInput.d.ts.map +1 -1
  170. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutAlertsInput.js.map +1 -1
  171. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutAlertsInput.mjs +0 -8
  172. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutPositionsInput.d.ts +0 -2
  173. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutPositionsInput.d.ts.map +1 -1
  174. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutPositionsInput.js.map +1 -1
  175. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutPositionsInput.mjs +0 -8
  176. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutUserInput.d.ts +0 -2
  177. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutUserInput.d.ts.map +1 -1
  178. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutUserInput.js.map +1 -1
  179. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutUserInput.mjs +0 -8
  180. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountOrderByWithRelationInput.d.ts +0 -2
  181. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountOrderByWithRelationInput.d.ts.map +1 -1
  182. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountOrderByWithRelationInput.js.map +1 -1
  183. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountOrderByWithRelationInput.mjs +0 -8
  184. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateInput.d.ts +0 -2
  185. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateInput.d.ts.map +1 -1
  186. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateInput.js.map +1 -1
  187. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateInput.mjs +0 -8
  188. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutAlertsInput.d.ts +0 -2
  189. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutAlertsInput.d.ts.map +1 -1
  190. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutAlertsInput.js.map +1 -1
  191. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutAlertsInput.mjs +0 -8
  192. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutPositionsInput.d.ts +0 -2
  193. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutPositionsInput.d.ts.map +1 -1
  194. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutPositionsInput.js.map +1 -1
  195. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutPositionsInput.mjs +0 -8
  196. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutUserInput.d.ts +0 -2
  197. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutUserInput.d.ts.map +1 -1
  198. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutUserInput.js.map +1 -1
  199. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutUserInput.mjs +0 -8
  200. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereInput.d.ts +0 -2
  201. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereInput.d.ts.map +1 -1
  202. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereInput.js.map +1 -1
  203. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereInput.mjs +0 -8
  204. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereUniqueInput.d.ts +0 -2
  205. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereUniqueInput.d.ts.map +1 -1
  206. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereUniqueInput.js.map +1 -1
  207. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereUniqueInput.mjs +0 -8
  208. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateInput.d.ts +1 -2
  209. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateInput.d.ts.map +1 -1
  210. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateInput.js.map +1 -1
  211. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateInput.mjs +7 -8
  212. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutActionInput.d.ts +1 -2
  213. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutActionInput.d.ts.map +1 -1
  214. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutActionInput.js.map +1 -1
  215. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutActionInput.mjs +7 -8
  216. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutContractInput.d.ts +1 -2
  217. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutContractInput.d.ts.map +1 -1
  218. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutContractInput.js.map +1 -1
  219. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutContractInput.mjs +7 -8
  220. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutStopLossInput.d.ts +1 -2
  221. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutStopLossInput.d.ts.map +1 -1
  222. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutStopLossInput.js.map +1 -1
  223. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutStopLossInput.mjs +7 -8
  224. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutTakeProfitInput.d.ts +1 -2
  225. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutTakeProfitInput.d.ts.map +1 -1
  226. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutTakeProfitInput.js.map +1 -1
  227. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutTakeProfitInput.mjs +7 -8
  228. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByWithRelationInput.d.ts +0 -2
  229. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByWithRelationInput.d.ts.map +1 -1
  230. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByWithRelationInput.js.map +1 -1
  231. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByWithRelationInput.mjs +0 -8
  232. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateInput.d.ts +1 -2
  233. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateInput.d.ts.map +1 -1
  234. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateInput.js.map +1 -1
  235. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateInput.mjs +7 -8
  236. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyMutationInput.d.ts +1 -0
  237. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyMutationInput.d.ts.map +1 -1
  238. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyMutationInput.js.map +1 -1
  239. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyMutationInput.mjs +7 -0
  240. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutActionInput.d.ts +1 -2
  241. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutActionInput.d.ts.map +1 -1
  242. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutActionInput.js.map +1 -1
  243. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutActionInput.mjs +7 -8
  244. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutContractInput.d.ts +1 -2
  245. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutContractInput.d.ts.map +1 -1
  246. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutContractInput.js.map +1 -1
  247. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutContractInput.mjs +7 -8
  248. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutStopLossInput.d.ts +1 -2
  249. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutStopLossInput.d.ts.map +1 -1
  250. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutStopLossInput.js.map +1 -1
  251. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutStopLossInput.mjs +7 -8
  252. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutTakeProfitInput.d.ts +1 -2
  253. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutTakeProfitInput.d.ts.map +1 -1
  254. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutTakeProfitInput.js.map +1 -1
  255. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutTakeProfitInput.mjs +7 -8
  256. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderWhereInput.d.ts +0 -2
  257. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderWhereInput.d.ts.map +1 -1
  258. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderWhereInput.js.map +1 -1
  259. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderWhereInput.mjs +0 -8
  260. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts +0 -2
  261. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts.map +1 -1
  262. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.js.map +1 -1
  263. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.mjs +0 -8
  264. package/esm/generated/typegraphql-prisma/resolvers/inputs/index.d.ts +0 -20
  265. package/esm/generated/typegraphql-prisma/resolvers/inputs/index.d.ts.map +1 -1
  266. package/esm/generated/typegraphql-prisma/resolvers/inputs/index.js.map +1 -1
  267. package/esm/generated/typegraphql-prisma/resolvers/inputs/index.mjs +0 -20
  268. package/esm/generated/typegraphql-prisma/resolvers/outputs/AlpacaAccountCount.d.ts +0 -3
  269. package/esm/generated/typegraphql-prisma/resolvers/outputs/AlpacaAccountCount.d.ts.map +1 -1
  270. package/esm/generated/typegraphql-prisma/resolvers/outputs/AlpacaAccountCount.js.map +1 -1
  271. package/esm/generated/typegraphql-prisma/resolvers/outputs/AlpacaAccountCount.mjs +0 -16
  272. package/esm/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnOrder.d.ts +0 -2
  273. package/esm/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnOrder.d.ts.map +1 -1
  274. package/esm/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnOrder.js.map +1 -1
  275. package/esm/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnOrder.mjs +0 -8
  276. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/index.d.ts +0 -1
  277. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/index.d.ts.map +1 -1
  278. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/index.js.map +1 -1
  279. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/index.mjs +0 -1
  280. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/AlpacaAccountRelationsResolver.d.ts +0 -3
  281. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/AlpacaAccountRelationsResolver.d.ts.map +1 -1
  282. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/AlpacaAccountRelationsResolver.js.map +1 -1
  283. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/AlpacaAccountRelationsResolver.mjs +0 -26
  284. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/index.d.ts +0 -1
  285. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/index.d.ts.map +1 -1
  286. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/index.js.map +1 -1
  287. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/index.mjs +0 -1
  288. package/esm/generated/typegraphql-prisma/resolvers/relations/Order/OrderRelationsResolver.d.ts +0 -2
  289. package/esm/generated/typegraphql-prisma/resolvers/relations/Order/OrderRelationsResolver.d.ts.map +1 -1
  290. package/esm/generated/typegraphql-prisma/resolvers/relations/Order/OrderRelationsResolver.js.map +1 -1
  291. package/esm/generated/typegraphql-prisma/resolvers/relations/Order/OrderRelationsResolver.mjs +0 -23
  292. package/esm/index.d.ts +44 -44
  293. package/generated/typegraphql-prisma/enhance.cjs +30 -50
  294. package/generated/typegraphql-prisma/enhance.d.ts.map +1 -1
  295. package/generated/typegraphql-prisma/enhance.js.map +1 -1
  296. package/generated/typegraphql-prisma/models/AlpacaAccount.d.ts +0 -5
  297. package/generated/typegraphql-prisma/models/AlpacaAccount.d.ts.map +1 -1
  298. package/generated/typegraphql-prisma/models/AlpacaAccount.js.map +1 -1
  299. package/generated/typegraphql-prisma/models/Order.d.ts +0 -5
  300. package/generated/typegraphql-prisma/models/Order.d.ts.map +1 -1
  301. package/generated/typegraphql-prisma/models/Order.js.map +1 -1
  302. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateInput.cjs +0 -7
  303. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateInput.d.ts +0 -2
  304. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateInput.d.ts.map +1 -1
  305. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateInput.js.map +1 -1
  306. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutAlertsInput.cjs +0 -7
  307. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutAlertsInput.d.ts +0 -2
  308. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutAlertsInput.d.ts.map +1 -1
  309. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutAlertsInput.js.map +1 -1
  310. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutPositionsInput.cjs +0 -7
  311. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutPositionsInput.d.ts +0 -2
  312. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutPositionsInput.d.ts.map +1 -1
  313. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutPositionsInput.js.map +1 -1
  314. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutUserInput.cjs +0 -7
  315. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutUserInput.d.ts +0 -2
  316. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutUserInput.d.ts.map +1 -1
  317. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutUserInput.js.map +1 -1
  318. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountOrderByWithRelationInput.cjs +0 -7
  319. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountOrderByWithRelationInput.d.ts +0 -2
  320. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountOrderByWithRelationInput.d.ts.map +1 -1
  321. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountOrderByWithRelationInput.js.map +1 -1
  322. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateInput.cjs +0 -7
  323. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateInput.d.ts +0 -2
  324. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateInput.d.ts.map +1 -1
  325. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateInput.js.map +1 -1
  326. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutAlertsInput.cjs +0 -7
  327. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutAlertsInput.d.ts +0 -2
  328. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutAlertsInput.d.ts.map +1 -1
  329. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutAlertsInput.js.map +1 -1
  330. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutPositionsInput.cjs +0 -7
  331. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutPositionsInput.d.ts +0 -2
  332. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutPositionsInput.d.ts.map +1 -1
  333. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutPositionsInput.js.map +1 -1
  334. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutUserInput.cjs +0 -7
  335. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutUserInput.d.ts +0 -2
  336. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutUserInput.d.ts.map +1 -1
  337. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutUserInput.js.map +1 -1
  338. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereInput.cjs +0 -7
  339. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereInput.d.ts +0 -2
  340. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereInput.d.ts.map +1 -1
  341. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereInput.js.map +1 -1
  342. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereUniqueInput.cjs +0 -7
  343. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereUniqueInput.d.ts +0 -2
  344. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereUniqueInput.d.ts.map +1 -1
  345. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountWhereUniqueInput.js.map +1 -1
  346. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateInput.cjs +6 -7
  347. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateInput.d.ts +1 -2
  348. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateInput.d.ts.map +1 -1
  349. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateInput.js.map +1 -1
  350. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutActionInput.cjs +6 -7
  351. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutActionInput.d.ts +1 -2
  352. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutActionInput.d.ts.map +1 -1
  353. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutActionInput.js.map +1 -1
  354. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutContractInput.cjs +6 -7
  355. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutContractInput.d.ts +1 -2
  356. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutContractInput.d.ts.map +1 -1
  357. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutContractInput.js.map +1 -1
  358. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutStopLossInput.cjs +6 -7
  359. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutStopLossInput.d.ts +1 -2
  360. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutStopLossInput.d.ts.map +1 -1
  361. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutStopLossInput.js.map +1 -1
  362. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutTakeProfitInput.cjs +6 -7
  363. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutTakeProfitInput.d.ts +1 -2
  364. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutTakeProfitInput.d.ts.map +1 -1
  365. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutTakeProfitInput.js.map +1 -1
  366. package/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByWithRelationInput.cjs +0 -7
  367. package/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByWithRelationInput.d.ts +0 -2
  368. package/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByWithRelationInput.d.ts.map +1 -1
  369. package/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByWithRelationInput.js.map +1 -1
  370. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateInput.cjs +6 -7
  371. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateInput.d.ts +1 -2
  372. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateInput.d.ts.map +1 -1
  373. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateInput.js.map +1 -1
  374. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyMutationInput.cjs +6 -0
  375. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyMutationInput.d.ts +1 -0
  376. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyMutationInput.d.ts.map +1 -1
  377. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyMutationInput.js.map +1 -1
  378. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutActionInput.cjs +6 -7
  379. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutActionInput.d.ts +1 -2
  380. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutActionInput.d.ts.map +1 -1
  381. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutActionInput.js.map +1 -1
  382. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutContractInput.cjs +6 -7
  383. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutContractInput.d.ts +1 -2
  384. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutContractInput.d.ts.map +1 -1
  385. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutContractInput.js.map +1 -1
  386. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutStopLossInput.cjs +6 -7
  387. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutStopLossInput.d.ts +1 -2
  388. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutStopLossInput.d.ts.map +1 -1
  389. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutStopLossInput.js.map +1 -1
  390. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutTakeProfitInput.cjs +6 -7
  391. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutTakeProfitInput.d.ts +1 -2
  392. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutTakeProfitInput.d.ts.map +1 -1
  393. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutTakeProfitInput.js.map +1 -1
  394. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereInput.cjs +0 -7
  395. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereInput.d.ts +0 -2
  396. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereInput.d.ts.map +1 -1
  397. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereInput.js.map +1 -1
  398. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.cjs +0 -7
  399. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts +0 -2
  400. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts.map +1 -1
  401. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.js.map +1 -1
  402. package/generated/typegraphql-prisma/resolvers/inputs/index.cjs +15 -55
  403. package/generated/typegraphql-prisma/resolvers/inputs/index.d.ts +0 -20
  404. package/generated/typegraphql-prisma/resolvers/inputs/index.d.ts.map +1 -1
  405. package/generated/typegraphql-prisma/resolvers/inputs/index.js.map +1 -1
  406. package/generated/typegraphql-prisma/resolvers/outputs/AlpacaAccountCount.cjs +0 -15
  407. package/generated/typegraphql-prisma/resolvers/outputs/AlpacaAccountCount.d.ts +0 -3
  408. package/generated/typegraphql-prisma/resolvers/outputs/AlpacaAccountCount.d.ts.map +1 -1
  409. package/generated/typegraphql-prisma/resolvers/outputs/AlpacaAccountCount.js.map +1 -1
  410. package/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnOrder.cjs +0 -7
  411. package/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnOrder.d.ts +0 -2
  412. package/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnOrder.d.ts.map +1 -1
  413. package/generated/typegraphql-prisma/resolvers/outputs/CreateManyAndReturnOrder.js.map +1 -1
  414. package/generated/typegraphql-prisma/resolvers/outputs/args/index.cjs +1 -3
  415. package/generated/typegraphql-prisma/resolvers/outputs/args/index.d.ts +0 -1
  416. package/generated/typegraphql-prisma/resolvers/outputs/args/index.d.ts.map +1 -1
  417. package/generated/typegraphql-prisma/resolvers/outputs/args/index.js.map +1 -1
  418. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/AlpacaAccountRelationsResolver.cjs +0 -26
  419. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/AlpacaAccountRelationsResolver.d.ts +0 -3
  420. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/AlpacaAccountRelationsResolver.d.ts.map +1 -1
  421. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/AlpacaAccountRelationsResolver.js.map +1 -1
  422. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/index.cjs +1 -3
  423. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/index.d.ts +0 -1
  424. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/index.d.ts.map +1 -1
  425. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/index.js.map +1 -1
  426. package/generated/typegraphql-prisma/resolvers/relations/Order/OrderRelationsResolver.cjs +0 -23
  427. package/generated/typegraphql-prisma/resolvers/relations/Order/OrderRelationsResolver.d.ts +0 -2
  428. package/generated/typegraphql-prisma/resolvers/relations/Order/OrderRelationsResolver.d.ts.map +1 -1
  429. package/generated/typegraphql-prisma/resolvers/relations/Order/OrderRelationsResolver.js.map +1 -1
  430. package/index.d.ts +44 -44
  431. package/package.json +1 -1
  432. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateNestedOneWithoutOrdersInput.d.ts +0 -9
  433. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateNestedOneWithoutOrdersInput.d.ts.map +0 -1
  434. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateNestedOneWithoutOrdersInput.js.map +0 -1
  435. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateNestedOneWithoutOrdersInput.mjs +0 -41
  436. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateOrConnectWithoutOrdersInput.d.ts +0 -7
  437. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateOrConnectWithoutOrdersInput.d.ts.map +0 -1
  438. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateOrConnectWithoutOrdersInput.js.map +0 -1
  439. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateOrConnectWithoutOrdersInput.mjs +0 -33
  440. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutOrdersInput.d.ts +0 -26
  441. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutOrdersInput.d.ts.map +0 -1
  442. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutOrdersInput.js.map +0 -1
  443. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutOrdersInput.mjs +0 -155
  444. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateOneRequiredWithoutOrdersNestedInput.d.ts +0 -13
  445. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateOneRequiredWithoutOrdersNestedInput.d.ts.map +0 -1
  446. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateOneRequiredWithoutOrdersNestedInput.js.map +0 -1
  447. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateOneRequiredWithoutOrdersNestedInput.mjs +0 -57
  448. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateToOneWithWhereWithoutOrdersInput.d.ts +0 -7
  449. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateToOneWithWhereWithoutOrdersInput.d.ts.map +0 -1
  450. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateToOneWithWhereWithoutOrdersInput.js.map +0 -1
  451. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateToOneWithWhereWithoutOrdersInput.mjs +0 -33
  452. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutOrdersInput.d.ts +0 -31
  453. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutOrdersInput.d.ts.map +0 -1
  454. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutOrdersInput.js.map +0 -1
  455. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutOrdersInput.mjs +0 -159
  456. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpsertWithoutOrdersInput.d.ts +0 -9
  457. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpsertWithoutOrdersInput.d.ts.map +0 -1
  458. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpsertWithoutOrdersInput.js.map +0 -1
  459. package/esm/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpsertWithoutOrdersInput.mjs +0 -41
  460. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInput.d.ts +0 -46
  461. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInput.d.ts.map +0 -1
  462. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInput.js.map +0 -1
  463. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInput.mjs +0 -318
  464. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInputEnvelope.d.ts +0 -6
  465. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInputEnvelope.d.ts.map +0 -1
  466. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInputEnvelope.js.map +0 -1
  467. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInputEnvelope.mjs +0 -32
  468. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateNestedManyWithoutAlpacaAccountInput.d.ts +0 -11
  469. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateNestedManyWithoutAlpacaAccountInput.d.ts.map +0 -1
  470. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateNestedManyWithoutAlpacaAccountInput.js.map +0 -1
  471. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateNestedManyWithoutAlpacaAccountInput.mjs +0 -49
  472. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateOrConnectWithoutAlpacaAccountInput.d.ts +0 -7
  473. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateOrConnectWithoutAlpacaAccountInput.d.ts.map +0 -1
  474. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateOrConnectWithoutAlpacaAccountInput.js.map +0 -1
  475. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateOrConnectWithoutAlpacaAccountInput.mjs +0 -33
  476. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutAlpacaAccountInput.d.ts +0 -52
  477. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutAlpacaAccountInput.d.ts.map +0 -1
  478. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutAlpacaAccountInput.js.map +0 -1
  479. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutAlpacaAccountInput.mjs +0 -336
  480. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderListRelationFilter.d.ts +0 -7
  481. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderListRelationFilter.d.ts.map +0 -1
  482. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderListRelationFilter.js.map +0 -1
  483. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderListRelationFilter.mjs +0 -39
  484. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByRelationAggregateInput.d.ts +0 -4
  485. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByRelationAggregateInput.d.ts.map +0 -1
  486. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByRelationAggregateInput.js.map +0 -1
  487. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByRelationAggregateInput.mjs +0 -25
  488. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderScalarWhereInput.d.ts +0 -63
  489. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderScalarWhereInput.d.ts.map +0 -1
  490. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderScalarWhereInput.js.map +0 -1
  491. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderScalarWhereInput.mjs +0 -353
  492. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithWhereWithoutAlpacaAccountInput.d.ts +0 -7
  493. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithWhereWithoutAlpacaAccountInput.d.ts.map +0 -1
  494. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithWhereWithoutAlpacaAccountInput.js.map +0 -1
  495. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithWhereWithoutAlpacaAccountInput.mjs +0 -33
  496. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithoutAlpacaAccountNestedInput.d.ts +0 -22
  497. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithoutAlpacaAccountNestedInput.d.ts.map +0 -1
  498. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithoutAlpacaAccountNestedInput.js.map +0 -1
  499. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithoutAlpacaAccountNestedInput.mjs +0 -102
  500. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithWhereUniqueWithoutAlpacaAccountInput.d.ts +0 -7
  501. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithWhereUniqueWithoutAlpacaAccountInput.d.ts.map +0 -1
  502. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithWhereUniqueWithoutAlpacaAccountInput.js.map +0 -1
  503. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithWhereUniqueWithoutAlpacaAccountInput.mjs +0 -33
  504. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutAlpacaAccountInput.d.ts +0 -64
  505. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutAlpacaAccountInput.d.ts.map +0 -1
  506. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutAlpacaAccountInput.js.map +0 -1
  507. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutAlpacaAccountInput.mjs +0 -342
  508. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpsertWithWhereUniqueWithoutAlpacaAccountInput.d.ts +0 -9
  509. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpsertWithWhereUniqueWithoutAlpacaAccountInput.d.ts.map +0 -1
  510. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpsertWithWhereUniqueWithoutAlpacaAccountInput.js.map +0 -1
  511. package/esm/generated/typegraphql-prisma/resolvers/inputs/OrderUpsertWithWhereUniqueWithoutAlpacaAccountInput.mjs +0 -41
  512. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/AlpacaAccountCountOrdersArgs.d.ts +0 -5
  513. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/AlpacaAccountCountOrdersArgs.d.ts.map +0 -1
  514. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/AlpacaAccountCountOrdersArgs.js.map +0 -1
  515. package/esm/generated/typegraphql-prisma/resolvers/outputs/args/AlpacaAccountCountOrdersArgs.mjs +0 -25
  516. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/AlpacaAccountOrdersArgs.d.ts +0 -12
  517. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/AlpacaAccountOrdersArgs.d.ts.map +0 -1
  518. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/AlpacaAccountOrdersArgs.js.map +0 -1
  519. package/esm/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/AlpacaAccountOrdersArgs.mjs +0 -63
  520. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateNestedOneWithoutOrdersInput.cjs +0 -74
  521. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateNestedOneWithoutOrdersInput.d.ts +0 -9
  522. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateNestedOneWithoutOrdersInput.d.ts.map +0 -1
  523. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateNestedOneWithoutOrdersInput.js.map +0 -1
  524. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateOrConnectWithoutOrdersInput.cjs +0 -67
  525. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateOrConnectWithoutOrdersInput.d.ts +0 -7
  526. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateOrConnectWithoutOrdersInput.d.ts.map +0 -1
  527. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateOrConnectWithoutOrdersInput.js.map +0 -1
  528. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutOrdersInput.cjs +0 -172
  529. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutOrdersInput.d.ts +0 -26
  530. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutOrdersInput.d.ts.map +0 -1
  531. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountCreateWithoutOrdersInput.js.map +0 -1
  532. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateOneRequiredWithoutOrdersNestedInput.cjs +0 -88
  533. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateOneRequiredWithoutOrdersNestedInput.d.ts +0 -13
  534. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateOneRequiredWithoutOrdersNestedInput.d.ts.map +0 -1
  535. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateOneRequiredWithoutOrdersNestedInput.js.map +0 -1
  536. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateToOneWithWhereWithoutOrdersInput.cjs +0 -67
  537. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateToOneWithWhereWithoutOrdersInput.d.ts +0 -7
  538. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateToOneWithWhereWithoutOrdersInput.d.ts.map +0 -1
  539. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateToOneWithWhereWithoutOrdersInput.js.map +0 -1
  540. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutOrdersInput.cjs +0 -176
  541. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutOrdersInput.d.ts +0 -31
  542. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutOrdersInput.d.ts.map +0 -1
  543. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpdateWithoutOrdersInput.js.map +0 -1
  544. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpsertWithoutOrdersInput.cjs +0 -74
  545. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpsertWithoutOrdersInput.d.ts +0 -9
  546. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpsertWithoutOrdersInput.d.ts.map +0 -1
  547. package/generated/typegraphql-prisma/resolvers/inputs/AlpacaAccountUpsertWithoutOrdersInput.js.map +0 -1
  548. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInput.cjs +0 -312
  549. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInput.d.ts +0 -46
  550. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInput.d.ts.map +0 -1
  551. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInput.js.map +0 -1
  552. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInputEnvelope.cjs +0 -66
  553. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInputEnvelope.d.ts +0 -6
  554. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInputEnvelope.d.ts.map +0 -1
  555. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateManyAlpacaAccountInputEnvelope.js.map +0 -1
  556. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateNestedManyWithoutAlpacaAccountInput.cjs +0 -81
  557. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateNestedManyWithoutAlpacaAccountInput.d.ts +0 -11
  558. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateNestedManyWithoutAlpacaAccountInput.d.ts.map +0 -1
  559. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateNestedManyWithoutAlpacaAccountInput.js.map +0 -1
  560. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateOrConnectWithoutAlpacaAccountInput.cjs +0 -67
  561. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateOrConnectWithoutAlpacaAccountInput.d.ts +0 -7
  562. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateOrConnectWithoutAlpacaAccountInput.d.ts.map +0 -1
  563. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateOrConnectWithoutAlpacaAccountInput.js.map +0 -1
  564. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutAlpacaAccountInput.cjs +0 -328
  565. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutAlpacaAccountInput.d.ts +0 -52
  566. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutAlpacaAccountInput.d.ts.map +0 -1
  567. package/generated/typegraphql-prisma/resolvers/inputs/OrderCreateWithoutAlpacaAccountInput.js.map +0 -1
  568. package/generated/typegraphql-prisma/resolvers/inputs/OrderListRelationFilter.cjs +0 -72
  569. package/generated/typegraphql-prisma/resolvers/inputs/OrderListRelationFilter.d.ts +0 -7
  570. package/generated/typegraphql-prisma/resolvers/inputs/OrderListRelationFilter.d.ts.map +0 -1
  571. package/generated/typegraphql-prisma/resolvers/inputs/OrderListRelationFilter.js.map +0 -1
  572. package/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByRelationAggregateInput.cjs +0 -60
  573. package/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByRelationAggregateInput.d.ts +0 -4
  574. package/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByRelationAggregateInput.d.ts.map +0 -1
  575. package/generated/typegraphql-prisma/resolvers/inputs/OrderOrderByRelationAggregateInput.js.map +0 -1
  576. package/generated/typegraphql-prisma/resolvers/inputs/OrderScalarWhereInput.cjs +0 -343
  577. package/generated/typegraphql-prisma/resolvers/inputs/OrderScalarWhereInput.d.ts +0 -63
  578. package/generated/typegraphql-prisma/resolvers/inputs/OrderScalarWhereInput.d.ts.map +0 -1
  579. package/generated/typegraphql-prisma/resolvers/inputs/OrderScalarWhereInput.js.map +0 -1
  580. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithWhereWithoutAlpacaAccountInput.cjs +0 -67
  581. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithWhereWithoutAlpacaAccountInput.d.ts +0 -7
  582. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithWhereWithoutAlpacaAccountInput.d.ts.map +0 -1
  583. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithWhereWithoutAlpacaAccountInput.js.map +0 -1
  584. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithoutAlpacaAccountNestedInput.cjs +0 -127
  585. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithoutAlpacaAccountNestedInput.d.ts +0 -22
  586. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithoutAlpacaAccountNestedInput.d.ts.map +0 -1
  587. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateManyWithoutAlpacaAccountNestedInput.js.map +0 -1
  588. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithWhereUniqueWithoutAlpacaAccountInput.cjs +0 -67
  589. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithWhereUniqueWithoutAlpacaAccountInput.d.ts +0 -7
  590. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithWhereUniqueWithoutAlpacaAccountInput.d.ts.map +0 -1
  591. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithWhereUniqueWithoutAlpacaAccountInput.js.map +0 -1
  592. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutAlpacaAccountInput.cjs +0 -334
  593. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutAlpacaAccountInput.d.ts +0 -64
  594. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutAlpacaAccountInput.d.ts.map +0 -1
  595. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpdateWithoutAlpacaAccountInput.js.map +0 -1
  596. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpsertWithWhereUniqueWithoutAlpacaAccountInput.cjs +0 -74
  597. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpsertWithWhereUniqueWithoutAlpacaAccountInput.d.ts +0 -9
  598. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpsertWithWhereUniqueWithoutAlpacaAccountInput.d.ts.map +0 -1
  599. package/generated/typegraphql-prisma/resolvers/inputs/OrderUpsertWithWhereUniqueWithoutAlpacaAccountInput.js.map +0 -1
  600. package/generated/typegraphql-prisma/resolvers/outputs/args/AlpacaAccountCountOrdersArgs.cjs +0 -60
  601. package/generated/typegraphql-prisma/resolvers/outputs/args/AlpacaAccountCountOrdersArgs.d.ts +0 -5
  602. package/generated/typegraphql-prisma/resolvers/outputs/args/AlpacaAccountCountOrdersArgs.d.ts.map +0 -1
  603. package/generated/typegraphql-prisma/resolvers/outputs/args/AlpacaAccountCountOrdersArgs.js.map +0 -1
  604. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/AlpacaAccountOrdersArgs.cjs +0 -93
  605. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/AlpacaAccountOrdersArgs.d.ts +0 -12
  606. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/AlpacaAccountOrdersArgs.d.ts.map +0 -1
  607. package/generated/typegraphql-prisma/resolvers/relations/AlpacaAccount/args/AlpacaAccountOrdersArgs.js.map +0 -1
package/Order.cjs CHANGED
@@ -106,6 +106,7 @@ exports.Order = {
106
106
  const variables = {
107
107
  data: {
108
108
  clientOrderId: props.clientOrderId !== undefined ? props.clientOrderId : undefined,
109
+ alpacaAccountId: props.alpacaAccountId !== undefined ? props.alpacaAccountId : undefined,
109
110
  qty: props.qty !== undefined ? props.qty : undefined,
110
111
  notional: props.notional !== undefined ? props.notional : undefined,
111
112
  side: props.side !== undefined ? props.side : undefined,
@@ -176,221 +177,6 @@ exports.Order = {
176
177
  },
177
178
  }
178
179
  } : undefined,
179
- alpacaAccount: props.alpacaAccount ?
180
- typeof props.alpacaAccount === 'object' && Object.keys(props.alpacaAccount).length === 1 && Object.keys(props.alpacaAccount)[0] === 'id'
181
- ? { connect: {
182
- id: props.alpacaAccount.id
183
- }
184
- }
185
- : { connectOrCreate: {
186
- where: {
187
- id: props.alpacaAccount.id !== undefined ? props.alpacaAccount.id : undefined,
188
- userId: props.alpacaAccount.userId !== undefined ? {
189
- equals: props.alpacaAccount.userId
190
- } : undefined,
191
- },
192
- create: {
193
- type: props.alpacaAccount.type !== undefined ? props.alpacaAccount.type : undefined,
194
- APIKey: props.alpacaAccount.APIKey !== undefined ? props.alpacaAccount.APIKey : undefined,
195
- APISecret: props.alpacaAccount.APISecret !== undefined ? props.alpacaAccount.APISecret : undefined,
196
- configuration: props.alpacaAccount.configuration !== undefined ? props.alpacaAccount.configuration : undefined,
197
- marketOpen: props.alpacaAccount.marketOpen !== undefined ? props.alpacaAccount.marketOpen : undefined,
198
- realTime: props.alpacaAccount.realTime !== undefined ? props.alpacaAccount.realTime : undefined,
199
- tradeAllocationPct: props.alpacaAccount.tradeAllocationPct !== undefined ? props.alpacaAccount.tradeAllocationPct : undefined,
200
- minPercentageChange: props.alpacaAccount.minPercentageChange !== undefined ? props.alpacaAccount.minPercentageChange : undefined,
201
- volumeThreshold: props.alpacaAccount.volumeThreshold !== undefined ? props.alpacaAccount.volumeThreshold : undefined,
202
- enablePortfolioTrailingStop: props.alpacaAccount.enablePortfolioTrailingStop !== undefined ? props.alpacaAccount.enablePortfolioTrailingStop : undefined,
203
- portfolioTrailPercent: props.alpacaAccount.portfolioTrailPercent !== undefined ? props.alpacaAccount.portfolioTrailPercent : undefined,
204
- portfolioProfitThresholdPercent: props.alpacaAccount.portfolioProfitThresholdPercent !== undefined ? props.alpacaAccount.portfolioProfitThresholdPercent : undefined,
205
- reducedPortfolioTrailPercent: props.alpacaAccount.reducedPortfolioTrailPercent !== undefined ? props.alpacaAccount.reducedPortfolioTrailPercent : undefined,
206
- user: props.alpacaAccount.user ?
207
- typeof props.alpacaAccount.user === 'object' && Object.keys(props.alpacaAccount.user).length === 1 && Object.keys(props.alpacaAccount.user)[0] === 'id'
208
- ? { connect: {
209
- id: props.alpacaAccount.user.id
210
- }
211
- }
212
- : { connectOrCreate: {
213
- where: {
214
- id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
215
- email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
216
- name: props.alpacaAccount.user.name !== undefined ? {
217
- equals: props.alpacaAccount.user.name
218
- } : undefined,
219
- },
220
- create: {
221
- name: props.alpacaAccount.user.name !== undefined ? props.alpacaAccount.user.name : undefined,
222
- email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
223
- emailVerified: props.alpacaAccount.user.emailVerified !== undefined ? props.alpacaAccount.user.emailVerified : undefined,
224
- image: props.alpacaAccount.user.image !== undefined ? props.alpacaAccount.user.image : undefined,
225
- role: props.alpacaAccount.user.role !== undefined ? props.alpacaAccount.user.role : undefined,
226
- bio: props.alpacaAccount.user.bio !== undefined ? props.alpacaAccount.user.bio : undefined,
227
- jobTitle: props.alpacaAccount.user.jobTitle !== undefined ? props.alpacaAccount.user.jobTitle : undefined,
228
- currentAccount: props.alpacaAccount.user.currentAccount !== undefined ? props.alpacaAccount.user.currentAccount : undefined,
229
- plan: props.alpacaAccount.user.plan !== undefined ? props.alpacaAccount.user.plan : undefined,
230
- openaiAPIKey: props.alpacaAccount.user.openaiAPIKey !== undefined ? props.alpacaAccount.user.openaiAPIKey : undefined,
231
- openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? props.alpacaAccount.user.openaiModel : undefined,
232
- customer: props.alpacaAccount.user.customer ?
233
- typeof props.alpacaAccount.user.customer === 'object' && Object.keys(props.alpacaAccount.user.customer).length === 1 && Object.keys(props.alpacaAccount.user.customer)[0] === 'id'
234
- ? { connect: {
235
- id: props.alpacaAccount.user.customer.id
236
- }
237
- }
238
- : { connectOrCreate: {
239
- where: {
240
- id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
241
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
242
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
243
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
244
- equals: props.alpacaAccount.user.customer.authUserId
245
- } : undefined,
246
- name: props.alpacaAccount.user.customer.name !== undefined ? {
247
- equals: props.alpacaAccount.user.customer.name
248
- } : undefined,
249
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
250
- equals: props.alpacaAccount.user.customer.stripePriceId
251
- } : undefined,
252
- },
253
- create: {
254
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
255
- name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
256
- plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
257
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
258
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
259
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
260
- stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
261
- },
262
- }
263
- } : undefined,
264
- accounts: props.alpacaAccount.user.accounts ?
265
- Array.isArray(props.alpacaAccount.user.accounts) && props.alpacaAccount.user.accounts.length > 0 && props.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
266
- connect: props.alpacaAccount.user.accounts.map((item) => ({
267
- id: item.id
268
- }))
269
- }
270
- : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
271
- where: {
272
- id: item.id !== undefined ? item.id : undefined,
273
- userId: item.userId !== undefined ? {
274
- equals: item.userId
275
- } : undefined,
276
- providerAccountId: item.providerAccountId !== undefined ? {
277
- equals: item.providerAccountId
278
- } : undefined,
279
- },
280
- create: {
281
- type: item.type !== undefined ? item.type : undefined,
282
- provider: item.provider !== undefined ? item.provider : undefined,
283
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
284
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
285
- access_token: item.access_token !== undefined ? item.access_token : undefined,
286
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
287
- token_type: item.token_type !== undefined ? item.token_type : undefined,
288
- scope: item.scope !== undefined ? item.scope : undefined,
289
- id_token: item.id_token !== undefined ? item.id_token : undefined,
290
- session_state: item.session_state !== undefined ? item.session_state : undefined,
291
- },
292
- }))
293
- } : undefined,
294
- sessions: props.alpacaAccount.user.sessions ?
295
- Array.isArray(props.alpacaAccount.user.sessions) && props.alpacaAccount.user.sessions.length > 0 && props.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
296
- connect: props.alpacaAccount.user.sessions.map((item) => ({
297
- id: item.id
298
- }))
299
- }
300
- : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
301
- where: {
302
- id: item.id !== undefined ? item.id : undefined,
303
- userId: item.userId !== undefined ? {
304
- equals: item.userId
305
- } : undefined,
306
- },
307
- create: {
308
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
309
- expires: item.expires !== undefined ? item.expires : undefined,
310
- },
311
- }))
312
- } : undefined,
313
- authenticators: props.alpacaAccount.user.authenticators ?
314
- Array.isArray(props.alpacaAccount.user.authenticators) && props.alpacaAccount.user.authenticators.length > 0 && props.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
315
- connect: props.alpacaAccount.user.authenticators.map((item) => ({
316
- id: item.id
317
- }))
318
- }
319
- : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
320
- where: {
321
- id: item.id !== undefined ? item.id : undefined,
322
- userId: item.userId !== undefined ? {
323
- equals: item.userId
324
- } : undefined,
325
- },
326
- create: {
327
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
328
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
329
- counter: item.counter !== undefined ? item.counter : undefined,
330
- },
331
- }))
332
- } : undefined,
333
- },
334
- }
335
- } : undefined,
336
- positions: props.alpacaAccount.positions ?
337
- Array.isArray(props.alpacaAccount.positions) && props.alpacaAccount.positions.length > 0 && props.alpacaAccount.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
338
- connect: props.alpacaAccount.positions.map((item) => ({
339
- id: item.id
340
- }))
341
- }
342
- : { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
343
- where: {
344
- id: item.id !== undefined ? item.id : undefined,
345
- symbol: item.symbol !== undefined ? {
346
- equals: item.symbol
347
- } : undefined,
348
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
349
- equals: item.alpacaAccountId
350
- } : undefined,
351
- },
352
- create: {
353
- symbol: item.symbol !== undefined ? item.symbol : undefined,
354
- averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
355
- qty: item.qty !== undefined ? item.qty : undefined,
356
- qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
357
- marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
358
- costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
359
- unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
360
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
361
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
362
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
363
- currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
364
- lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
365
- changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
366
- assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
367
- closed: item.closed !== undefined ? item.closed : undefined,
368
- },
369
- }))
370
- } : undefined,
371
- alerts: props.alpacaAccount.alerts ?
372
- Array.isArray(props.alpacaAccount.alerts) && props.alpacaAccount.alerts.length > 0 && props.alpacaAccount.alerts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
373
- connect: props.alpacaAccount.alerts.map((item) => ({
374
- id: item.id
375
- }))
376
- }
377
- : { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
378
- where: {
379
- id: item.id !== undefined ? item.id : undefined,
380
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
381
- equals: item.alpacaAccountId
382
- } : undefined,
383
- },
384
- create: {
385
- message: item.message !== undefined ? item.message : undefined,
386
- type: item.type !== undefined ? item.type : undefined,
387
- isRead: item.isRead !== undefined ? item.isRead : undefined,
388
- },
389
- }))
390
- } : undefined,
391
- },
392
- }
393
- } : undefined,
394
180
  action: props.action ?
395
181
  typeof props.action === 'object' && Object.keys(props.action).length === 1 && Object.keys(props.action)[0] === 'id'
396
182
  ? { connect: {
@@ -657,6 +443,9 @@ exports.Order = {
657
443
  clientOrderId: props.clientOrderId !== undefined ? {
658
444
  set: props.clientOrderId
659
445
  } : undefined,
446
+ alpacaAccountId: props.alpacaAccountId !== undefined ? {
447
+ set: props.alpacaAccountId
448
+ } : undefined,
660
449
  qty: props.qty !== undefined ? {
661
450
  set: props.qty
662
451
  } : undefined,
@@ -835,746 +624,6 @@ exports.Order = {
835
624
  },
836
625
  }
837
626
  } : undefined,
838
- alpacaAccount: props.alpacaAccount ?
839
- typeof props.alpacaAccount === 'object' && Object.keys(props.alpacaAccount).length === 1 && (Object.keys(props.alpacaAccount)[0] === 'id' || Object.keys(props.alpacaAccount)[0] === 'symbol')
840
- ? {
841
- connect: {
842
- id: props.alpacaAccount.id
843
- }
844
- } : { upsert: {
845
- where: {
846
- id: props.alpacaAccount.id !== undefined ? {
847
- equals: props.alpacaAccount.id
848
- } : undefined,
849
- userId: props.alpacaAccount.userId !== undefined ? {
850
- equals: props.alpacaAccount.userId
851
- } : undefined,
852
- },
853
- update: {
854
- id: props.alpacaAccount.id !== undefined ? {
855
- set: props.alpacaAccount.id
856
- } : undefined,
857
- type: props.alpacaAccount.type !== undefined ? {
858
- set: props.alpacaAccount.type
859
- } : undefined,
860
- APIKey: props.alpacaAccount.APIKey !== undefined ? {
861
- set: props.alpacaAccount.APIKey
862
- } : undefined,
863
- APISecret: props.alpacaAccount.APISecret !== undefined ? {
864
- set: props.alpacaAccount.APISecret
865
- } : undefined,
866
- configuration: props.alpacaAccount.configuration !== undefined ? {
867
- set: props.alpacaAccount.configuration
868
- } : undefined,
869
- marketOpen: props.alpacaAccount.marketOpen !== undefined ? {
870
- set: props.alpacaAccount.marketOpen
871
- } : undefined,
872
- realTime: props.alpacaAccount.realTime !== undefined ? {
873
- set: props.alpacaAccount.realTime
874
- } : undefined,
875
- tradeAllocationPct: props.alpacaAccount.tradeAllocationPct !== undefined ? {
876
- set: props.alpacaAccount.tradeAllocationPct
877
- } : undefined,
878
- minPercentageChange: props.alpacaAccount.minPercentageChange !== undefined ? {
879
- set: props.alpacaAccount.minPercentageChange
880
- } : undefined,
881
- volumeThreshold: props.alpacaAccount.volumeThreshold !== undefined ? {
882
- set: props.alpacaAccount.volumeThreshold
883
- } : undefined,
884
- enablePortfolioTrailingStop: props.alpacaAccount.enablePortfolioTrailingStop !== undefined ? {
885
- set: props.alpacaAccount.enablePortfolioTrailingStop
886
- } : undefined,
887
- portfolioTrailPercent: props.alpacaAccount.portfolioTrailPercent !== undefined ? {
888
- set: props.alpacaAccount.portfolioTrailPercent
889
- } : undefined,
890
- portfolioProfitThresholdPercent: props.alpacaAccount.portfolioProfitThresholdPercent !== undefined ? {
891
- set: props.alpacaAccount.portfolioProfitThresholdPercent
892
- } : undefined,
893
- reducedPortfolioTrailPercent: props.alpacaAccount.reducedPortfolioTrailPercent !== undefined ? {
894
- set: props.alpacaAccount.reducedPortfolioTrailPercent
895
- } : undefined,
896
- user: props.alpacaAccount.user ?
897
- typeof props.alpacaAccount.user === 'object' && Object.keys(props.alpacaAccount.user).length === 1 && (Object.keys(props.alpacaAccount.user)[0] === 'id' || Object.keys(props.alpacaAccount.user)[0] === 'symbol')
898
- ? {
899
- connect: {
900
- id: props.alpacaAccount.user.id
901
- }
902
- } : { upsert: {
903
- where: {
904
- id: props.alpacaAccount.user.id !== undefined ? {
905
- equals: props.alpacaAccount.user.id
906
- } : undefined,
907
- name: props.alpacaAccount.user.name !== undefined ? {
908
- equals: props.alpacaAccount.user.name
909
- } : undefined,
910
- email: props.alpacaAccount.user.email !== undefined ? {
911
- equals: props.alpacaAccount.user.email
912
- } : undefined,
913
- customerId: props.alpacaAccount.user.customerId !== undefined ? {
914
- equals: props.alpacaAccount.user.customerId
915
- } : undefined,
916
- },
917
- update: {
918
- id: props.alpacaAccount.user.id !== undefined ? {
919
- set: props.alpacaAccount.user.id
920
- } : undefined,
921
- name: props.alpacaAccount.user.name !== undefined ? {
922
- set: props.alpacaAccount.user.name
923
- } : undefined,
924
- email: props.alpacaAccount.user.email !== undefined ? {
925
- set: props.alpacaAccount.user.email
926
- } : undefined,
927
- emailVerified: props.alpacaAccount.user.emailVerified !== undefined ? {
928
- set: props.alpacaAccount.user.emailVerified
929
- } : undefined,
930
- image: props.alpacaAccount.user.image !== undefined ? {
931
- set: props.alpacaAccount.user.image
932
- } : undefined,
933
- role: props.alpacaAccount.user.role !== undefined ? {
934
- set: props.alpacaAccount.user.role
935
- } : undefined,
936
- bio: props.alpacaAccount.user.bio !== undefined ? {
937
- set: props.alpacaAccount.user.bio
938
- } : undefined,
939
- jobTitle: props.alpacaAccount.user.jobTitle !== undefined ? {
940
- set: props.alpacaAccount.user.jobTitle
941
- } : undefined,
942
- currentAccount: props.alpacaAccount.user.currentAccount !== undefined ? {
943
- set: props.alpacaAccount.user.currentAccount
944
- } : undefined,
945
- plan: props.alpacaAccount.user.plan !== undefined ? {
946
- set: props.alpacaAccount.user.plan
947
- } : undefined,
948
- openaiAPIKey: props.alpacaAccount.user.openaiAPIKey !== undefined ? {
949
- set: props.alpacaAccount.user.openaiAPIKey
950
- } : undefined,
951
- openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? {
952
- set: props.alpacaAccount.user.openaiModel
953
- } : undefined,
954
- customer: props.alpacaAccount.user.customer ?
955
- typeof props.alpacaAccount.user.customer === 'object' && Object.keys(props.alpacaAccount.user.customer).length === 1 && (Object.keys(props.alpacaAccount.user.customer)[0] === 'id' || Object.keys(props.alpacaAccount.user.customer)[0] === 'symbol')
956
- ? {
957
- connect: {
958
- id: props.alpacaAccount.user.customer.id
959
- }
960
- } : { upsert: {
961
- where: {
962
- id: props.alpacaAccount.user.customer.id !== undefined ? {
963
- equals: props.alpacaAccount.user.customer.id
964
- } : undefined,
965
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
966
- equals: props.alpacaAccount.user.customer.authUserId
967
- } : undefined,
968
- name: props.alpacaAccount.user.customer.name !== undefined ? {
969
- equals: props.alpacaAccount.user.customer.name
970
- } : undefined,
971
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
972
- equals: props.alpacaAccount.user.customer.stripeCustomerId
973
- } : undefined,
974
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
975
- equals: props.alpacaAccount.user.customer.stripeSubscriptionId
976
- } : undefined,
977
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
978
- equals: props.alpacaAccount.user.customer.stripePriceId
979
- } : undefined,
980
- },
981
- update: {
982
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
983
- set: props.alpacaAccount.user.customer.authUserId
984
- } : undefined,
985
- name: props.alpacaAccount.user.customer.name !== undefined ? {
986
- set: props.alpacaAccount.user.customer.name
987
- } : undefined,
988
- plan: props.alpacaAccount.user.customer.plan !== undefined ? {
989
- set: props.alpacaAccount.user.customer.plan
990
- } : undefined,
991
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
992
- set: props.alpacaAccount.user.customer.stripeCustomerId
993
- } : undefined,
994
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
995
- set: props.alpacaAccount.user.customer.stripeSubscriptionId
996
- } : undefined,
997
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
998
- set: props.alpacaAccount.user.customer.stripePriceId
999
- } : undefined,
1000
- stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? {
1001
- set: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd
1002
- } : undefined,
1003
- },
1004
- create: {
1005
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
1006
- name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
1007
- plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
1008
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
1009
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
1010
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
1011
- stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
1012
- },
1013
- }
1014
- } : undefined,
1015
- accounts: props.alpacaAccount.user.accounts ?
1016
- Array.isArray(props.alpacaAccount.user.accounts) && props.alpacaAccount.user.accounts.length > 0 && props.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
1017
- connect: props.alpacaAccount.user.accounts.map((item) => ({
1018
- id: item.id
1019
- }))
1020
- } : { upsert: props.alpacaAccount.user.accounts.map((item) => ({
1021
- where: {
1022
- id: item.id !== undefined ? item.id : undefined,
1023
- userId: item.userId !== undefined ? {
1024
- equals: item.userId
1025
- } : undefined,
1026
- providerAccountId: item.providerAccountId !== undefined ? {
1027
- equals: item.providerAccountId
1028
- } : undefined,
1029
- },
1030
- update: {
1031
- id: item.id !== undefined ? {
1032
- set: item.id
1033
- } : undefined,
1034
- type: item.type !== undefined ? {
1035
- set: item.type
1036
- } : undefined,
1037
- provider: item.provider !== undefined ? {
1038
- set: item.provider
1039
- } : undefined,
1040
- providerAccountId: item.providerAccountId !== undefined ? {
1041
- set: item.providerAccountId
1042
- } : undefined,
1043
- refresh_token: item.refresh_token !== undefined ? {
1044
- set: item.refresh_token
1045
- } : undefined,
1046
- access_token: item.access_token !== undefined ? {
1047
- set: item.access_token
1048
- } : undefined,
1049
- expires_at: item.expires_at !== undefined ? {
1050
- set: item.expires_at
1051
- } : undefined,
1052
- token_type: item.token_type !== undefined ? {
1053
- set: item.token_type
1054
- } : undefined,
1055
- scope: item.scope !== undefined ? {
1056
- set: item.scope
1057
- } : undefined,
1058
- id_token: item.id_token !== undefined ? {
1059
- set: item.id_token
1060
- } : undefined,
1061
- session_state: item.session_state !== undefined ? {
1062
- set: item.session_state
1063
- } : undefined,
1064
- },
1065
- create: {
1066
- type: item.type !== undefined ? item.type : undefined,
1067
- provider: item.provider !== undefined ? item.provider : undefined,
1068
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
1069
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
1070
- access_token: item.access_token !== undefined ? item.access_token : undefined,
1071
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
1072
- token_type: item.token_type !== undefined ? item.token_type : undefined,
1073
- scope: item.scope !== undefined ? item.scope : undefined,
1074
- id_token: item.id_token !== undefined ? item.id_token : undefined,
1075
- session_state: item.session_state !== undefined ? item.session_state : undefined,
1076
- },
1077
- }))
1078
- } : undefined,
1079
- sessions: props.alpacaAccount.user.sessions ?
1080
- Array.isArray(props.alpacaAccount.user.sessions) && props.alpacaAccount.user.sessions.length > 0 && props.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
1081
- connect: props.alpacaAccount.user.sessions.map((item) => ({
1082
- id: item.id
1083
- }))
1084
- } : { upsert: props.alpacaAccount.user.sessions.map((item) => ({
1085
- where: {
1086
- id: item.id !== undefined ? item.id : undefined,
1087
- userId: item.userId !== undefined ? {
1088
- equals: item.userId
1089
- } : undefined,
1090
- },
1091
- update: {
1092
- id: item.id !== undefined ? {
1093
- set: item.id
1094
- } : undefined,
1095
- sessionToken: item.sessionToken !== undefined ? {
1096
- set: item.sessionToken
1097
- } : undefined,
1098
- expires: item.expires !== undefined ? {
1099
- set: item.expires
1100
- } : undefined,
1101
- },
1102
- create: {
1103
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
1104
- expires: item.expires !== undefined ? item.expires : undefined,
1105
- },
1106
- }))
1107
- } : undefined,
1108
- authenticators: props.alpacaAccount.user.authenticators ?
1109
- Array.isArray(props.alpacaAccount.user.authenticators) && props.alpacaAccount.user.authenticators.length > 0 && props.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
1110
- connect: props.alpacaAccount.user.authenticators.map((item) => ({
1111
- id: item.id
1112
- }))
1113
- } : { upsert: props.alpacaAccount.user.authenticators.map((item) => ({
1114
- where: {
1115
- id: item.id !== undefined ? item.id : undefined,
1116
- userId: item.userId !== undefined ? {
1117
- equals: item.userId
1118
- } : undefined,
1119
- },
1120
- update: {
1121
- id: item.id !== undefined ? {
1122
- set: item.id
1123
- } : undefined,
1124
- credentialID: item.credentialID !== undefined ? {
1125
- set: item.credentialID
1126
- } : undefined,
1127
- publicKey: item.publicKey !== undefined ? {
1128
- set: item.publicKey
1129
- } : undefined,
1130
- counter: item.counter !== undefined ? {
1131
- set: item.counter
1132
- } : undefined,
1133
- },
1134
- create: {
1135
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
1136
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
1137
- counter: item.counter !== undefined ? item.counter : undefined,
1138
- },
1139
- }))
1140
- } : undefined,
1141
- },
1142
- create: {
1143
- name: props.alpacaAccount.user.name !== undefined ? props.alpacaAccount.user.name : undefined,
1144
- email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
1145
- emailVerified: props.alpacaAccount.user.emailVerified !== undefined ? props.alpacaAccount.user.emailVerified : undefined,
1146
- image: props.alpacaAccount.user.image !== undefined ? props.alpacaAccount.user.image : undefined,
1147
- role: props.alpacaAccount.user.role !== undefined ? props.alpacaAccount.user.role : undefined,
1148
- bio: props.alpacaAccount.user.bio !== undefined ? props.alpacaAccount.user.bio : undefined,
1149
- jobTitle: props.alpacaAccount.user.jobTitle !== undefined ? props.alpacaAccount.user.jobTitle : undefined,
1150
- currentAccount: props.alpacaAccount.user.currentAccount !== undefined ? props.alpacaAccount.user.currentAccount : undefined,
1151
- plan: props.alpacaAccount.user.plan !== undefined ? props.alpacaAccount.user.plan : undefined,
1152
- openaiAPIKey: props.alpacaAccount.user.openaiAPIKey !== undefined ? props.alpacaAccount.user.openaiAPIKey : undefined,
1153
- openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? props.alpacaAccount.user.openaiModel : undefined,
1154
- customer: props.alpacaAccount.user.customer ?
1155
- typeof props.alpacaAccount.user.customer === 'object' && Object.keys(props.alpacaAccount.user.customer).length === 1 && Object.keys(props.alpacaAccount.user.customer)[0] === 'id'
1156
- ? { connect: {
1157
- id: props.alpacaAccount.user.customer.id
1158
- }
1159
- }
1160
- : { connectOrCreate: {
1161
- where: {
1162
- id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
1163
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
1164
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
1165
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
1166
- equals: props.alpacaAccount.user.customer.authUserId
1167
- } : undefined,
1168
- name: props.alpacaAccount.user.customer.name !== undefined ? {
1169
- equals: props.alpacaAccount.user.customer.name
1170
- } : undefined,
1171
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
1172
- equals: props.alpacaAccount.user.customer.stripePriceId
1173
- } : undefined,
1174
- },
1175
- create: {
1176
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
1177
- name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
1178
- plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
1179
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
1180
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
1181
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
1182
- stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
1183
- },
1184
- }
1185
- } : undefined,
1186
- accounts: props.alpacaAccount.user.accounts ?
1187
- Array.isArray(props.alpacaAccount.user.accounts) && props.alpacaAccount.user.accounts.length > 0 && props.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1188
- connect: props.alpacaAccount.user.accounts.map((item) => ({
1189
- id: item.id
1190
- }))
1191
- }
1192
- : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
1193
- where: {
1194
- id: item.id !== undefined ? item.id : undefined,
1195
- userId: item.userId !== undefined ? {
1196
- equals: item.userId
1197
- } : undefined,
1198
- providerAccountId: item.providerAccountId !== undefined ? {
1199
- equals: item.providerAccountId
1200
- } : undefined,
1201
- },
1202
- create: {
1203
- type: item.type !== undefined ? item.type : undefined,
1204
- provider: item.provider !== undefined ? item.provider : undefined,
1205
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
1206
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
1207
- access_token: item.access_token !== undefined ? item.access_token : undefined,
1208
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
1209
- token_type: item.token_type !== undefined ? item.token_type : undefined,
1210
- scope: item.scope !== undefined ? item.scope : undefined,
1211
- id_token: item.id_token !== undefined ? item.id_token : undefined,
1212
- session_state: item.session_state !== undefined ? item.session_state : undefined,
1213
- },
1214
- }))
1215
- } : undefined,
1216
- sessions: props.alpacaAccount.user.sessions ?
1217
- Array.isArray(props.alpacaAccount.user.sessions) && props.alpacaAccount.user.sessions.length > 0 && props.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1218
- connect: props.alpacaAccount.user.sessions.map((item) => ({
1219
- id: item.id
1220
- }))
1221
- }
1222
- : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
1223
- where: {
1224
- id: item.id !== undefined ? item.id : undefined,
1225
- userId: item.userId !== undefined ? {
1226
- equals: item.userId
1227
- } : undefined,
1228
- },
1229
- create: {
1230
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
1231
- expires: item.expires !== undefined ? item.expires : undefined,
1232
- },
1233
- }))
1234
- } : undefined,
1235
- authenticators: props.alpacaAccount.user.authenticators ?
1236
- Array.isArray(props.alpacaAccount.user.authenticators) && props.alpacaAccount.user.authenticators.length > 0 && props.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1237
- connect: props.alpacaAccount.user.authenticators.map((item) => ({
1238
- id: item.id
1239
- }))
1240
- }
1241
- : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
1242
- where: {
1243
- id: item.id !== undefined ? item.id : undefined,
1244
- userId: item.userId !== undefined ? {
1245
- equals: item.userId
1246
- } : undefined,
1247
- },
1248
- create: {
1249
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
1250
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
1251
- counter: item.counter !== undefined ? item.counter : undefined,
1252
- },
1253
- }))
1254
- } : undefined,
1255
- },
1256
- }
1257
- } : undefined,
1258
- positions: props.alpacaAccount.positions ?
1259
- Array.isArray(props.alpacaAccount.positions) && props.alpacaAccount.positions.length > 0 && props.alpacaAccount.positions.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
1260
- connect: props.alpacaAccount.positions.map((item) => ({
1261
- id: item.id
1262
- }))
1263
- } : { upsert: props.alpacaAccount.positions.map((item) => ({
1264
- where: {
1265
- id: item.id !== undefined ? item.id : undefined,
1266
- symbol: item.symbol !== undefined ? {
1267
- equals: item.symbol
1268
- } : undefined,
1269
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
1270
- equals: item.alpacaAccountId
1271
- } : undefined,
1272
- },
1273
- update: {
1274
- id: item.id !== undefined ? {
1275
- set: item.id
1276
- } : undefined,
1277
- symbol: item.symbol !== undefined ? {
1278
- set: item.symbol
1279
- } : undefined,
1280
- averageEntryPrice: item.averageEntryPrice !== undefined ? {
1281
- set: item.averageEntryPrice
1282
- } : undefined,
1283
- qty: item.qty !== undefined ? {
1284
- set: item.qty
1285
- } : undefined,
1286
- qtyAvailable: item.qtyAvailable !== undefined ? {
1287
- set: item.qtyAvailable
1288
- } : undefined,
1289
- marketValue: item.marketValue !== undefined ? {
1290
- set: item.marketValue
1291
- } : undefined,
1292
- costBasis: item.costBasis !== undefined ? {
1293
- set: item.costBasis
1294
- } : undefined,
1295
- unrealizedPL: item.unrealizedPL !== undefined ? {
1296
- set: item.unrealizedPL
1297
- } : undefined,
1298
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? {
1299
- set: item.unrealizedPLPC
1300
- } : undefined,
1301
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? {
1302
- set: item.unrealisedIntradayPL
1303
- } : undefined,
1304
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? {
1305
- set: item.unrealisedIntradayPLPC
1306
- } : undefined,
1307
- currentPrice: item.currentPrice !== undefined ? {
1308
- set: item.currentPrice
1309
- } : undefined,
1310
- lastTradePrice: item.lastTradePrice !== undefined ? {
1311
- set: item.lastTradePrice
1312
- } : undefined,
1313
- changeToday: item.changeToday !== undefined ? {
1314
- set: item.changeToday
1315
- } : undefined,
1316
- assetMarginable: item.assetMarginable !== undefined ? {
1317
- set: item.assetMarginable
1318
- } : undefined,
1319
- closed: item.closed !== undefined ? {
1320
- set: item.closed
1321
- } : undefined,
1322
- },
1323
- create: {
1324
- symbol: item.symbol !== undefined ? item.symbol : undefined,
1325
- averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
1326
- qty: item.qty !== undefined ? item.qty : undefined,
1327
- qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
1328
- marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
1329
- costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
1330
- unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
1331
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
1332
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
1333
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
1334
- currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
1335
- lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
1336
- changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
1337
- assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
1338
- closed: item.closed !== undefined ? item.closed : undefined,
1339
- },
1340
- }))
1341
- } : undefined,
1342
- alerts: props.alpacaAccount.alerts ?
1343
- Array.isArray(props.alpacaAccount.alerts) && props.alpacaAccount.alerts.length > 0 && props.alpacaAccount.alerts.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
1344
- connect: props.alpacaAccount.alerts.map((item) => ({
1345
- id: item.id
1346
- }))
1347
- } : { upsert: props.alpacaAccount.alerts.map((item) => ({
1348
- where: {
1349
- id: item.id !== undefined ? item.id : undefined,
1350
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
1351
- equals: item.alpacaAccountId
1352
- } : undefined,
1353
- },
1354
- update: {
1355
- id: item.id !== undefined ? {
1356
- set: item.id
1357
- } : undefined,
1358
- message: item.message !== undefined ? {
1359
- set: item.message
1360
- } : undefined,
1361
- type: item.type !== undefined ? {
1362
- set: item.type
1363
- } : undefined,
1364
- isRead: item.isRead !== undefined ? {
1365
- set: item.isRead
1366
- } : undefined,
1367
- },
1368
- create: {
1369
- message: item.message !== undefined ? item.message : undefined,
1370
- type: item.type !== undefined ? item.type : undefined,
1371
- isRead: item.isRead !== undefined ? item.isRead : undefined,
1372
- },
1373
- }))
1374
- } : undefined,
1375
- },
1376
- create: {
1377
- type: props.alpacaAccount.type !== undefined ? props.alpacaAccount.type : undefined,
1378
- APIKey: props.alpacaAccount.APIKey !== undefined ? props.alpacaAccount.APIKey : undefined,
1379
- APISecret: props.alpacaAccount.APISecret !== undefined ? props.alpacaAccount.APISecret : undefined,
1380
- configuration: props.alpacaAccount.configuration !== undefined ? props.alpacaAccount.configuration : undefined,
1381
- marketOpen: props.alpacaAccount.marketOpen !== undefined ? props.alpacaAccount.marketOpen : undefined,
1382
- realTime: props.alpacaAccount.realTime !== undefined ? props.alpacaAccount.realTime : undefined,
1383
- tradeAllocationPct: props.alpacaAccount.tradeAllocationPct !== undefined ? props.alpacaAccount.tradeAllocationPct : undefined,
1384
- minPercentageChange: props.alpacaAccount.minPercentageChange !== undefined ? props.alpacaAccount.minPercentageChange : undefined,
1385
- volumeThreshold: props.alpacaAccount.volumeThreshold !== undefined ? props.alpacaAccount.volumeThreshold : undefined,
1386
- enablePortfolioTrailingStop: props.alpacaAccount.enablePortfolioTrailingStop !== undefined ? props.alpacaAccount.enablePortfolioTrailingStop : undefined,
1387
- portfolioTrailPercent: props.alpacaAccount.portfolioTrailPercent !== undefined ? props.alpacaAccount.portfolioTrailPercent : undefined,
1388
- portfolioProfitThresholdPercent: props.alpacaAccount.portfolioProfitThresholdPercent !== undefined ? props.alpacaAccount.portfolioProfitThresholdPercent : undefined,
1389
- reducedPortfolioTrailPercent: props.alpacaAccount.reducedPortfolioTrailPercent !== undefined ? props.alpacaAccount.reducedPortfolioTrailPercent : undefined,
1390
- user: props.alpacaAccount.user ?
1391
- typeof props.alpacaAccount.user === 'object' && Object.keys(props.alpacaAccount.user).length === 1 && Object.keys(props.alpacaAccount.user)[0] === 'id'
1392
- ? { connect: {
1393
- id: props.alpacaAccount.user.id
1394
- }
1395
- }
1396
- : { connectOrCreate: {
1397
- where: {
1398
- id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
1399
- email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
1400
- name: props.alpacaAccount.user.name !== undefined ? {
1401
- equals: props.alpacaAccount.user.name
1402
- } : undefined,
1403
- },
1404
- create: {
1405
- name: props.alpacaAccount.user.name !== undefined ? props.alpacaAccount.user.name : undefined,
1406
- email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
1407
- emailVerified: props.alpacaAccount.user.emailVerified !== undefined ? props.alpacaAccount.user.emailVerified : undefined,
1408
- image: props.alpacaAccount.user.image !== undefined ? props.alpacaAccount.user.image : undefined,
1409
- role: props.alpacaAccount.user.role !== undefined ? props.alpacaAccount.user.role : undefined,
1410
- bio: props.alpacaAccount.user.bio !== undefined ? props.alpacaAccount.user.bio : undefined,
1411
- jobTitle: props.alpacaAccount.user.jobTitle !== undefined ? props.alpacaAccount.user.jobTitle : undefined,
1412
- currentAccount: props.alpacaAccount.user.currentAccount !== undefined ? props.alpacaAccount.user.currentAccount : undefined,
1413
- plan: props.alpacaAccount.user.plan !== undefined ? props.alpacaAccount.user.plan : undefined,
1414
- openaiAPIKey: props.alpacaAccount.user.openaiAPIKey !== undefined ? props.alpacaAccount.user.openaiAPIKey : undefined,
1415
- openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? props.alpacaAccount.user.openaiModel : undefined,
1416
- customer: props.alpacaAccount.user.customer ?
1417
- typeof props.alpacaAccount.user.customer === 'object' && Object.keys(props.alpacaAccount.user.customer).length === 1 && Object.keys(props.alpacaAccount.user.customer)[0] === 'id'
1418
- ? { connect: {
1419
- id: props.alpacaAccount.user.customer.id
1420
- }
1421
- }
1422
- : { connectOrCreate: {
1423
- where: {
1424
- id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
1425
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
1426
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
1427
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
1428
- equals: props.alpacaAccount.user.customer.authUserId
1429
- } : undefined,
1430
- name: props.alpacaAccount.user.customer.name !== undefined ? {
1431
- equals: props.alpacaAccount.user.customer.name
1432
- } : undefined,
1433
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
1434
- equals: props.alpacaAccount.user.customer.stripePriceId
1435
- } : undefined,
1436
- },
1437
- create: {
1438
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
1439
- name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
1440
- plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
1441
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
1442
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
1443
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
1444
- stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
1445
- },
1446
- }
1447
- } : undefined,
1448
- accounts: props.alpacaAccount.user.accounts ?
1449
- Array.isArray(props.alpacaAccount.user.accounts) && props.alpacaAccount.user.accounts.length > 0 && props.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1450
- connect: props.alpacaAccount.user.accounts.map((item) => ({
1451
- id: item.id
1452
- }))
1453
- }
1454
- : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
1455
- where: {
1456
- id: item.id !== undefined ? item.id : undefined,
1457
- userId: item.userId !== undefined ? {
1458
- equals: item.userId
1459
- } : undefined,
1460
- providerAccountId: item.providerAccountId !== undefined ? {
1461
- equals: item.providerAccountId
1462
- } : undefined,
1463
- },
1464
- create: {
1465
- type: item.type !== undefined ? item.type : undefined,
1466
- provider: item.provider !== undefined ? item.provider : undefined,
1467
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
1468
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
1469
- access_token: item.access_token !== undefined ? item.access_token : undefined,
1470
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
1471
- token_type: item.token_type !== undefined ? item.token_type : undefined,
1472
- scope: item.scope !== undefined ? item.scope : undefined,
1473
- id_token: item.id_token !== undefined ? item.id_token : undefined,
1474
- session_state: item.session_state !== undefined ? item.session_state : undefined,
1475
- },
1476
- }))
1477
- } : undefined,
1478
- sessions: props.alpacaAccount.user.sessions ?
1479
- Array.isArray(props.alpacaAccount.user.sessions) && props.alpacaAccount.user.sessions.length > 0 && props.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1480
- connect: props.alpacaAccount.user.sessions.map((item) => ({
1481
- id: item.id
1482
- }))
1483
- }
1484
- : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
1485
- where: {
1486
- id: item.id !== undefined ? item.id : undefined,
1487
- userId: item.userId !== undefined ? {
1488
- equals: item.userId
1489
- } : undefined,
1490
- },
1491
- create: {
1492
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
1493
- expires: item.expires !== undefined ? item.expires : undefined,
1494
- },
1495
- }))
1496
- } : undefined,
1497
- authenticators: props.alpacaAccount.user.authenticators ?
1498
- Array.isArray(props.alpacaAccount.user.authenticators) && props.alpacaAccount.user.authenticators.length > 0 && props.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1499
- connect: props.alpacaAccount.user.authenticators.map((item) => ({
1500
- id: item.id
1501
- }))
1502
- }
1503
- : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
1504
- where: {
1505
- id: item.id !== undefined ? item.id : undefined,
1506
- userId: item.userId !== undefined ? {
1507
- equals: item.userId
1508
- } : undefined,
1509
- },
1510
- create: {
1511
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
1512
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
1513
- counter: item.counter !== undefined ? item.counter : undefined,
1514
- },
1515
- }))
1516
- } : undefined,
1517
- },
1518
- }
1519
- } : undefined,
1520
- positions: props.alpacaAccount.positions ?
1521
- Array.isArray(props.alpacaAccount.positions) && props.alpacaAccount.positions.length > 0 && props.alpacaAccount.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1522
- connect: props.alpacaAccount.positions.map((item) => ({
1523
- id: item.id
1524
- }))
1525
- }
1526
- : { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
1527
- where: {
1528
- id: item.id !== undefined ? item.id : undefined,
1529
- symbol: item.symbol !== undefined ? {
1530
- equals: item.symbol
1531
- } : undefined,
1532
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
1533
- equals: item.alpacaAccountId
1534
- } : undefined,
1535
- },
1536
- create: {
1537
- symbol: item.symbol !== undefined ? item.symbol : undefined,
1538
- averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
1539
- qty: item.qty !== undefined ? item.qty : undefined,
1540
- qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
1541
- marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
1542
- costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
1543
- unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
1544
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
1545
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
1546
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
1547
- currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
1548
- lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
1549
- changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
1550
- assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
1551
- closed: item.closed !== undefined ? item.closed : undefined,
1552
- },
1553
- }))
1554
- } : undefined,
1555
- alerts: props.alpacaAccount.alerts ?
1556
- Array.isArray(props.alpacaAccount.alerts) && props.alpacaAccount.alerts.length > 0 && props.alpacaAccount.alerts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1557
- connect: props.alpacaAccount.alerts.map((item) => ({
1558
- id: item.id
1559
- }))
1560
- }
1561
- : { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
1562
- where: {
1563
- id: item.id !== undefined ? item.id : undefined,
1564
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
1565
- equals: item.alpacaAccountId
1566
- } : undefined,
1567
- },
1568
- create: {
1569
- message: item.message !== undefined ? item.message : undefined,
1570
- type: item.type !== undefined ? item.type : undefined,
1571
- isRead: item.isRead !== undefined ? item.isRead : undefined,
1572
- },
1573
- }))
1574
- } : undefined,
1575
- },
1576
- }
1577
- } : undefined,
1578
627
  action: props.action ?
1579
628
  typeof props.action === 'object' && Object.keys(props.action).length === 1 && (Object.keys(props.action)[0] === 'id' || Object.keys(props.action)[0] === 'symbol')
1580
629
  ? {
@@ -1985,6 +1034,7 @@ exports.Order = {
1985
1034
  },
1986
1035
  create: {
1987
1036
  clientOrderId: props.clientOrderId !== undefined ? props.clientOrderId : undefined,
1037
+ alpacaAccountId: props.alpacaAccountId !== undefined ? props.alpacaAccountId : undefined,
1988
1038
  qty: props.qty !== undefined ? props.qty : undefined,
1989
1039
  notional: props.notional !== undefined ? props.notional : undefined,
1990
1040
  side: props.side !== undefined ? props.side : undefined,
@@ -2055,221 +1105,6 @@ exports.Order = {
2055
1105
  },
2056
1106
  }
2057
1107
  } : undefined,
2058
- alpacaAccount: props.alpacaAccount ?
2059
- typeof props.alpacaAccount === 'object' && Object.keys(props.alpacaAccount).length === 1 && Object.keys(props.alpacaAccount)[0] === 'id'
2060
- ? { connect: {
2061
- id: props.alpacaAccount.id
2062
- }
2063
- }
2064
- : { connectOrCreate: {
2065
- where: {
2066
- id: props.alpacaAccount.id !== undefined ? props.alpacaAccount.id : undefined,
2067
- userId: props.alpacaAccount.userId !== undefined ? {
2068
- equals: props.alpacaAccount.userId
2069
- } : undefined,
2070
- },
2071
- create: {
2072
- type: props.alpacaAccount.type !== undefined ? props.alpacaAccount.type : undefined,
2073
- APIKey: props.alpacaAccount.APIKey !== undefined ? props.alpacaAccount.APIKey : undefined,
2074
- APISecret: props.alpacaAccount.APISecret !== undefined ? props.alpacaAccount.APISecret : undefined,
2075
- configuration: props.alpacaAccount.configuration !== undefined ? props.alpacaAccount.configuration : undefined,
2076
- marketOpen: props.alpacaAccount.marketOpen !== undefined ? props.alpacaAccount.marketOpen : undefined,
2077
- realTime: props.alpacaAccount.realTime !== undefined ? props.alpacaAccount.realTime : undefined,
2078
- tradeAllocationPct: props.alpacaAccount.tradeAllocationPct !== undefined ? props.alpacaAccount.tradeAllocationPct : undefined,
2079
- minPercentageChange: props.alpacaAccount.minPercentageChange !== undefined ? props.alpacaAccount.minPercentageChange : undefined,
2080
- volumeThreshold: props.alpacaAccount.volumeThreshold !== undefined ? props.alpacaAccount.volumeThreshold : undefined,
2081
- enablePortfolioTrailingStop: props.alpacaAccount.enablePortfolioTrailingStop !== undefined ? props.alpacaAccount.enablePortfolioTrailingStop : undefined,
2082
- portfolioTrailPercent: props.alpacaAccount.portfolioTrailPercent !== undefined ? props.alpacaAccount.portfolioTrailPercent : undefined,
2083
- portfolioProfitThresholdPercent: props.alpacaAccount.portfolioProfitThresholdPercent !== undefined ? props.alpacaAccount.portfolioProfitThresholdPercent : undefined,
2084
- reducedPortfolioTrailPercent: props.alpacaAccount.reducedPortfolioTrailPercent !== undefined ? props.alpacaAccount.reducedPortfolioTrailPercent : undefined,
2085
- user: props.alpacaAccount.user ?
2086
- typeof props.alpacaAccount.user === 'object' && Object.keys(props.alpacaAccount.user).length === 1 && Object.keys(props.alpacaAccount.user)[0] === 'id'
2087
- ? { connect: {
2088
- id: props.alpacaAccount.user.id
2089
- }
2090
- }
2091
- : { connectOrCreate: {
2092
- where: {
2093
- id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
2094
- email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
2095
- name: props.alpacaAccount.user.name !== undefined ? {
2096
- equals: props.alpacaAccount.user.name
2097
- } : undefined,
2098
- },
2099
- create: {
2100
- name: props.alpacaAccount.user.name !== undefined ? props.alpacaAccount.user.name : undefined,
2101
- email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
2102
- emailVerified: props.alpacaAccount.user.emailVerified !== undefined ? props.alpacaAccount.user.emailVerified : undefined,
2103
- image: props.alpacaAccount.user.image !== undefined ? props.alpacaAccount.user.image : undefined,
2104
- role: props.alpacaAccount.user.role !== undefined ? props.alpacaAccount.user.role : undefined,
2105
- bio: props.alpacaAccount.user.bio !== undefined ? props.alpacaAccount.user.bio : undefined,
2106
- jobTitle: props.alpacaAccount.user.jobTitle !== undefined ? props.alpacaAccount.user.jobTitle : undefined,
2107
- currentAccount: props.alpacaAccount.user.currentAccount !== undefined ? props.alpacaAccount.user.currentAccount : undefined,
2108
- plan: props.alpacaAccount.user.plan !== undefined ? props.alpacaAccount.user.plan : undefined,
2109
- openaiAPIKey: props.alpacaAccount.user.openaiAPIKey !== undefined ? props.alpacaAccount.user.openaiAPIKey : undefined,
2110
- openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? props.alpacaAccount.user.openaiModel : undefined,
2111
- customer: props.alpacaAccount.user.customer ?
2112
- typeof props.alpacaAccount.user.customer === 'object' && Object.keys(props.alpacaAccount.user.customer).length === 1 && Object.keys(props.alpacaAccount.user.customer)[0] === 'id'
2113
- ? { connect: {
2114
- id: props.alpacaAccount.user.customer.id
2115
- }
2116
- }
2117
- : { connectOrCreate: {
2118
- where: {
2119
- id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
2120
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
2121
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
2122
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
2123
- equals: props.alpacaAccount.user.customer.authUserId
2124
- } : undefined,
2125
- name: props.alpacaAccount.user.customer.name !== undefined ? {
2126
- equals: props.alpacaAccount.user.customer.name
2127
- } : undefined,
2128
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
2129
- equals: props.alpacaAccount.user.customer.stripePriceId
2130
- } : undefined,
2131
- },
2132
- create: {
2133
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
2134
- name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
2135
- plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
2136
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
2137
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
2138
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
2139
- stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
2140
- },
2141
- }
2142
- } : undefined,
2143
- accounts: props.alpacaAccount.user.accounts ?
2144
- Array.isArray(props.alpacaAccount.user.accounts) && props.alpacaAccount.user.accounts.length > 0 && props.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2145
- connect: props.alpacaAccount.user.accounts.map((item) => ({
2146
- id: item.id
2147
- }))
2148
- }
2149
- : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
2150
- where: {
2151
- id: item.id !== undefined ? item.id : undefined,
2152
- userId: item.userId !== undefined ? {
2153
- equals: item.userId
2154
- } : undefined,
2155
- providerAccountId: item.providerAccountId !== undefined ? {
2156
- equals: item.providerAccountId
2157
- } : undefined,
2158
- },
2159
- create: {
2160
- type: item.type !== undefined ? item.type : undefined,
2161
- provider: item.provider !== undefined ? item.provider : undefined,
2162
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
2163
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
2164
- access_token: item.access_token !== undefined ? item.access_token : undefined,
2165
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
2166
- token_type: item.token_type !== undefined ? item.token_type : undefined,
2167
- scope: item.scope !== undefined ? item.scope : undefined,
2168
- id_token: item.id_token !== undefined ? item.id_token : undefined,
2169
- session_state: item.session_state !== undefined ? item.session_state : undefined,
2170
- },
2171
- }))
2172
- } : undefined,
2173
- sessions: props.alpacaAccount.user.sessions ?
2174
- Array.isArray(props.alpacaAccount.user.sessions) && props.alpacaAccount.user.sessions.length > 0 && props.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2175
- connect: props.alpacaAccount.user.sessions.map((item) => ({
2176
- id: item.id
2177
- }))
2178
- }
2179
- : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
2180
- where: {
2181
- id: item.id !== undefined ? item.id : undefined,
2182
- userId: item.userId !== undefined ? {
2183
- equals: item.userId
2184
- } : undefined,
2185
- },
2186
- create: {
2187
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
2188
- expires: item.expires !== undefined ? item.expires : undefined,
2189
- },
2190
- }))
2191
- } : undefined,
2192
- authenticators: props.alpacaAccount.user.authenticators ?
2193
- Array.isArray(props.alpacaAccount.user.authenticators) && props.alpacaAccount.user.authenticators.length > 0 && props.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2194
- connect: props.alpacaAccount.user.authenticators.map((item) => ({
2195
- id: item.id
2196
- }))
2197
- }
2198
- : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
2199
- where: {
2200
- id: item.id !== undefined ? item.id : undefined,
2201
- userId: item.userId !== undefined ? {
2202
- equals: item.userId
2203
- } : undefined,
2204
- },
2205
- create: {
2206
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
2207
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
2208
- counter: item.counter !== undefined ? item.counter : undefined,
2209
- },
2210
- }))
2211
- } : undefined,
2212
- },
2213
- }
2214
- } : undefined,
2215
- positions: props.alpacaAccount.positions ?
2216
- Array.isArray(props.alpacaAccount.positions) && props.alpacaAccount.positions.length > 0 && props.alpacaAccount.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2217
- connect: props.alpacaAccount.positions.map((item) => ({
2218
- id: item.id
2219
- }))
2220
- }
2221
- : { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
2222
- where: {
2223
- id: item.id !== undefined ? item.id : undefined,
2224
- symbol: item.symbol !== undefined ? {
2225
- equals: item.symbol
2226
- } : undefined,
2227
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
2228
- equals: item.alpacaAccountId
2229
- } : undefined,
2230
- },
2231
- create: {
2232
- symbol: item.symbol !== undefined ? item.symbol : undefined,
2233
- averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
2234
- qty: item.qty !== undefined ? item.qty : undefined,
2235
- qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
2236
- marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
2237
- costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
2238
- unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
2239
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
2240
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
2241
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
2242
- currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
2243
- lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
2244
- changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
2245
- assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
2246
- closed: item.closed !== undefined ? item.closed : undefined,
2247
- },
2248
- }))
2249
- } : undefined,
2250
- alerts: props.alpacaAccount.alerts ?
2251
- Array.isArray(props.alpacaAccount.alerts) && props.alpacaAccount.alerts.length > 0 && props.alpacaAccount.alerts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2252
- connect: props.alpacaAccount.alerts.map((item) => ({
2253
- id: item.id
2254
- }))
2255
- }
2256
- : { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
2257
- where: {
2258
- id: item.id !== undefined ? item.id : undefined,
2259
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
2260
- equals: item.alpacaAccountId
2261
- } : undefined,
2262
- },
2263
- create: {
2264
- message: item.message !== undefined ? item.message : undefined,
2265
- type: item.type !== undefined ? item.type : undefined,
2266
- isRead: item.isRead !== undefined ? item.isRead : undefined,
2267
- },
2268
- }))
2269
- } : undefined,
2270
- },
2271
- }
2272
- } : undefined,
2273
1108
  action: props.action ?
2274
1109
  typeof props.action === 'object' && Object.keys(props.action).length === 1 && Object.keys(props.action)[0] === 'id'
2275
1110
  ? { connect: {
@@ -2400,6 +1235,9 @@ exports.Order = {
2400
1235
  clientOrderId: props.clientOrderId !== undefined ? {
2401
1236
  set: props.clientOrderId
2402
1237
  } : undefined,
1238
+ alpacaAccountId: props.alpacaAccountId !== undefined ? {
1239
+ set: props.alpacaAccountId
1240
+ } : undefined,
2403
1241
  qty: props.qty !== undefined ? {
2404
1242
  set: props.qty
2405
1243
  } : undefined,
@@ -2512,803 +1350,63 @@ exports.Order = {
2512
1350
  typeof props.stopLoss === 'object' && Object.keys(props.stopLoss).length === 1 && (Object.keys(props.stopLoss)[0] === 'id' || Object.keys(props.stopLoss)[0] === 'symbol')
2513
1351
  ? {
2514
1352
  connect: {
2515
- id: props.stopLoss.id
2516
- }
2517
- } : { upsert: {
2518
- where: {
2519
- id: props.stopLoss.id !== undefined ? {
2520
- equals: props.stopLoss.id
2521
- } : undefined,
2522
- orderId: props.stopLoss.orderId !== undefined ? {
2523
- equals: props.stopLoss.orderId
2524
- } : undefined,
2525
- },
2526
- update: {
2527
- id: props.stopLoss.id !== undefined ? {
2528
- set: props.stopLoss.id
2529
- } : undefined,
2530
- stopPrice: props.stopLoss.stopPrice !== undefined ? {
2531
- set: props.stopLoss.stopPrice
2532
- } : undefined,
2533
- limitPrice: props.stopLoss.limitPrice !== undefined ? {
2534
- set: props.stopLoss.limitPrice
2535
- } : undefined,
2536
- },
2537
- create: {
2538
- stopPrice: props.stopLoss.stopPrice !== undefined ? props.stopLoss.stopPrice : undefined,
2539
- limitPrice: props.stopLoss.limitPrice !== undefined ? props.stopLoss.limitPrice : undefined,
2540
- },
2541
- }
2542
- } : undefined,
2543
- takeProfit: props.takeProfit ?
2544
- typeof props.takeProfit === 'object' && Object.keys(props.takeProfit).length === 1 && (Object.keys(props.takeProfit)[0] === 'id' || Object.keys(props.takeProfit)[0] === 'symbol')
2545
- ? {
2546
- connect: {
2547
- id: props.takeProfit.id
2548
- }
2549
- } : { upsert: {
2550
- where: {
2551
- id: props.takeProfit.id !== undefined ? {
2552
- equals: props.takeProfit.id
2553
- } : undefined,
2554
- orderId: props.takeProfit.orderId !== undefined ? {
2555
- equals: props.takeProfit.orderId
2556
- } : undefined,
2557
- },
2558
- update: {
2559
- id: props.takeProfit.id !== undefined ? {
2560
- set: props.takeProfit.id
2561
- } : undefined,
2562
- limitPrice: props.takeProfit.limitPrice !== undefined ? {
2563
- set: props.takeProfit.limitPrice
2564
- } : undefined,
2565
- stopPrice: props.takeProfit.stopPrice !== undefined ? {
2566
- set: props.takeProfit.stopPrice
2567
- } : undefined,
2568
- },
2569
- create: {
2570
- limitPrice: props.takeProfit.limitPrice !== undefined ? props.takeProfit.limitPrice : undefined,
2571
- stopPrice: props.takeProfit.stopPrice !== undefined ? props.takeProfit.stopPrice : undefined,
2572
- },
2573
- }
2574
- } : undefined,
2575
- alpacaAccount: props.alpacaAccount ?
2576
- typeof props.alpacaAccount === 'object' && Object.keys(props.alpacaAccount).length === 1 && (Object.keys(props.alpacaAccount)[0] === 'id' || Object.keys(props.alpacaAccount)[0] === 'symbol')
2577
- ? {
2578
- connect: {
2579
- id: props.alpacaAccount.id
2580
- }
2581
- } : { upsert: {
2582
- where: {
2583
- id: props.alpacaAccount.id !== undefined ? {
2584
- equals: props.alpacaAccount.id
2585
- } : undefined,
2586
- userId: props.alpacaAccount.userId !== undefined ? {
2587
- equals: props.alpacaAccount.userId
2588
- } : undefined,
2589
- },
2590
- update: {
2591
- id: props.alpacaAccount.id !== undefined ? {
2592
- set: props.alpacaAccount.id
2593
- } : undefined,
2594
- type: props.alpacaAccount.type !== undefined ? {
2595
- set: props.alpacaAccount.type
2596
- } : undefined,
2597
- APIKey: props.alpacaAccount.APIKey !== undefined ? {
2598
- set: props.alpacaAccount.APIKey
2599
- } : undefined,
2600
- APISecret: props.alpacaAccount.APISecret !== undefined ? {
2601
- set: props.alpacaAccount.APISecret
2602
- } : undefined,
2603
- configuration: props.alpacaAccount.configuration !== undefined ? {
2604
- set: props.alpacaAccount.configuration
2605
- } : undefined,
2606
- marketOpen: props.alpacaAccount.marketOpen !== undefined ? {
2607
- set: props.alpacaAccount.marketOpen
2608
- } : undefined,
2609
- realTime: props.alpacaAccount.realTime !== undefined ? {
2610
- set: props.alpacaAccount.realTime
2611
- } : undefined,
2612
- tradeAllocationPct: props.alpacaAccount.tradeAllocationPct !== undefined ? {
2613
- set: props.alpacaAccount.tradeAllocationPct
2614
- } : undefined,
2615
- minPercentageChange: props.alpacaAccount.minPercentageChange !== undefined ? {
2616
- set: props.alpacaAccount.minPercentageChange
2617
- } : undefined,
2618
- volumeThreshold: props.alpacaAccount.volumeThreshold !== undefined ? {
2619
- set: props.alpacaAccount.volumeThreshold
2620
- } : undefined,
2621
- enablePortfolioTrailingStop: props.alpacaAccount.enablePortfolioTrailingStop !== undefined ? {
2622
- set: props.alpacaAccount.enablePortfolioTrailingStop
2623
- } : undefined,
2624
- portfolioTrailPercent: props.alpacaAccount.portfolioTrailPercent !== undefined ? {
2625
- set: props.alpacaAccount.portfolioTrailPercent
2626
- } : undefined,
2627
- portfolioProfitThresholdPercent: props.alpacaAccount.portfolioProfitThresholdPercent !== undefined ? {
2628
- set: props.alpacaAccount.portfolioProfitThresholdPercent
2629
- } : undefined,
2630
- reducedPortfolioTrailPercent: props.alpacaAccount.reducedPortfolioTrailPercent !== undefined ? {
2631
- set: props.alpacaAccount.reducedPortfolioTrailPercent
2632
- } : undefined,
2633
- user: props.alpacaAccount.user ?
2634
- typeof props.alpacaAccount.user === 'object' && Object.keys(props.alpacaAccount.user).length === 1 && (Object.keys(props.alpacaAccount.user)[0] === 'id' || Object.keys(props.alpacaAccount.user)[0] === 'symbol')
2635
- ? {
2636
- connect: {
2637
- id: props.alpacaAccount.user.id
2638
- }
2639
- } : { upsert: {
2640
- where: {
2641
- id: props.alpacaAccount.user.id !== undefined ? {
2642
- equals: props.alpacaAccount.user.id
2643
- } : undefined,
2644
- name: props.alpacaAccount.user.name !== undefined ? {
2645
- equals: props.alpacaAccount.user.name
2646
- } : undefined,
2647
- email: props.alpacaAccount.user.email !== undefined ? {
2648
- equals: props.alpacaAccount.user.email
2649
- } : undefined,
2650
- customerId: props.alpacaAccount.user.customerId !== undefined ? {
2651
- equals: props.alpacaAccount.user.customerId
2652
- } : undefined,
2653
- },
2654
- update: {
2655
- id: props.alpacaAccount.user.id !== undefined ? {
2656
- set: props.alpacaAccount.user.id
2657
- } : undefined,
2658
- name: props.alpacaAccount.user.name !== undefined ? {
2659
- set: props.alpacaAccount.user.name
2660
- } : undefined,
2661
- email: props.alpacaAccount.user.email !== undefined ? {
2662
- set: props.alpacaAccount.user.email
2663
- } : undefined,
2664
- emailVerified: props.alpacaAccount.user.emailVerified !== undefined ? {
2665
- set: props.alpacaAccount.user.emailVerified
2666
- } : undefined,
2667
- image: props.alpacaAccount.user.image !== undefined ? {
2668
- set: props.alpacaAccount.user.image
2669
- } : undefined,
2670
- role: props.alpacaAccount.user.role !== undefined ? {
2671
- set: props.alpacaAccount.user.role
2672
- } : undefined,
2673
- bio: props.alpacaAccount.user.bio !== undefined ? {
2674
- set: props.alpacaAccount.user.bio
2675
- } : undefined,
2676
- jobTitle: props.alpacaAccount.user.jobTitle !== undefined ? {
2677
- set: props.alpacaAccount.user.jobTitle
2678
- } : undefined,
2679
- currentAccount: props.alpacaAccount.user.currentAccount !== undefined ? {
2680
- set: props.alpacaAccount.user.currentAccount
2681
- } : undefined,
2682
- plan: props.alpacaAccount.user.plan !== undefined ? {
2683
- set: props.alpacaAccount.user.plan
2684
- } : undefined,
2685
- openaiAPIKey: props.alpacaAccount.user.openaiAPIKey !== undefined ? {
2686
- set: props.alpacaAccount.user.openaiAPIKey
2687
- } : undefined,
2688
- openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? {
2689
- set: props.alpacaAccount.user.openaiModel
2690
- } : undefined,
2691
- customer: props.alpacaAccount.user.customer ?
2692
- typeof props.alpacaAccount.user.customer === 'object' && Object.keys(props.alpacaAccount.user.customer).length === 1 && (Object.keys(props.alpacaAccount.user.customer)[0] === 'id' || Object.keys(props.alpacaAccount.user.customer)[0] === 'symbol')
2693
- ? {
2694
- connect: {
2695
- id: props.alpacaAccount.user.customer.id
2696
- }
2697
- } : { upsert: {
2698
- where: {
2699
- id: props.alpacaAccount.user.customer.id !== undefined ? {
2700
- equals: props.alpacaAccount.user.customer.id
2701
- } : undefined,
2702
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
2703
- equals: props.alpacaAccount.user.customer.authUserId
2704
- } : undefined,
2705
- name: props.alpacaAccount.user.customer.name !== undefined ? {
2706
- equals: props.alpacaAccount.user.customer.name
2707
- } : undefined,
2708
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
2709
- equals: props.alpacaAccount.user.customer.stripeCustomerId
2710
- } : undefined,
2711
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
2712
- equals: props.alpacaAccount.user.customer.stripeSubscriptionId
2713
- } : undefined,
2714
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
2715
- equals: props.alpacaAccount.user.customer.stripePriceId
2716
- } : undefined,
2717
- },
2718
- update: {
2719
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
2720
- set: props.alpacaAccount.user.customer.authUserId
2721
- } : undefined,
2722
- name: props.alpacaAccount.user.customer.name !== undefined ? {
2723
- set: props.alpacaAccount.user.customer.name
2724
- } : undefined,
2725
- plan: props.alpacaAccount.user.customer.plan !== undefined ? {
2726
- set: props.alpacaAccount.user.customer.plan
2727
- } : undefined,
2728
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
2729
- set: props.alpacaAccount.user.customer.stripeCustomerId
2730
- } : undefined,
2731
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
2732
- set: props.alpacaAccount.user.customer.stripeSubscriptionId
2733
- } : undefined,
2734
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
2735
- set: props.alpacaAccount.user.customer.stripePriceId
2736
- } : undefined,
2737
- stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? {
2738
- set: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd
2739
- } : undefined,
2740
- },
2741
- create: {
2742
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
2743
- name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
2744
- plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
2745
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
2746
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
2747
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
2748
- stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
2749
- },
2750
- }
2751
- } : undefined,
2752
- accounts: props.alpacaAccount.user.accounts ?
2753
- Array.isArray(props.alpacaAccount.user.accounts) && props.alpacaAccount.user.accounts.length > 0 && props.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
2754
- connect: props.alpacaAccount.user.accounts.map((item) => ({
2755
- id: item.id
2756
- }))
2757
- } : { upsert: props.alpacaAccount.user.accounts.map((item) => ({
2758
- where: {
2759
- id: item.id !== undefined ? item.id : undefined,
2760
- userId: item.userId !== undefined ? {
2761
- equals: item.userId
2762
- } : undefined,
2763
- providerAccountId: item.providerAccountId !== undefined ? {
2764
- equals: item.providerAccountId
2765
- } : undefined,
2766
- },
2767
- update: {
2768
- id: item.id !== undefined ? {
2769
- set: item.id
2770
- } : undefined,
2771
- type: item.type !== undefined ? {
2772
- set: item.type
2773
- } : undefined,
2774
- provider: item.provider !== undefined ? {
2775
- set: item.provider
2776
- } : undefined,
2777
- providerAccountId: item.providerAccountId !== undefined ? {
2778
- set: item.providerAccountId
2779
- } : undefined,
2780
- refresh_token: item.refresh_token !== undefined ? {
2781
- set: item.refresh_token
2782
- } : undefined,
2783
- access_token: item.access_token !== undefined ? {
2784
- set: item.access_token
2785
- } : undefined,
2786
- expires_at: item.expires_at !== undefined ? {
2787
- set: item.expires_at
2788
- } : undefined,
2789
- token_type: item.token_type !== undefined ? {
2790
- set: item.token_type
2791
- } : undefined,
2792
- scope: item.scope !== undefined ? {
2793
- set: item.scope
2794
- } : undefined,
2795
- id_token: item.id_token !== undefined ? {
2796
- set: item.id_token
2797
- } : undefined,
2798
- session_state: item.session_state !== undefined ? {
2799
- set: item.session_state
2800
- } : undefined,
2801
- },
2802
- create: {
2803
- type: item.type !== undefined ? item.type : undefined,
2804
- provider: item.provider !== undefined ? item.provider : undefined,
2805
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
2806
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
2807
- access_token: item.access_token !== undefined ? item.access_token : undefined,
2808
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
2809
- token_type: item.token_type !== undefined ? item.token_type : undefined,
2810
- scope: item.scope !== undefined ? item.scope : undefined,
2811
- id_token: item.id_token !== undefined ? item.id_token : undefined,
2812
- session_state: item.session_state !== undefined ? item.session_state : undefined,
2813
- },
2814
- }))
2815
- } : undefined,
2816
- sessions: props.alpacaAccount.user.sessions ?
2817
- Array.isArray(props.alpacaAccount.user.sessions) && props.alpacaAccount.user.sessions.length > 0 && props.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
2818
- connect: props.alpacaAccount.user.sessions.map((item) => ({
2819
- id: item.id
2820
- }))
2821
- } : { upsert: props.alpacaAccount.user.sessions.map((item) => ({
2822
- where: {
2823
- id: item.id !== undefined ? item.id : undefined,
2824
- userId: item.userId !== undefined ? {
2825
- equals: item.userId
2826
- } : undefined,
2827
- },
2828
- update: {
2829
- id: item.id !== undefined ? {
2830
- set: item.id
2831
- } : undefined,
2832
- sessionToken: item.sessionToken !== undefined ? {
2833
- set: item.sessionToken
2834
- } : undefined,
2835
- expires: item.expires !== undefined ? {
2836
- set: item.expires
2837
- } : undefined,
2838
- },
2839
- create: {
2840
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
2841
- expires: item.expires !== undefined ? item.expires : undefined,
2842
- },
2843
- }))
2844
- } : undefined,
2845
- authenticators: props.alpacaAccount.user.authenticators ?
2846
- Array.isArray(props.alpacaAccount.user.authenticators) && props.alpacaAccount.user.authenticators.length > 0 && props.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
2847
- connect: props.alpacaAccount.user.authenticators.map((item) => ({
2848
- id: item.id
2849
- }))
2850
- } : { upsert: props.alpacaAccount.user.authenticators.map((item) => ({
2851
- where: {
2852
- id: item.id !== undefined ? item.id : undefined,
2853
- userId: item.userId !== undefined ? {
2854
- equals: item.userId
2855
- } : undefined,
2856
- },
2857
- update: {
2858
- id: item.id !== undefined ? {
2859
- set: item.id
2860
- } : undefined,
2861
- credentialID: item.credentialID !== undefined ? {
2862
- set: item.credentialID
2863
- } : undefined,
2864
- publicKey: item.publicKey !== undefined ? {
2865
- set: item.publicKey
2866
- } : undefined,
2867
- counter: item.counter !== undefined ? {
2868
- set: item.counter
2869
- } : undefined,
2870
- },
2871
- create: {
2872
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
2873
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
2874
- counter: item.counter !== undefined ? item.counter : undefined,
2875
- },
2876
- }))
2877
- } : undefined,
2878
- },
2879
- create: {
2880
- name: props.alpacaAccount.user.name !== undefined ? props.alpacaAccount.user.name : undefined,
2881
- email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
2882
- emailVerified: props.alpacaAccount.user.emailVerified !== undefined ? props.alpacaAccount.user.emailVerified : undefined,
2883
- image: props.alpacaAccount.user.image !== undefined ? props.alpacaAccount.user.image : undefined,
2884
- role: props.alpacaAccount.user.role !== undefined ? props.alpacaAccount.user.role : undefined,
2885
- bio: props.alpacaAccount.user.bio !== undefined ? props.alpacaAccount.user.bio : undefined,
2886
- jobTitle: props.alpacaAccount.user.jobTitle !== undefined ? props.alpacaAccount.user.jobTitle : undefined,
2887
- currentAccount: props.alpacaAccount.user.currentAccount !== undefined ? props.alpacaAccount.user.currentAccount : undefined,
2888
- plan: props.alpacaAccount.user.plan !== undefined ? props.alpacaAccount.user.plan : undefined,
2889
- openaiAPIKey: props.alpacaAccount.user.openaiAPIKey !== undefined ? props.alpacaAccount.user.openaiAPIKey : undefined,
2890
- openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? props.alpacaAccount.user.openaiModel : undefined,
2891
- customer: props.alpacaAccount.user.customer ?
2892
- typeof props.alpacaAccount.user.customer === 'object' && Object.keys(props.alpacaAccount.user.customer).length === 1 && Object.keys(props.alpacaAccount.user.customer)[0] === 'id'
2893
- ? { connect: {
2894
- id: props.alpacaAccount.user.customer.id
2895
- }
2896
- }
2897
- : { connectOrCreate: {
2898
- where: {
2899
- id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
2900
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
2901
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
2902
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
2903
- equals: props.alpacaAccount.user.customer.authUserId
2904
- } : undefined,
2905
- name: props.alpacaAccount.user.customer.name !== undefined ? {
2906
- equals: props.alpacaAccount.user.customer.name
2907
- } : undefined,
2908
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
2909
- equals: props.alpacaAccount.user.customer.stripePriceId
2910
- } : undefined,
2911
- },
2912
- create: {
2913
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
2914
- name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
2915
- plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
2916
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
2917
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
2918
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
2919
- stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
2920
- },
2921
- }
2922
- } : undefined,
2923
- accounts: props.alpacaAccount.user.accounts ?
2924
- Array.isArray(props.alpacaAccount.user.accounts) && props.alpacaAccount.user.accounts.length > 0 && props.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2925
- connect: props.alpacaAccount.user.accounts.map((item) => ({
2926
- id: item.id
2927
- }))
2928
- }
2929
- : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
2930
- where: {
2931
- id: item.id !== undefined ? item.id : undefined,
2932
- userId: item.userId !== undefined ? {
2933
- equals: item.userId
2934
- } : undefined,
2935
- providerAccountId: item.providerAccountId !== undefined ? {
2936
- equals: item.providerAccountId
2937
- } : undefined,
2938
- },
2939
- create: {
2940
- type: item.type !== undefined ? item.type : undefined,
2941
- provider: item.provider !== undefined ? item.provider : undefined,
2942
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
2943
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
2944
- access_token: item.access_token !== undefined ? item.access_token : undefined,
2945
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
2946
- token_type: item.token_type !== undefined ? item.token_type : undefined,
2947
- scope: item.scope !== undefined ? item.scope : undefined,
2948
- id_token: item.id_token !== undefined ? item.id_token : undefined,
2949
- session_state: item.session_state !== undefined ? item.session_state : undefined,
2950
- },
2951
- }))
2952
- } : undefined,
2953
- sessions: props.alpacaAccount.user.sessions ?
2954
- Array.isArray(props.alpacaAccount.user.sessions) && props.alpacaAccount.user.sessions.length > 0 && props.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2955
- connect: props.alpacaAccount.user.sessions.map((item) => ({
2956
- id: item.id
2957
- }))
2958
- }
2959
- : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
2960
- where: {
2961
- id: item.id !== undefined ? item.id : undefined,
2962
- userId: item.userId !== undefined ? {
2963
- equals: item.userId
2964
- } : undefined,
2965
- },
2966
- create: {
2967
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
2968
- expires: item.expires !== undefined ? item.expires : undefined,
2969
- },
2970
- }))
2971
- } : undefined,
2972
- authenticators: props.alpacaAccount.user.authenticators ?
2973
- Array.isArray(props.alpacaAccount.user.authenticators) && props.alpacaAccount.user.authenticators.length > 0 && props.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2974
- connect: props.alpacaAccount.user.authenticators.map((item) => ({
2975
- id: item.id
2976
- }))
2977
- }
2978
- : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
2979
- where: {
2980
- id: item.id !== undefined ? item.id : undefined,
2981
- userId: item.userId !== undefined ? {
2982
- equals: item.userId
2983
- } : undefined,
2984
- },
2985
- create: {
2986
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
2987
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
2988
- counter: item.counter !== undefined ? item.counter : undefined,
2989
- },
2990
- }))
2991
- } : undefined,
2992
- },
2993
- }
2994
- } : undefined,
2995
- positions: props.alpacaAccount.positions ?
2996
- Array.isArray(props.alpacaAccount.positions) && props.alpacaAccount.positions.length > 0 && props.alpacaAccount.positions.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
2997
- connect: props.alpacaAccount.positions.map((item) => ({
2998
- id: item.id
2999
- }))
3000
- } : { upsert: props.alpacaAccount.positions.map((item) => ({
3001
- where: {
3002
- id: item.id !== undefined ? item.id : undefined,
3003
- symbol: item.symbol !== undefined ? {
3004
- equals: item.symbol
3005
- } : undefined,
3006
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
3007
- equals: item.alpacaAccountId
3008
- } : undefined,
3009
- },
3010
- update: {
3011
- id: item.id !== undefined ? {
3012
- set: item.id
3013
- } : undefined,
3014
- symbol: item.symbol !== undefined ? {
3015
- set: item.symbol
3016
- } : undefined,
3017
- averageEntryPrice: item.averageEntryPrice !== undefined ? {
3018
- set: item.averageEntryPrice
3019
- } : undefined,
3020
- qty: item.qty !== undefined ? {
3021
- set: item.qty
3022
- } : undefined,
3023
- qtyAvailable: item.qtyAvailable !== undefined ? {
3024
- set: item.qtyAvailable
3025
- } : undefined,
3026
- marketValue: item.marketValue !== undefined ? {
3027
- set: item.marketValue
3028
- } : undefined,
3029
- costBasis: item.costBasis !== undefined ? {
3030
- set: item.costBasis
3031
- } : undefined,
3032
- unrealizedPL: item.unrealizedPL !== undefined ? {
3033
- set: item.unrealizedPL
3034
- } : undefined,
3035
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? {
3036
- set: item.unrealizedPLPC
3037
- } : undefined,
3038
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? {
3039
- set: item.unrealisedIntradayPL
3040
- } : undefined,
3041
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? {
3042
- set: item.unrealisedIntradayPLPC
3043
- } : undefined,
3044
- currentPrice: item.currentPrice !== undefined ? {
3045
- set: item.currentPrice
3046
- } : undefined,
3047
- lastTradePrice: item.lastTradePrice !== undefined ? {
3048
- set: item.lastTradePrice
3049
- } : undefined,
3050
- changeToday: item.changeToday !== undefined ? {
3051
- set: item.changeToday
3052
- } : undefined,
3053
- assetMarginable: item.assetMarginable !== undefined ? {
3054
- set: item.assetMarginable
3055
- } : undefined,
3056
- closed: item.closed !== undefined ? {
3057
- set: item.closed
3058
- } : undefined,
3059
- },
3060
- create: {
3061
- symbol: item.symbol !== undefined ? item.symbol : undefined,
3062
- averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
3063
- qty: item.qty !== undefined ? item.qty : undefined,
3064
- qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
3065
- marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
3066
- costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
3067
- unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
3068
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
3069
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
3070
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
3071
- currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
3072
- lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
3073
- changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
3074
- assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
3075
- closed: item.closed !== undefined ? item.closed : undefined,
3076
- },
3077
- }))
3078
- } : undefined,
3079
- alerts: props.alpacaAccount.alerts ?
3080
- Array.isArray(props.alpacaAccount.alerts) && props.alpacaAccount.alerts.length > 0 && props.alpacaAccount.alerts.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
3081
- connect: props.alpacaAccount.alerts.map((item) => ({
3082
- id: item.id
3083
- }))
3084
- } : { upsert: props.alpacaAccount.alerts.map((item) => ({
3085
- where: {
3086
- id: item.id !== undefined ? item.id : undefined,
3087
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
3088
- equals: item.alpacaAccountId
3089
- } : undefined,
3090
- },
3091
- update: {
3092
- id: item.id !== undefined ? {
3093
- set: item.id
3094
- } : undefined,
3095
- message: item.message !== undefined ? {
3096
- set: item.message
3097
- } : undefined,
3098
- type: item.type !== undefined ? {
3099
- set: item.type
3100
- } : undefined,
3101
- isRead: item.isRead !== undefined ? {
3102
- set: item.isRead
3103
- } : undefined,
3104
- },
3105
- create: {
3106
- message: item.message !== undefined ? item.message : undefined,
3107
- type: item.type !== undefined ? item.type : undefined,
3108
- isRead: item.isRead !== undefined ? item.isRead : undefined,
3109
- },
3110
- }))
3111
- } : undefined,
1353
+ id: props.stopLoss.id
1354
+ }
1355
+ } : { upsert: {
1356
+ where: {
1357
+ id: props.stopLoss.id !== undefined ? {
1358
+ equals: props.stopLoss.id
1359
+ } : undefined,
1360
+ orderId: props.stopLoss.orderId !== undefined ? {
1361
+ equals: props.stopLoss.orderId
1362
+ } : undefined,
1363
+ },
1364
+ update: {
1365
+ id: props.stopLoss.id !== undefined ? {
1366
+ set: props.stopLoss.id
1367
+ } : undefined,
1368
+ stopPrice: props.stopLoss.stopPrice !== undefined ? {
1369
+ set: props.stopLoss.stopPrice
1370
+ } : undefined,
1371
+ limitPrice: props.stopLoss.limitPrice !== undefined ? {
1372
+ set: props.stopLoss.limitPrice
1373
+ } : undefined,
3112
1374
  },
3113
1375
  create: {
3114
- type: props.alpacaAccount.type !== undefined ? props.alpacaAccount.type : undefined,
3115
- APIKey: props.alpacaAccount.APIKey !== undefined ? props.alpacaAccount.APIKey : undefined,
3116
- APISecret: props.alpacaAccount.APISecret !== undefined ? props.alpacaAccount.APISecret : undefined,
3117
- configuration: props.alpacaAccount.configuration !== undefined ? props.alpacaAccount.configuration : undefined,
3118
- marketOpen: props.alpacaAccount.marketOpen !== undefined ? props.alpacaAccount.marketOpen : undefined,
3119
- realTime: props.alpacaAccount.realTime !== undefined ? props.alpacaAccount.realTime : undefined,
3120
- tradeAllocationPct: props.alpacaAccount.tradeAllocationPct !== undefined ? props.alpacaAccount.tradeAllocationPct : undefined,
3121
- minPercentageChange: props.alpacaAccount.minPercentageChange !== undefined ? props.alpacaAccount.minPercentageChange : undefined,
3122
- volumeThreshold: props.alpacaAccount.volumeThreshold !== undefined ? props.alpacaAccount.volumeThreshold : undefined,
3123
- enablePortfolioTrailingStop: props.alpacaAccount.enablePortfolioTrailingStop !== undefined ? props.alpacaAccount.enablePortfolioTrailingStop : undefined,
3124
- portfolioTrailPercent: props.alpacaAccount.portfolioTrailPercent !== undefined ? props.alpacaAccount.portfolioTrailPercent : undefined,
3125
- portfolioProfitThresholdPercent: props.alpacaAccount.portfolioProfitThresholdPercent !== undefined ? props.alpacaAccount.portfolioProfitThresholdPercent : undefined,
3126
- reducedPortfolioTrailPercent: props.alpacaAccount.reducedPortfolioTrailPercent !== undefined ? props.alpacaAccount.reducedPortfolioTrailPercent : undefined,
3127
- user: props.alpacaAccount.user ?
3128
- typeof props.alpacaAccount.user === 'object' && Object.keys(props.alpacaAccount.user).length === 1 && Object.keys(props.alpacaAccount.user)[0] === 'id'
3129
- ? { connect: {
3130
- id: props.alpacaAccount.user.id
3131
- }
3132
- }
3133
- : { connectOrCreate: {
3134
- where: {
3135
- id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
3136
- email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
3137
- name: props.alpacaAccount.user.name !== undefined ? {
3138
- equals: props.alpacaAccount.user.name
3139
- } : undefined,
3140
- },
3141
- create: {
3142
- name: props.alpacaAccount.user.name !== undefined ? props.alpacaAccount.user.name : undefined,
3143
- email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
3144
- emailVerified: props.alpacaAccount.user.emailVerified !== undefined ? props.alpacaAccount.user.emailVerified : undefined,
3145
- image: props.alpacaAccount.user.image !== undefined ? props.alpacaAccount.user.image : undefined,
3146
- role: props.alpacaAccount.user.role !== undefined ? props.alpacaAccount.user.role : undefined,
3147
- bio: props.alpacaAccount.user.bio !== undefined ? props.alpacaAccount.user.bio : undefined,
3148
- jobTitle: props.alpacaAccount.user.jobTitle !== undefined ? props.alpacaAccount.user.jobTitle : undefined,
3149
- currentAccount: props.alpacaAccount.user.currentAccount !== undefined ? props.alpacaAccount.user.currentAccount : undefined,
3150
- plan: props.alpacaAccount.user.plan !== undefined ? props.alpacaAccount.user.plan : undefined,
3151
- openaiAPIKey: props.alpacaAccount.user.openaiAPIKey !== undefined ? props.alpacaAccount.user.openaiAPIKey : undefined,
3152
- openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? props.alpacaAccount.user.openaiModel : undefined,
3153
- customer: props.alpacaAccount.user.customer ?
3154
- typeof props.alpacaAccount.user.customer === 'object' && Object.keys(props.alpacaAccount.user.customer).length === 1 && Object.keys(props.alpacaAccount.user.customer)[0] === 'id'
3155
- ? { connect: {
3156
- id: props.alpacaAccount.user.customer.id
3157
- }
3158
- }
3159
- : { connectOrCreate: {
3160
- where: {
3161
- id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
3162
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
3163
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
3164
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
3165
- equals: props.alpacaAccount.user.customer.authUserId
3166
- } : undefined,
3167
- name: props.alpacaAccount.user.customer.name !== undefined ? {
3168
- equals: props.alpacaAccount.user.customer.name
3169
- } : undefined,
3170
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
3171
- equals: props.alpacaAccount.user.customer.stripePriceId
3172
- } : undefined,
3173
- },
3174
- create: {
3175
- authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
3176
- name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
3177
- plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
3178
- stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
3179
- stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
3180
- stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
3181
- stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
3182
- },
3183
- }
3184
- } : undefined,
3185
- accounts: props.alpacaAccount.user.accounts ?
3186
- Array.isArray(props.alpacaAccount.user.accounts) && props.alpacaAccount.user.accounts.length > 0 && props.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3187
- connect: props.alpacaAccount.user.accounts.map((item) => ({
3188
- id: item.id
3189
- }))
3190
- }
3191
- : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
3192
- where: {
3193
- id: item.id !== undefined ? item.id : undefined,
3194
- userId: item.userId !== undefined ? {
3195
- equals: item.userId
3196
- } : undefined,
3197
- providerAccountId: item.providerAccountId !== undefined ? {
3198
- equals: item.providerAccountId
3199
- } : undefined,
3200
- },
3201
- create: {
3202
- type: item.type !== undefined ? item.type : undefined,
3203
- provider: item.provider !== undefined ? item.provider : undefined,
3204
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
3205
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
3206
- access_token: item.access_token !== undefined ? item.access_token : undefined,
3207
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
3208
- token_type: item.token_type !== undefined ? item.token_type : undefined,
3209
- scope: item.scope !== undefined ? item.scope : undefined,
3210
- id_token: item.id_token !== undefined ? item.id_token : undefined,
3211
- session_state: item.session_state !== undefined ? item.session_state : undefined,
3212
- },
3213
- }))
3214
- } : undefined,
3215
- sessions: props.alpacaAccount.user.sessions ?
3216
- Array.isArray(props.alpacaAccount.user.sessions) && props.alpacaAccount.user.sessions.length > 0 && props.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3217
- connect: props.alpacaAccount.user.sessions.map((item) => ({
3218
- id: item.id
3219
- }))
3220
- }
3221
- : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
3222
- where: {
3223
- id: item.id !== undefined ? item.id : undefined,
3224
- userId: item.userId !== undefined ? {
3225
- equals: item.userId
3226
- } : undefined,
3227
- },
3228
- create: {
3229
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
3230
- expires: item.expires !== undefined ? item.expires : undefined,
3231
- },
3232
- }))
3233
- } : undefined,
3234
- authenticators: props.alpacaAccount.user.authenticators ?
3235
- Array.isArray(props.alpacaAccount.user.authenticators) && props.alpacaAccount.user.authenticators.length > 0 && props.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3236
- connect: props.alpacaAccount.user.authenticators.map((item) => ({
3237
- id: item.id
3238
- }))
3239
- }
3240
- : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
3241
- where: {
3242
- id: item.id !== undefined ? item.id : undefined,
3243
- userId: item.userId !== undefined ? {
3244
- equals: item.userId
3245
- } : undefined,
3246
- },
3247
- create: {
3248
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
3249
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
3250
- counter: item.counter !== undefined ? item.counter : undefined,
3251
- },
3252
- }))
3253
- } : undefined,
3254
- },
3255
- }
3256
- } : undefined,
3257
- positions: props.alpacaAccount.positions ?
3258
- Array.isArray(props.alpacaAccount.positions) && props.alpacaAccount.positions.length > 0 && props.alpacaAccount.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3259
- connect: props.alpacaAccount.positions.map((item) => ({
3260
- id: item.id
3261
- }))
3262
- }
3263
- : { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
3264
- where: {
3265
- id: item.id !== undefined ? item.id : undefined,
3266
- symbol: item.symbol !== undefined ? {
3267
- equals: item.symbol
3268
- } : undefined,
3269
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
3270
- equals: item.alpacaAccountId
3271
- } : undefined,
3272
- },
3273
- create: {
3274
- symbol: item.symbol !== undefined ? item.symbol : undefined,
3275
- averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
3276
- qty: item.qty !== undefined ? item.qty : undefined,
3277
- qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
3278
- marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
3279
- costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
3280
- unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
3281
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
3282
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
3283
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
3284
- currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
3285
- lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
3286
- changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
3287
- assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
3288
- closed: item.closed !== undefined ? item.closed : undefined,
3289
- },
3290
- }))
3291
- } : undefined,
3292
- alerts: props.alpacaAccount.alerts ?
3293
- Array.isArray(props.alpacaAccount.alerts) && props.alpacaAccount.alerts.length > 0 && props.alpacaAccount.alerts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3294
- connect: props.alpacaAccount.alerts.map((item) => ({
3295
- id: item.id
3296
- }))
3297
- }
3298
- : { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
3299
- where: {
3300
- id: item.id !== undefined ? item.id : undefined,
3301
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
3302
- equals: item.alpacaAccountId
3303
- } : undefined,
3304
- },
3305
- create: {
3306
- message: item.message !== undefined ? item.message : undefined,
3307
- type: item.type !== undefined ? item.type : undefined,
3308
- isRead: item.isRead !== undefined ? item.isRead : undefined,
3309
- },
3310
- }))
3311
- } : undefined,
1376
+ stopPrice: props.stopLoss.stopPrice !== undefined ? props.stopLoss.stopPrice : undefined,
1377
+ limitPrice: props.stopLoss.limitPrice !== undefined ? props.stopLoss.limitPrice : undefined,
1378
+ },
1379
+ }
1380
+ } : undefined,
1381
+ takeProfit: props.takeProfit ?
1382
+ typeof props.takeProfit === 'object' && Object.keys(props.takeProfit).length === 1 && (Object.keys(props.takeProfit)[0] === 'id' || Object.keys(props.takeProfit)[0] === 'symbol')
1383
+ ? {
1384
+ connect: {
1385
+ id: props.takeProfit.id
1386
+ }
1387
+ } : { upsert: {
1388
+ where: {
1389
+ id: props.takeProfit.id !== undefined ? {
1390
+ equals: props.takeProfit.id
1391
+ } : undefined,
1392
+ orderId: props.takeProfit.orderId !== undefined ? {
1393
+ equals: props.takeProfit.orderId
1394
+ } : undefined,
1395
+ },
1396
+ update: {
1397
+ id: props.takeProfit.id !== undefined ? {
1398
+ set: props.takeProfit.id
1399
+ } : undefined,
1400
+ limitPrice: props.takeProfit.limitPrice !== undefined ? {
1401
+ set: props.takeProfit.limitPrice
1402
+ } : undefined,
1403
+ stopPrice: props.takeProfit.stopPrice !== undefined ? {
1404
+ set: props.takeProfit.stopPrice
1405
+ } : undefined,
1406
+ },
1407
+ create: {
1408
+ limitPrice: props.takeProfit.limitPrice !== undefined ? props.takeProfit.limitPrice : undefined,
1409
+ stopPrice: props.takeProfit.stopPrice !== undefined ? props.takeProfit.stopPrice : undefined,
3312
1410
  },
3313
1411
  }
3314
1412
  } : undefined,
@@ -3727,6 +1825,9 @@ exports.Order = {
3727
1825
  clientOrderId: prop.clientOrderId !== undefined ? {
3728
1826
  set: prop.clientOrderId
3729
1827
  } : undefined,
1828
+ alpacaAccountId: prop.alpacaAccountId !== undefined ? {
1829
+ set: prop.alpacaAccountId
1830
+ } : undefined,
3730
1831
  qty: prop.qty !== undefined ? {
3731
1832
  set: prop.qty
3732
1833
  } : undefined,
@@ -3905,746 +2006,6 @@ exports.Order = {
3905
2006
  },
3906
2007
  }
3907
2008
  } : undefined,
3908
- alpacaAccount: prop.alpacaAccount ?
3909
- typeof prop.alpacaAccount === 'object' && Object.keys(prop.alpacaAccount).length === 1 && (Object.keys(prop.alpacaAccount)[0] === 'id' || Object.keys(prop.alpacaAccount)[0] === 'symbol')
3910
- ? {
3911
- connect: {
3912
- id: prop.alpacaAccount.id
3913
- }
3914
- } : { upsert: {
3915
- where: {
3916
- id: prop.alpacaAccount.id !== undefined ? {
3917
- equals: prop.alpacaAccount.id
3918
- } : undefined,
3919
- userId: prop.alpacaAccount.userId !== undefined ? {
3920
- equals: prop.alpacaAccount.userId
3921
- } : undefined,
3922
- },
3923
- update: {
3924
- id: prop.alpacaAccount.id !== undefined ? {
3925
- set: prop.alpacaAccount.id
3926
- } : undefined,
3927
- type: prop.alpacaAccount.type !== undefined ? {
3928
- set: prop.alpacaAccount.type
3929
- } : undefined,
3930
- APIKey: prop.alpacaAccount.APIKey !== undefined ? {
3931
- set: prop.alpacaAccount.APIKey
3932
- } : undefined,
3933
- APISecret: prop.alpacaAccount.APISecret !== undefined ? {
3934
- set: prop.alpacaAccount.APISecret
3935
- } : undefined,
3936
- configuration: prop.alpacaAccount.configuration !== undefined ? {
3937
- set: prop.alpacaAccount.configuration
3938
- } : undefined,
3939
- marketOpen: prop.alpacaAccount.marketOpen !== undefined ? {
3940
- set: prop.alpacaAccount.marketOpen
3941
- } : undefined,
3942
- realTime: prop.alpacaAccount.realTime !== undefined ? {
3943
- set: prop.alpacaAccount.realTime
3944
- } : undefined,
3945
- tradeAllocationPct: prop.alpacaAccount.tradeAllocationPct !== undefined ? {
3946
- set: prop.alpacaAccount.tradeAllocationPct
3947
- } : undefined,
3948
- minPercentageChange: prop.alpacaAccount.minPercentageChange !== undefined ? {
3949
- set: prop.alpacaAccount.minPercentageChange
3950
- } : undefined,
3951
- volumeThreshold: prop.alpacaAccount.volumeThreshold !== undefined ? {
3952
- set: prop.alpacaAccount.volumeThreshold
3953
- } : undefined,
3954
- enablePortfolioTrailingStop: prop.alpacaAccount.enablePortfolioTrailingStop !== undefined ? {
3955
- set: prop.alpacaAccount.enablePortfolioTrailingStop
3956
- } : undefined,
3957
- portfolioTrailPercent: prop.alpacaAccount.portfolioTrailPercent !== undefined ? {
3958
- set: prop.alpacaAccount.portfolioTrailPercent
3959
- } : undefined,
3960
- portfolioProfitThresholdPercent: prop.alpacaAccount.portfolioProfitThresholdPercent !== undefined ? {
3961
- set: prop.alpacaAccount.portfolioProfitThresholdPercent
3962
- } : undefined,
3963
- reducedPortfolioTrailPercent: prop.alpacaAccount.reducedPortfolioTrailPercent !== undefined ? {
3964
- set: prop.alpacaAccount.reducedPortfolioTrailPercent
3965
- } : undefined,
3966
- user: prop.alpacaAccount.user ?
3967
- typeof prop.alpacaAccount.user === 'object' && Object.keys(prop.alpacaAccount.user).length === 1 && (Object.keys(prop.alpacaAccount.user)[0] === 'id' || Object.keys(prop.alpacaAccount.user)[0] === 'symbol')
3968
- ? {
3969
- connect: {
3970
- id: prop.alpacaAccount.user.id
3971
- }
3972
- } : { upsert: {
3973
- where: {
3974
- id: prop.alpacaAccount.user.id !== undefined ? {
3975
- equals: prop.alpacaAccount.user.id
3976
- } : undefined,
3977
- name: prop.alpacaAccount.user.name !== undefined ? {
3978
- equals: prop.alpacaAccount.user.name
3979
- } : undefined,
3980
- email: prop.alpacaAccount.user.email !== undefined ? {
3981
- equals: prop.alpacaAccount.user.email
3982
- } : undefined,
3983
- customerId: prop.alpacaAccount.user.customerId !== undefined ? {
3984
- equals: prop.alpacaAccount.user.customerId
3985
- } : undefined,
3986
- },
3987
- update: {
3988
- id: prop.alpacaAccount.user.id !== undefined ? {
3989
- set: prop.alpacaAccount.user.id
3990
- } : undefined,
3991
- name: prop.alpacaAccount.user.name !== undefined ? {
3992
- set: prop.alpacaAccount.user.name
3993
- } : undefined,
3994
- email: prop.alpacaAccount.user.email !== undefined ? {
3995
- set: prop.alpacaAccount.user.email
3996
- } : undefined,
3997
- emailVerified: prop.alpacaAccount.user.emailVerified !== undefined ? {
3998
- set: prop.alpacaAccount.user.emailVerified
3999
- } : undefined,
4000
- image: prop.alpacaAccount.user.image !== undefined ? {
4001
- set: prop.alpacaAccount.user.image
4002
- } : undefined,
4003
- role: prop.alpacaAccount.user.role !== undefined ? {
4004
- set: prop.alpacaAccount.user.role
4005
- } : undefined,
4006
- bio: prop.alpacaAccount.user.bio !== undefined ? {
4007
- set: prop.alpacaAccount.user.bio
4008
- } : undefined,
4009
- jobTitle: prop.alpacaAccount.user.jobTitle !== undefined ? {
4010
- set: prop.alpacaAccount.user.jobTitle
4011
- } : undefined,
4012
- currentAccount: prop.alpacaAccount.user.currentAccount !== undefined ? {
4013
- set: prop.alpacaAccount.user.currentAccount
4014
- } : undefined,
4015
- plan: prop.alpacaAccount.user.plan !== undefined ? {
4016
- set: prop.alpacaAccount.user.plan
4017
- } : undefined,
4018
- openaiAPIKey: prop.alpacaAccount.user.openaiAPIKey !== undefined ? {
4019
- set: prop.alpacaAccount.user.openaiAPIKey
4020
- } : undefined,
4021
- openaiModel: prop.alpacaAccount.user.openaiModel !== undefined ? {
4022
- set: prop.alpacaAccount.user.openaiModel
4023
- } : undefined,
4024
- customer: prop.alpacaAccount.user.customer ?
4025
- typeof prop.alpacaAccount.user.customer === 'object' && Object.keys(prop.alpacaAccount.user.customer).length === 1 && (Object.keys(prop.alpacaAccount.user.customer)[0] === 'id' || Object.keys(prop.alpacaAccount.user.customer)[0] === 'symbol')
4026
- ? {
4027
- connect: {
4028
- id: prop.alpacaAccount.user.customer.id
4029
- }
4030
- } : { upsert: {
4031
- where: {
4032
- id: prop.alpacaAccount.user.customer.id !== undefined ? {
4033
- equals: prop.alpacaAccount.user.customer.id
4034
- } : undefined,
4035
- authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
4036
- equals: prop.alpacaAccount.user.customer.authUserId
4037
- } : undefined,
4038
- name: prop.alpacaAccount.user.customer.name !== undefined ? {
4039
- equals: prop.alpacaAccount.user.customer.name
4040
- } : undefined,
4041
- stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
4042
- equals: prop.alpacaAccount.user.customer.stripeCustomerId
4043
- } : undefined,
4044
- stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
4045
- equals: prop.alpacaAccount.user.customer.stripeSubscriptionId
4046
- } : undefined,
4047
- stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
4048
- equals: prop.alpacaAccount.user.customer.stripePriceId
4049
- } : undefined,
4050
- },
4051
- update: {
4052
- authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
4053
- set: prop.alpacaAccount.user.customer.authUserId
4054
- } : undefined,
4055
- name: prop.alpacaAccount.user.customer.name !== undefined ? {
4056
- set: prop.alpacaAccount.user.customer.name
4057
- } : undefined,
4058
- plan: prop.alpacaAccount.user.customer.plan !== undefined ? {
4059
- set: prop.alpacaAccount.user.customer.plan
4060
- } : undefined,
4061
- stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
4062
- set: prop.alpacaAccount.user.customer.stripeCustomerId
4063
- } : undefined,
4064
- stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
4065
- set: prop.alpacaAccount.user.customer.stripeSubscriptionId
4066
- } : undefined,
4067
- stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
4068
- set: prop.alpacaAccount.user.customer.stripePriceId
4069
- } : undefined,
4070
- stripeCurrentPeriodEnd: prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? {
4071
- set: prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd
4072
- } : undefined,
4073
- },
4074
- create: {
4075
- authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
4076
- name: prop.alpacaAccount.user.customer.name !== undefined ? prop.alpacaAccount.user.customer.name : undefined,
4077
- plan: prop.alpacaAccount.user.customer.plan !== undefined ? prop.alpacaAccount.user.customer.plan : undefined,
4078
- stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
4079
- stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
4080
- stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? prop.alpacaAccount.user.customer.stripePriceId : undefined,
4081
- stripeCurrentPeriodEnd: prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
4082
- },
4083
- }
4084
- } : undefined,
4085
- accounts: prop.alpacaAccount.user.accounts ?
4086
- Array.isArray(prop.alpacaAccount.user.accounts) && prop.alpacaAccount.user.accounts.length > 0 && prop.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
4087
- connect: prop.alpacaAccount.user.accounts.map((item) => ({
4088
- id: item.id
4089
- }))
4090
- } : { upsert: prop.alpacaAccount.user.accounts.map((item) => ({
4091
- where: {
4092
- id: item.id !== undefined ? item.id : undefined,
4093
- userId: item.userId !== undefined ? {
4094
- equals: item.userId
4095
- } : undefined,
4096
- providerAccountId: item.providerAccountId !== undefined ? {
4097
- equals: item.providerAccountId
4098
- } : undefined,
4099
- },
4100
- update: {
4101
- id: item.id !== undefined ? {
4102
- set: item.id
4103
- } : undefined,
4104
- type: item.type !== undefined ? {
4105
- set: item.type
4106
- } : undefined,
4107
- provider: item.provider !== undefined ? {
4108
- set: item.provider
4109
- } : undefined,
4110
- providerAccountId: item.providerAccountId !== undefined ? {
4111
- set: item.providerAccountId
4112
- } : undefined,
4113
- refresh_token: item.refresh_token !== undefined ? {
4114
- set: item.refresh_token
4115
- } : undefined,
4116
- access_token: item.access_token !== undefined ? {
4117
- set: item.access_token
4118
- } : undefined,
4119
- expires_at: item.expires_at !== undefined ? {
4120
- set: item.expires_at
4121
- } : undefined,
4122
- token_type: item.token_type !== undefined ? {
4123
- set: item.token_type
4124
- } : undefined,
4125
- scope: item.scope !== undefined ? {
4126
- set: item.scope
4127
- } : undefined,
4128
- id_token: item.id_token !== undefined ? {
4129
- set: item.id_token
4130
- } : undefined,
4131
- session_state: item.session_state !== undefined ? {
4132
- set: item.session_state
4133
- } : undefined,
4134
- },
4135
- create: {
4136
- type: item.type !== undefined ? item.type : undefined,
4137
- provider: item.provider !== undefined ? item.provider : undefined,
4138
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
4139
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
4140
- access_token: item.access_token !== undefined ? item.access_token : undefined,
4141
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
4142
- token_type: item.token_type !== undefined ? item.token_type : undefined,
4143
- scope: item.scope !== undefined ? item.scope : undefined,
4144
- id_token: item.id_token !== undefined ? item.id_token : undefined,
4145
- session_state: item.session_state !== undefined ? item.session_state : undefined,
4146
- },
4147
- }))
4148
- } : undefined,
4149
- sessions: prop.alpacaAccount.user.sessions ?
4150
- Array.isArray(prop.alpacaAccount.user.sessions) && prop.alpacaAccount.user.sessions.length > 0 && prop.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
4151
- connect: prop.alpacaAccount.user.sessions.map((item) => ({
4152
- id: item.id
4153
- }))
4154
- } : { upsert: prop.alpacaAccount.user.sessions.map((item) => ({
4155
- where: {
4156
- id: item.id !== undefined ? item.id : undefined,
4157
- userId: item.userId !== undefined ? {
4158
- equals: item.userId
4159
- } : undefined,
4160
- },
4161
- update: {
4162
- id: item.id !== undefined ? {
4163
- set: item.id
4164
- } : undefined,
4165
- sessionToken: item.sessionToken !== undefined ? {
4166
- set: item.sessionToken
4167
- } : undefined,
4168
- expires: item.expires !== undefined ? {
4169
- set: item.expires
4170
- } : undefined,
4171
- },
4172
- create: {
4173
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
4174
- expires: item.expires !== undefined ? item.expires : undefined,
4175
- },
4176
- }))
4177
- } : undefined,
4178
- authenticators: prop.alpacaAccount.user.authenticators ?
4179
- Array.isArray(prop.alpacaAccount.user.authenticators) && prop.alpacaAccount.user.authenticators.length > 0 && prop.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
4180
- connect: prop.alpacaAccount.user.authenticators.map((item) => ({
4181
- id: item.id
4182
- }))
4183
- } : { upsert: prop.alpacaAccount.user.authenticators.map((item) => ({
4184
- where: {
4185
- id: item.id !== undefined ? item.id : undefined,
4186
- userId: item.userId !== undefined ? {
4187
- equals: item.userId
4188
- } : undefined,
4189
- },
4190
- update: {
4191
- id: item.id !== undefined ? {
4192
- set: item.id
4193
- } : undefined,
4194
- credentialID: item.credentialID !== undefined ? {
4195
- set: item.credentialID
4196
- } : undefined,
4197
- publicKey: item.publicKey !== undefined ? {
4198
- set: item.publicKey
4199
- } : undefined,
4200
- counter: item.counter !== undefined ? {
4201
- set: item.counter
4202
- } : undefined,
4203
- },
4204
- create: {
4205
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
4206
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
4207
- counter: item.counter !== undefined ? item.counter : undefined,
4208
- },
4209
- }))
4210
- } : undefined,
4211
- },
4212
- create: {
4213
- name: prop.alpacaAccount.user.name !== undefined ? prop.alpacaAccount.user.name : undefined,
4214
- email: prop.alpacaAccount.user.email !== undefined ? prop.alpacaAccount.user.email : undefined,
4215
- emailVerified: prop.alpacaAccount.user.emailVerified !== undefined ? prop.alpacaAccount.user.emailVerified : undefined,
4216
- image: prop.alpacaAccount.user.image !== undefined ? prop.alpacaAccount.user.image : undefined,
4217
- role: prop.alpacaAccount.user.role !== undefined ? prop.alpacaAccount.user.role : undefined,
4218
- bio: prop.alpacaAccount.user.bio !== undefined ? prop.alpacaAccount.user.bio : undefined,
4219
- jobTitle: prop.alpacaAccount.user.jobTitle !== undefined ? prop.alpacaAccount.user.jobTitle : undefined,
4220
- currentAccount: prop.alpacaAccount.user.currentAccount !== undefined ? prop.alpacaAccount.user.currentAccount : undefined,
4221
- plan: prop.alpacaAccount.user.plan !== undefined ? prop.alpacaAccount.user.plan : undefined,
4222
- openaiAPIKey: prop.alpacaAccount.user.openaiAPIKey !== undefined ? prop.alpacaAccount.user.openaiAPIKey : undefined,
4223
- openaiModel: prop.alpacaAccount.user.openaiModel !== undefined ? prop.alpacaAccount.user.openaiModel : undefined,
4224
- customer: prop.alpacaAccount.user.customer ?
4225
- typeof prop.alpacaAccount.user.customer === 'object' && Object.keys(prop.alpacaAccount.user.customer).length === 1 && Object.keys(prop.alpacaAccount.user.customer)[0] === 'id'
4226
- ? { connect: {
4227
- id: prop.alpacaAccount.user.customer.id
4228
- }
4229
- }
4230
- : { connectOrCreate: {
4231
- where: {
4232
- id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
4233
- stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
4234
- stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
4235
- authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
4236
- equals: prop.alpacaAccount.user.customer.authUserId
4237
- } : undefined,
4238
- name: prop.alpacaAccount.user.customer.name !== undefined ? {
4239
- equals: prop.alpacaAccount.user.customer.name
4240
- } : undefined,
4241
- stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
4242
- equals: prop.alpacaAccount.user.customer.stripePriceId
4243
- } : undefined,
4244
- },
4245
- create: {
4246
- authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
4247
- name: prop.alpacaAccount.user.customer.name !== undefined ? prop.alpacaAccount.user.customer.name : undefined,
4248
- plan: prop.alpacaAccount.user.customer.plan !== undefined ? prop.alpacaAccount.user.customer.plan : undefined,
4249
- stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
4250
- stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
4251
- stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? prop.alpacaAccount.user.customer.stripePriceId : undefined,
4252
- stripeCurrentPeriodEnd: prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
4253
- },
4254
- }
4255
- } : undefined,
4256
- accounts: prop.alpacaAccount.user.accounts ?
4257
- Array.isArray(prop.alpacaAccount.user.accounts) && prop.alpacaAccount.user.accounts.length > 0 && prop.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4258
- connect: prop.alpacaAccount.user.accounts.map((item) => ({
4259
- id: item.id
4260
- }))
4261
- }
4262
- : { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
4263
- where: {
4264
- id: item.id !== undefined ? item.id : undefined,
4265
- userId: item.userId !== undefined ? {
4266
- equals: item.userId
4267
- } : undefined,
4268
- providerAccountId: item.providerAccountId !== undefined ? {
4269
- equals: item.providerAccountId
4270
- } : undefined,
4271
- },
4272
- create: {
4273
- type: item.type !== undefined ? item.type : undefined,
4274
- provider: item.provider !== undefined ? item.provider : undefined,
4275
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
4276
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
4277
- access_token: item.access_token !== undefined ? item.access_token : undefined,
4278
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
4279
- token_type: item.token_type !== undefined ? item.token_type : undefined,
4280
- scope: item.scope !== undefined ? item.scope : undefined,
4281
- id_token: item.id_token !== undefined ? item.id_token : undefined,
4282
- session_state: item.session_state !== undefined ? item.session_state : undefined,
4283
- },
4284
- }))
4285
- } : undefined,
4286
- sessions: prop.alpacaAccount.user.sessions ?
4287
- Array.isArray(prop.alpacaAccount.user.sessions) && prop.alpacaAccount.user.sessions.length > 0 && prop.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4288
- connect: prop.alpacaAccount.user.sessions.map((item) => ({
4289
- id: item.id
4290
- }))
4291
- }
4292
- : { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
4293
- where: {
4294
- id: item.id !== undefined ? item.id : undefined,
4295
- userId: item.userId !== undefined ? {
4296
- equals: item.userId
4297
- } : undefined,
4298
- },
4299
- create: {
4300
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
4301
- expires: item.expires !== undefined ? item.expires : undefined,
4302
- },
4303
- }))
4304
- } : undefined,
4305
- authenticators: prop.alpacaAccount.user.authenticators ?
4306
- Array.isArray(prop.alpacaAccount.user.authenticators) && prop.alpacaAccount.user.authenticators.length > 0 && prop.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4307
- connect: prop.alpacaAccount.user.authenticators.map((item) => ({
4308
- id: item.id
4309
- }))
4310
- }
4311
- : { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
4312
- where: {
4313
- id: item.id !== undefined ? item.id : undefined,
4314
- userId: item.userId !== undefined ? {
4315
- equals: item.userId
4316
- } : undefined,
4317
- },
4318
- create: {
4319
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
4320
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
4321
- counter: item.counter !== undefined ? item.counter : undefined,
4322
- },
4323
- }))
4324
- } : undefined,
4325
- },
4326
- }
4327
- } : undefined,
4328
- positions: prop.alpacaAccount.positions ?
4329
- Array.isArray(prop.alpacaAccount.positions) && prop.alpacaAccount.positions.length > 0 && prop.alpacaAccount.positions.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
4330
- connect: prop.alpacaAccount.positions.map((item) => ({
4331
- id: item.id
4332
- }))
4333
- } : { upsert: prop.alpacaAccount.positions.map((item) => ({
4334
- where: {
4335
- id: item.id !== undefined ? item.id : undefined,
4336
- symbol: item.symbol !== undefined ? {
4337
- equals: item.symbol
4338
- } : undefined,
4339
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
4340
- equals: item.alpacaAccountId
4341
- } : undefined,
4342
- },
4343
- update: {
4344
- id: item.id !== undefined ? {
4345
- set: item.id
4346
- } : undefined,
4347
- symbol: item.symbol !== undefined ? {
4348
- set: item.symbol
4349
- } : undefined,
4350
- averageEntryPrice: item.averageEntryPrice !== undefined ? {
4351
- set: item.averageEntryPrice
4352
- } : undefined,
4353
- qty: item.qty !== undefined ? {
4354
- set: item.qty
4355
- } : undefined,
4356
- qtyAvailable: item.qtyAvailable !== undefined ? {
4357
- set: item.qtyAvailable
4358
- } : undefined,
4359
- marketValue: item.marketValue !== undefined ? {
4360
- set: item.marketValue
4361
- } : undefined,
4362
- costBasis: item.costBasis !== undefined ? {
4363
- set: item.costBasis
4364
- } : undefined,
4365
- unrealizedPL: item.unrealizedPL !== undefined ? {
4366
- set: item.unrealizedPL
4367
- } : undefined,
4368
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? {
4369
- set: item.unrealizedPLPC
4370
- } : undefined,
4371
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? {
4372
- set: item.unrealisedIntradayPL
4373
- } : undefined,
4374
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? {
4375
- set: item.unrealisedIntradayPLPC
4376
- } : undefined,
4377
- currentPrice: item.currentPrice !== undefined ? {
4378
- set: item.currentPrice
4379
- } : undefined,
4380
- lastTradePrice: item.lastTradePrice !== undefined ? {
4381
- set: item.lastTradePrice
4382
- } : undefined,
4383
- changeToday: item.changeToday !== undefined ? {
4384
- set: item.changeToday
4385
- } : undefined,
4386
- assetMarginable: item.assetMarginable !== undefined ? {
4387
- set: item.assetMarginable
4388
- } : undefined,
4389
- closed: item.closed !== undefined ? {
4390
- set: item.closed
4391
- } : undefined,
4392
- },
4393
- create: {
4394
- symbol: item.symbol !== undefined ? item.symbol : undefined,
4395
- averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
4396
- qty: item.qty !== undefined ? item.qty : undefined,
4397
- qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
4398
- marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
4399
- costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
4400
- unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
4401
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
4402
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
4403
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
4404
- currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
4405
- lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
4406
- changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
4407
- assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
4408
- closed: item.closed !== undefined ? item.closed : undefined,
4409
- },
4410
- }))
4411
- } : undefined,
4412
- alerts: prop.alpacaAccount.alerts ?
4413
- Array.isArray(prop.alpacaAccount.alerts) && prop.alpacaAccount.alerts.length > 0 && prop.alpacaAccount.alerts.every((item) => typeof item === 'object' && ('id' in item || 'symbol' in item) && Object.keys(item).length === 1) ? {
4414
- connect: prop.alpacaAccount.alerts.map((item) => ({
4415
- id: item.id
4416
- }))
4417
- } : { upsert: prop.alpacaAccount.alerts.map((item) => ({
4418
- where: {
4419
- id: item.id !== undefined ? item.id : undefined,
4420
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
4421
- equals: item.alpacaAccountId
4422
- } : undefined,
4423
- },
4424
- update: {
4425
- id: item.id !== undefined ? {
4426
- set: item.id
4427
- } : undefined,
4428
- message: item.message !== undefined ? {
4429
- set: item.message
4430
- } : undefined,
4431
- type: item.type !== undefined ? {
4432
- set: item.type
4433
- } : undefined,
4434
- isRead: item.isRead !== undefined ? {
4435
- set: item.isRead
4436
- } : undefined,
4437
- },
4438
- create: {
4439
- message: item.message !== undefined ? item.message : undefined,
4440
- type: item.type !== undefined ? item.type : undefined,
4441
- isRead: item.isRead !== undefined ? item.isRead : undefined,
4442
- },
4443
- }))
4444
- } : undefined,
4445
- },
4446
- create: {
4447
- type: prop.alpacaAccount.type !== undefined ? prop.alpacaAccount.type : undefined,
4448
- APIKey: prop.alpacaAccount.APIKey !== undefined ? prop.alpacaAccount.APIKey : undefined,
4449
- APISecret: prop.alpacaAccount.APISecret !== undefined ? prop.alpacaAccount.APISecret : undefined,
4450
- configuration: prop.alpacaAccount.configuration !== undefined ? prop.alpacaAccount.configuration : undefined,
4451
- marketOpen: prop.alpacaAccount.marketOpen !== undefined ? prop.alpacaAccount.marketOpen : undefined,
4452
- realTime: prop.alpacaAccount.realTime !== undefined ? prop.alpacaAccount.realTime : undefined,
4453
- tradeAllocationPct: prop.alpacaAccount.tradeAllocationPct !== undefined ? prop.alpacaAccount.tradeAllocationPct : undefined,
4454
- minPercentageChange: prop.alpacaAccount.minPercentageChange !== undefined ? prop.alpacaAccount.minPercentageChange : undefined,
4455
- volumeThreshold: prop.alpacaAccount.volumeThreshold !== undefined ? prop.alpacaAccount.volumeThreshold : undefined,
4456
- enablePortfolioTrailingStop: prop.alpacaAccount.enablePortfolioTrailingStop !== undefined ? prop.alpacaAccount.enablePortfolioTrailingStop : undefined,
4457
- portfolioTrailPercent: prop.alpacaAccount.portfolioTrailPercent !== undefined ? prop.alpacaAccount.portfolioTrailPercent : undefined,
4458
- portfolioProfitThresholdPercent: prop.alpacaAccount.portfolioProfitThresholdPercent !== undefined ? prop.alpacaAccount.portfolioProfitThresholdPercent : undefined,
4459
- reducedPortfolioTrailPercent: prop.alpacaAccount.reducedPortfolioTrailPercent !== undefined ? prop.alpacaAccount.reducedPortfolioTrailPercent : undefined,
4460
- user: prop.alpacaAccount.user ?
4461
- typeof prop.alpacaAccount.user === 'object' && Object.keys(prop.alpacaAccount.user).length === 1 && Object.keys(prop.alpacaAccount.user)[0] === 'id'
4462
- ? { connect: {
4463
- id: prop.alpacaAccount.user.id
4464
- }
4465
- }
4466
- : { connectOrCreate: {
4467
- where: {
4468
- id: prop.alpacaAccount.user.id !== undefined ? prop.alpacaAccount.user.id : undefined,
4469
- email: prop.alpacaAccount.user.email !== undefined ? prop.alpacaAccount.user.email : undefined,
4470
- name: prop.alpacaAccount.user.name !== undefined ? {
4471
- equals: prop.alpacaAccount.user.name
4472
- } : undefined,
4473
- },
4474
- create: {
4475
- name: prop.alpacaAccount.user.name !== undefined ? prop.alpacaAccount.user.name : undefined,
4476
- email: prop.alpacaAccount.user.email !== undefined ? prop.alpacaAccount.user.email : undefined,
4477
- emailVerified: prop.alpacaAccount.user.emailVerified !== undefined ? prop.alpacaAccount.user.emailVerified : undefined,
4478
- image: prop.alpacaAccount.user.image !== undefined ? prop.alpacaAccount.user.image : undefined,
4479
- role: prop.alpacaAccount.user.role !== undefined ? prop.alpacaAccount.user.role : undefined,
4480
- bio: prop.alpacaAccount.user.bio !== undefined ? prop.alpacaAccount.user.bio : undefined,
4481
- jobTitle: prop.alpacaAccount.user.jobTitle !== undefined ? prop.alpacaAccount.user.jobTitle : undefined,
4482
- currentAccount: prop.alpacaAccount.user.currentAccount !== undefined ? prop.alpacaAccount.user.currentAccount : undefined,
4483
- plan: prop.alpacaAccount.user.plan !== undefined ? prop.alpacaAccount.user.plan : undefined,
4484
- openaiAPIKey: prop.alpacaAccount.user.openaiAPIKey !== undefined ? prop.alpacaAccount.user.openaiAPIKey : undefined,
4485
- openaiModel: prop.alpacaAccount.user.openaiModel !== undefined ? prop.alpacaAccount.user.openaiModel : undefined,
4486
- customer: prop.alpacaAccount.user.customer ?
4487
- typeof prop.alpacaAccount.user.customer === 'object' && Object.keys(prop.alpacaAccount.user.customer).length === 1 && Object.keys(prop.alpacaAccount.user.customer)[0] === 'id'
4488
- ? { connect: {
4489
- id: prop.alpacaAccount.user.customer.id
4490
- }
4491
- }
4492
- : { connectOrCreate: {
4493
- where: {
4494
- id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
4495
- stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
4496
- stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
4497
- authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
4498
- equals: prop.alpacaAccount.user.customer.authUserId
4499
- } : undefined,
4500
- name: prop.alpacaAccount.user.customer.name !== undefined ? {
4501
- equals: prop.alpacaAccount.user.customer.name
4502
- } : undefined,
4503
- stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
4504
- equals: prop.alpacaAccount.user.customer.stripePriceId
4505
- } : undefined,
4506
- },
4507
- create: {
4508
- authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
4509
- name: prop.alpacaAccount.user.customer.name !== undefined ? prop.alpacaAccount.user.customer.name : undefined,
4510
- plan: prop.alpacaAccount.user.customer.plan !== undefined ? prop.alpacaAccount.user.customer.plan : undefined,
4511
- stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
4512
- stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
4513
- stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? prop.alpacaAccount.user.customer.stripePriceId : undefined,
4514
- stripeCurrentPeriodEnd: prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
4515
- },
4516
- }
4517
- } : undefined,
4518
- accounts: prop.alpacaAccount.user.accounts ?
4519
- Array.isArray(prop.alpacaAccount.user.accounts) && prop.alpacaAccount.user.accounts.length > 0 && prop.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4520
- connect: prop.alpacaAccount.user.accounts.map((item) => ({
4521
- id: item.id
4522
- }))
4523
- }
4524
- : { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
4525
- where: {
4526
- id: item.id !== undefined ? item.id : undefined,
4527
- userId: item.userId !== undefined ? {
4528
- equals: item.userId
4529
- } : undefined,
4530
- providerAccountId: item.providerAccountId !== undefined ? {
4531
- equals: item.providerAccountId
4532
- } : undefined,
4533
- },
4534
- create: {
4535
- type: item.type !== undefined ? item.type : undefined,
4536
- provider: item.provider !== undefined ? item.provider : undefined,
4537
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
4538
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
4539
- access_token: item.access_token !== undefined ? item.access_token : undefined,
4540
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
4541
- token_type: item.token_type !== undefined ? item.token_type : undefined,
4542
- scope: item.scope !== undefined ? item.scope : undefined,
4543
- id_token: item.id_token !== undefined ? item.id_token : undefined,
4544
- session_state: item.session_state !== undefined ? item.session_state : undefined,
4545
- },
4546
- }))
4547
- } : undefined,
4548
- sessions: prop.alpacaAccount.user.sessions ?
4549
- Array.isArray(prop.alpacaAccount.user.sessions) && prop.alpacaAccount.user.sessions.length > 0 && prop.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4550
- connect: prop.alpacaAccount.user.sessions.map((item) => ({
4551
- id: item.id
4552
- }))
4553
- }
4554
- : { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
4555
- where: {
4556
- id: item.id !== undefined ? item.id : undefined,
4557
- userId: item.userId !== undefined ? {
4558
- equals: item.userId
4559
- } : undefined,
4560
- },
4561
- create: {
4562
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
4563
- expires: item.expires !== undefined ? item.expires : undefined,
4564
- },
4565
- }))
4566
- } : undefined,
4567
- authenticators: prop.alpacaAccount.user.authenticators ?
4568
- Array.isArray(prop.alpacaAccount.user.authenticators) && prop.alpacaAccount.user.authenticators.length > 0 && prop.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4569
- connect: prop.alpacaAccount.user.authenticators.map((item) => ({
4570
- id: item.id
4571
- }))
4572
- }
4573
- : { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
4574
- where: {
4575
- id: item.id !== undefined ? item.id : undefined,
4576
- userId: item.userId !== undefined ? {
4577
- equals: item.userId
4578
- } : undefined,
4579
- },
4580
- create: {
4581
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
4582
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
4583
- counter: item.counter !== undefined ? item.counter : undefined,
4584
- },
4585
- }))
4586
- } : undefined,
4587
- },
4588
- }
4589
- } : undefined,
4590
- positions: prop.alpacaAccount.positions ?
4591
- Array.isArray(prop.alpacaAccount.positions) && prop.alpacaAccount.positions.length > 0 && prop.alpacaAccount.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4592
- connect: prop.alpacaAccount.positions.map((item) => ({
4593
- id: item.id
4594
- }))
4595
- }
4596
- : { connectOrCreate: prop.alpacaAccount.positions.map((item) => ({
4597
- where: {
4598
- id: item.id !== undefined ? item.id : undefined,
4599
- symbol: item.symbol !== undefined ? {
4600
- equals: item.symbol
4601
- } : undefined,
4602
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
4603
- equals: item.alpacaAccountId
4604
- } : undefined,
4605
- },
4606
- create: {
4607
- symbol: item.symbol !== undefined ? item.symbol : undefined,
4608
- averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
4609
- qty: item.qty !== undefined ? item.qty : undefined,
4610
- qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
4611
- marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
4612
- costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
4613
- unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
4614
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
4615
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
4616
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
4617
- currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
4618
- lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
4619
- changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
4620
- assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
4621
- closed: item.closed !== undefined ? item.closed : undefined,
4622
- },
4623
- }))
4624
- } : undefined,
4625
- alerts: prop.alpacaAccount.alerts ?
4626
- Array.isArray(prop.alpacaAccount.alerts) && prop.alpacaAccount.alerts.length > 0 && prop.alpacaAccount.alerts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4627
- connect: prop.alpacaAccount.alerts.map((item) => ({
4628
- id: item.id
4629
- }))
4630
- }
4631
- : { connectOrCreate: prop.alpacaAccount.alerts.map((item) => ({
4632
- where: {
4633
- id: item.id !== undefined ? item.id : undefined,
4634
- alpacaAccountId: item.alpacaAccountId !== undefined ? {
4635
- equals: item.alpacaAccountId
4636
- } : undefined,
4637
- },
4638
- create: {
4639
- message: item.message !== undefined ? item.message : undefined,
4640
- type: item.type !== undefined ? item.type : undefined,
4641
- isRead: item.isRead !== undefined ? item.isRead : undefined,
4642
- },
4643
- }))
4644
- } : undefined,
4645
- },
4646
- }
4647
- } : undefined,
4648
2009
  action: prop.action ?
4649
2010
  typeof prop.action === 'object' && Object.keys(prop.action).length === 1 && (Object.keys(prop.action)[0] === 'id' || Object.keys(prop.action)[0] === 'symbol')
4650
2011
  ? {
@@ -5067,7 +2428,7 @@ exports.Order = {
5067
2428
  * @param globalClient - Apollo Client instance.
5068
2429
  * @returns The retrieved Order or null.
5069
2430
  */
5070
- async get(props, globalClient) {
2431
+ async get(props, globalClient, where) {
5071
2432
  var _a, _b;
5072
2433
  const [modules, client] = await Promise.all([
5073
2434
  (0, client_1.getApolloModules)(),
@@ -5083,7 +2444,7 @@ exports.Order = {
5083
2444
  }
5084
2445
  }`;
5085
2446
  const variables = {
5086
- where: {
2447
+ where: where ? where : {
5087
2448
  id: props.id !== undefined ? props.id : undefined,
5088
2449
  clientOrderId: props.clientOrderId !== undefined ? props.clientOrderId : undefined,
5089
2450
  actionId: props.actionId !== undefined ? props.actionId : undefined,
@@ -5156,7 +2517,7 @@ exports.Order = {
5156
2517
  * @param globalClient - Apollo Client instance.
5157
2518
  * @returns An array of found Order records or null.
5158
2519
  */
5159
- async findMany(props, globalClient) {
2520
+ async findMany(props, globalClient, where) {
5160
2521
  const [modules, client] = await Promise.all([
5161
2522
  (0, client_1.getApolloModules)(),
5162
2523
  globalClient
@@ -5171,7 +2532,7 @@ exports.Order = {
5171
2532
  }
5172
2533
  }`;
5173
2534
  const variables = {
5174
- where: {
2535
+ where: where ? where : {
5175
2536
  id: props.id !== undefined ? {
5176
2537
  equals: props.id
5177
2538
  } : undefined,