adaptic-backend 1.0.159 → 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.
- package/Account.cjs +285 -8
- package/Action.cjs +615 -4
- package/Alert.cjs +338 -4
- package/AlpacaAccount.cjs +771 -4
- package/Asset.cjs +642 -0
- package/Authenticator.cjs +288 -4
- package/Customer.cjs +273 -10
- package/NewsArticle.cjs +165 -0
- package/NewsArticleAssetSentiment.cjs +256 -8
- package/Order.cjs +510 -10
- package/Position.cjs +546 -8
- package/Session.cjs +288 -4
- package/StopLoss.cjs +348 -1
- package/TakeProfit.cjs +348 -1
- package/Trade.cjs +607 -8
- package/User.cjs +261 -0
- package/package.json +1 -1
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +285 -8
- package/server/Action.d.ts.map +1 -1
- package/server/Action.js.map +1 -1
- package/server/Action.mjs +615 -4
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +338 -4
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +771 -4
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +642 -0
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +288 -4
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +273 -10
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +165 -0
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +256 -8
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +510 -10
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +546 -8
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +288 -4
- package/server/StopLoss.d.ts.map +1 -1
- package/server/StopLoss.js.map +1 -1
- package/server/StopLoss.mjs +348 -1
- package/server/TakeProfit.d.ts.map +1 -1
- package/server/TakeProfit.js.map +1 -1
- package/server/TakeProfit.mjs +348 -1
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +607 -8
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +261 -0
@@ -223,6 +223,12 @@ export const NewsArticleAssetSentiment = {
|
|
223
223
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
224
224
|
where: {
|
225
225
|
id: item.id !== undefined ? item.id : undefined,
|
226
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
227
|
+
equals: item.alpacaAccountId
|
228
|
+
} : undefined,
|
229
|
+
assetId: item.assetId !== undefined ? {
|
230
|
+
equals: item.assetId
|
231
|
+
} : undefined,
|
226
232
|
},
|
227
233
|
create: {
|
228
234
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -245,6 +251,9 @@ export const NewsArticleAssetSentiment = {
|
|
245
251
|
: { connectOrCreate: {
|
246
252
|
where: {
|
247
253
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
254
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
255
|
+
equals: item.alpacaAccount.userId
|
256
|
+
} : undefined,
|
248
257
|
},
|
249
258
|
create: {
|
250
259
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -268,6 +277,9 @@ export const NewsArticleAssetSentiment = {
|
|
268
277
|
: { connectOrCreate: item.actions.map((item) => ({
|
269
278
|
where: {
|
270
279
|
id: item.id !== undefined ? item.id : undefined,
|
280
|
+
tradeId: item.tradeId !== undefined ? {
|
281
|
+
equals: item.tradeId
|
282
|
+
} : undefined,
|
271
283
|
},
|
272
284
|
create: {
|
273
285
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -290,6 +302,15 @@ export const NewsArticleAssetSentiment = {
|
|
290
302
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
291
303
|
where: {
|
292
304
|
id: item.id !== undefined ? item.id : undefined,
|
305
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
306
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
307
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
308
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
309
|
+
equals: item.alpacaAccountId
|
310
|
+
} : undefined,
|
311
|
+
assetId: item.assetId !== undefined ? {
|
312
|
+
equals: item.assetId
|
313
|
+
} : undefined,
|
293
314
|
},
|
294
315
|
create: {
|
295
316
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -323,6 +344,7 @@ export const NewsArticleAssetSentiment = {
|
|
323
344
|
: { connectOrCreate: {
|
324
345
|
where: {
|
325
346
|
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
347
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
326
348
|
},
|
327
349
|
create: {
|
328
350
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -339,6 +361,7 @@ export const NewsArticleAssetSentiment = {
|
|
339
361
|
: { connectOrCreate: {
|
340
362
|
where: {
|
341
363
|
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
364
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
342
365
|
},
|
343
366
|
create: {
|
344
367
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -355,6 +378,9 @@ export const NewsArticleAssetSentiment = {
|
|
355
378
|
: { connectOrCreate: {
|
356
379
|
where: {
|
357
380
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
381
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
382
|
+
equals: item.alpacaAccount.userId
|
383
|
+
} : undefined,
|
358
384
|
},
|
359
385
|
create: {
|
360
386
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -378,6 +404,9 @@ export const NewsArticleAssetSentiment = {
|
|
378
404
|
: { connectOrCreate: {
|
379
405
|
where: {
|
380
406
|
id: item.action.id !== undefined ? item.action.id : undefined,
|
407
|
+
tradeId: item.action.tradeId !== undefined ? {
|
408
|
+
equals: item.action.tradeId
|
409
|
+
} : undefined,
|
381
410
|
},
|
382
411
|
create: {
|
383
412
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -400,6 +429,12 @@ export const NewsArticleAssetSentiment = {
|
|
400
429
|
: { connectOrCreate: props.asset.positions.map((item) => ({
|
401
430
|
where: {
|
402
431
|
id: item.id !== undefined ? item.id : undefined,
|
432
|
+
assetId: item.assetId !== undefined ? {
|
433
|
+
equals: item.assetId
|
434
|
+
} : undefined,
|
435
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
436
|
+
equals: item.alpacaAccountId
|
437
|
+
} : undefined,
|
403
438
|
},
|
404
439
|
create: {
|
405
440
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -424,6 +459,9 @@ export const NewsArticleAssetSentiment = {
|
|
424
459
|
: { connectOrCreate: {
|
425
460
|
where: {
|
426
461
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
462
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
463
|
+
equals: item.alpacaAccount.userId
|
464
|
+
} : undefined,
|
427
465
|
},
|
428
466
|
create: {
|
429
467
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -520,8 +558,12 @@ export const NewsArticleAssetSentiment = {
|
|
520
558
|
where: {
|
521
559
|
id: props.id !== undefined ? props.id : undefined,
|
522
560
|
url: props.url !== undefined ? props.url : undefined,
|
523
|
-
assetId: props.assetId !== undefined ?
|
524
|
-
|
561
|
+
assetId: props.assetId !== undefined ? {
|
562
|
+
equals: props.assetId
|
563
|
+
} : undefined,
|
564
|
+
newsArticleId: props.newsArticleId !== undefined ? {
|
565
|
+
equals: props.newsArticleId
|
566
|
+
} : undefined,
|
525
567
|
relevancyScore: props.relevancyScore !== undefined ? props.relevancyScore : undefined,
|
526
568
|
sentimentScore: props.sentimentScore !== undefined ? props.sentimentScore : undefined,
|
527
569
|
sentimentLabel: props.sentimentLabel !== undefined ? props.sentimentLabel : undefined,
|
@@ -802,6 +844,12 @@ export const NewsArticleAssetSentiment = {
|
|
802
844
|
upsert: props.asset.trades.map((item) => ({
|
803
845
|
where: {
|
804
846
|
id: item.id !== undefined ? item.id : undefined,
|
847
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
848
|
+
equals: item.alpacaAccountId
|
849
|
+
} : undefined,
|
850
|
+
assetId: item.assetId !== undefined ? {
|
851
|
+
equals: item.assetId
|
852
|
+
} : undefined,
|
805
853
|
},
|
806
854
|
update: {
|
807
855
|
id: item.id !== undefined ? {
|
@@ -846,6 +894,9 @@ export const NewsArticleAssetSentiment = {
|
|
846
894
|
id: item.alpacaAccount.id !== undefined ? {
|
847
895
|
equals: item.alpacaAccount.id
|
848
896
|
} : undefined,
|
897
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
898
|
+
equals: item.alpacaAccount.userId
|
899
|
+
} : undefined,
|
849
900
|
},
|
850
901
|
update: {
|
851
902
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -896,6 +947,9 @@ export const NewsArticleAssetSentiment = {
|
|
896
947
|
upsert: item.actions.map((item) => ({
|
897
948
|
where: {
|
898
949
|
id: item.id !== undefined ? item.id : undefined,
|
950
|
+
tradeId: item.tradeId !== undefined ? {
|
951
|
+
equals: item.tradeId
|
952
|
+
} : undefined,
|
899
953
|
},
|
900
954
|
update: {
|
901
955
|
id: item.id !== undefined ? {
|
@@ -948,6 +1002,9 @@ export const NewsArticleAssetSentiment = {
|
|
948
1002
|
: { connectOrCreate: {
|
949
1003
|
where: {
|
950
1004
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1005
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1006
|
+
equals: item.alpacaAccount.userId
|
1007
|
+
} : undefined,
|
951
1008
|
},
|
952
1009
|
create: {
|
953
1010
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -971,6 +1028,9 @@ export const NewsArticleAssetSentiment = {
|
|
971
1028
|
: { connectOrCreate: item.actions.map((item) => ({
|
972
1029
|
where: {
|
973
1030
|
id: item.id !== undefined ? item.id : undefined,
|
1031
|
+
tradeId: item.tradeId !== undefined ? {
|
1032
|
+
equals: item.tradeId
|
1033
|
+
} : undefined,
|
974
1034
|
},
|
975
1035
|
create: {
|
976
1036
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -988,6 +1048,15 @@ export const NewsArticleAssetSentiment = {
|
|
988
1048
|
upsert: props.asset.orders.map((item) => ({
|
989
1049
|
where: {
|
990
1050
|
id: item.id !== undefined ? item.id : undefined,
|
1051
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1052
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1053
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1054
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1055
|
+
equals: item.alpacaAccountId
|
1056
|
+
} : undefined,
|
1057
|
+
assetId: item.assetId !== undefined ? {
|
1058
|
+
equals: item.assetId
|
1059
|
+
} : undefined,
|
991
1060
|
},
|
992
1061
|
update: {
|
993
1062
|
id: item.id !== undefined ? {
|
@@ -1065,6 +1134,9 @@ export const NewsArticleAssetSentiment = {
|
|
1065
1134
|
id: item.stopLoss.id !== undefined ? {
|
1066
1135
|
equals: item.stopLoss.id
|
1067
1136
|
} : undefined,
|
1137
|
+
orderId: item.stopLoss.orderId !== undefined ? {
|
1138
|
+
equals: item.stopLoss.orderId
|
1139
|
+
} : undefined,
|
1068
1140
|
},
|
1069
1141
|
update: {
|
1070
1142
|
id: item.stopLoss.id !== undefined ? {
|
@@ -1089,6 +1161,9 @@ export const NewsArticleAssetSentiment = {
|
|
1089
1161
|
id: item.takeProfit.id !== undefined ? {
|
1090
1162
|
equals: item.takeProfit.id
|
1091
1163
|
} : undefined,
|
1164
|
+
orderId: item.takeProfit.orderId !== undefined ? {
|
1165
|
+
equals: item.takeProfit.orderId
|
1166
|
+
} : undefined,
|
1092
1167
|
},
|
1093
1168
|
update: {
|
1094
1169
|
id: item.takeProfit.id !== undefined ? {
|
@@ -1113,6 +1188,9 @@ export const NewsArticleAssetSentiment = {
|
|
1113
1188
|
id: item.alpacaAccount.id !== undefined ? {
|
1114
1189
|
equals: item.alpacaAccount.id
|
1115
1190
|
} : undefined,
|
1191
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1192
|
+
equals: item.alpacaAccount.userId
|
1193
|
+
} : undefined,
|
1116
1194
|
},
|
1117
1195
|
update: {
|
1118
1196
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -1165,6 +1243,9 @@ export const NewsArticleAssetSentiment = {
|
|
1165
1243
|
id: item.action.id !== undefined ? {
|
1166
1244
|
equals: item.action.id
|
1167
1245
|
} : undefined,
|
1246
|
+
tradeId: item.action.tradeId !== undefined ? {
|
1247
|
+
equals: item.action.tradeId
|
1248
|
+
} : undefined,
|
1168
1249
|
},
|
1169
1250
|
update: {
|
1170
1251
|
id: item.action.id !== undefined ? {
|
@@ -1228,6 +1309,7 @@ export const NewsArticleAssetSentiment = {
|
|
1228
1309
|
: { connectOrCreate: {
|
1229
1310
|
where: {
|
1230
1311
|
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
1312
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
1231
1313
|
},
|
1232
1314
|
create: {
|
1233
1315
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -1244,6 +1326,7 @@ export const NewsArticleAssetSentiment = {
|
|
1244
1326
|
: { connectOrCreate: {
|
1245
1327
|
where: {
|
1246
1328
|
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
1329
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
1247
1330
|
},
|
1248
1331
|
create: {
|
1249
1332
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -1260,6 +1343,9 @@ export const NewsArticleAssetSentiment = {
|
|
1260
1343
|
: { connectOrCreate: {
|
1261
1344
|
where: {
|
1262
1345
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1346
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1347
|
+
equals: item.alpacaAccount.userId
|
1348
|
+
} : undefined,
|
1263
1349
|
},
|
1264
1350
|
create: {
|
1265
1351
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -1283,6 +1369,9 @@ export const NewsArticleAssetSentiment = {
|
|
1283
1369
|
: { connectOrCreate: {
|
1284
1370
|
where: {
|
1285
1371
|
id: item.action.id !== undefined ? item.action.id : undefined,
|
1372
|
+
tradeId: item.action.tradeId !== undefined ? {
|
1373
|
+
equals: item.action.tradeId
|
1374
|
+
} : undefined,
|
1286
1375
|
},
|
1287
1376
|
create: {
|
1288
1377
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -1300,6 +1389,12 @@ export const NewsArticleAssetSentiment = {
|
|
1300
1389
|
upsert: props.asset.positions.map((item) => ({
|
1301
1390
|
where: {
|
1302
1391
|
id: item.id !== undefined ? item.id : undefined,
|
1392
|
+
assetId: item.assetId !== undefined ? {
|
1393
|
+
equals: item.assetId
|
1394
|
+
} : undefined,
|
1395
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1396
|
+
equals: item.alpacaAccountId
|
1397
|
+
} : undefined,
|
1303
1398
|
},
|
1304
1399
|
update: {
|
1305
1400
|
id: item.id !== undefined ? {
|
@@ -1350,6 +1445,9 @@ export const NewsArticleAssetSentiment = {
|
|
1350
1445
|
id: item.alpacaAccount.id !== undefined ? {
|
1351
1446
|
equals: item.alpacaAccount.id
|
1352
1447
|
} : undefined,
|
1448
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1449
|
+
equals: item.alpacaAccount.userId
|
1450
|
+
} : undefined,
|
1353
1451
|
},
|
1354
1452
|
update: {
|
1355
1453
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -1420,6 +1518,9 @@ export const NewsArticleAssetSentiment = {
|
|
1420
1518
|
: { connectOrCreate: {
|
1421
1519
|
where: {
|
1422
1520
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1521
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1522
|
+
equals: item.alpacaAccount.userId
|
1523
|
+
} : undefined,
|
1423
1524
|
},
|
1424
1525
|
create: {
|
1425
1526
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -1503,6 +1604,12 @@ export const NewsArticleAssetSentiment = {
|
|
1503
1604
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
1504
1605
|
where: {
|
1505
1606
|
id: item.id !== undefined ? item.id : undefined,
|
1607
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1608
|
+
equals: item.alpacaAccountId
|
1609
|
+
} : undefined,
|
1610
|
+
assetId: item.assetId !== undefined ? {
|
1611
|
+
equals: item.assetId
|
1612
|
+
} : undefined,
|
1506
1613
|
},
|
1507
1614
|
create: {
|
1508
1615
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1525,6 +1632,9 @@ export const NewsArticleAssetSentiment = {
|
|
1525
1632
|
: { connectOrCreate: {
|
1526
1633
|
where: {
|
1527
1634
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1635
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1636
|
+
equals: item.alpacaAccount.userId
|
1637
|
+
} : undefined,
|
1528
1638
|
},
|
1529
1639
|
create: {
|
1530
1640
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -1548,6 +1658,9 @@ export const NewsArticleAssetSentiment = {
|
|
1548
1658
|
: { connectOrCreate: item.actions.map((item) => ({
|
1549
1659
|
where: {
|
1550
1660
|
id: item.id !== undefined ? item.id : undefined,
|
1661
|
+
tradeId: item.tradeId !== undefined ? {
|
1662
|
+
equals: item.tradeId
|
1663
|
+
} : undefined,
|
1551
1664
|
},
|
1552
1665
|
create: {
|
1553
1666
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -1570,6 +1683,15 @@ export const NewsArticleAssetSentiment = {
|
|
1570
1683
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
1571
1684
|
where: {
|
1572
1685
|
id: item.id !== undefined ? item.id : undefined,
|
1686
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1687
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1688
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1689
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1690
|
+
equals: item.alpacaAccountId
|
1691
|
+
} : undefined,
|
1692
|
+
assetId: item.assetId !== undefined ? {
|
1693
|
+
equals: item.assetId
|
1694
|
+
} : undefined,
|
1573
1695
|
},
|
1574
1696
|
create: {
|
1575
1697
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -1603,6 +1725,7 @@ export const NewsArticleAssetSentiment = {
|
|
1603
1725
|
: { connectOrCreate: {
|
1604
1726
|
where: {
|
1605
1727
|
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
1728
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
1606
1729
|
},
|
1607
1730
|
create: {
|
1608
1731
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -1619,6 +1742,7 @@ export const NewsArticleAssetSentiment = {
|
|
1619
1742
|
: { connectOrCreate: {
|
1620
1743
|
where: {
|
1621
1744
|
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
1745
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
1622
1746
|
},
|
1623
1747
|
create: {
|
1624
1748
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -1635,6 +1759,9 @@ export const NewsArticleAssetSentiment = {
|
|
1635
1759
|
: { connectOrCreate: {
|
1636
1760
|
where: {
|
1637
1761
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1762
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1763
|
+
equals: item.alpacaAccount.userId
|
1764
|
+
} : undefined,
|
1638
1765
|
},
|
1639
1766
|
create: {
|
1640
1767
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -1658,6 +1785,9 @@ export const NewsArticleAssetSentiment = {
|
|
1658
1785
|
: { connectOrCreate: {
|
1659
1786
|
where: {
|
1660
1787
|
id: item.action.id !== undefined ? item.action.id : undefined,
|
1788
|
+
tradeId: item.action.tradeId !== undefined ? {
|
1789
|
+
equals: item.action.tradeId
|
1790
|
+
} : undefined,
|
1661
1791
|
},
|
1662
1792
|
create: {
|
1663
1793
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -1680,6 +1810,12 @@ export const NewsArticleAssetSentiment = {
|
|
1680
1810
|
: { connectOrCreate: props.asset.positions.map((item) => ({
|
1681
1811
|
where: {
|
1682
1812
|
id: item.id !== undefined ? item.id : undefined,
|
1813
|
+
assetId: item.assetId !== undefined ? {
|
1814
|
+
equals: item.assetId
|
1815
|
+
} : undefined,
|
1816
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1817
|
+
equals: item.alpacaAccountId
|
1818
|
+
} : undefined,
|
1683
1819
|
},
|
1684
1820
|
create: {
|
1685
1821
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1704,6 +1840,9 @@ export const NewsArticleAssetSentiment = {
|
|
1704
1840
|
: { connectOrCreate: {
|
1705
1841
|
where: {
|
1706
1842
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1843
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1844
|
+
equals: item.alpacaAccount.userId
|
1845
|
+
} : undefined,
|
1707
1846
|
},
|
1708
1847
|
create: {
|
1709
1848
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -1760,8 +1899,12 @@ export const NewsArticleAssetSentiment = {
|
|
1760
1899
|
where: {
|
1761
1900
|
id: prop.id !== undefined ? prop.id : undefined,
|
1762
1901
|
url: prop.url !== undefined ? prop.url : undefined,
|
1763
|
-
assetId: prop.assetId !== undefined ?
|
1764
|
-
|
1902
|
+
assetId: prop.assetId !== undefined ? {
|
1903
|
+
equals: prop.assetId
|
1904
|
+
} : undefined,
|
1905
|
+
newsArticleId: prop.newsArticleId !== undefined ? {
|
1906
|
+
equals: prop.newsArticleId
|
1907
|
+
} : undefined,
|
1765
1908
|
relevancyScore: prop.relevancyScore !== undefined ? prop.relevancyScore : undefined,
|
1766
1909
|
sentimentScore: prop.sentimentScore !== undefined ? prop.sentimentScore : undefined,
|
1767
1910
|
sentimentLabel: prop.sentimentLabel !== undefined ? prop.sentimentLabel : undefined,
|
@@ -2042,6 +2185,12 @@ export const NewsArticleAssetSentiment = {
|
|
2042
2185
|
upsert: prop.asset.trades.map((item) => ({
|
2043
2186
|
where: {
|
2044
2187
|
id: item.id !== undefined ? item.id : undefined,
|
2188
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2189
|
+
equals: item.alpacaAccountId
|
2190
|
+
} : undefined,
|
2191
|
+
assetId: item.assetId !== undefined ? {
|
2192
|
+
equals: item.assetId
|
2193
|
+
} : undefined,
|
2045
2194
|
},
|
2046
2195
|
update: {
|
2047
2196
|
id: item.id !== undefined ? {
|
@@ -2086,6 +2235,9 @@ export const NewsArticleAssetSentiment = {
|
|
2086
2235
|
id: item.alpacaAccount.id !== undefined ? {
|
2087
2236
|
equals: item.alpacaAccount.id
|
2088
2237
|
} : undefined,
|
2238
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
2239
|
+
equals: item.alpacaAccount.userId
|
2240
|
+
} : undefined,
|
2089
2241
|
},
|
2090
2242
|
update: {
|
2091
2243
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -2136,6 +2288,9 @@ export const NewsArticleAssetSentiment = {
|
|
2136
2288
|
upsert: item.actions.map((item) => ({
|
2137
2289
|
where: {
|
2138
2290
|
id: item.id !== undefined ? item.id : undefined,
|
2291
|
+
tradeId: item.tradeId !== undefined ? {
|
2292
|
+
equals: item.tradeId
|
2293
|
+
} : undefined,
|
2139
2294
|
},
|
2140
2295
|
update: {
|
2141
2296
|
id: item.id !== undefined ? {
|
@@ -2188,6 +2343,9 @@ export const NewsArticleAssetSentiment = {
|
|
2188
2343
|
: { connectOrCreate: {
|
2189
2344
|
where: {
|
2190
2345
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2346
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
2347
|
+
equals: item.alpacaAccount.userId
|
2348
|
+
} : undefined,
|
2191
2349
|
},
|
2192
2350
|
create: {
|
2193
2351
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -2211,6 +2369,9 @@ export const NewsArticleAssetSentiment = {
|
|
2211
2369
|
: { connectOrCreate: item.actions.map((item) => ({
|
2212
2370
|
where: {
|
2213
2371
|
id: item.id !== undefined ? item.id : undefined,
|
2372
|
+
tradeId: item.tradeId !== undefined ? {
|
2373
|
+
equals: item.tradeId
|
2374
|
+
} : undefined,
|
2214
2375
|
},
|
2215
2376
|
create: {
|
2216
2377
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -2228,6 +2389,15 @@ export const NewsArticleAssetSentiment = {
|
|
2228
2389
|
upsert: prop.asset.orders.map((item) => ({
|
2229
2390
|
where: {
|
2230
2391
|
id: item.id !== undefined ? item.id : undefined,
|
2392
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2393
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2394
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2395
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2396
|
+
equals: item.alpacaAccountId
|
2397
|
+
} : undefined,
|
2398
|
+
assetId: item.assetId !== undefined ? {
|
2399
|
+
equals: item.assetId
|
2400
|
+
} : undefined,
|
2231
2401
|
},
|
2232
2402
|
update: {
|
2233
2403
|
id: item.id !== undefined ? {
|
@@ -2305,6 +2475,9 @@ export const NewsArticleAssetSentiment = {
|
|
2305
2475
|
id: item.stopLoss.id !== undefined ? {
|
2306
2476
|
equals: item.stopLoss.id
|
2307
2477
|
} : undefined,
|
2478
|
+
orderId: item.stopLoss.orderId !== undefined ? {
|
2479
|
+
equals: item.stopLoss.orderId
|
2480
|
+
} : undefined,
|
2308
2481
|
},
|
2309
2482
|
update: {
|
2310
2483
|
id: item.stopLoss.id !== undefined ? {
|
@@ -2329,6 +2502,9 @@ export const NewsArticleAssetSentiment = {
|
|
2329
2502
|
id: item.takeProfit.id !== undefined ? {
|
2330
2503
|
equals: item.takeProfit.id
|
2331
2504
|
} : undefined,
|
2505
|
+
orderId: item.takeProfit.orderId !== undefined ? {
|
2506
|
+
equals: item.takeProfit.orderId
|
2507
|
+
} : undefined,
|
2332
2508
|
},
|
2333
2509
|
update: {
|
2334
2510
|
id: item.takeProfit.id !== undefined ? {
|
@@ -2353,6 +2529,9 @@ export const NewsArticleAssetSentiment = {
|
|
2353
2529
|
id: item.alpacaAccount.id !== undefined ? {
|
2354
2530
|
equals: item.alpacaAccount.id
|
2355
2531
|
} : undefined,
|
2532
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
2533
|
+
equals: item.alpacaAccount.userId
|
2534
|
+
} : undefined,
|
2356
2535
|
},
|
2357
2536
|
update: {
|
2358
2537
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -2405,6 +2584,9 @@ export const NewsArticleAssetSentiment = {
|
|
2405
2584
|
id: item.action.id !== undefined ? {
|
2406
2585
|
equals: item.action.id
|
2407
2586
|
} : undefined,
|
2587
|
+
tradeId: item.action.tradeId !== undefined ? {
|
2588
|
+
equals: item.action.tradeId
|
2589
|
+
} : undefined,
|
2408
2590
|
},
|
2409
2591
|
update: {
|
2410
2592
|
id: item.action.id !== undefined ? {
|
@@ -2468,6 +2650,7 @@ export const NewsArticleAssetSentiment = {
|
|
2468
2650
|
: { connectOrCreate: {
|
2469
2651
|
where: {
|
2470
2652
|
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
2653
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
2471
2654
|
},
|
2472
2655
|
create: {
|
2473
2656
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -2484,6 +2667,7 @@ export const NewsArticleAssetSentiment = {
|
|
2484
2667
|
: { connectOrCreate: {
|
2485
2668
|
where: {
|
2486
2669
|
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
2670
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
2487
2671
|
},
|
2488
2672
|
create: {
|
2489
2673
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -2500,6 +2684,9 @@ export const NewsArticleAssetSentiment = {
|
|
2500
2684
|
: { connectOrCreate: {
|
2501
2685
|
where: {
|
2502
2686
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2687
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
2688
|
+
equals: item.alpacaAccount.userId
|
2689
|
+
} : undefined,
|
2503
2690
|
},
|
2504
2691
|
create: {
|
2505
2692
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -2523,6 +2710,9 @@ export const NewsArticleAssetSentiment = {
|
|
2523
2710
|
: { connectOrCreate: {
|
2524
2711
|
where: {
|
2525
2712
|
id: item.action.id !== undefined ? item.action.id : undefined,
|
2713
|
+
tradeId: item.action.tradeId !== undefined ? {
|
2714
|
+
equals: item.action.tradeId
|
2715
|
+
} : undefined,
|
2526
2716
|
},
|
2527
2717
|
create: {
|
2528
2718
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -2540,6 +2730,12 @@ export const NewsArticleAssetSentiment = {
|
|
2540
2730
|
upsert: prop.asset.positions.map((item) => ({
|
2541
2731
|
where: {
|
2542
2732
|
id: item.id !== undefined ? item.id : undefined,
|
2733
|
+
assetId: item.assetId !== undefined ? {
|
2734
|
+
equals: item.assetId
|
2735
|
+
} : undefined,
|
2736
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2737
|
+
equals: item.alpacaAccountId
|
2738
|
+
} : undefined,
|
2543
2739
|
},
|
2544
2740
|
update: {
|
2545
2741
|
id: item.id !== undefined ? {
|
@@ -2590,6 +2786,9 @@ export const NewsArticleAssetSentiment = {
|
|
2590
2786
|
id: item.alpacaAccount.id !== undefined ? {
|
2591
2787
|
equals: item.alpacaAccount.id
|
2592
2788
|
} : undefined,
|
2789
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
2790
|
+
equals: item.alpacaAccount.userId
|
2791
|
+
} : undefined,
|
2593
2792
|
},
|
2594
2793
|
update: {
|
2595
2794
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -2660,6 +2859,9 @@ export const NewsArticleAssetSentiment = {
|
|
2660
2859
|
: { connectOrCreate: {
|
2661
2860
|
where: {
|
2662
2861
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2862
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
2863
|
+
equals: item.alpacaAccount.userId
|
2864
|
+
} : undefined,
|
2663
2865
|
},
|
2664
2866
|
create: {
|
2665
2867
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -2743,6 +2945,12 @@ export const NewsArticleAssetSentiment = {
|
|
2743
2945
|
: { connectOrCreate: prop.asset.trades.map((item) => ({
|
2744
2946
|
where: {
|
2745
2947
|
id: item.id !== undefined ? item.id : undefined,
|
2948
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2949
|
+
equals: item.alpacaAccountId
|
2950
|
+
} : undefined,
|
2951
|
+
assetId: item.assetId !== undefined ? {
|
2952
|
+
equals: item.assetId
|
2953
|
+
} : undefined,
|
2746
2954
|
},
|
2747
2955
|
create: {
|
2748
2956
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -2765,6 +2973,9 @@ export const NewsArticleAssetSentiment = {
|
|
2765
2973
|
: { connectOrCreate: {
|
2766
2974
|
where: {
|
2767
2975
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2976
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
2977
|
+
equals: item.alpacaAccount.userId
|
2978
|
+
} : undefined,
|
2768
2979
|
},
|
2769
2980
|
create: {
|
2770
2981
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -2788,6 +2999,9 @@ export const NewsArticleAssetSentiment = {
|
|
2788
2999
|
: { connectOrCreate: item.actions.map((item) => ({
|
2789
3000
|
where: {
|
2790
3001
|
id: item.id !== undefined ? item.id : undefined,
|
3002
|
+
tradeId: item.tradeId !== undefined ? {
|
3003
|
+
equals: item.tradeId
|
3004
|
+
} : undefined,
|
2791
3005
|
},
|
2792
3006
|
create: {
|
2793
3007
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -2810,6 +3024,15 @@ export const NewsArticleAssetSentiment = {
|
|
2810
3024
|
: { connectOrCreate: prop.asset.orders.map((item) => ({
|
2811
3025
|
where: {
|
2812
3026
|
id: item.id !== undefined ? item.id : undefined,
|
3027
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
3028
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
3029
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
3030
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3031
|
+
equals: item.alpacaAccountId
|
3032
|
+
} : undefined,
|
3033
|
+
assetId: item.assetId !== undefined ? {
|
3034
|
+
equals: item.assetId
|
3035
|
+
} : undefined,
|
2813
3036
|
},
|
2814
3037
|
create: {
|
2815
3038
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -2843,6 +3066,7 @@ export const NewsArticleAssetSentiment = {
|
|
2843
3066
|
: { connectOrCreate: {
|
2844
3067
|
where: {
|
2845
3068
|
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
3069
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
2846
3070
|
},
|
2847
3071
|
create: {
|
2848
3072
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -2859,6 +3083,7 @@ export const NewsArticleAssetSentiment = {
|
|
2859
3083
|
: { connectOrCreate: {
|
2860
3084
|
where: {
|
2861
3085
|
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
3086
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
2862
3087
|
},
|
2863
3088
|
create: {
|
2864
3089
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -2875,6 +3100,9 @@ export const NewsArticleAssetSentiment = {
|
|
2875
3100
|
: { connectOrCreate: {
|
2876
3101
|
where: {
|
2877
3102
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
3103
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
3104
|
+
equals: item.alpacaAccount.userId
|
3105
|
+
} : undefined,
|
2878
3106
|
},
|
2879
3107
|
create: {
|
2880
3108
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -2898,6 +3126,9 @@ export const NewsArticleAssetSentiment = {
|
|
2898
3126
|
: { connectOrCreate: {
|
2899
3127
|
where: {
|
2900
3128
|
id: item.action.id !== undefined ? item.action.id : undefined,
|
3129
|
+
tradeId: item.action.tradeId !== undefined ? {
|
3130
|
+
equals: item.action.tradeId
|
3131
|
+
} : undefined,
|
2901
3132
|
},
|
2902
3133
|
create: {
|
2903
3134
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -2920,6 +3151,12 @@ export const NewsArticleAssetSentiment = {
|
|
2920
3151
|
: { connectOrCreate: prop.asset.positions.map((item) => ({
|
2921
3152
|
where: {
|
2922
3153
|
id: item.id !== undefined ? item.id : undefined,
|
3154
|
+
assetId: item.assetId !== undefined ? {
|
3155
|
+
equals: item.assetId
|
3156
|
+
} : undefined,
|
3157
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3158
|
+
equals: item.alpacaAccountId
|
3159
|
+
} : undefined,
|
2923
3160
|
},
|
2924
3161
|
create: {
|
2925
3162
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2944,6 +3181,9 @@ export const NewsArticleAssetSentiment = {
|
|
2944
3181
|
: { connectOrCreate: {
|
2945
3182
|
where: {
|
2946
3183
|
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
3184
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
3185
|
+
equals: item.alpacaAccount.userId
|
3186
|
+
} : undefined,
|
2947
3187
|
},
|
2948
3188
|
create: {
|
2949
3189
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -3035,8 +3275,12 @@ export const NewsArticleAssetSentiment = {
|
|
3035
3275
|
where: {
|
3036
3276
|
id: props.id !== undefined ? props.id : undefined,
|
3037
3277
|
url: props.url !== undefined ? props.url : undefined,
|
3038
|
-
assetId: props.assetId !== undefined ?
|
3039
|
-
|
3278
|
+
assetId: props.assetId !== undefined ? {
|
3279
|
+
equals: props.assetId
|
3280
|
+
} : undefined,
|
3281
|
+
newsArticleId: props.newsArticleId !== undefined ? {
|
3282
|
+
equals: props.newsArticleId
|
3283
|
+
} : undefined,
|
3040
3284
|
relevancyScore: props.relevancyScore !== undefined ? props.relevancyScore : undefined,
|
3041
3285
|
sentimentScore: props.sentimentScore !== undefined ? props.sentimentScore : undefined,
|
3042
3286
|
sentimentLabel: props.sentimentLabel !== undefined ? props.sentimentLabel : undefined,
|
@@ -3105,8 +3349,12 @@ export const NewsArticleAssetSentiment = {
|
|
3105
3349
|
id: props.id !== undefined ? {
|
3106
3350
|
equals: props.id
|
3107
3351
|
} : undefined,
|
3108
|
-
assetId: props.assetId !== undefined ?
|
3109
|
-
|
3352
|
+
assetId: props.assetId !== undefined ? {
|
3353
|
+
equals: props.assetId
|
3354
|
+
} : undefined,
|
3355
|
+
newsArticleId: props.newsArticleId !== undefined ? {
|
3356
|
+
equals: props.newsArticleId
|
3357
|
+
} : undefined,
|
3110
3358
|
url: props.url !== undefined ? {
|
3111
3359
|
equals: props.url
|
3112
3360
|
} : undefined,
|