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.
- package/Account.cjs +50 -150
- package/Action.cjs +117 -351
- package/Alert.cjs +85 -255
- package/AlpacaAccount.cjs +130 -390
- package/Asset.cjs +129 -387
- package/Authenticator.cjs +50 -150
- package/Customer.cjs +54 -162
- package/EconomicEvent.cjs +3 -9
- package/NewsArticle.cjs +30 -90
- package/NewsArticleAssetSentiment.cjs +57 -171
- package/Order.cjs +119 -357
- package/Position.cjs +133 -399
- package/Session.cjs +50 -150
- package/StopLoss.cjs +68 -204
- package/TakeProfit.cjs +68 -204
- package/Trade.cjs +145 -435
- package/User.cjs +73 -219
- package/VerificationToken.cjs +3 -9
- package/package.json +1 -1
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +50 -150
- package/server/Action.d.ts.map +1 -1
- package/server/Action.js.map +1 -1
- package/server/Action.mjs +117 -351
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +85 -255
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +130 -390
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +129 -387
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +50 -150
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +54 -162
- package/server/EconomicEvent.d.ts.map +1 -1
- package/server/EconomicEvent.js.map +1 -1
- package/server/EconomicEvent.mjs +3 -9
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +30 -90
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +57 -171
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +119 -357
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +133 -399
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +50 -150
- package/server/StopLoss.d.ts.map +1 -1
- package/server/StopLoss.js.map +1 -1
- package/server/StopLoss.mjs +68 -204
- package/server/TakeProfit.d.ts.map +1 -1
- package/server/TakeProfit.js.map +1 -1
- package/server/TakeProfit.mjs +68 -204
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +145 -435
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +73 -219
- package/server/VerificationToken.d.ts.map +1 -1
- package/server/VerificationToken.js.map +1 -1
- package/server/VerificationToken.mjs +3 -9
package/server/TakeProfit.mjs
CHANGED
@@ -42,9 +42,7 @@ export const TakeProfit = {
|
|
42
42
|
}
|
43
43
|
: { connectOrCreate: {
|
44
44
|
where: {
|
45
|
-
id: props.Order.id !== undefined ?
|
46
|
-
equals: props.Order.id
|
47
|
-
} : undefined,
|
45
|
+
id: props.Order.id !== undefined ? props.Order.id : undefined,
|
48
46
|
clientOrderId: props.Order.clientOrderId !== undefined ? props.Order.clientOrderId : undefined,
|
49
47
|
actionId: props.Order.actionId !== undefined ? props.Order.actionId : undefined,
|
50
48
|
stopLossId: props.Order.stopLossId !== undefined ? props.Order.stopLossId : undefined,
|
@@ -86,9 +84,7 @@ export const TakeProfit = {
|
|
86
84
|
}
|
87
85
|
: { connectOrCreate: {
|
88
86
|
where: {
|
89
|
-
id: props.Order.stopLoss.id !== undefined ?
|
90
|
-
equals: props.Order.stopLoss.id
|
91
|
-
} : undefined,
|
87
|
+
id: props.Order.stopLoss.id !== undefined ? props.Order.stopLoss.id : undefined,
|
92
88
|
orderId: props.Order.stopLoss.orderId !== undefined ? props.Order.stopLoss.orderId : undefined,
|
93
89
|
},
|
94
90
|
create: {
|
@@ -105,9 +101,7 @@ export const TakeProfit = {
|
|
105
101
|
}
|
106
102
|
: { connectOrCreate: {
|
107
103
|
where: {
|
108
|
-
id: props.Order.alpacaAccount.id !== undefined ?
|
109
|
-
equals: props.Order.alpacaAccount.id
|
110
|
-
} : undefined,
|
104
|
+
id: props.Order.alpacaAccount.id !== undefined ? props.Order.alpacaAccount.id : undefined,
|
111
105
|
userId: props.Order.alpacaAccount.userId !== undefined ? {
|
112
106
|
equals: props.Order.alpacaAccount.userId
|
113
107
|
} : undefined,
|
@@ -130,9 +124,7 @@ export const TakeProfit = {
|
|
130
124
|
}
|
131
125
|
: { connectOrCreate: {
|
132
126
|
where: {
|
133
|
-
id: props.Order.alpacaAccount.user.id !== undefined ?
|
134
|
-
equals: props.Order.alpacaAccount.user.id
|
135
|
-
} : undefined,
|
127
|
+
id: props.Order.alpacaAccount.user.id !== undefined ? props.Order.alpacaAccount.user.id : undefined,
|
136
128
|
email: props.Order.alpacaAccount.user.email !== undefined ? props.Order.alpacaAccount.user.email : undefined,
|
137
129
|
name: props.Order.alpacaAccount.user.name !== undefined ? {
|
138
130
|
equals: props.Order.alpacaAccount.user.name
|
@@ -161,9 +153,7 @@ export const TakeProfit = {
|
|
161
153
|
}
|
162
154
|
: { connectOrCreate: props.Order.alpacaAccount.trades.map((item) => ({
|
163
155
|
where: {
|
164
|
-
id: item.id !== undefined ?
|
165
|
-
equals: item.id
|
166
|
-
} : undefined,
|
156
|
+
id: item.id !== undefined ? item.id : undefined,
|
167
157
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
168
158
|
equals: item.alpacaAccountId
|
169
159
|
} : undefined,
|
@@ -194,9 +184,7 @@ export const TakeProfit = {
|
|
194
184
|
}
|
195
185
|
: { connectOrCreate: props.Order.alpacaAccount.positions.map((item) => ({
|
196
186
|
where: {
|
197
|
-
id: item.id !== undefined ?
|
198
|
-
equals: item.id
|
199
|
-
} : undefined,
|
187
|
+
id: item.id !== undefined ? item.id : undefined,
|
200
188
|
assetId: item.assetId !== undefined ? {
|
201
189
|
equals: item.assetId
|
202
190
|
} : undefined,
|
@@ -229,9 +217,7 @@ export const TakeProfit = {
|
|
229
217
|
}
|
230
218
|
: { connectOrCreate: props.Order.alpacaAccount.alerts.map((item) => ({
|
231
219
|
where: {
|
232
|
-
id: item.id !== undefined ?
|
233
|
-
equals: item.id
|
234
|
-
} : undefined,
|
220
|
+
id: item.id !== undefined ? item.id : undefined,
|
235
221
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
236
222
|
equals: item.alpacaAccountId
|
237
223
|
} : undefined,
|
@@ -254,9 +240,7 @@ export const TakeProfit = {
|
|
254
240
|
}
|
255
241
|
: { connectOrCreate: {
|
256
242
|
where: {
|
257
|
-
id: props.Order.action.id !== undefined ?
|
258
|
-
equals: props.Order.action.id
|
259
|
-
} : undefined,
|
243
|
+
id: props.Order.action.id !== undefined ? props.Order.action.id : undefined,
|
260
244
|
tradeId: props.Order.action.tradeId !== undefined ? {
|
261
245
|
equals: props.Order.action.tradeId
|
262
246
|
} : undefined,
|
@@ -275,9 +259,7 @@ export const TakeProfit = {
|
|
275
259
|
}
|
276
260
|
: { connectOrCreate: {
|
277
261
|
where: {
|
278
|
-
id: props.Order.action.trade.id !== undefined ?
|
279
|
-
equals: props.Order.action.trade.id
|
280
|
-
} : undefined,
|
262
|
+
id: props.Order.action.trade.id !== undefined ? props.Order.action.trade.id : undefined,
|
281
263
|
alpacaAccountId: props.Order.action.trade.alpacaAccountId !== undefined ? {
|
282
264
|
equals: props.Order.action.trade.alpacaAccountId
|
283
265
|
} : undefined,
|
@@ -311,9 +293,7 @@ export const TakeProfit = {
|
|
311
293
|
}
|
312
294
|
: { connectOrCreate: {
|
313
295
|
where: {
|
314
|
-
id: props.Order.asset.id !== undefined ?
|
315
|
-
equals: props.Order.asset.id
|
316
|
-
} : undefined,
|
296
|
+
id: props.Order.asset.id !== undefined ? props.Order.asset.id : undefined,
|
317
297
|
symbol: props.Order.asset.symbol !== undefined ? props.Order.asset.symbol : undefined,
|
318
298
|
name: props.Order.asset.name !== undefined ? props.Order.asset.name : undefined,
|
319
299
|
},
|
@@ -381,9 +361,7 @@ export const TakeProfit = {
|
|
381
361
|
}
|
382
362
|
: { connectOrCreate: props.Order.asset.trades.map((item) => ({
|
383
363
|
where: {
|
384
|
-
id: item.id !== undefined ?
|
385
|
-
equals: item.id
|
386
|
-
} : undefined,
|
364
|
+
id: item.id !== undefined ? item.id : undefined,
|
387
365
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
388
366
|
equals: item.alpacaAccountId
|
389
367
|
} : undefined,
|
@@ -414,9 +392,7 @@ export const TakeProfit = {
|
|
414
392
|
}
|
415
393
|
: { connectOrCreate: props.Order.asset.positions.map((item) => ({
|
416
394
|
where: {
|
417
|
-
id: item.id !== undefined ?
|
418
|
-
equals: item.id
|
419
|
-
} : undefined,
|
395
|
+
id: item.id !== undefined ? item.id : undefined,
|
420
396
|
assetId: item.assetId !== undefined ? {
|
421
397
|
equals: item.assetId
|
422
398
|
} : undefined,
|
@@ -449,9 +425,7 @@ export const TakeProfit = {
|
|
449
425
|
}
|
450
426
|
: { connectOrCreate: props.Order.asset.newsMentions.map((item) => ({
|
451
427
|
where: {
|
452
|
-
id: item.id !== undefined ?
|
453
|
-
equals: item.id
|
454
|
-
} : undefined,
|
428
|
+
id: item.id !== undefined ? item.id : undefined,
|
455
429
|
url: item.url !== undefined ? item.url : undefined,
|
456
430
|
assetId: item.assetId !== undefined ? {
|
457
431
|
equals: item.assetId
|
@@ -545,9 +519,7 @@ export const TakeProfit = {
|
|
545
519
|
}`;
|
546
520
|
const variables = {
|
547
521
|
where: {
|
548
|
-
id: props.id !== undefined ?
|
549
|
-
equals: props.id
|
550
|
-
} : undefined,
|
522
|
+
id: props.id !== undefined ? props.id : undefined,
|
551
523
|
orderId: props.orderId !== undefined ? props.orderId : undefined,
|
552
524
|
createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
|
553
525
|
updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
|
@@ -794,9 +766,7 @@ export const TakeProfit = {
|
|
794
766
|
trades: props.Order.alpacaAccount.trades ? {
|
795
767
|
upsert: props.Order.alpacaAccount.trades.map((item) => ({
|
796
768
|
where: {
|
797
|
-
id: item.id !== undefined ?
|
798
|
-
equals: item.id
|
799
|
-
} : undefined,
|
769
|
+
id: item.id !== undefined ? item.id : undefined,
|
800
770
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
801
771
|
equals: item.alpacaAccountId
|
802
772
|
} : undefined,
|
@@ -860,9 +830,7 @@ export const TakeProfit = {
|
|
860
830
|
positions: props.Order.alpacaAccount.positions ? {
|
861
831
|
upsert: props.Order.alpacaAccount.positions.map((item) => ({
|
862
832
|
where: {
|
863
|
-
id: item.id !== undefined ?
|
864
|
-
equals: item.id
|
865
|
-
} : undefined,
|
833
|
+
id: item.id !== undefined ? item.id : undefined,
|
866
834
|
assetId: item.assetId !== undefined ? {
|
867
835
|
equals: item.assetId
|
868
836
|
} : undefined,
|
@@ -934,9 +902,7 @@ export const TakeProfit = {
|
|
934
902
|
alerts: props.Order.alpacaAccount.alerts ? {
|
935
903
|
upsert: props.Order.alpacaAccount.alerts.map((item) => ({
|
936
904
|
where: {
|
937
|
-
id: item.id !== undefined ?
|
938
|
-
equals: item.id
|
939
|
-
} : undefined,
|
905
|
+
id: item.id !== undefined ? item.id : undefined,
|
940
906
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
941
907
|
equals: item.alpacaAccountId
|
942
908
|
} : undefined,
|
@@ -981,9 +947,7 @@ export const TakeProfit = {
|
|
981
947
|
}
|
982
948
|
: { connectOrCreate: {
|
983
949
|
where: {
|
984
|
-
id: props.Order.alpacaAccount.user.id !== undefined ?
|
985
|
-
equals: props.Order.alpacaAccount.user.id
|
986
|
-
} : undefined,
|
950
|
+
id: props.Order.alpacaAccount.user.id !== undefined ? props.Order.alpacaAccount.user.id : undefined,
|
987
951
|
email: props.Order.alpacaAccount.user.email !== undefined ? props.Order.alpacaAccount.user.email : undefined,
|
988
952
|
name: props.Order.alpacaAccount.user.name !== undefined ? {
|
989
953
|
equals: props.Order.alpacaAccount.user.name
|
@@ -1012,9 +976,7 @@ export const TakeProfit = {
|
|
1012
976
|
}
|
1013
977
|
: { connectOrCreate: props.Order.alpacaAccount.trades.map((item) => ({
|
1014
978
|
where: {
|
1015
|
-
id: item.id !== undefined ?
|
1016
|
-
equals: item.id
|
1017
|
-
} : undefined,
|
979
|
+
id: item.id !== undefined ? item.id : undefined,
|
1018
980
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1019
981
|
equals: item.alpacaAccountId
|
1020
982
|
} : undefined,
|
@@ -1045,9 +1007,7 @@ export const TakeProfit = {
|
|
1045
1007
|
}
|
1046
1008
|
: { connectOrCreate: props.Order.alpacaAccount.positions.map((item) => ({
|
1047
1009
|
where: {
|
1048
|
-
id: item.id !== undefined ?
|
1049
|
-
equals: item.id
|
1050
|
-
} : undefined,
|
1010
|
+
id: item.id !== undefined ? item.id : undefined,
|
1051
1011
|
assetId: item.assetId !== undefined ? {
|
1052
1012
|
equals: item.assetId
|
1053
1013
|
} : undefined,
|
@@ -1080,9 +1040,7 @@ export const TakeProfit = {
|
|
1080
1040
|
}
|
1081
1041
|
: { connectOrCreate: props.Order.alpacaAccount.alerts.map((item) => ({
|
1082
1042
|
where: {
|
1083
|
-
id: item.id !== undefined ?
|
1084
|
-
equals: item.id
|
1085
|
-
} : undefined,
|
1043
|
+
id: item.id !== undefined ? item.id : undefined,
|
1086
1044
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1087
1045
|
equals: item.alpacaAccountId
|
1088
1046
|
} : undefined,
|
@@ -1207,9 +1165,7 @@ export const TakeProfit = {
|
|
1207
1165
|
}
|
1208
1166
|
: { connectOrCreate: {
|
1209
1167
|
where: {
|
1210
|
-
id: props.Order.action.trade.id !== undefined ?
|
1211
|
-
equals: props.Order.action.trade.id
|
1212
|
-
} : undefined,
|
1168
|
+
id: props.Order.action.trade.id !== undefined ? props.Order.action.trade.id : undefined,
|
1213
1169
|
alpacaAccountId: props.Order.action.trade.alpacaAccountId !== undefined ? {
|
1214
1170
|
equals: props.Order.action.trade.alpacaAccountId
|
1215
1171
|
} : undefined,
|
@@ -1420,9 +1376,7 @@ export const TakeProfit = {
|
|
1420
1376
|
trades: props.Order.asset.trades ? {
|
1421
1377
|
upsert: props.Order.asset.trades.map((item) => ({
|
1422
1378
|
where: {
|
1423
|
-
id: item.id !== undefined ?
|
1424
|
-
equals: item.id
|
1425
|
-
} : undefined,
|
1379
|
+
id: item.id !== undefined ? item.id : undefined,
|
1426
1380
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1427
1381
|
equals: item.alpacaAccountId
|
1428
1382
|
} : undefined,
|
@@ -1486,9 +1440,7 @@ export const TakeProfit = {
|
|
1486
1440
|
positions: props.Order.asset.positions ? {
|
1487
1441
|
upsert: props.Order.asset.positions.map((item) => ({
|
1488
1442
|
where: {
|
1489
|
-
id: item.id !== undefined ?
|
1490
|
-
equals: item.id
|
1491
|
-
} : undefined,
|
1443
|
+
id: item.id !== undefined ? item.id : undefined,
|
1492
1444
|
assetId: item.assetId !== undefined ? {
|
1493
1445
|
equals: item.assetId
|
1494
1446
|
} : undefined,
|
@@ -1560,9 +1512,7 @@ export const TakeProfit = {
|
|
1560
1512
|
newsMentions: props.Order.asset.newsMentions ? {
|
1561
1513
|
upsert: props.Order.asset.newsMentions.map((item) => ({
|
1562
1514
|
where: {
|
1563
|
-
id: item.id !== undefined ?
|
1564
|
-
equals: item.id
|
1565
|
-
} : undefined,
|
1515
|
+
id: item.id !== undefined ? item.id : undefined,
|
1566
1516
|
url: item.url !== undefined ? item.url : undefined,
|
1567
1517
|
assetId: item.assetId !== undefined ? {
|
1568
1518
|
equals: item.assetId
|
@@ -1661,9 +1611,7 @@ export const TakeProfit = {
|
|
1661
1611
|
}
|
1662
1612
|
: { connectOrCreate: props.Order.asset.trades.map((item) => ({
|
1663
1613
|
where: {
|
1664
|
-
id: item.id !== undefined ?
|
1665
|
-
equals: item.id
|
1666
|
-
} : undefined,
|
1614
|
+
id: item.id !== undefined ? item.id : undefined,
|
1667
1615
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1668
1616
|
equals: item.alpacaAccountId
|
1669
1617
|
} : undefined,
|
@@ -1694,9 +1642,7 @@ export const TakeProfit = {
|
|
1694
1642
|
}
|
1695
1643
|
: { connectOrCreate: props.Order.asset.positions.map((item) => ({
|
1696
1644
|
where: {
|
1697
|
-
id: item.id !== undefined ?
|
1698
|
-
equals: item.id
|
1699
|
-
} : undefined,
|
1645
|
+
id: item.id !== undefined ? item.id : undefined,
|
1700
1646
|
assetId: item.assetId !== undefined ? {
|
1701
1647
|
equals: item.assetId
|
1702
1648
|
} : undefined,
|
@@ -1729,9 +1675,7 @@ export const TakeProfit = {
|
|
1729
1675
|
}
|
1730
1676
|
: { connectOrCreate: props.Order.asset.newsMentions.map((item) => ({
|
1731
1677
|
where: {
|
1732
|
-
id: item.id !== undefined ?
|
1733
|
-
equals: item.id
|
1734
|
-
} : undefined,
|
1678
|
+
id: item.id !== undefined ? item.id : undefined,
|
1735
1679
|
url: item.url !== undefined ? item.url : undefined,
|
1736
1680
|
assetId: item.assetId !== undefined ? {
|
1737
1681
|
equals: item.assetId
|
@@ -1783,9 +1727,7 @@ export const TakeProfit = {
|
|
1783
1727
|
}
|
1784
1728
|
: { connectOrCreate: {
|
1785
1729
|
where: {
|
1786
|
-
id: props.Order.stopLoss.id !== undefined ?
|
1787
|
-
equals: props.Order.stopLoss.id
|
1788
|
-
} : undefined,
|
1730
|
+
id: props.Order.stopLoss.id !== undefined ? props.Order.stopLoss.id : undefined,
|
1789
1731
|
orderId: props.Order.stopLoss.orderId !== undefined ? props.Order.stopLoss.orderId : undefined,
|
1790
1732
|
},
|
1791
1733
|
create: {
|
@@ -1802,9 +1744,7 @@ export const TakeProfit = {
|
|
1802
1744
|
}
|
1803
1745
|
: { connectOrCreate: {
|
1804
1746
|
where: {
|
1805
|
-
id: props.Order.alpacaAccount.id !== undefined ?
|
1806
|
-
equals: props.Order.alpacaAccount.id
|
1807
|
-
} : undefined,
|
1747
|
+
id: props.Order.alpacaAccount.id !== undefined ? props.Order.alpacaAccount.id : undefined,
|
1808
1748
|
userId: props.Order.alpacaAccount.userId !== undefined ? {
|
1809
1749
|
equals: props.Order.alpacaAccount.userId
|
1810
1750
|
} : undefined,
|
@@ -1827,9 +1767,7 @@ export const TakeProfit = {
|
|
1827
1767
|
}
|
1828
1768
|
: { connectOrCreate: {
|
1829
1769
|
where: {
|
1830
|
-
id: props.Order.alpacaAccount.user.id !== undefined ?
|
1831
|
-
equals: props.Order.alpacaAccount.user.id
|
1832
|
-
} : undefined,
|
1770
|
+
id: props.Order.alpacaAccount.user.id !== undefined ? props.Order.alpacaAccount.user.id : undefined,
|
1833
1771
|
email: props.Order.alpacaAccount.user.email !== undefined ? props.Order.alpacaAccount.user.email : undefined,
|
1834
1772
|
name: props.Order.alpacaAccount.user.name !== undefined ? {
|
1835
1773
|
equals: props.Order.alpacaAccount.user.name
|
@@ -1858,9 +1796,7 @@ export const TakeProfit = {
|
|
1858
1796
|
}
|
1859
1797
|
: { connectOrCreate: props.Order.alpacaAccount.trades.map((item) => ({
|
1860
1798
|
where: {
|
1861
|
-
id: item.id !== undefined ?
|
1862
|
-
equals: item.id
|
1863
|
-
} : undefined,
|
1799
|
+
id: item.id !== undefined ? item.id : undefined,
|
1864
1800
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1865
1801
|
equals: item.alpacaAccountId
|
1866
1802
|
} : undefined,
|
@@ -1891,9 +1827,7 @@ export const TakeProfit = {
|
|
1891
1827
|
}
|
1892
1828
|
: { connectOrCreate: props.Order.alpacaAccount.positions.map((item) => ({
|
1893
1829
|
where: {
|
1894
|
-
id: item.id !== undefined ?
|
1895
|
-
equals: item.id
|
1896
|
-
} : undefined,
|
1830
|
+
id: item.id !== undefined ? item.id : undefined,
|
1897
1831
|
assetId: item.assetId !== undefined ? {
|
1898
1832
|
equals: item.assetId
|
1899
1833
|
} : undefined,
|
@@ -1926,9 +1860,7 @@ export const TakeProfit = {
|
|
1926
1860
|
}
|
1927
1861
|
: { connectOrCreate: props.Order.alpacaAccount.alerts.map((item) => ({
|
1928
1862
|
where: {
|
1929
|
-
id: item.id !== undefined ?
|
1930
|
-
equals: item.id
|
1931
|
-
} : undefined,
|
1863
|
+
id: item.id !== undefined ? item.id : undefined,
|
1932
1864
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1933
1865
|
equals: item.alpacaAccountId
|
1934
1866
|
} : undefined,
|
@@ -1951,9 +1883,7 @@ export const TakeProfit = {
|
|
1951
1883
|
}
|
1952
1884
|
: { connectOrCreate: {
|
1953
1885
|
where: {
|
1954
|
-
id: props.Order.action.id !== undefined ?
|
1955
|
-
equals: props.Order.action.id
|
1956
|
-
} : undefined,
|
1886
|
+
id: props.Order.action.id !== undefined ? props.Order.action.id : undefined,
|
1957
1887
|
tradeId: props.Order.action.tradeId !== undefined ? {
|
1958
1888
|
equals: props.Order.action.tradeId
|
1959
1889
|
} : undefined,
|
@@ -1972,9 +1902,7 @@ export const TakeProfit = {
|
|
1972
1902
|
}
|
1973
1903
|
: { connectOrCreate: {
|
1974
1904
|
where: {
|
1975
|
-
id: props.Order.action.trade.id !== undefined ?
|
1976
|
-
equals: props.Order.action.trade.id
|
1977
|
-
} : undefined,
|
1905
|
+
id: props.Order.action.trade.id !== undefined ? props.Order.action.trade.id : undefined,
|
1978
1906
|
alpacaAccountId: props.Order.action.trade.alpacaAccountId !== undefined ? {
|
1979
1907
|
equals: props.Order.action.trade.alpacaAccountId
|
1980
1908
|
} : undefined,
|
@@ -2008,9 +1936,7 @@ export const TakeProfit = {
|
|
2008
1936
|
}
|
2009
1937
|
: { connectOrCreate: {
|
2010
1938
|
where: {
|
2011
|
-
id: props.Order.asset.id !== undefined ?
|
2012
|
-
equals: props.Order.asset.id
|
2013
|
-
} : undefined,
|
1939
|
+
id: props.Order.asset.id !== undefined ? props.Order.asset.id : undefined,
|
2014
1940
|
symbol: props.Order.asset.symbol !== undefined ? props.Order.asset.symbol : undefined,
|
2015
1941
|
name: props.Order.asset.name !== undefined ? props.Order.asset.name : undefined,
|
2016
1942
|
},
|
@@ -2078,9 +2004,7 @@ export const TakeProfit = {
|
|
2078
2004
|
}
|
2079
2005
|
: { connectOrCreate: props.Order.asset.trades.map((item) => ({
|
2080
2006
|
where: {
|
2081
|
-
id: item.id !== undefined ?
|
2082
|
-
equals: item.id
|
2083
|
-
} : undefined,
|
2007
|
+
id: item.id !== undefined ? item.id : undefined,
|
2084
2008
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2085
2009
|
equals: item.alpacaAccountId
|
2086
2010
|
} : undefined,
|
@@ -2111,9 +2035,7 @@ export const TakeProfit = {
|
|
2111
2035
|
}
|
2112
2036
|
: { connectOrCreate: props.Order.asset.positions.map((item) => ({
|
2113
2037
|
where: {
|
2114
|
-
id: item.id !== undefined ?
|
2115
|
-
equals: item.id
|
2116
|
-
} : undefined,
|
2038
|
+
id: item.id !== undefined ? item.id : undefined,
|
2117
2039
|
assetId: item.assetId !== undefined ? {
|
2118
2040
|
equals: item.assetId
|
2119
2041
|
} : undefined,
|
@@ -2146,9 +2068,7 @@ export const TakeProfit = {
|
|
2146
2068
|
}
|
2147
2069
|
: { connectOrCreate: props.Order.asset.newsMentions.map((item) => ({
|
2148
2070
|
where: {
|
2149
|
-
id: item.id !== undefined ?
|
2150
|
-
equals: item.id
|
2151
|
-
} : undefined,
|
2071
|
+
id: item.id !== undefined ? item.id : undefined,
|
2152
2072
|
url: item.url !== undefined ? item.url : undefined,
|
2153
2073
|
assetId: item.assetId !== undefined ? {
|
2154
2074
|
equals: item.assetId
|
@@ -2205,9 +2125,7 @@ export const TakeProfit = {
|
|
2205
2125
|
}`;
|
2206
2126
|
const variables = props.map(prop => ({
|
2207
2127
|
where: {
|
2208
|
-
id: prop.id !== undefined ?
|
2209
|
-
equals: prop.id
|
2210
|
-
} : undefined,
|
2128
|
+
id: prop.id !== undefined ? prop.id : undefined,
|
2211
2129
|
orderId: prop.orderId !== undefined ? prop.orderId : undefined,
|
2212
2130
|
createdAt: prop.createdAt !== undefined ? prop.createdAt : undefined,
|
2213
2131
|
updatedAt: prop.updatedAt !== undefined ? prop.updatedAt : undefined,
|
@@ -2454,9 +2372,7 @@ export const TakeProfit = {
|
|
2454
2372
|
trades: prop.Order.alpacaAccount.trades ? {
|
2455
2373
|
upsert: prop.Order.alpacaAccount.trades.map((item) => ({
|
2456
2374
|
where: {
|
2457
|
-
id: item.id !== undefined ?
|
2458
|
-
equals: item.id
|
2459
|
-
} : undefined,
|
2375
|
+
id: item.id !== undefined ? item.id : undefined,
|
2460
2376
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2461
2377
|
equals: item.alpacaAccountId
|
2462
2378
|
} : undefined,
|
@@ -2520,9 +2436,7 @@ export const TakeProfit = {
|
|
2520
2436
|
positions: prop.Order.alpacaAccount.positions ? {
|
2521
2437
|
upsert: prop.Order.alpacaAccount.positions.map((item) => ({
|
2522
2438
|
where: {
|
2523
|
-
id: item.id !== undefined ?
|
2524
|
-
equals: item.id
|
2525
|
-
} : undefined,
|
2439
|
+
id: item.id !== undefined ? item.id : undefined,
|
2526
2440
|
assetId: item.assetId !== undefined ? {
|
2527
2441
|
equals: item.assetId
|
2528
2442
|
} : undefined,
|
@@ -2594,9 +2508,7 @@ export const TakeProfit = {
|
|
2594
2508
|
alerts: prop.Order.alpacaAccount.alerts ? {
|
2595
2509
|
upsert: prop.Order.alpacaAccount.alerts.map((item) => ({
|
2596
2510
|
where: {
|
2597
|
-
id: item.id !== undefined ?
|
2598
|
-
equals: item.id
|
2599
|
-
} : undefined,
|
2511
|
+
id: item.id !== undefined ? item.id : undefined,
|
2600
2512
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2601
2513
|
equals: item.alpacaAccountId
|
2602
2514
|
} : undefined,
|
@@ -2641,9 +2553,7 @@ export const TakeProfit = {
|
|
2641
2553
|
}
|
2642
2554
|
: { connectOrCreate: {
|
2643
2555
|
where: {
|
2644
|
-
id: prop.Order.alpacaAccount.user.id !== undefined ?
|
2645
|
-
equals: prop.Order.alpacaAccount.user.id
|
2646
|
-
} : undefined,
|
2556
|
+
id: prop.Order.alpacaAccount.user.id !== undefined ? prop.Order.alpacaAccount.user.id : undefined,
|
2647
2557
|
email: prop.Order.alpacaAccount.user.email !== undefined ? prop.Order.alpacaAccount.user.email : undefined,
|
2648
2558
|
name: prop.Order.alpacaAccount.user.name !== undefined ? {
|
2649
2559
|
equals: prop.Order.alpacaAccount.user.name
|
@@ -2672,9 +2582,7 @@ export const TakeProfit = {
|
|
2672
2582
|
}
|
2673
2583
|
: { connectOrCreate: prop.Order.alpacaAccount.trades.map((item) => ({
|
2674
2584
|
where: {
|
2675
|
-
id: item.id !== undefined ?
|
2676
|
-
equals: item.id
|
2677
|
-
} : undefined,
|
2585
|
+
id: item.id !== undefined ? item.id : undefined,
|
2678
2586
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2679
2587
|
equals: item.alpacaAccountId
|
2680
2588
|
} : undefined,
|
@@ -2705,9 +2613,7 @@ export const TakeProfit = {
|
|
2705
2613
|
}
|
2706
2614
|
: { connectOrCreate: prop.Order.alpacaAccount.positions.map((item) => ({
|
2707
2615
|
where: {
|
2708
|
-
id: item.id !== undefined ?
|
2709
|
-
equals: item.id
|
2710
|
-
} : undefined,
|
2616
|
+
id: item.id !== undefined ? item.id : undefined,
|
2711
2617
|
assetId: item.assetId !== undefined ? {
|
2712
2618
|
equals: item.assetId
|
2713
2619
|
} : undefined,
|
@@ -2740,9 +2646,7 @@ export const TakeProfit = {
|
|
2740
2646
|
}
|
2741
2647
|
: { connectOrCreate: prop.Order.alpacaAccount.alerts.map((item) => ({
|
2742
2648
|
where: {
|
2743
|
-
id: item.id !== undefined ?
|
2744
|
-
equals: item.id
|
2745
|
-
} : undefined,
|
2649
|
+
id: item.id !== undefined ? item.id : undefined,
|
2746
2650
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2747
2651
|
equals: item.alpacaAccountId
|
2748
2652
|
} : undefined,
|
@@ -2867,9 +2771,7 @@ export const TakeProfit = {
|
|
2867
2771
|
}
|
2868
2772
|
: { connectOrCreate: {
|
2869
2773
|
where: {
|
2870
|
-
id: prop.Order.action.trade.id !== undefined ?
|
2871
|
-
equals: prop.Order.action.trade.id
|
2872
|
-
} : undefined,
|
2774
|
+
id: prop.Order.action.trade.id !== undefined ? prop.Order.action.trade.id : undefined,
|
2873
2775
|
alpacaAccountId: prop.Order.action.trade.alpacaAccountId !== undefined ? {
|
2874
2776
|
equals: prop.Order.action.trade.alpacaAccountId
|
2875
2777
|
} : undefined,
|
@@ -3080,9 +2982,7 @@ export const TakeProfit = {
|
|
3080
2982
|
trades: prop.Order.asset.trades ? {
|
3081
2983
|
upsert: prop.Order.asset.trades.map((item) => ({
|
3082
2984
|
where: {
|
3083
|
-
id: item.id !== undefined ?
|
3084
|
-
equals: item.id
|
3085
|
-
} : undefined,
|
2985
|
+
id: item.id !== undefined ? item.id : undefined,
|
3086
2986
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3087
2987
|
equals: item.alpacaAccountId
|
3088
2988
|
} : undefined,
|
@@ -3146,9 +3046,7 @@ export const TakeProfit = {
|
|
3146
3046
|
positions: prop.Order.asset.positions ? {
|
3147
3047
|
upsert: prop.Order.asset.positions.map((item) => ({
|
3148
3048
|
where: {
|
3149
|
-
id: item.id !== undefined ?
|
3150
|
-
equals: item.id
|
3151
|
-
} : undefined,
|
3049
|
+
id: item.id !== undefined ? item.id : undefined,
|
3152
3050
|
assetId: item.assetId !== undefined ? {
|
3153
3051
|
equals: item.assetId
|
3154
3052
|
} : undefined,
|
@@ -3220,9 +3118,7 @@ export const TakeProfit = {
|
|
3220
3118
|
newsMentions: prop.Order.asset.newsMentions ? {
|
3221
3119
|
upsert: prop.Order.asset.newsMentions.map((item) => ({
|
3222
3120
|
where: {
|
3223
|
-
id: item.id !== undefined ?
|
3224
|
-
equals: item.id
|
3225
|
-
} : undefined,
|
3121
|
+
id: item.id !== undefined ? item.id : undefined,
|
3226
3122
|
url: item.url !== undefined ? item.url : undefined,
|
3227
3123
|
assetId: item.assetId !== undefined ? {
|
3228
3124
|
equals: item.assetId
|
@@ -3321,9 +3217,7 @@ export const TakeProfit = {
|
|
3321
3217
|
}
|
3322
3218
|
: { connectOrCreate: prop.Order.asset.trades.map((item) => ({
|
3323
3219
|
where: {
|
3324
|
-
id: item.id !== undefined ?
|
3325
|
-
equals: item.id
|
3326
|
-
} : undefined,
|
3220
|
+
id: item.id !== undefined ? item.id : undefined,
|
3327
3221
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3328
3222
|
equals: item.alpacaAccountId
|
3329
3223
|
} : undefined,
|
@@ -3354,9 +3248,7 @@ export const TakeProfit = {
|
|
3354
3248
|
}
|
3355
3249
|
: { connectOrCreate: prop.Order.asset.positions.map((item) => ({
|
3356
3250
|
where: {
|
3357
|
-
id: item.id !== undefined ?
|
3358
|
-
equals: item.id
|
3359
|
-
} : undefined,
|
3251
|
+
id: item.id !== undefined ? item.id : undefined,
|
3360
3252
|
assetId: item.assetId !== undefined ? {
|
3361
3253
|
equals: item.assetId
|
3362
3254
|
} : undefined,
|
@@ -3389,9 +3281,7 @@ export const TakeProfit = {
|
|
3389
3281
|
}
|
3390
3282
|
: { connectOrCreate: prop.Order.asset.newsMentions.map((item) => ({
|
3391
3283
|
where: {
|
3392
|
-
id: item.id !== undefined ?
|
3393
|
-
equals: item.id
|
3394
|
-
} : undefined,
|
3284
|
+
id: item.id !== undefined ? item.id : undefined,
|
3395
3285
|
url: item.url !== undefined ? item.url : undefined,
|
3396
3286
|
assetId: item.assetId !== undefined ? {
|
3397
3287
|
equals: item.assetId
|
@@ -3443,9 +3333,7 @@ export const TakeProfit = {
|
|
3443
3333
|
}
|
3444
3334
|
: { connectOrCreate: {
|
3445
3335
|
where: {
|
3446
|
-
id: prop.Order.stopLoss.id !== undefined ?
|
3447
|
-
equals: prop.Order.stopLoss.id
|
3448
|
-
} : undefined,
|
3336
|
+
id: prop.Order.stopLoss.id !== undefined ? prop.Order.stopLoss.id : undefined,
|
3449
3337
|
orderId: prop.Order.stopLoss.orderId !== undefined ? prop.Order.stopLoss.orderId : undefined,
|
3450
3338
|
},
|
3451
3339
|
create: {
|
@@ -3462,9 +3350,7 @@ export const TakeProfit = {
|
|
3462
3350
|
}
|
3463
3351
|
: { connectOrCreate: {
|
3464
3352
|
where: {
|
3465
|
-
id: prop.Order.alpacaAccount.id !== undefined ?
|
3466
|
-
equals: prop.Order.alpacaAccount.id
|
3467
|
-
} : undefined,
|
3353
|
+
id: prop.Order.alpacaAccount.id !== undefined ? prop.Order.alpacaAccount.id : undefined,
|
3468
3354
|
userId: prop.Order.alpacaAccount.userId !== undefined ? {
|
3469
3355
|
equals: prop.Order.alpacaAccount.userId
|
3470
3356
|
} : undefined,
|
@@ -3487,9 +3373,7 @@ export const TakeProfit = {
|
|
3487
3373
|
}
|
3488
3374
|
: { connectOrCreate: {
|
3489
3375
|
where: {
|
3490
|
-
id: prop.Order.alpacaAccount.user.id !== undefined ?
|
3491
|
-
equals: prop.Order.alpacaAccount.user.id
|
3492
|
-
} : undefined,
|
3376
|
+
id: prop.Order.alpacaAccount.user.id !== undefined ? prop.Order.alpacaAccount.user.id : undefined,
|
3493
3377
|
email: prop.Order.alpacaAccount.user.email !== undefined ? prop.Order.alpacaAccount.user.email : undefined,
|
3494
3378
|
name: prop.Order.alpacaAccount.user.name !== undefined ? {
|
3495
3379
|
equals: prop.Order.alpacaAccount.user.name
|
@@ -3518,9 +3402,7 @@ export const TakeProfit = {
|
|
3518
3402
|
}
|
3519
3403
|
: { connectOrCreate: prop.Order.alpacaAccount.trades.map((item) => ({
|
3520
3404
|
where: {
|
3521
|
-
id: item.id !== undefined ?
|
3522
|
-
equals: item.id
|
3523
|
-
} : undefined,
|
3405
|
+
id: item.id !== undefined ? item.id : undefined,
|
3524
3406
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3525
3407
|
equals: item.alpacaAccountId
|
3526
3408
|
} : undefined,
|
@@ -3551,9 +3433,7 @@ export const TakeProfit = {
|
|
3551
3433
|
}
|
3552
3434
|
: { connectOrCreate: prop.Order.alpacaAccount.positions.map((item) => ({
|
3553
3435
|
where: {
|
3554
|
-
id: item.id !== undefined ?
|
3555
|
-
equals: item.id
|
3556
|
-
} : undefined,
|
3436
|
+
id: item.id !== undefined ? item.id : undefined,
|
3557
3437
|
assetId: item.assetId !== undefined ? {
|
3558
3438
|
equals: item.assetId
|
3559
3439
|
} : undefined,
|
@@ -3586,9 +3466,7 @@ export const TakeProfit = {
|
|
3586
3466
|
}
|
3587
3467
|
: { connectOrCreate: prop.Order.alpacaAccount.alerts.map((item) => ({
|
3588
3468
|
where: {
|
3589
|
-
id: item.id !== undefined ?
|
3590
|
-
equals: item.id
|
3591
|
-
} : undefined,
|
3469
|
+
id: item.id !== undefined ? item.id : undefined,
|
3592
3470
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3593
3471
|
equals: item.alpacaAccountId
|
3594
3472
|
} : undefined,
|
@@ -3611,9 +3489,7 @@ export const TakeProfit = {
|
|
3611
3489
|
}
|
3612
3490
|
: { connectOrCreate: {
|
3613
3491
|
where: {
|
3614
|
-
id: prop.Order.action.id !== undefined ?
|
3615
|
-
equals: prop.Order.action.id
|
3616
|
-
} : undefined,
|
3492
|
+
id: prop.Order.action.id !== undefined ? prop.Order.action.id : undefined,
|
3617
3493
|
tradeId: prop.Order.action.tradeId !== undefined ? {
|
3618
3494
|
equals: prop.Order.action.tradeId
|
3619
3495
|
} : undefined,
|
@@ -3632,9 +3508,7 @@ export const TakeProfit = {
|
|
3632
3508
|
}
|
3633
3509
|
: { connectOrCreate: {
|
3634
3510
|
where: {
|
3635
|
-
id: prop.Order.action.trade.id !== undefined ?
|
3636
|
-
equals: prop.Order.action.trade.id
|
3637
|
-
} : undefined,
|
3511
|
+
id: prop.Order.action.trade.id !== undefined ? prop.Order.action.trade.id : undefined,
|
3638
3512
|
alpacaAccountId: prop.Order.action.trade.alpacaAccountId !== undefined ? {
|
3639
3513
|
equals: prop.Order.action.trade.alpacaAccountId
|
3640
3514
|
} : undefined,
|
@@ -3668,9 +3542,7 @@ export const TakeProfit = {
|
|
3668
3542
|
}
|
3669
3543
|
: { connectOrCreate: {
|
3670
3544
|
where: {
|
3671
|
-
id: prop.Order.asset.id !== undefined ?
|
3672
|
-
equals: prop.Order.asset.id
|
3673
|
-
} : undefined,
|
3545
|
+
id: prop.Order.asset.id !== undefined ? prop.Order.asset.id : undefined,
|
3674
3546
|
symbol: prop.Order.asset.symbol !== undefined ? prop.Order.asset.symbol : undefined,
|
3675
3547
|
name: prop.Order.asset.name !== undefined ? prop.Order.asset.name : undefined,
|
3676
3548
|
},
|
@@ -3738,9 +3610,7 @@ export const TakeProfit = {
|
|
3738
3610
|
}
|
3739
3611
|
: { connectOrCreate: prop.Order.asset.trades.map((item) => ({
|
3740
3612
|
where: {
|
3741
|
-
id: item.id !== undefined ?
|
3742
|
-
equals: item.id
|
3743
|
-
} : undefined,
|
3613
|
+
id: item.id !== undefined ? item.id : undefined,
|
3744
3614
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3745
3615
|
equals: item.alpacaAccountId
|
3746
3616
|
} : undefined,
|
@@ -3771,9 +3641,7 @@ export const TakeProfit = {
|
|
3771
3641
|
}
|
3772
3642
|
: { connectOrCreate: prop.Order.asset.positions.map((item) => ({
|
3773
3643
|
where: {
|
3774
|
-
id: item.id !== undefined ?
|
3775
|
-
equals: item.id
|
3776
|
-
} : undefined,
|
3644
|
+
id: item.id !== undefined ? item.id : undefined,
|
3777
3645
|
assetId: item.assetId !== undefined ? {
|
3778
3646
|
equals: item.assetId
|
3779
3647
|
} : undefined,
|
@@ -3806,9 +3674,7 @@ export const TakeProfit = {
|
|
3806
3674
|
}
|
3807
3675
|
: { connectOrCreate: prop.Order.asset.newsMentions.map((item) => ({
|
3808
3676
|
where: {
|
3809
|
-
id: item.id !== undefined ?
|
3810
|
-
equals: item.id
|
3811
|
-
} : undefined,
|
3677
|
+
id: item.id !== undefined ? item.id : undefined,
|
3812
3678
|
url: item.url !== undefined ? item.url : undefined,
|
3813
3679
|
assetId: item.assetId !== undefined ? {
|
3814
3680
|
equals: item.assetId
|
@@ -3900,9 +3766,7 @@ export const TakeProfit = {
|
|
3900
3766
|
}`;
|
3901
3767
|
const variables = {
|
3902
3768
|
where: {
|
3903
|
-
id: props.id !== undefined ?
|
3904
|
-
equals: props.id
|
3905
|
-
} : undefined,
|
3769
|
+
id: props.id !== undefined ? props.id : undefined,
|
3906
3770
|
orderId: props.orderId !== undefined ? props.orderId : undefined,
|
3907
3771
|
createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
|
3908
3772
|
updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
|