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
@@ -125,9 +125,7 @@ exports.NewsArticleAssetSentiment = {
125
125
  }
126
126
  : { connectOrCreate: {
127
127
  where: {
128
- id: props.news.id !== undefined ? {
129
- equals: props.news.id
130
- } : undefined,
128
+ id: props.news.id !== undefined ? props.news.id : undefined,
131
129
  url: props.news.url !== undefined ? props.news.url : undefined,
132
130
  title: props.news.title !== undefined ? {
133
131
  equals: props.news.title
@@ -158,9 +156,7 @@ exports.NewsArticleAssetSentiment = {
158
156
  }
159
157
  : { connectOrCreate: {
160
158
  where: {
161
- id: props.asset.id !== undefined ? {
162
- equals: props.asset.id
163
- } : undefined,
159
+ id: props.asset.id !== undefined ? props.asset.id : undefined,
164
160
  symbol: props.asset.symbol !== undefined ? props.asset.symbol : undefined,
165
161
  name: props.asset.name !== undefined ? props.asset.name : undefined,
166
162
  },
@@ -228,9 +224,7 @@ exports.NewsArticleAssetSentiment = {
228
224
  }
229
225
  : { connectOrCreate: props.asset.trades.map((item) => ({
230
226
  where: {
231
- id: item.id !== undefined ? {
232
- equals: item.id
233
- } : undefined,
227
+ id: item.id !== undefined ? item.id : undefined,
234
228
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
235
229
  equals: item.alpacaAccountId
236
230
  } : undefined,
@@ -258,9 +252,7 @@ exports.NewsArticleAssetSentiment = {
258
252
  }
259
253
  : { connectOrCreate: {
260
254
  where: {
261
- id: item.alpacaAccount.id !== undefined ? {
262
- equals: item.alpacaAccount.id
263
- } : undefined,
255
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
264
256
  userId: item.alpacaAccount.userId !== undefined ? {
265
257
  equals: item.alpacaAccount.userId
266
258
  } : undefined,
@@ -286,9 +278,7 @@ exports.NewsArticleAssetSentiment = {
286
278
  }
287
279
  : { connectOrCreate: item.actions.map((item) => ({
288
280
  where: {
289
- id: item.id !== undefined ? {
290
- equals: item.id
291
- } : undefined,
281
+ id: item.id !== undefined ? item.id : undefined,
292
282
  tradeId: item.tradeId !== undefined ? {
293
283
  equals: item.tradeId
294
284
  } : undefined,
@@ -313,9 +303,7 @@ exports.NewsArticleAssetSentiment = {
313
303
  }
314
304
  : { connectOrCreate: props.asset.orders.map((item) => ({
315
305
  where: {
316
- id: item.id !== undefined ? {
317
- equals: item.id
318
- } : undefined,
306
+ id: item.id !== undefined ? item.id : undefined,
319
307
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
320
308
  actionId: item.actionId !== undefined ? item.actionId : undefined,
321
309
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -357,9 +345,7 @@ exports.NewsArticleAssetSentiment = {
357
345
  }
358
346
  : { connectOrCreate: {
359
347
  where: {
360
- id: item.stopLoss.id !== undefined ? {
361
- equals: item.stopLoss.id
362
- } : undefined,
348
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
363
349
  orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
364
350
  },
365
351
  create: {
@@ -376,9 +362,7 @@ exports.NewsArticleAssetSentiment = {
376
362
  }
377
363
  : { connectOrCreate: {
378
364
  where: {
379
- id: item.takeProfit.id !== undefined ? {
380
- equals: item.takeProfit.id
381
- } : undefined,
365
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
382
366
  orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
383
367
  },
384
368
  create: {
@@ -395,9 +379,7 @@ exports.NewsArticleAssetSentiment = {
395
379
  }
396
380
  : { connectOrCreate: {
397
381
  where: {
398
- id: item.alpacaAccount.id !== undefined ? {
399
- equals: item.alpacaAccount.id
400
- } : undefined,
382
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
401
383
  userId: item.alpacaAccount.userId !== undefined ? {
402
384
  equals: item.alpacaAccount.userId
403
385
  } : undefined,
@@ -423,9 +405,7 @@ exports.NewsArticleAssetSentiment = {
423
405
  }
424
406
  : { connectOrCreate: {
425
407
  where: {
426
- id: item.action.id !== undefined ? {
427
- equals: item.action.id
428
- } : undefined,
408
+ id: item.action.id !== undefined ? item.action.id : undefined,
429
409
  tradeId: item.action.tradeId !== undefined ? {
430
410
  equals: item.action.tradeId
431
411
  } : undefined,
@@ -450,9 +430,7 @@ exports.NewsArticleAssetSentiment = {
450
430
  }
451
431
  : { connectOrCreate: props.asset.positions.map((item) => ({
452
432
  where: {
453
- id: item.id !== undefined ? {
454
- equals: item.id
455
- } : undefined,
433
+ id: item.id !== undefined ? item.id : undefined,
456
434
  assetId: item.assetId !== undefined ? {
457
435
  equals: item.assetId
458
436
  } : undefined,
@@ -482,9 +460,7 @@ exports.NewsArticleAssetSentiment = {
482
460
  }
483
461
  : { connectOrCreate: {
484
462
  where: {
485
- id: item.alpacaAccount.id !== undefined ? {
486
- equals: item.alpacaAccount.id
487
- } : undefined,
463
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
488
464
  userId: item.alpacaAccount.userId !== undefined ? {
489
465
  equals: item.alpacaAccount.userId
490
466
  } : undefined,
@@ -582,9 +558,7 @@ exports.NewsArticleAssetSentiment = {
582
558
  }`;
583
559
  const variables = {
584
560
  where: {
585
- id: props.id !== undefined ? {
586
- equals: props.id
587
- } : undefined,
561
+ id: props.id !== undefined ? props.id : undefined,
588
562
  url: props.url !== undefined ? props.url : undefined,
589
563
  assetId: props.assetId !== undefined ? {
590
564
  equals: props.assetId
@@ -871,9 +845,7 @@ exports.NewsArticleAssetSentiment = {
871
845
  trades: props.asset.trades ? {
872
846
  upsert: props.asset.trades.map((item) => ({
873
847
  where: {
874
- id: item.id !== undefined ? {
875
- equals: item.id
876
- } : undefined,
848
+ id: item.id !== undefined ? item.id : undefined,
877
849
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
878
850
  equals: item.alpacaAccountId
879
851
  } : undefined,
@@ -976,9 +948,7 @@ exports.NewsArticleAssetSentiment = {
976
948
  actions: item.actions ? {
977
949
  upsert: item.actions.map((item) => ({
978
950
  where: {
979
- id: item.id !== undefined ? {
980
- equals: item.id
981
- } : undefined,
951
+ id: item.id !== undefined ? item.id : undefined,
982
952
  tradeId: item.tradeId !== undefined ? {
983
953
  equals: item.tradeId
984
954
  } : undefined,
@@ -1033,9 +1003,7 @@ exports.NewsArticleAssetSentiment = {
1033
1003
  }
1034
1004
  : { connectOrCreate: {
1035
1005
  where: {
1036
- id: item.alpacaAccount.id !== undefined ? {
1037
- equals: item.alpacaAccount.id
1038
- } : undefined,
1006
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1039
1007
  userId: item.alpacaAccount.userId !== undefined ? {
1040
1008
  equals: item.alpacaAccount.userId
1041
1009
  } : undefined,
@@ -1061,9 +1029,7 @@ exports.NewsArticleAssetSentiment = {
1061
1029
  }
1062
1030
  : { connectOrCreate: item.actions.map((item) => ({
1063
1031
  where: {
1064
- id: item.id !== undefined ? {
1065
- equals: item.id
1066
- } : undefined,
1032
+ id: item.id !== undefined ? item.id : undefined,
1067
1033
  tradeId: item.tradeId !== undefined ? {
1068
1034
  equals: item.tradeId
1069
1035
  } : undefined,
@@ -1083,9 +1049,7 @@ exports.NewsArticleAssetSentiment = {
1083
1049
  orders: props.asset.orders ? {
1084
1050
  upsert: props.asset.orders.map((item) => ({
1085
1051
  where: {
1086
- id: item.id !== undefined ? {
1087
- equals: item.id
1088
- } : undefined,
1052
+ id: item.id !== undefined ? item.id : undefined,
1089
1053
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1090
1054
  actionId: item.actionId !== undefined ? item.actionId : undefined,
1091
1055
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -1346,9 +1310,7 @@ exports.NewsArticleAssetSentiment = {
1346
1310
  }
1347
1311
  : { connectOrCreate: {
1348
1312
  where: {
1349
- id: item.stopLoss.id !== undefined ? {
1350
- equals: item.stopLoss.id
1351
- } : undefined,
1313
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
1352
1314
  orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
1353
1315
  },
1354
1316
  create: {
@@ -1365,9 +1327,7 @@ exports.NewsArticleAssetSentiment = {
1365
1327
  }
1366
1328
  : { connectOrCreate: {
1367
1329
  where: {
1368
- id: item.takeProfit.id !== undefined ? {
1369
- equals: item.takeProfit.id
1370
- } : undefined,
1330
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
1371
1331
  orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
1372
1332
  },
1373
1333
  create: {
@@ -1384,9 +1344,7 @@ exports.NewsArticleAssetSentiment = {
1384
1344
  }
1385
1345
  : { connectOrCreate: {
1386
1346
  where: {
1387
- id: item.alpacaAccount.id !== undefined ? {
1388
- equals: item.alpacaAccount.id
1389
- } : undefined,
1347
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1390
1348
  userId: item.alpacaAccount.userId !== undefined ? {
1391
1349
  equals: item.alpacaAccount.userId
1392
1350
  } : undefined,
@@ -1412,9 +1370,7 @@ exports.NewsArticleAssetSentiment = {
1412
1370
  }
1413
1371
  : { connectOrCreate: {
1414
1372
  where: {
1415
- id: item.action.id !== undefined ? {
1416
- equals: item.action.id
1417
- } : undefined,
1373
+ id: item.action.id !== undefined ? item.action.id : undefined,
1418
1374
  tradeId: item.action.tradeId !== undefined ? {
1419
1375
  equals: item.action.tradeId
1420
1376
  } : undefined,
@@ -1434,9 +1390,7 @@ exports.NewsArticleAssetSentiment = {
1434
1390
  positions: props.asset.positions ? {
1435
1391
  upsert: props.asset.positions.map((item) => ({
1436
1392
  where: {
1437
- id: item.id !== undefined ? {
1438
- equals: item.id
1439
- } : undefined,
1393
+ id: item.id !== undefined ? item.id : undefined,
1440
1394
  assetId: item.assetId !== undefined ? {
1441
1395
  equals: item.assetId
1442
1396
  } : undefined,
@@ -1565,9 +1519,7 @@ exports.NewsArticleAssetSentiment = {
1565
1519
  }
1566
1520
  : { connectOrCreate: {
1567
1521
  where: {
1568
- id: item.alpacaAccount.id !== undefined ? {
1569
- equals: item.alpacaAccount.id
1570
- } : undefined,
1522
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1571
1523
  userId: item.alpacaAccount.userId !== undefined ? {
1572
1524
  equals: item.alpacaAccount.userId
1573
1525
  } : undefined,
@@ -1653,9 +1605,7 @@ exports.NewsArticleAssetSentiment = {
1653
1605
  }
1654
1606
  : { connectOrCreate: props.asset.trades.map((item) => ({
1655
1607
  where: {
1656
- id: item.id !== undefined ? {
1657
- equals: item.id
1658
- } : undefined,
1608
+ id: item.id !== undefined ? item.id : undefined,
1659
1609
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
1660
1610
  equals: item.alpacaAccountId
1661
1611
  } : undefined,
@@ -1683,9 +1633,7 @@ exports.NewsArticleAssetSentiment = {
1683
1633
  }
1684
1634
  : { connectOrCreate: {
1685
1635
  where: {
1686
- id: item.alpacaAccount.id !== undefined ? {
1687
- equals: item.alpacaAccount.id
1688
- } : undefined,
1636
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1689
1637
  userId: item.alpacaAccount.userId !== undefined ? {
1690
1638
  equals: item.alpacaAccount.userId
1691
1639
  } : undefined,
@@ -1711,9 +1659,7 @@ exports.NewsArticleAssetSentiment = {
1711
1659
  }
1712
1660
  : { connectOrCreate: item.actions.map((item) => ({
1713
1661
  where: {
1714
- id: item.id !== undefined ? {
1715
- equals: item.id
1716
- } : undefined,
1662
+ id: item.id !== undefined ? item.id : undefined,
1717
1663
  tradeId: item.tradeId !== undefined ? {
1718
1664
  equals: item.tradeId
1719
1665
  } : undefined,
@@ -1738,9 +1684,7 @@ exports.NewsArticleAssetSentiment = {
1738
1684
  }
1739
1685
  : { connectOrCreate: props.asset.orders.map((item) => ({
1740
1686
  where: {
1741
- id: item.id !== undefined ? {
1742
- equals: item.id
1743
- } : undefined,
1687
+ id: item.id !== undefined ? item.id : undefined,
1744
1688
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1745
1689
  actionId: item.actionId !== undefined ? item.actionId : undefined,
1746
1690
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -1782,9 +1726,7 @@ exports.NewsArticleAssetSentiment = {
1782
1726
  }
1783
1727
  : { connectOrCreate: {
1784
1728
  where: {
1785
- id: item.stopLoss.id !== undefined ? {
1786
- equals: item.stopLoss.id
1787
- } : undefined,
1729
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
1788
1730
  orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
1789
1731
  },
1790
1732
  create: {
@@ -1801,9 +1743,7 @@ exports.NewsArticleAssetSentiment = {
1801
1743
  }
1802
1744
  : { connectOrCreate: {
1803
1745
  where: {
1804
- id: item.takeProfit.id !== undefined ? {
1805
- equals: item.takeProfit.id
1806
- } : undefined,
1746
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
1807
1747
  orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
1808
1748
  },
1809
1749
  create: {
@@ -1820,9 +1760,7 @@ exports.NewsArticleAssetSentiment = {
1820
1760
  }
1821
1761
  : { connectOrCreate: {
1822
1762
  where: {
1823
- id: item.alpacaAccount.id !== undefined ? {
1824
- equals: item.alpacaAccount.id
1825
- } : undefined,
1763
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1826
1764
  userId: item.alpacaAccount.userId !== undefined ? {
1827
1765
  equals: item.alpacaAccount.userId
1828
1766
  } : undefined,
@@ -1848,9 +1786,7 @@ exports.NewsArticleAssetSentiment = {
1848
1786
  }
1849
1787
  : { connectOrCreate: {
1850
1788
  where: {
1851
- id: item.action.id !== undefined ? {
1852
- equals: item.action.id
1853
- } : undefined,
1789
+ id: item.action.id !== undefined ? item.action.id : undefined,
1854
1790
  tradeId: item.action.tradeId !== undefined ? {
1855
1791
  equals: item.action.tradeId
1856
1792
  } : undefined,
@@ -1875,9 +1811,7 @@ exports.NewsArticleAssetSentiment = {
1875
1811
  }
1876
1812
  : { connectOrCreate: props.asset.positions.map((item) => ({
1877
1813
  where: {
1878
- id: item.id !== undefined ? {
1879
- equals: item.id
1880
- } : undefined,
1814
+ id: item.id !== undefined ? item.id : undefined,
1881
1815
  assetId: item.assetId !== undefined ? {
1882
1816
  equals: item.assetId
1883
1817
  } : undefined,
@@ -1907,9 +1841,7 @@ exports.NewsArticleAssetSentiment = {
1907
1841
  }
1908
1842
  : { connectOrCreate: {
1909
1843
  where: {
1910
- id: item.alpacaAccount.id !== undefined ? {
1911
- equals: item.alpacaAccount.id
1912
- } : undefined,
1844
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1913
1845
  userId: item.alpacaAccount.userId !== undefined ? {
1914
1846
  equals: item.alpacaAccount.userId
1915
1847
  } : undefined,
@@ -1967,9 +1899,7 @@ exports.NewsArticleAssetSentiment = {
1967
1899
  }`;
1968
1900
  const variables = props.map(prop => ({
1969
1901
  where: {
1970
- id: prop.id !== undefined ? {
1971
- equals: prop.id
1972
- } : undefined,
1902
+ id: prop.id !== undefined ? prop.id : undefined,
1973
1903
  url: prop.url !== undefined ? prop.url : undefined,
1974
1904
  assetId: prop.assetId !== undefined ? {
1975
1905
  equals: prop.assetId
@@ -2256,9 +2186,7 @@ exports.NewsArticleAssetSentiment = {
2256
2186
  trades: prop.asset.trades ? {
2257
2187
  upsert: prop.asset.trades.map((item) => ({
2258
2188
  where: {
2259
- id: item.id !== undefined ? {
2260
- equals: item.id
2261
- } : undefined,
2189
+ id: item.id !== undefined ? item.id : undefined,
2262
2190
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
2263
2191
  equals: item.alpacaAccountId
2264
2192
  } : undefined,
@@ -2361,9 +2289,7 @@ exports.NewsArticleAssetSentiment = {
2361
2289
  actions: item.actions ? {
2362
2290
  upsert: item.actions.map((item) => ({
2363
2291
  where: {
2364
- id: item.id !== undefined ? {
2365
- equals: item.id
2366
- } : undefined,
2292
+ id: item.id !== undefined ? item.id : undefined,
2367
2293
  tradeId: item.tradeId !== undefined ? {
2368
2294
  equals: item.tradeId
2369
2295
  } : undefined,
@@ -2418,9 +2344,7 @@ exports.NewsArticleAssetSentiment = {
2418
2344
  }
2419
2345
  : { connectOrCreate: {
2420
2346
  where: {
2421
- id: item.alpacaAccount.id !== undefined ? {
2422
- equals: item.alpacaAccount.id
2423
- } : undefined,
2347
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
2424
2348
  userId: item.alpacaAccount.userId !== undefined ? {
2425
2349
  equals: item.alpacaAccount.userId
2426
2350
  } : undefined,
@@ -2446,9 +2370,7 @@ exports.NewsArticleAssetSentiment = {
2446
2370
  }
2447
2371
  : { connectOrCreate: item.actions.map((item) => ({
2448
2372
  where: {
2449
- id: item.id !== undefined ? {
2450
- equals: item.id
2451
- } : undefined,
2373
+ id: item.id !== undefined ? item.id : undefined,
2452
2374
  tradeId: item.tradeId !== undefined ? {
2453
2375
  equals: item.tradeId
2454
2376
  } : undefined,
@@ -2468,9 +2390,7 @@ exports.NewsArticleAssetSentiment = {
2468
2390
  orders: prop.asset.orders ? {
2469
2391
  upsert: prop.asset.orders.map((item) => ({
2470
2392
  where: {
2471
- id: item.id !== undefined ? {
2472
- equals: item.id
2473
- } : undefined,
2393
+ id: item.id !== undefined ? item.id : undefined,
2474
2394
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2475
2395
  actionId: item.actionId !== undefined ? item.actionId : undefined,
2476
2396
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -2731,9 +2651,7 @@ exports.NewsArticleAssetSentiment = {
2731
2651
  }
2732
2652
  : { connectOrCreate: {
2733
2653
  where: {
2734
- id: item.stopLoss.id !== undefined ? {
2735
- equals: item.stopLoss.id
2736
- } : undefined,
2654
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
2737
2655
  orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
2738
2656
  },
2739
2657
  create: {
@@ -2750,9 +2668,7 @@ exports.NewsArticleAssetSentiment = {
2750
2668
  }
2751
2669
  : { connectOrCreate: {
2752
2670
  where: {
2753
- id: item.takeProfit.id !== undefined ? {
2754
- equals: item.takeProfit.id
2755
- } : undefined,
2671
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
2756
2672
  orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
2757
2673
  },
2758
2674
  create: {
@@ -2769,9 +2685,7 @@ exports.NewsArticleAssetSentiment = {
2769
2685
  }
2770
2686
  : { connectOrCreate: {
2771
2687
  where: {
2772
- id: item.alpacaAccount.id !== undefined ? {
2773
- equals: item.alpacaAccount.id
2774
- } : undefined,
2688
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
2775
2689
  userId: item.alpacaAccount.userId !== undefined ? {
2776
2690
  equals: item.alpacaAccount.userId
2777
2691
  } : undefined,
@@ -2797,9 +2711,7 @@ exports.NewsArticleAssetSentiment = {
2797
2711
  }
2798
2712
  : { connectOrCreate: {
2799
2713
  where: {
2800
- id: item.action.id !== undefined ? {
2801
- equals: item.action.id
2802
- } : undefined,
2714
+ id: item.action.id !== undefined ? item.action.id : undefined,
2803
2715
  tradeId: item.action.tradeId !== undefined ? {
2804
2716
  equals: item.action.tradeId
2805
2717
  } : undefined,
@@ -2819,9 +2731,7 @@ exports.NewsArticleAssetSentiment = {
2819
2731
  positions: prop.asset.positions ? {
2820
2732
  upsert: prop.asset.positions.map((item) => ({
2821
2733
  where: {
2822
- id: item.id !== undefined ? {
2823
- equals: item.id
2824
- } : undefined,
2734
+ id: item.id !== undefined ? item.id : undefined,
2825
2735
  assetId: item.assetId !== undefined ? {
2826
2736
  equals: item.assetId
2827
2737
  } : undefined,
@@ -2950,9 +2860,7 @@ exports.NewsArticleAssetSentiment = {
2950
2860
  }
2951
2861
  : { connectOrCreate: {
2952
2862
  where: {
2953
- id: item.alpacaAccount.id !== undefined ? {
2954
- equals: item.alpacaAccount.id
2955
- } : undefined,
2863
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
2956
2864
  userId: item.alpacaAccount.userId !== undefined ? {
2957
2865
  equals: item.alpacaAccount.userId
2958
2866
  } : undefined,
@@ -3038,9 +2946,7 @@ exports.NewsArticleAssetSentiment = {
3038
2946
  }
3039
2947
  : { connectOrCreate: prop.asset.trades.map((item) => ({
3040
2948
  where: {
3041
- id: item.id !== undefined ? {
3042
- equals: item.id
3043
- } : undefined,
2949
+ id: item.id !== undefined ? item.id : undefined,
3044
2950
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
3045
2951
  equals: item.alpacaAccountId
3046
2952
  } : undefined,
@@ -3068,9 +2974,7 @@ exports.NewsArticleAssetSentiment = {
3068
2974
  }
3069
2975
  : { connectOrCreate: {
3070
2976
  where: {
3071
- id: item.alpacaAccount.id !== undefined ? {
3072
- equals: item.alpacaAccount.id
3073
- } : undefined,
2977
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3074
2978
  userId: item.alpacaAccount.userId !== undefined ? {
3075
2979
  equals: item.alpacaAccount.userId
3076
2980
  } : undefined,
@@ -3096,9 +3000,7 @@ exports.NewsArticleAssetSentiment = {
3096
3000
  }
3097
3001
  : { connectOrCreate: item.actions.map((item) => ({
3098
3002
  where: {
3099
- id: item.id !== undefined ? {
3100
- equals: item.id
3101
- } : undefined,
3003
+ id: item.id !== undefined ? item.id : undefined,
3102
3004
  tradeId: item.tradeId !== undefined ? {
3103
3005
  equals: item.tradeId
3104
3006
  } : undefined,
@@ -3123,9 +3025,7 @@ exports.NewsArticleAssetSentiment = {
3123
3025
  }
3124
3026
  : { connectOrCreate: prop.asset.orders.map((item) => ({
3125
3027
  where: {
3126
- id: item.id !== undefined ? {
3127
- equals: item.id
3128
- } : undefined,
3028
+ id: item.id !== undefined ? item.id : undefined,
3129
3029
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3130
3030
  actionId: item.actionId !== undefined ? item.actionId : undefined,
3131
3031
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
@@ -3167,9 +3067,7 @@ exports.NewsArticleAssetSentiment = {
3167
3067
  }
3168
3068
  : { connectOrCreate: {
3169
3069
  where: {
3170
- id: item.stopLoss.id !== undefined ? {
3171
- equals: item.stopLoss.id
3172
- } : undefined,
3070
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
3173
3071
  orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
3174
3072
  },
3175
3073
  create: {
@@ -3186,9 +3084,7 @@ exports.NewsArticleAssetSentiment = {
3186
3084
  }
3187
3085
  : { connectOrCreate: {
3188
3086
  where: {
3189
- id: item.takeProfit.id !== undefined ? {
3190
- equals: item.takeProfit.id
3191
- } : undefined,
3087
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
3192
3088
  orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
3193
3089
  },
3194
3090
  create: {
@@ -3205,9 +3101,7 @@ exports.NewsArticleAssetSentiment = {
3205
3101
  }
3206
3102
  : { connectOrCreate: {
3207
3103
  where: {
3208
- id: item.alpacaAccount.id !== undefined ? {
3209
- equals: item.alpacaAccount.id
3210
- } : undefined,
3104
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3211
3105
  userId: item.alpacaAccount.userId !== undefined ? {
3212
3106
  equals: item.alpacaAccount.userId
3213
3107
  } : undefined,
@@ -3233,9 +3127,7 @@ exports.NewsArticleAssetSentiment = {
3233
3127
  }
3234
3128
  : { connectOrCreate: {
3235
3129
  where: {
3236
- id: item.action.id !== undefined ? {
3237
- equals: item.action.id
3238
- } : undefined,
3130
+ id: item.action.id !== undefined ? item.action.id : undefined,
3239
3131
  tradeId: item.action.tradeId !== undefined ? {
3240
3132
  equals: item.action.tradeId
3241
3133
  } : undefined,
@@ -3260,9 +3152,7 @@ exports.NewsArticleAssetSentiment = {
3260
3152
  }
3261
3153
  : { connectOrCreate: prop.asset.positions.map((item) => ({
3262
3154
  where: {
3263
- id: item.id !== undefined ? {
3264
- equals: item.id
3265
- } : undefined,
3155
+ id: item.id !== undefined ? item.id : undefined,
3266
3156
  assetId: item.assetId !== undefined ? {
3267
3157
  equals: item.assetId
3268
3158
  } : undefined,
@@ -3292,9 +3182,7 @@ exports.NewsArticleAssetSentiment = {
3292
3182
  }
3293
3183
  : { connectOrCreate: {
3294
3184
  where: {
3295
- id: item.alpacaAccount.id !== undefined ? {
3296
- equals: item.alpacaAccount.id
3297
- } : undefined,
3185
+ id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3298
3186
  userId: item.alpacaAccount.userId !== undefined ? {
3299
3187
  equals: item.alpacaAccount.userId
3300
3188
  } : undefined,
@@ -3388,9 +3276,7 @@ exports.NewsArticleAssetSentiment = {
3388
3276
  }`;
3389
3277
  const variables = {
3390
3278
  where: {
3391
- id: props.id !== undefined ? {
3392
- equals: props.id
3393
- } : undefined,
3279
+ id: props.id !== undefined ? props.id : undefined,
3394
3280
  url: props.url !== undefined ? props.url : undefined,
3395
3281
  assetId: props.assetId !== undefined ? {
3396
3282
  equals: props.assetId