adaptic-backend 1.0.160 → 1.0.161

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 (73) hide show
  1. package/Account.cjs +50 -150
  2. package/Action.cjs +117 -351
  3. package/Alert.cjs +85 -255
  4. package/AlpacaAccount.cjs +130 -390
  5. package/Asset.cjs +129 -387
  6. package/Authenticator.cjs +50 -150
  7. package/Customer.cjs +54 -162
  8. package/EconomicEvent.cjs +3 -9
  9. package/NewsArticle.cjs +30 -90
  10. package/NewsArticleAssetSentiment.cjs +57 -171
  11. package/Order.cjs +119 -357
  12. package/Position.cjs +133 -399
  13. package/Session.cjs +50 -150
  14. package/StopLoss.cjs +68 -204
  15. package/TakeProfit.cjs +68 -204
  16. package/Trade.cjs +145 -435
  17. package/User.cjs +73 -219
  18. package/VerificationToken.cjs +3 -9
  19. package/package.json +1 -1
  20. package/server/Account.d.ts.map +1 -1
  21. package/server/Account.js.map +1 -1
  22. package/server/Account.mjs +50 -150
  23. package/server/Action.d.ts.map +1 -1
  24. package/server/Action.js.map +1 -1
  25. package/server/Action.mjs +117 -351
  26. package/server/Alert.d.ts.map +1 -1
  27. package/server/Alert.js.map +1 -1
  28. package/server/Alert.mjs +85 -255
  29. package/server/AlpacaAccount.d.ts.map +1 -1
  30. package/server/AlpacaAccount.js.map +1 -1
  31. package/server/AlpacaAccount.mjs +130 -390
  32. package/server/Asset.d.ts.map +1 -1
  33. package/server/Asset.js.map +1 -1
  34. package/server/Asset.mjs +129 -387
  35. package/server/Authenticator.d.ts.map +1 -1
  36. package/server/Authenticator.js.map +1 -1
  37. package/server/Authenticator.mjs +50 -150
  38. package/server/Customer.d.ts.map +1 -1
  39. package/server/Customer.js.map +1 -1
  40. package/server/Customer.mjs +54 -162
  41. package/server/EconomicEvent.d.ts.map +1 -1
  42. package/server/EconomicEvent.js.map +1 -1
  43. package/server/EconomicEvent.mjs +3 -9
  44. package/server/NewsArticle.d.ts.map +1 -1
  45. package/server/NewsArticle.js.map +1 -1
  46. package/server/NewsArticle.mjs +30 -90
  47. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  48. package/server/NewsArticleAssetSentiment.js.map +1 -1
  49. package/server/NewsArticleAssetSentiment.mjs +57 -171
  50. package/server/Order.d.ts.map +1 -1
  51. package/server/Order.js.map +1 -1
  52. package/server/Order.mjs +119 -357
  53. package/server/Position.d.ts.map +1 -1
  54. package/server/Position.js.map +1 -1
  55. package/server/Position.mjs +133 -399
  56. package/server/Session.d.ts.map +1 -1
  57. package/server/Session.js.map +1 -1
  58. package/server/Session.mjs +50 -150
  59. package/server/StopLoss.d.ts.map +1 -1
  60. package/server/StopLoss.js.map +1 -1
  61. package/server/StopLoss.mjs +68 -204
  62. package/server/TakeProfit.d.ts.map +1 -1
  63. package/server/TakeProfit.js.map +1 -1
  64. package/server/TakeProfit.mjs +68 -204
  65. package/server/Trade.d.ts.map +1 -1
  66. package/server/Trade.js.map +1 -1
  67. package/server/Trade.mjs +145 -435
  68. package/server/User.d.ts.map +1 -1
  69. package/server/User.js.map +1 -1
  70. package/server/User.mjs +73 -219
  71. package/server/VerificationToken.d.ts.map +1 -1
  72. package/server/VerificationToken.js.map +1 -1
  73. package/server/VerificationToken.mjs +3 -9
@@ -551,9 +551,7 @@ export const AlpacaAccount = {
551
551
  }
552
552
  : { connectOrCreate: {
553
553
  where: {
554
- id: props.user.id !== undefined ? {
555
- equals: props.user.id
556
- } : undefined,
554
+ id: props.user.id !== undefined ? props.user.id : undefined,
557
555
  email: props.user.email !== undefined ? props.user.email : undefined,
558
556
  name: props.user.name !== undefined ? {
559
557
  equals: props.user.name
@@ -579,9 +577,7 @@ export const AlpacaAccount = {
579
577
  }
580
578
  : { connectOrCreate: {
581
579
  where: {
582
- id: props.user.customer.id !== undefined ? {
583
- equals: props.user.customer.id
584
- } : undefined,
580
+ id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
585
581
  stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
586
582
  stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
587
583
  authUserId: props.user.customer.authUserId !== undefined ? {
@@ -613,9 +609,7 @@ export const AlpacaAccount = {
613
609
  }
614
610
  : { connectOrCreate: props.user.accounts.map((item) => ({
615
611
  where: {
616
- id: item.id !== undefined ? {
617
- equals: item.id
618
- } : undefined,
612
+ id: item.id !== undefined ? item.id : undefined,
619
613
  userId: item.userId !== undefined ? {
620
614
  equals: item.userId
621
615
  } : undefined,
@@ -645,9 +639,7 @@ export const AlpacaAccount = {
645
639
  }
646
640
  : { connectOrCreate: props.user.sessions.map((item) => ({
647
641
  where: {
648
- id: item.id !== undefined ? {
649
- equals: item.id
650
- } : undefined,
642
+ id: item.id !== undefined ? item.id : undefined,
651
643
  userId: item.userId !== undefined ? {
652
644
  equals: item.userId
653
645
  } : undefined,
@@ -666,9 +658,7 @@ export const AlpacaAccount = {
666
658
  }
667
659
  : { connectOrCreate: props.user.authenticators.map((item) => ({
668
660
  where: {
669
- id: item.id !== undefined ? {
670
- equals: item.id
671
- } : undefined,
661
+ id: item.id !== undefined ? item.id : undefined,
672
662
  userId: item.userId !== undefined ? {
673
663
  equals: item.userId
674
664
  } : undefined,
@@ -691,9 +681,7 @@ export const AlpacaAccount = {
691
681
  }
692
682
  : { connectOrCreate: props.trades.map((item) => ({
693
683
  where: {
694
- id: item.id !== undefined ? {
695
- equals: item.id
696
- } : undefined,
684
+ id: item.id !== undefined ? item.id : undefined,
697
685
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
698
686
  equals: item.alpacaAccountId
699
687
  } : undefined,
@@ -721,9 +709,7 @@ export const AlpacaAccount = {
721
709
  }
722
710
  : { connectOrCreate: {
723
711
  where: {
724
- id: item.asset.id !== undefined ? {
725
- equals: item.asset.id
726
- } : undefined,
712
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
727
713
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
728
714
  name: item.asset.name !== undefined ? item.asset.name : undefined,
729
715
  },
@@ -791,9 +777,7 @@ export const AlpacaAccount = {
791
777
  }
792
778
  : { connectOrCreate: item.asset.orders.map((item) => ({
793
779
  where: {
794
- id: item.id !== undefined ? {
795
- equals: item.id
796
- } : undefined,
780
+ id: item.id !== undefined ? item.id : undefined,
797
781
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
798
782
  actionId: item.actionId !== undefined ? item.actionId : undefined,
799
783
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -838,9 +822,7 @@ export const AlpacaAccount = {
838
822
  }
839
823
  : { connectOrCreate: item.asset.positions.map((item) => ({
840
824
  where: {
841
- id: item.id !== undefined ? {
842
- equals: item.id
843
- } : undefined,
825
+ id: item.id !== undefined ? item.id : undefined,
844
826
  assetId: item.assetId !== undefined ? {
845
827
  equals: item.assetId
846
828
  } : undefined,
@@ -873,9 +855,7 @@ export const AlpacaAccount = {
873
855
  }
874
856
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
875
857
  where: {
876
- id: item.id !== undefined ? {
877
- equals: item.id
878
- } : undefined,
858
+ id: item.id !== undefined ? item.id : undefined,
879
859
  url: item.url !== undefined ? item.url : undefined,
880
860
  assetId: item.assetId !== undefined ? {
881
861
  equals: item.assetId
@@ -903,9 +883,7 @@ export const AlpacaAccount = {
903
883
  }
904
884
  : { connectOrCreate: item.actions.map((item) => ({
905
885
  where: {
906
- id: item.id !== undefined ? {
907
- equals: item.id
908
- } : undefined,
886
+ id: item.id !== undefined ? item.id : undefined,
909
887
  tradeId: item.tradeId !== undefined ? {
910
888
  equals: item.tradeId
911
889
  } : undefined,
@@ -924,9 +902,7 @@ export const AlpacaAccount = {
924
902
  }
925
903
  : { connectOrCreate: {
926
904
  where: {
927
- id: item.order.id !== undefined ? {
928
- equals: item.order.id
929
- } : undefined,
905
+ id: item.order.id !== undefined ? item.order.id : undefined,
930
906
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
931
907
  actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
932
908
  stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
@@ -977,9 +953,7 @@ export const AlpacaAccount = {
977
953
  }
978
954
  : { connectOrCreate: props.orders.map((item) => ({
979
955
  where: {
980
- id: item.id !== undefined ? {
981
- equals: item.id
982
- } : undefined,
956
+ id: item.id !== undefined ? item.id : undefined,
983
957
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
984
958
  actionId: item.actionId !== undefined ? item.actionId : undefined,
985
959
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -1021,9 +995,7 @@ export const AlpacaAccount = {
1021
995
  }
1022
996
  : { connectOrCreate: {
1023
997
  where: {
1024
- id: item.stopLoss.id !== undefined ? {
1025
- equals: item.stopLoss.id
1026
- } : undefined,
998
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
1027
999
  orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
1028
1000
  },
1029
1001
  create: {
@@ -1040,9 +1012,7 @@ export const AlpacaAccount = {
1040
1012
  }
1041
1013
  : { connectOrCreate: {
1042
1014
  where: {
1043
- id: item.takeProfit.id !== undefined ? {
1044
- equals: item.takeProfit.id
1045
- } : undefined,
1015
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
1046
1016
  orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
1047
1017
  },
1048
1018
  create: {
@@ -1059,9 +1029,7 @@ export const AlpacaAccount = {
1059
1029
  }
1060
1030
  : { connectOrCreate: {
1061
1031
  where: {
1062
- id: item.action.id !== undefined ? {
1063
- equals: item.action.id
1064
- } : undefined,
1032
+ id: item.action.id !== undefined ? item.action.id : undefined,
1065
1033
  tradeId: item.action.tradeId !== undefined ? {
1066
1034
  equals: item.action.tradeId
1067
1035
  } : undefined,
@@ -1080,9 +1048,7 @@ export const AlpacaAccount = {
1080
1048
  }
1081
1049
  : { connectOrCreate: {
1082
1050
  where: {
1083
- id: item.action.trade.id !== undefined ? {
1084
- equals: item.action.trade.id
1085
- } : undefined,
1051
+ id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
1086
1052
  alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
1087
1053
  equals: item.action.trade.alpacaAccountId
1088
1054
  } : undefined,
@@ -1116,9 +1082,7 @@ export const AlpacaAccount = {
1116
1082
  }
1117
1083
  : { connectOrCreate: {
1118
1084
  where: {
1119
- id: item.asset.id !== undefined ? {
1120
- equals: item.asset.id
1121
- } : undefined,
1085
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
1122
1086
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1123
1087
  name: item.asset.name !== undefined ? item.asset.name : undefined,
1124
1088
  },
@@ -1186,9 +1150,7 @@ export const AlpacaAccount = {
1186
1150
  }
1187
1151
  : { connectOrCreate: item.asset.trades.map((item) => ({
1188
1152
  where: {
1189
- id: item.id !== undefined ? {
1190
- equals: item.id
1191
- } : undefined,
1153
+ id: item.id !== undefined ? item.id : undefined,
1192
1154
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
1193
1155
  equals: item.alpacaAccountId
1194
1156
  } : undefined,
@@ -1219,9 +1181,7 @@ export const AlpacaAccount = {
1219
1181
  }
1220
1182
  : { connectOrCreate: item.asset.positions.map((item) => ({
1221
1183
  where: {
1222
- id: item.id !== undefined ? {
1223
- equals: item.id
1224
- } : undefined,
1184
+ id: item.id !== undefined ? item.id : undefined,
1225
1185
  assetId: item.assetId !== undefined ? {
1226
1186
  equals: item.assetId
1227
1187
  } : undefined,
@@ -1254,9 +1214,7 @@ export const AlpacaAccount = {
1254
1214
  }
1255
1215
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
1256
1216
  where: {
1257
- id: item.id !== undefined ? {
1258
- equals: item.id
1259
- } : undefined,
1217
+ id: item.id !== undefined ? item.id : undefined,
1260
1218
  url: item.url !== undefined ? item.url : undefined,
1261
1219
  assetId: item.assetId !== undefined ? {
1262
1220
  equals: item.assetId
@@ -1287,9 +1245,7 @@ export const AlpacaAccount = {
1287
1245
  }
1288
1246
  : { connectOrCreate: props.positions.map((item) => ({
1289
1247
  where: {
1290
- id: item.id !== undefined ? {
1291
- equals: item.id
1292
- } : undefined,
1248
+ id: item.id !== undefined ? item.id : undefined,
1293
1249
  assetId: item.assetId !== undefined ? {
1294
1250
  equals: item.assetId
1295
1251
  } : undefined,
@@ -1319,9 +1275,7 @@ export const AlpacaAccount = {
1319
1275
  }
1320
1276
  : { connectOrCreate: {
1321
1277
  where: {
1322
- id: item.asset.id !== undefined ? {
1323
- equals: item.asset.id
1324
- } : undefined,
1278
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
1325
1279
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1326
1280
  name: item.asset.name !== undefined ? item.asset.name : undefined,
1327
1281
  },
@@ -1389,9 +1343,7 @@ export const AlpacaAccount = {
1389
1343
  }
1390
1344
  : { connectOrCreate: item.asset.trades.map((item) => ({
1391
1345
  where: {
1392
- id: item.id !== undefined ? {
1393
- equals: item.id
1394
- } : undefined,
1346
+ id: item.id !== undefined ? item.id : undefined,
1395
1347
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
1396
1348
  equals: item.alpacaAccountId
1397
1349
  } : undefined,
@@ -1422,9 +1374,7 @@ export const AlpacaAccount = {
1422
1374
  }
1423
1375
  : { connectOrCreate: item.asset.orders.map((item) => ({
1424
1376
  where: {
1425
- id: item.id !== undefined ? {
1426
- equals: item.id
1427
- } : undefined,
1377
+ id: item.id !== undefined ? item.id : undefined,
1428
1378
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1429
1379
  actionId: item.actionId !== undefined ? item.actionId : undefined,
1430
1380
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -1469,9 +1419,7 @@ export const AlpacaAccount = {
1469
1419
  }
1470
1420
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
1471
1421
  where: {
1472
- id: item.id !== undefined ? {
1473
- equals: item.id
1474
- } : undefined,
1422
+ id: item.id !== undefined ? item.id : undefined,
1475
1423
  url: item.url !== undefined ? item.url : undefined,
1476
1424
  assetId: item.assetId !== undefined ? {
1477
1425
  equals: item.assetId
@@ -1502,9 +1450,7 @@ export const AlpacaAccount = {
1502
1450
  }
1503
1451
  : { connectOrCreate: props.alerts.map((item) => ({
1504
1452
  where: {
1505
- id: item.id !== undefined ? {
1506
- equals: item.id
1507
- } : undefined,
1453
+ id: item.id !== undefined ? item.id : undefined,
1508
1454
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
1509
1455
  equals: item.alpacaAccountId
1510
1456
  } : undefined,
@@ -1594,9 +1540,7 @@ export const AlpacaAccount = {
1594
1540
  }`;
1595
1541
  const variables = {
1596
1542
  where: {
1597
- id: props.id !== undefined ? {
1598
- equals: props.id
1599
- } : undefined,
1543
+ id: props.id !== undefined ? props.id : undefined,
1600
1544
  type: props.type !== undefined ? props.type : undefined,
1601
1545
  APIKey: props.APIKey !== undefined ? props.APIKey : undefined,
1602
1546
  APISecret: props.APISecret !== undefined ? props.APISecret : undefined,
@@ -1757,9 +1701,7 @@ export const AlpacaAccount = {
1757
1701
  accounts: props.user.accounts ? {
1758
1702
  upsert: props.user.accounts.map((item) => ({
1759
1703
  where: {
1760
- id: item.id !== undefined ? {
1761
- equals: item.id
1762
- } : undefined,
1704
+ id: item.id !== undefined ? item.id : undefined,
1763
1705
  userId: item.userId !== undefined ? {
1764
1706
  equals: item.userId
1765
1707
  } : undefined,
@@ -1819,9 +1761,7 @@ export const AlpacaAccount = {
1819
1761
  sessions: props.user.sessions ? {
1820
1762
  upsert: props.user.sessions.map((item) => ({
1821
1763
  where: {
1822
- id: item.id !== undefined ? {
1823
- equals: item.id
1824
- } : undefined,
1764
+ id: item.id !== undefined ? item.id : undefined,
1825
1765
  userId: item.userId !== undefined ? {
1826
1766
  equals: item.userId
1827
1767
  } : undefined,
@@ -1846,9 +1786,7 @@ export const AlpacaAccount = {
1846
1786
  authenticators: props.user.authenticators ? {
1847
1787
  upsert: props.user.authenticators.map((item) => ({
1848
1788
  where: {
1849
- id: item.id !== undefined ? {
1850
- equals: item.id
1851
- } : undefined,
1789
+ id: item.id !== undefined ? item.id : undefined,
1852
1790
  userId: item.userId !== undefined ? {
1853
1791
  equals: item.userId
1854
1792
  } : undefined,
@@ -1895,9 +1833,7 @@ export const AlpacaAccount = {
1895
1833
  }
1896
1834
  : { connectOrCreate: {
1897
1835
  where: {
1898
- id: props.user.customer.id !== undefined ? {
1899
- equals: props.user.customer.id
1900
- } : undefined,
1836
+ id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
1901
1837
  stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
1902
1838
  stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
1903
1839
  authUserId: props.user.customer.authUserId !== undefined ? {
@@ -1929,9 +1865,7 @@ export const AlpacaAccount = {
1929
1865
  }
1930
1866
  : { connectOrCreate: props.user.accounts.map((item) => ({
1931
1867
  where: {
1932
- id: item.id !== undefined ? {
1933
- equals: item.id
1934
- } : undefined,
1868
+ id: item.id !== undefined ? item.id : undefined,
1935
1869
  userId: item.userId !== undefined ? {
1936
1870
  equals: item.userId
1937
1871
  } : undefined,
@@ -1961,9 +1895,7 @@ export const AlpacaAccount = {
1961
1895
  }
1962
1896
  : { connectOrCreate: props.user.sessions.map((item) => ({
1963
1897
  where: {
1964
- id: item.id !== undefined ? {
1965
- equals: item.id
1966
- } : undefined,
1898
+ id: item.id !== undefined ? item.id : undefined,
1967
1899
  userId: item.userId !== undefined ? {
1968
1900
  equals: item.userId
1969
1901
  } : undefined,
@@ -1982,9 +1914,7 @@ export const AlpacaAccount = {
1982
1914
  }
1983
1915
  : { connectOrCreate: props.user.authenticators.map((item) => ({
1984
1916
  where: {
1985
- id: item.id !== undefined ? {
1986
- equals: item.id
1987
- } : undefined,
1917
+ id: item.id !== undefined ? item.id : undefined,
1988
1918
  userId: item.userId !== undefined ? {
1989
1919
  equals: item.userId
1990
1920
  } : undefined,
@@ -2002,9 +1932,7 @@ export const AlpacaAccount = {
2002
1932
  trades: props.trades ? {
2003
1933
  upsert: props.trades.map((item) => ({
2004
1934
  where: {
2005
- id: item.id !== undefined ? {
2006
- equals: item.id
2007
- } : undefined,
1935
+ id: item.id !== undefined ? item.id : undefined,
2008
1936
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
2009
1937
  equals: item.alpacaAccountId
2010
1938
  } : undefined,
@@ -2234,9 +2162,7 @@ export const AlpacaAccount = {
2234
2162
  orders: item.asset.orders ? {
2235
2163
  upsert: item.asset.orders.map((item) => ({
2236
2164
  where: {
2237
- id: item.id !== undefined ? {
2238
- equals: item.id
2239
- } : undefined,
2165
+ id: item.id !== undefined ? item.id : undefined,
2240
2166
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2241
2167
  actionId: item.actionId !== undefined ? item.actionId : undefined,
2242
2168
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -2347,9 +2273,7 @@ export const AlpacaAccount = {
2347
2273
  positions: item.asset.positions ? {
2348
2274
  upsert: item.asset.positions.map((item) => ({
2349
2275
  where: {
2350
- id: item.id !== undefined ? {
2351
- equals: item.id
2352
- } : undefined,
2276
+ id: item.id !== undefined ? item.id : undefined,
2353
2277
  assetId: item.assetId !== undefined ? {
2354
2278
  equals: item.assetId
2355
2279
  } : undefined,
@@ -2421,9 +2345,7 @@ export const AlpacaAccount = {
2421
2345
  newsMentions: item.asset.newsMentions ? {
2422
2346
  upsert: item.asset.newsMentions.map((item) => ({
2423
2347
  where: {
2424
- id: item.id !== undefined ? {
2425
- equals: item.id
2426
- } : undefined,
2348
+ id: item.id !== undefined ? item.id : undefined,
2427
2349
  url: item.url !== undefined ? item.url : undefined,
2428
2350
  assetId: item.assetId !== undefined ? {
2429
2351
  equals: item.assetId
@@ -2522,9 +2444,7 @@ export const AlpacaAccount = {
2522
2444
  }
2523
2445
  : { connectOrCreate: item.asset.orders.map((item) => ({
2524
2446
  where: {
2525
- id: item.id !== undefined ? {
2526
- equals: item.id
2527
- } : undefined,
2447
+ id: item.id !== undefined ? item.id : undefined,
2528
2448
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2529
2449
  actionId: item.actionId !== undefined ? item.actionId : undefined,
2530
2450
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -2569,9 +2489,7 @@ export const AlpacaAccount = {
2569
2489
  }
2570
2490
  : { connectOrCreate: item.asset.positions.map((item) => ({
2571
2491
  where: {
2572
- id: item.id !== undefined ? {
2573
- equals: item.id
2574
- } : undefined,
2492
+ id: item.id !== undefined ? item.id : undefined,
2575
2493
  assetId: item.assetId !== undefined ? {
2576
2494
  equals: item.assetId
2577
2495
  } : undefined,
@@ -2604,9 +2522,7 @@ export const AlpacaAccount = {
2604
2522
  }
2605
2523
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
2606
2524
  where: {
2607
- id: item.id !== undefined ? {
2608
- equals: item.id
2609
- } : undefined,
2525
+ id: item.id !== undefined ? item.id : undefined,
2610
2526
  url: item.url !== undefined ? item.url : undefined,
2611
2527
  assetId: item.assetId !== undefined ? {
2612
2528
  equals: item.assetId
@@ -2629,9 +2545,7 @@ export const AlpacaAccount = {
2629
2545
  actions: item.actions ? {
2630
2546
  upsert: item.actions.map((item) => ({
2631
2547
  where: {
2632
- id: item.id !== undefined ? {
2633
- equals: item.id
2634
- } : undefined,
2548
+ id: item.id !== undefined ? item.id : undefined,
2635
2549
  tradeId: item.tradeId !== undefined ? {
2636
2550
  equals: item.tradeId
2637
2551
  } : undefined,
@@ -2786,9 +2700,7 @@ export const AlpacaAccount = {
2786
2700
  }
2787
2701
  : { connectOrCreate: {
2788
2702
  where: {
2789
- id: item.order.id !== undefined ? {
2790
- equals: item.order.id
2791
- } : undefined,
2703
+ id: item.order.id !== undefined ? item.order.id : undefined,
2792
2704
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2793
2705
  actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2794
2706
  stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
@@ -2849,9 +2761,7 @@ export const AlpacaAccount = {
2849
2761
  }
2850
2762
  : { connectOrCreate: {
2851
2763
  where: {
2852
- id: item.asset.id !== undefined ? {
2853
- equals: item.asset.id
2854
- } : undefined,
2764
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
2855
2765
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2856
2766
  name: item.asset.name !== undefined ? item.asset.name : undefined,
2857
2767
  },
@@ -2919,9 +2829,7 @@ export const AlpacaAccount = {
2919
2829
  }
2920
2830
  : { connectOrCreate: item.asset.orders.map((item) => ({
2921
2831
  where: {
2922
- id: item.id !== undefined ? {
2923
- equals: item.id
2924
- } : undefined,
2832
+ id: item.id !== undefined ? item.id : undefined,
2925
2833
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2926
2834
  actionId: item.actionId !== undefined ? item.actionId : undefined,
2927
2835
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -2966,9 +2874,7 @@ export const AlpacaAccount = {
2966
2874
  }
2967
2875
  : { connectOrCreate: item.asset.positions.map((item) => ({
2968
2876
  where: {
2969
- id: item.id !== undefined ? {
2970
- equals: item.id
2971
- } : undefined,
2877
+ id: item.id !== undefined ? item.id : undefined,
2972
2878
  assetId: item.assetId !== undefined ? {
2973
2879
  equals: item.assetId
2974
2880
  } : undefined,
@@ -3001,9 +2907,7 @@ export const AlpacaAccount = {
3001
2907
  }
3002
2908
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
3003
2909
  where: {
3004
- id: item.id !== undefined ? {
3005
- equals: item.id
3006
- } : undefined,
2910
+ id: item.id !== undefined ? item.id : undefined,
3007
2911
  url: item.url !== undefined ? item.url : undefined,
3008
2912
  assetId: item.assetId !== undefined ? {
3009
2913
  equals: item.assetId
@@ -3031,9 +2935,7 @@ export const AlpacaAccount = {
3031
2935
  }
3032
2936
  : { connectOrCreate: item.actions.map((item) => ({
3033
2937
  where: {
3034
- id: item.id !== undefined ? {
3035
- equals: item.id
3036
- } : undefined,
2938
+ id: item.id !== undefined ? item.id : undefined,
3037
2939
  tradeId: item.tradeId !== undefined ? {
3038
2940
  equals: item.tradeId
3039
2941
  } : undefined,
@@ -3052,9 +2954,7 @@ export const AlpacaAccount = {
3052
2954
  }
3053
2955
  : { connectOrCreate: {
3054
2956
  where: {
3055
- id: item.order.id !== undefined ? {
3056
- equals: item.order.id
3057
- } : undefined,
2957
+ id: item.order.id !== undefined ? item.order.id : undefined,
3058
2958
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
3059
2959
  actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
3060
2960
  stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
@@ -3100,9 +3000,7 @@ export const AlpacaAccount = {
3100
3000
  orders: props.orders ? {
3101
3001
  upsert: props.orders.map((item) => ({
3102
3002
  where: {
3103
- id: item.id !== undefined ? {
3104
- equals: item.id
3105
- } : undefined,
3003
+ id: item.id !== undefined ? item.id : undefined,
3106
3004
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3107
3005
  actionId: item.actionId !== undefined ? item.actionId : undefined,
3108
3006
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -3347,9 +3245,7 @@ export const AlpacaAccount = {
3347
3245
  }
3348
3246
  : { connectOrCreate: {
3349
3247
  where: {
3350
- id: item.action.trade.id !== undefined ? {
3351
- equals: item.action.trade.id
3352
- } : undefined,
3248
+ id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3353
3249
  alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3354
3250
  equals: item.action.trade.alpacaAccountId
3355
3251
  } : undefined,
@@ -3560,9 +3456,7 @@ export const AlpacaAccount = {
3560
3456
  trades: item.asset.trades ? {
3561
3457
  upsert: item.asset.trades.map((item) => ({
3562
3458
  where: {
3563
- id: item.id !== undefined ? {
3564
- equals: item.id
3565
- } : undefined,
3459
+ id: item.id !== undefined ? item.id : undefined,
3566
3460
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
3567
3461
  equals: item.alpacaAccountId
3568
3462
  } : undefined,
@@ -3626,9 +3520,7 @@ export const AlpacaAccount = {
3626
3520
  positions: item.asset.positions ? {
3627
3521
  upsert: item.asset.positions.map((item) => ({
3628
3522
  where: {
3629
- id: item.id !== undefined ? {
3630
- equals: item.id
3631
- } : undefined,
3523
+ id: item.id !== undefined ? item.id : undefined,
3632
3524
  assetId: item.assetId !== undefined ? {
3633
3525
  equals: item.assetId
3634
3526
  } : undefined,
@@ -3700,9 +3592,7 @@ export const AlpacaAccount = {
3700
3592
  newsMentions: item.asset.newsMentions ? {
3701
3593
  upsert: item.asset.newsMentions.map((item) => ({
3702
3594
  where: {
3703
- id: item.id !== undefined ? {
3704
- equals: item.id
3705
- } : undefined,
3595
+ id: item.id !== undefined ? item.id : undefined,
3706
3596
  url: item.url !== undefined ? item.url : undefined,
3707
3597
  assetId: item.assetId !== undefined ? {
3708
3598
  equals: item.assetId
@@ -3801,9 +3691,7 @@ export const AlpacaAccount = {
3801
3691
  }
3802
3692
  : { connectOrCreate: item.asset.trades.map((item) => ({
3803
3693
  where: {
3804
- id: item.id !== undefined ? {
3805
- equals: item.id
3806
- } : undefined,
3694
+ id: item.id !== undefined ? item.id : undefined,
3807
3695
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
3808
3696
  equals: item.alpacaAccountId
3809
3697
  } : undefined,
@@ -3834,9 +3722,7 @@ export const AlpacaAccount = {
3834
3722
  }
3835
3723
  : { connectOrCreate: item.asset.positions.map((item) => ({
3836
3724
  where: {
3837
- id: item.id !== undefined ? {
3838
- equals: item.id
3839
- } : undefined,
3725
+ id: item.id !== undefined ? item.id : undefined,
3840
3726
  assetId: item.assetId !== undefined ? {
3841
3727
  equals: item.assetId
3842
3728
  } : undefined,
@@ -3869,9 +3755,7 @@ export const AlpacaAccount = {
3869
3755
  }
3870
3756
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
3871
3757
  where: {
3872
- id: item.id !== undefined ? {
3873
- equals: item.id
3874
- } : undefined,
3758
+ id: item.id !== undefined ? item.id : undefined,
3875
3759
  url: item.url !== undefined ? item.url : undefined,
3876
3760
  assetId: item.assetId !== undefined ? {
3877
3761
  equals: item.assetId
@@ -3923,9 +3807,7 @@ export const AlpacaAccount = {
3923
3807
  }
3924
3808
  : { connectOrCreate: {
3925
3809
  where: {
3926
- id: item.stopLoss.id !== undefined ? {
3927
- equals: item.stopLoss.id
3928
- } : undefined,
3810
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
3929
3811
  orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
3930
3812
  },
3931
3813
  create: {
@@ -3942,9 +3824,7 @@ export const AlpacaAccount = {
3942
3824
  }
3943
3825
  : { connectOrCreate: {
3944
3826
  where: {
3945
- id: item.takeProfit.id !== undefined ? {
3946
- equals: item.takeProfit.id
3947
- } : undefined,
3827
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
3948
3828
  orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
3949
3829
  },
3950
3830
  create: {
@@ -3961,9 +3841,7 @@ export const AlpacaAccount = {
3961
3841
  }
3962
3842
  : { connectOrCreate: {
3963
3843
  where: {
3964
- id: item.action.id !== undefined ? {
3965
- equals: item.action.id
3966
- } : undefined,
3844
+ id: item.action.id !== undefined ? item.action.id : undefined,
3967
3845
  tradeId: item.action.tradeId !== undefined ? {
3968
3846
  equals: item.action.tradeId
3969
3847
  } : undefined,
@@ -3982,9 +3860,7 @@ export const AlpacaAccount = {
3982
3860
  }
3983
3861
  : { connectOrCreate: {
3984
3862
  where: {
3985
- id: item.action.trade.id !== undefined ? {
3986
- equals: item.action.trade.id
3987
- } : undefined,
3863
+ id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3988
3864
  alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3989
3865
  equals: item.action.trade.alpacaAccountId
3990
3866
  } : undefined,
@@ -4018,9 +3894,7 @@ export const AlpacaAccount = {
4018
3894
  }
4019
3895
  : { connectOrCreate: {
4020
3896
  where: {
4021
- id: item.asset.id !== undefined ? {
4022
- equals: item.asset.id
4023
- } : undefined,
3897
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
4024
3898
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4025
3899
  name: item.asset.name !== undefined ? item.asset.name : undefined,
4026
3900
  },
@@ -4088,9 +3962,7 @@ export const AlpacaAccount = {
4088
3962
  }
4089
3963
  : { connectOrCreate: item.asset.trades.map((item) => ({
4090
3964
  where: {
4091
- id: item.id !== undefined ? {
4092
- equals: item.id
4093
- } : undefined,
3965
+ id: item.id !== undefined ? item.id : undefined,
4094
3966
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
4095
3967
  equals: item.alpacaAccountId
4096
3968
  } : undefined,
@@ -4121,9 +3993,7 @@ export const AlpacaAccount = {
4121
3993
  }
4122
3994
  : { connectOrCreate: item.asset.positions.map((item) => ({
4123
3995
  where: {
4124
- id: item.id !== undefined ? {
4125
- equals: item.id
4126
- } : undefined,
3996
+ id: item.id !== undefined ? item.id : undefined,
4127
3997
  assetId: item.assetId !== undefined ? {
4128
3998
  equals: item.assetId
4129
3999
  } : undefined,
@@ -4156,9 +4026,7 @@ export const AlpacaAccount = {
4156
4026
  }
4157
4027
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
4158
4028
  where: {
4159
- id: item.id !== undefined ? {
4160
- equals: item.id
4161
- } : undefined,
4029
+ id: item.id !== undefined ? item.id : undefined,
4162
4030
  url: item.url !== undefined ? item.url : undefined,
4163
4031
  assetId: item.assetId !== undefined ? {
4164
4032
  equals: item.assetId
@@ -4184,9 +4052,7 @@ export const AlpacaAccount = {
4184
4052
  positions: props.positions ? {
4185
4053
  upsert: props.positions.map((item) => ({
4186
4054
  where: {
4187
- id: item.id !== undefined ? {
4188
- equals: item.id
4189
- } : undefined,
4055
+ id: item.id !== undefined ? item.id : undefined,
4190
4056
  assetId: item.assetId !== undefined ? {
4191
4057
  equals: item.assetId
4192
4058
  } : undefined,
@@ -4422,9 +4288,7 @@ export const AlpacaAccount = {
4422
4288
  trades: item.asset.trades ? {
4423
4289
  upsert: item.asset.trades.map((item) => ({
4424
4290
  where: {
4425
- id: item.id !== undefined ? {
4426
- equals: item.id
4427
- } : undefined,
4291
+ id: item.id !== undefined ? item.id : undefined,
4428
4292
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
4429
4293
  equals: item.alpacaAccountId
4430
4294
  } : undefined,
@@ -4488,9 +4352,7 @@ export const AlpacaAccount = {
4488
4352
  orders: item.asset.orders ? {
4489
4353
  upsert: item.asset.orders.map((item) => ({
4490
4354
  where: {
4491
- id: item.id !== undefined ? {
4492
- equals: item.id
4493
- } : undefined,
4355
+ id: item.id !== undefined ? item.id : undefined,
4494
4356
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4495
4357
  actionId: item.actionId !== undefined ? item.actionId : undefined,
4496
4358
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -4601,9 +4463,7 @@ export const AlpacaAccount = {
4601
4463
  newsMentions: item.asset.newsMentions ? {
4602
4464
  upsert: item.asset.newsMentions.map((item) => ({
4603
4465
  where: {
4604
- id: item.id !== undefined ? {
4605
- equals: item.id
4606
- } : undefined,
4466
+ id: item.id !== undefined ? item.id : undefined,
4607
4467
  url: item.url !== undefined ? item.url : undefined,
4608
4468
  assetId: item.assetId !== undefined ? {
4609
4469
  equals: item.assetId
@@ -4702,9 +4562,7 @@ export const AlpacaAccount = {
4702
4562
  }
4703
4563
  : { connectOrCreate: item.asset.trades.map((item) => ({
4704
4564
  where: {
4705
- id: item.id !== undefined ? {
4706
- equals: item.id
4707
- } : undefined,
4565
+ id: item.id !== undefined ? item.id : undefined,
4708
4566
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
4709
4567
  equals: item.alpacaAccountId
4710
4568
  } : undefined,
@@ -4735,9 +4593,7 @@ export const AlpacaAccount = {
4735
4593
  }
4736
4594
  : { connectOrCreate: item.asset.orders.map((item) => ({
4737
4595
  where: {
4738
- id: item.id !== undefined ? {
4739
- equals: item.id
4740
- } : undefined,
4596
+ id: item.id !== undefined ? item.id : undefined,
4741
4597
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4742
4598
  actionId: item.actionId !== undefined ? item.actionId : undefined,
4743
4599
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -4782,9 +4638,7 @@ export const AlpacaAccount = {
4782
4638
  }
4783
4639
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
4784
4640
  where: {
4785
- id: item.id !== undefined ? {
4786
- equals: item.id
4787
- } : undefined,
4641
+ id: item.id !== undefined ? item.id : undefined,
4788
4642
  url: item.url !== undefined ? item.url : undefined,
4789
4643
  assetId: item.assetId !== undefined ? {
4790
4644
  equals: item.assetId
@@ -4827,9 +4681,7 @@ export const AlpacaAccount = {
4827
4681
  }
4828
4682
  : { connectOrCreate: {
4829
4683
  where: {
4830
- id: item.asset.id !== undefined ? {
4831
- equals: item.asset.id
4832
- } : undefined,
4684
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
4833
4685
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4834
4686
  name: item.asset.name !== undefined ? item.asset.name : undefined,
4835
4687
  },
@@ -4897,9 +4749,7 @@ export const AlpacaAccount = {
4897
4749
  }
4898
4750
  : { connectOrCreate: item.asset.trades.map((item) => ({
4899
4751
  where: {
4900
- id: item.id !== undefined ? {
4901
- equals: item.id
4902
- } : undefined,
4752
+ id: item.id !== undefined ? item.id : undefined,
4903
4753
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
4904
4754
  equals: item.alpacaAccountId
4905
4755
  } : undefined,
@@ -4930,9 +4780,7 @@ export const AlpacaAccount = {
4930
4780
  }
4931
4781
  : { connectOrCreate: item.asset.orders.map((item) => ({
4932
4782
  where: {
4933
- id: item.id !== undefined ? {
4934
- equals: item.id
4935
- } : undefined,
4783
+ id: item.id !== undefined ? item.id : undefined,
4936
4784
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4937
4785
  actionId: item.actionId !== undefined ? item.actionId : undefined,
4938
4786
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -4977,9 +4825,7 @@ export const AlpacaAccount = {
4977
4825
  }
4978
4826
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
4979
4827
  where: {
4980
- id: item.id !== undefined ? {
4981
- equals: item.id
4982
- } : undefined,
4828
+ id: item.id !== undefined ? item.id : undefined,
4983
4829
  url: item.url !== undefined ? item.url : undefined,
4984
4830
  assetId: item.assetId !== undefined ? {
4985
4831
  equals: item.assetId
@@ -5005,9 +4851,7 @@ export const AlpacaAccount = {
5005
4851
  alerts: props.alerts ? {
5006
4852
  upsert: props.alerts.map((item) => ({
5007
4853
  where: {
5008
- id: item.id !== undefined ? {
5009
- equals: item.id
5010
- } : undefined,
4854
+ id: item.id !== undefined ? item.id : undefined,
5011
4855
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
5012
4856
  equals: item.alpacaAccountId
5013
4857
  } : undefined,
@@ -5067,9 +4911,7 @@ export const AlpacaAccount = {
5067
4911
  }`;
5068
4912
  const variables = props.map(prop => ({
5069
4913
  where: {
5070
- id: prop.id !== undefined ? {
5071
- equals: prop.id
5072
- } : undefined,
4914
+ id: prop.id !== undefined ? prop.id : undefined,
5073
4915
  type: prop.type !== undefined ? prop.type : undefined,
5074
4916
  APIKey: prop.APIKey !== undefined ? prop.APIKey : undefined,
5075
4917
  APISecret: prop.APISecret !== undefined ? prop.APISecret : undefined,
@@ -5230,9 +5072,7 @@ export const AlpacaAccount = {
5230
5072
  accounts: prop.user.accounts ? {
5231
5073
  upsert: prop.user.accounts.map((item) => ({
5232
5074
  where: {
5233
- id: item.id !== undefined ? {
5234
- equals: item.id
5235
- } : undefined,
5075
+ id: item.id !== undefined ? item.id : undefined,
5236
5076
  userId: item.userId !== undefined ? {
5237
5077
  equals: item.userId
5238
5078
  } : undefined,
@@ -5292,9 +5132,7 @@ export const AlpacaAccount = {
5292
5132
  sessions: prop.user.sessions ? {
5293
5133
  upsert: prop.user.sessions.map((item) => ({
5294
5134
  where: {
5295
- id: item.id !== undefined ? {
5296
- equals: item.id
5297
- } : undefined,
5135
+ id: item.id !== undefined ? item.id : undefined,
5298
5136
  userId: item.userId !== undefined ? {
5299
5137
  equals: item.userId
5300
5138
  } : undefined,
@@ -5319,9 +5157,7 @@ export const AlpacaAccount = {
5319
5157
  authenticators: prop.user.authenticators ? {
5320
5158
  upsert: prop.user.authenticators.map((item) => ({
5321
5159
  where: {
5322
- id: item.id !== undefined ? {
5323
- equals: item.id
5324
- } : undefined,
5160
+ id: item.id !== undefined ? item.id : undefined,
5325
5161
  userId: item.userId !== undefined ? {
5326
5162
  equals: item.userId
5327
5163
  } : undefined,
@@ -5368,9 +5204,7 @@ export const AlpacaAccount = {
5368
5204
  }
5369
5205
  : { connectOrCreate: {
5370
5206
  where: {
5371
- id: prop.user.customer.id !== undefined ? {
5372
- equals: prop.user.customer.id
5373
- } : undefined,
5207
+ id: prop.user.customer.id !== undefined ? prop.user.customer.id : undefined,
5374
5208
  stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? prop.user.customer.stripeCustomerId : undefined,
5375
5209
  stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? prop.user.customer.stripeSubscriptionId : undefined,
5376
5210
  authUserId: prop.user.customer.authUserId !== undefined ? {
@@ -5402,9 +5236,7 @@ export const AlpacaAccount = {
5402
5236
  }
5403
5237
  : { connectOrCreate: prop.user.accounts.map((item) => ({
5404
5238
  where: {
5405
- id: item.id !== undefined ? {
5406
- equals: item.id
5407
- } : undefined,
5239
+ id: item.id !== undefined ? item.id : undefined,
5408
5240
  userId: item.userId !== undefined ? {
5409
5241
  equals: item.userId
5410
5242
  } : undefined,
@@ -5434,9 +5266,7 @@ export const AlpacaAccount = {
5434
5266
  }
5435
5267
  : { connectOrCreate: prop.user.sessions.map((item) => ({
5436
5268
  where: {
5437
- id: item.id !== undefined ? {
5438
- equals: item.id
5439
- } : undefined,
5269
+ id: item.id !== undefined ? item.id : undefined,
5440
5270
  userId: item.userId !== undefined ? {
5441
5271
  equals: item.userId
5442
5272
  } : undefined,
@@ -5455,9 +5285,7 @@ export const AlpacaAccount = {
5455
5285
  }
5456
5286
  : { connectOrCreate: prop.user.authenticators.map((item) => ({
5457
5287
  where: {
5458
- id: item.id !== undefined ? {
5459
- equals: item.id
5460
- } : undefined,
5288
+ id: item.id !== undefined ? item.id : undefined,
5461
5289
  userId: item.userId !== undefined ? {
5462
5290
  equals: item.userId
5463
5291
  } : undefined,
@@ -5475,9 +5303,7 @@ export const AlpacaAccount = {
5475
5303
  trades: prop.trades ? {
5476
5304
  upsert: prop.trades.map((item) => ({
5477
5305
  where: {
5478
- id: item.id !== undefined ? {
5479
- equals: item.id
5480
- } : undefined,
5306
+ id: item.id !== undefined ? item.id : undefined,
5481
5307
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
5482
5308
  equals: item.alpacaAccountId
5483
5309
  } : undefined,
@@ -5707,9 +5533,7 @@ export const AlpacaAccount = {
5707
5533
  orders: item.asset.orders ? {
5708
5534
  upsert: item.asset.orders.map((item) => ({
5709
5535
  where: {
5710
- id: item.id !== undefined ? {
5711
- equals: item.id
5712
- } : undefined,
5536
+ id: item.id !== undefined ? item.id : undefined,
5713
5537
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5714
5538
  actionId: item.actionId !== undefined ? item.actionId : undefined,
5715
5539
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -5820,9 +5644,7 @@ export const AlpacaAccount = {
5820
5644
  positions: item.asset.positions ? {
5821
5645
  upsert: item.asset.positions.map((item) => ({
5822
5646
  where: {
5823
- id: item.id !== undefined ? {
5824
- equals: item.id
5825
- } : undefined,
5647
+ id: item.id !== undefined ? item.id : undefined,
5826
5648
  assetId: item.assetId !== undefined ? {
5827
5649
  equals: item.assetId
5828
5650
  } : undefined,
@@ -5894,9 +5716,7 @@ export const AlpacaAccount = {
5894
5716
  newsMentions: item.asset.newsMentions ? {
5895
5717
  upsert: item.asset.newsMentions.map((item) => ({
5896
5718
  where: {
5897
- id: item.id !== undefined ? {
5898
- equals: item.id
5899
- } : undefined,
5719
+ id: item.id !== undefined ? item.id : undefined,
5900
5720
  url: item.url !== undefined ? item.url : undefined,
5901
5721
  assetId: item.assetId !== undefined ? {
5902
5722
  equals: item.assetId
@@ -5995,9 +5815,7 @@ export const AlpacaAccount = {
5995
5815
  }
5996
5816
  : { connectOrCreate: item.asset.orders.map((item) => ({
5997
5817
  where: {
5998
- id: item.id !== undefined ? {
5999
- equals: item.id
6000
- } : undefined,
5818
+ id: item.id !== undefined ? item.id : undefined,
6001
5819
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6002
5820
  actionId: item.actionId !== undefined ? item.actionId : undefined,
6003
5821
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -6042,9 +5860,7 @@ export const AlpacaAccount = {
6042
5860
  }
6043
5861
  : { connectOrCreate: item.asset.positions.map((item) => ({
6044
5862
  where: {
6045
- id: item.id !== undefined ? {
6046
- equals: item.id
6047
- } : undefined,
5863
+ id: item.id !== undefined ? item.id : undefined,
6048
5864
  assetId: item.assetId !== undefined ? {
6049
5865
  equals: item.assetId
6050
5866
  } : undefined,
@@ -6077,9 +5893,7 @@ export const AlpacaAccount = {
6077
5893
  }
6078
5894
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
6079
5895
  where: {
6080
- id: item.id !== undefined ? {
6081
- equals: item.id
6082
- } : undefined,
5896
+ id: item.id !== undefined ? item.id : undefined,
6083
5897
  url: item.url !== undefined ? item.url : undefined,
6084
5898
  assetId: item.assetId !== undefined ? {
6085
5899
  equals: item.assetId
@@ -6102,9 +5916,7 @@ export const AlpacaAccount = {
6102
5916
  actions: item.actions ? {
6103
5917
  upsert: item.actions.map((item) => ({
6104
5918
  where: {
6105
- id: item.id !== undefined ? {
6106
- equals: item.id
6107
- } : undefined,
5919
+ id: item.id !== undefined ? item.id : undefined,
6108
5920
  tradeId: item.tradeId !== undefined ? {
6109
5921
  equals: item.tradeId
6110
5922
  } : undefined,
@@ -6259,9 +6071,7 @@ export const AlpacaAccount = {
6259
6071
  }
6260
6072
  : { connectOrCreate: {
6261
6073
  where: {
6262
- id: item.order.id !== undefined ? {
6263
- equals: item.order.id
6264
- } : undefined,
6074
+ id: item.order.id !== undefined ? item.order.id : undefined,
6265
6075
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
6266
6076
  actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
6267
6077
  stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
@@ -6322,9 +6132,7 @@ export const AlpacaAccount = {
6322
6132
  }
6323
6133
  : { connectOrCreate: {
6324
6134
  where: {
6325
- id: item.asset.id !== undefined ? {
6326
- equals: item.asset.id
6327
- } : undefined,
6135
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
6328
6136
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
6329
6137
  name: item.asset.name !== undefined ? item.asset.name : undefined,
6330
6138
  },
@@ -6392,9 +6200,7 @@ export const AlpacaAccount = {
6392
6200
  }
6393
6201
  : { connectOrCreate: item.asset.orders.map((item) => ({
6394
6202
  where: {
6395
- id: item.id !== undefined ? {
6396
- equals: item.id
6397
- } : undefined,
6203
+ id: item.id !== undefined ? item.id : undefined,
6398
6204
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6399
6205
  actionId: item.actionId !== undefined ? item.actionId : undefined,
6400
6206
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -6439,9 +6245,7 @@ export const AlpacaAccount = {
6439
6245
  }
6440
6246
  : { connectOrCreate: item.asset.positions.map((item) => ({
6441
6247
  where: {
6442
- id: item.id !== undefined ? {
6443
- equals: item.id
6444
- } : undefined,
6248
+ id: item.id !== undefined ? item.id : undefined,
6445
6249
  assetId: item.assetId !== undefined ? {
6446
6250
  equals: item.assetId
6447
6251
  } : undefined,
@@ -6474,9 +6278,7 @@ export const AlpacaAccount = {
6474
6278
  }
6475
6279
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
6476
6280
  where: {
6477
- id: item.id !== undefined ? {
6478
- equals: item.id
6479
- } : undefined,
6281
+ id: item.id !== undefined ? item.id : undefined,
6480
6282
  url: item.url !== undefined ? item.url : undefined,
6481
6283
  assetId: item.assetId !== undefined ? {
6482
6284
  equals: item.assetId
@@ -6504,9 +6306,7 @@ export const AlpacaAccount = {
6504
6306
  }
6505
6307
  : { connectOrCreate: item.actions.map((item) => ({
6506
6308
  where: {
6507
- id: item.id !== undefined ? {
6508
- equals: item.id
6509
- } : undefined,
6309
+ id: item.id !== undefined ? item.id : undefined,
6510
6310
  tradeId: item.tradeId !== undefined ? {
6511
6311
  equals: item.tradeId
6512
6312
  } : undefined,
@@ -6525,9 +6325,7 @@ export const AlpacaAccount = {
6525
6325
  }
6526
6326
  : { connectOrCreate: {
6527
6327
  where: {
6528
- id: item.order.id !== undefined ? {
6529
- equals: item.order.id
6530
- } : undefined,
6328
+ id: item.order.id !== undefined ? item.order.id : undefined,
6531
6329
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
6532
6330
  actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
6533
6331
  stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
@@ -6573,9 +6371,7 @@ export const AlpacaAccount = {
6573
6371
  orders: prop.orders ? {
6574
6372
  upsert: prop.orders.map((item) => ({
6575
6373
  where: {
6576
- id: item.id !== undefined ? {
6577
- equals: item.id
6578
- } : undefined,
6374
+ id: item.id !== undefined ? item.id : undefined,
6579
6375
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6580
6376
  actionId: item.actionId !== undefined ? item.actionId : undefined,
6581
6377
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -6820,9 +6616,7 @@ export const AlpacaAccount = {
6820
6616
  }
6821
6617
  : { connectOrCreate: {
6822
6618
  where: {
6823
- id: item.action.trade.id !== undefined ? {
6824
- equals: item.action.trade.id
6825
- } : undefined,
6619
+ id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
6826
6620
  alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
6827
6621
  equals: item.action.trade.alpacaAccountId
6828
6622
  } : undefined,
@@ -7033,9 +6827,7 @@ export const AlpacaAccount = {
7033
6827
  trades: item.asset.trades ? {
7034
6828
  upsert: item.asset.trades.map((item) => ({
7035
6829
  where: {
7036
- id: item.id !== undefined ? {
7037
- equals: item.id
7038
- } : undefined,
6830
+ id: item.id !== undefined ? item.id : undefined,
7039
6831
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
7040
6832
  equals: item.alpacaAccountId
7041
6833
  } : undefined,
@@ -7099,9 +6891,7 @@ export const AlpacaAccount = {
7099
6891
  positions: item.asset.positions ? {
7100
6892
  upsert: item.asset.positions.map((item) => ({
7101
6893
  where: {
7102
- id: item.id !== undefined ? {
7103
- equals: item.id
7104
- } : undefined,
6894
+ id: item.id !== undefined ? item.id : undefined,
7105
6895
  assetId: item.assetId !== undefined ? {
7106
6896
  equals: item.assetId
7107
6897
  } : undefined,
@@ -7173,9 +6963,7 @@ export const AlpacaAccount = {
7173
6963
  newsMentions: item.asset.newsMentions ? {
7174
6964
  upsert: item.asset.newsMentions.map((item) => ({
7175
6965
  where: {
7176
- id: item.id !== undefined ? {
7177
- equals: item.id
7178
- } : undefined,
6966
+ id: item.id !== undefined ? item.id : undefined,
7179
6967
  url: item.url !== undefined ? item.url : undefined,
7180
6968
  assetId: item.assetId !== undefined ? {
7181
6969
  equals: item.assetId
@@ -7274,9 +7062,7 @@ export const AlpacaAccount = {
7274
7062
  }
7275
7063
  : { connectOrCreate: item.asset.trades.map((item) => ({
7276
7064
  where: {
7277
- id: item.id !== undefined ? {
7278
- equals: item.id
7279
- } : undefined,
7065
+ id: item.id !== undefined ? item.id : undefined,
7280
7066
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
7281
7067
  equals: item.alpacaAccountId
7282
7068
  } : undefined,
@@ -7307,9 +7093,7 @@ export const AlpacaAccount = {
7307
7093
  }
7308
7094
  : { connectOrCreate: item.asset.positions.map((item) => ({
7309
7095
  where: {
7310
- id: item.id !== undefined ? {
7311
- equals: item.id
7312
- } : undefined,
7096
+ id: item.id !== undefined ? item.id : undefined,
7313
7097
  assetId: item.assetId !== undefined ? {
7314
7098
  equals: item.assetId
7315
7099
  } : undefined,
@@ -7342,9 +7126,7 @@ export const AlpacaAccount = {
7342
7126
  }
7343
7127
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
7344
7128
  where: {
7345
- id: item.id !== undefined ? {
7346
- equals: item.id
7347
- } : undefined,
7129
+ id: item.id !== undefined ? item.id : undefined,
7348
7130
  url: item.url !== undefined ? item.url : undefined,
7349
7131
  assetId: item.assetId !== undefined ? {
7350
7132
  equals: item.assetId
@@ -7396,9 +7178,7 @@ export const AlpacaAccount = {
7396
7178
  }
7397
7179
  : { connectOrCreate: {
7398
7180
  where: {
7399
- id: item.stopLoss.id !== undefined ? {
7400
- equals: item.stopLoss.id
7401
- } : undefined,
7181
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
7402
7182
  orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
7403
7183
  },
7404
7184
  create: {
@@ -7415,9 +7195,7 @@ export const AlpacaAccount = {
7415
7195
  }
7416
7196
  : { connectOrCreate: {
7417
7197
  where: {
7418
- id: item.takeProfit.id !== undefined ? {
7419
- equals: item.takeProfit.id
7420
- } : undefined,
7198
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
7421
7199
  orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
7422
7200
  },
7423
7201
  create: {
@@ -7434,9 +7212,7 @@ export const AlpacaAccount = {
7434
7212
  }
7435
7213
  : { connectOrCreate: {
7436
7214
  where: {
7437
- id: item.action.id !== undefined ? {
7438
- equals: item.action.id
7439
- } : undefined,
7215
+ id: item.action.id !== undefined ? item.action.id : undefined,
7440
7216
  tradeId: item.action.tradeId !== undefined ? {
7441
7217
  equals: item.action.tradeId
7442
7218
  } : undefined,
@@ -7455,9 +7231,7 @@ export const AlpacaAccount = {
7455
7231
  }
7456
7232
  : { connectOrCreate: {
7457
7233
  where: {
7458
- id: item.action.trade.id !== undefined ? {
7459
- equals: item.action.trade.id
7460
- } : undefined,
7234
+ id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
7461
7235
  alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
7462
7236
  equals: item.action.trade.alpacaAccountId
7463
7237
  } : undefined,
@@ -7491,9 +7265,7 @@ export const AlpacaAccount = {
7491
7265
  }
7492
7266
  : { connectOrCreate: {
7493
7267
  where: {
7494
- id: item.asset.id !== undefined ? {
7495
- equals: item.asset.id
7496
- } : undefined,
7268
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
7497
7269
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
7498
7270
  name: item.asset.name !== undefined ? item.asset.name : undefined,
7499
7271
  },
@@ -7561,9 +7333,7 @@ export const AlpacaAccount = {
7561
7333
  }
7562
7334
  : { connectOrCreate: item.asset.trades.map((item) => ({
7563
7335
  where: {
7564
- id: item.id !== undefined ? {
7565
- equals: item.id
7566
- } : undefined,
7336
+ id: item.id !== undefined ? item.id : undefined,
7567
7337
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
7568
7338
  equals: item.alpacaAccountId
7569
7339
  } : undefined,
@@ -7594,9 +7364,7 @@ export const AlpacaAccount = {
7594
7364
  }
7595
7365
  : { connectOrCreate: item.asset.positions.map((item) => ({
7596
7366
  where: {
7597
- id: item.id !== undefined ? {
7598
- equals: item.id
7599
- } : undefined,
7367
+ id: item.id !== undefined ? item.id : undefined,
7600
7368
  assetId: item.assetId !== undefined ? {
7601
7369
  equals: item.assetId
7602
7370
  } : undefined,
@@ -7629,9 +7397,7 @@ export const AlpacaAccount = {
7629
7397
  }
7630
7398
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
7631
7399
  where: {
7632
- id: item.id !== undefined ? {
7633
- equals: item.id
7634
- } : undefined,
7400
+ id: item.id !== undefined ? item.id : undefined,
7635
7401
  url: item.url !== undefined ? item.url : undefined,
7636
7402
  assetId: item.assetId !== undefined ? {
7637
7403
  equals: item.assetId
@@ -7657,9 +7423,7 @@ export const AlpacaAccount = {
7657
7423
  positions: prop.positions ? {
7658
7424
  upsert: prop.positions.map((item) => ({
7659
7425
  where: {
7660
- id: item.id !== undefined ? {
7661
- equals: item.id
7662
- } : undefined,
7426
+ id: item.id !== undefined ? item.id : undefined,
7663
7427
  assetId: item.assetId !== undefined ? {
7664
7428
  equals: item.assetId
7665
7429
  } : undefined,
@@ -7895,9 +7659,7 @@ export const AlpacaAccount = {
7895
7659
  trades: item.asset.trades ? {
7896
7660
  upsert: item.asset.trades.map((item) => ({
7897
7661
  where: {
7898
- id: item.id !== undefined ? {
7899
- equals: item.id
7900
- } : undefined,
7662
+ id: item.id !== undefined ? item.id : undefined,
7901
7663
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
7902
7664
  equals: item.alpacaAccountId
7903
7665
  } : undefined,
@@ -7961,9 +7723,7 @@ export const AlpacaAccount = {
7961
7723
  orders: item.asset.orders ? {
7962
7724
  upsert: item.asset.orders.map((item) => ({
7963
7725
  where: {
7964
- id: item.id !== undefined ? {
7965
- equals: item.id
7966
- } : undefined,
7726
+ id: item.id !== undefined ? item.id : undefined,
7967
7727
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
7968
7728
  actionId: item.actionId !== undefined ? item.actionId : undefined,
7969
7729
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -8074,9 +7834,7 @@ export const AlpacaAccount = {
8074
7834
  newsMentions: item.asset.newsMentions ? {
8075
7835
  upsert: item.asset.newsMentions.map((item) => ({
8076
7836
  where: {
8077
- id: item.id !== undefined ? {
8078
- equals: item.id
8079
- } : undefined,
7837
+ id: item.id !== undefined ? item.id : undefined,
8080
7838
  url: item.url !== undefined ? item.url : undefined,
8081
7839
  assetId: item.assetId !== undefined ? {
8082
7840
  equals: item.assetId
@@ -8175,9 +7933,7 @@ export const AlpacaAccount = {
8175
7933
  }
8176
7934
  : { connectOrCreate: item.asset.trades.map((item) => ({
8177
7935
  where: {
8178
- id: item.id !== undefined ? {
8179
- equals: item.id
8180
- } : undefined,
7936
+ id: item.id !== undefined ? item.id : undefined,
8181
7937
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
8182
7938
  equals: item.alpacaAccountId
8183
7939
  } : undefined,
@@ -8208,9 +7964,7 @@ export const AlpacaAccount = {
8208
7964
  }
8209
7965
  : { connectOrCreate: item.asset.orders.map((item) => ({
8210
7966
  where: {
8211
- id: item.id !== undefined ? {
8212
- equals: item.id
8213
- } : undefined,
7967
+ id: item.id !== undefined ? item.id : undefined,
8214
7968
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
8215
7969
  actionId: item.actionId !== undefined ? item.actionId : undefined,
8216
7970
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -8255,9 +8009,7 @@ export const AlpacaAccount = {
8255
8009
  }
8256
8010
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
8257
8011
  where: {
8258
- id: item.id !== undefined ? {
8259
- equals: item.id
8260
- } : undefined,
8012
+ id: item.id !== undefined ? item.id : undefined,
8261
8013
  url: item.url !== undefined ? item.url : undefined,
8262
8014
  assetId: item.assetId !== undefined ? {
8263
8015
  equals: item.assetId
@@ -8300,9 +8052,7 @@ export const AlpacaAccount = {
8300
8052
  }
8301
8053
  : { connectOrCreate: {
8302
8054
  where: {
8303
- id: item.asset.id !== undefined ? {
8304
- equals: item.asset.id
8305
- } : undefined,
8055
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
8306
8056
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
8307
8057
  name: item.asset.name !== undefined ? item.asset.name : undefined,
8308
8058
  },
@@ -8370,9 +8120,7 @@ export const AlpacaAccount = {
8370
8120
  }
8371
8121
  : { connectOrCreate: item.asset.trades.map((item) => ({
8372
8122
  where: {
8373
- id: item.id !== undefined ? {
8374
- equals: item.id
8375
- } : undefined,
8123
+ id: item.id !== undefined ? item.id : undefined,
8376
8124
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
8377
8125
  equals: item.alpacaAccountId
8378
8126
  } : undefined,
@@ -8403,9 +8151,7 @@ export const AlpacaAccount = {
8403
8151
  }
8404
8152
  : { connectOrCreate: item.asset.orders.map((item) => ({
8405
8153
  where: {
8406
- id: item.id !== undefined ? {
8407
- equals: item.id
8408
- } : undefined,
8154
+ id: item.id !== undefined ? item.id : undefined,
8409
8155
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
8410
8156
  actionId: item.actionId !== undefined ? item.actionId : undefined,
8411
8157
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -8450,9 +8196,7 @@ export const AlpacaAccount = {
8450
8196
  }
8451
8197
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
8452
8198
  where: {
8453
- id: item.id !== undefined ? {
8454
- equals: item.id
8455
- } : undefined,
8199
+ id: item.id !== undefined ? item.id : undefined,
8456
8200
  url: item.url !== undefined ? item.url : undefined,
8457
8201
  assetId: item.assetId !== undefined ? {
8458
8202
  equals: item.assetId
@@ -8478,9 +8222,7 @@ export const AlpacaAccount = {
8478
8222
  alerts: prop.alerts ? {
8479
8223
  upsert: prop.alerts.map((item) => ({
8480
8224
  where: {
8481
- id: item.id !== undefined ? {
8482
- equals: item.id
8483
- } : undefined,
8225
+ id: item.id !== undefined ? item.id : undefined,
8484
8226
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
8485
8227
  equals: item.alpacaAccountId
8486
8228
  } : undefined,
@@ -8575,9 +8317,7 @@ export const AlpacaAccount = {
8575
8317
  }`;
8576
8318
  const variables = {
8577
8319
  where: {
8578
- id: props.id !== undefined ? {
8579
- equals: props.id
8580
- } : undefined,
8320
+ id: props.id !== undefined ? props.id : undefined,
8581
8321
  type: props.type !== undefined ? props.type : undefined,
8582
8322
  APIKey: props.APIKey !== undefined ? props.APIKey : undefined,
8583
8323
  APISecret: props.APISecret !== undefined ? props.APISecret : undefined,