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
package/server/Authenticator.mjs
CHANGED
@@ -235,9 +235,17 @@ export const Authenticator = {
|
|
235
235
|
: { connectOrCreate: {
|
236
236
|
where: {
|
237
237
|
id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
|
238
|
+
stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
|
239
|
+
stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
|
240
|
+
authUserId: props.user.customer.authUserId !== undefined ? {
|
241
|
+
equals: props.user.customer.authUserId
|
242
|
+
} : undefined,
|
238
243
|
name: props.user.customer.name !== undefined ? {
|
239
244
|
equals: props.user.customer.name
|
240
245
|
} : undefined,
|
246
|
+
stripePriceId: props.user.customer.stripePriceId !== undefined ? {
|
247
|
+
equals: props.user.customer.stripePriceId
|
248
|
+
} : undefined,
|
241
249
|
},
|
242
250
|
create: {
|
243
251
|
authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
|
@@ -259,6 +267,12 @@ export const Authenticator = {
|
|
259
267
|
: { connectOrCreate: props.user.accounts.map((item) => ({
|
260
268
|
where: {
|
261
269
|
id: item.id !== undefined ? item.id : undefined,
|
270
|
+
userId: item.userId !== undefined ? {
|
271
|
+
equals: item.userId
|
272
|
+
} : undefined,
|
273
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
274
|
+
equals: item.providerAccountId
|
275
|
+
} : undefined,
|
262
276
|
},
|
263
277
|
create: {
|
264
278
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -283,6 +297,9 @@ export const Authenticator = {
|
|
283
297
|
: { connectOrCreate: props.user.sessions.map((item) => ({
|
284
298
|
where: {
|
285
299
|
id: item.id !== undefined ? item.id : undefined,
|
300
|
+
userId: item.userId !== undefined ? {
|
301
|
+
equals: item.userId
|
302
|
+
} : undefined,
|
286
303
|
},
|
287
304
|
create: {
|
288
305
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -299,6 +316,9 @@ export const Authenticator = {
|
|
299
316
|
: { connectOrCreate: props.user.alpacaAccounts.map((item) => ({
|
300
317
|
where: {
|
301
318
|
id: item.id !== undefined ? item.id : undefined,
|
319
|
+
userId: item.userId !== undefined ? {
|
320
|
+
equals: item.userId
|
321
|
+
} : undefined,
|
302
322
|
},
|
303
323
|
create: {
|
304
324
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -319,6 +339,12 @@ export const Authenticator = {
|
|
319
339
|
: { connectOrCreate: item.trades.map((item) => ({
|
320
340
|
where: {
|
321
341
|
id: item.id !== undefined ? item.id : undefined,
|
342
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
343
|
+
equals: item.alpacaAccountId
|
344
|
+
} : undefined,
|
345
|
+
assetId: item.assetId !== undefined ? {
|
346
|
+
equals: item.assetId
|
347
|
+
} : undefined,
|
322
348
|
},
|
323
349
|
create: {
|
324
350
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -344,6 +370,15 @@ export const Authenticator = {
|
|
344
370
|
: { connectOrCreate: item.orders.map((item) => ({
|
345
371
|
where: {
|
346
372
|
id: item.id !== undefined ? item.id : undefined,
|
373
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
374
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
375
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
376
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
377
|
+
equals: item.alpacaAccountId
|
378
|
+
} : undefined,
|
379
|
+
assetId: item.assetId !== undefined ? {
|
380
|
+
equals: item.assetId
|
381
|
+
} : undefined,
|
347
382
|
},
|
348
383
|
create: {
|
349
384
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -380,6 +415,12 @@ export const Authenticator = {
|
|
380
415
|
: { connectOrCreate: item.positions.map((item) => ({
|
381
416
|
where: {
|
382
417
|
id: item.id !== undefined ? item.id : undefined,
|
418
|
+
assetId: item.assetId !== undefined ? {
|
419
|
+
equals: item.assetId
|
420
|
+
} : undefined,
|
421
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
422
|
+
equals: item.alpacaAccountId
|
423
|
+
} : undefined,
|
383
424
|
},
|
384
425
|
create: {
|
385
426
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -407,6 +448,9 @@ export const Authenticator = {
|
|
407
448
|
: { connectOrCreate: item.alerts.map((item) => ({
|
408
449
|
where: {
|
409
450
|
id: item.id !== undefined ? item.id : undefined,
|
451
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
452
|
+
equals: item.alpacaAccountId
|
453
|
+
} : undefined,
|
410
454
|
},
|
411
455
|
create: {
|
412
456
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -495,7 +539,9 @@ export const Authenticator = {
|
|
495
539
|
where: {
|
496
540
|
id: props.id !== undefined ? props.id : undefined,
|
497
541
|
credentialID: props.credentialID !== undefined ? props.credentialID : undefined,
|
498
|
-
userId: props.userId !== undefined ?
|
542
|
+
userId: props.userId !== undefined ? {
|
543
|
+
equals: props.userId
|
544
|
+
} : undefined,
|
499
545
|
publicKey: props.publicKey !== undefined ? props.publicKey : undefined,
|
500
546
|
counter: props.counter !== undefined ? props.counter : undefined,
|
501
547
|
createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
|
@@ -576,9 +622,21 @@ export const Authenticator = {
|
|
576
622
|
id: props.user.customer.id !== undefined ? {
|
577
623
|
equals: props.user.customer.id
|
578
624
|
} : undefined,
|
625
|
+
authUserId: props.user.customer.authUserId !== undefined ? {
|
626
|
+
equals: props.user.customer.authUserId
|
627
|
+
} : undefined,
|
579
628
|
name: props.user.customer.name !== undefined ? {
|
580
629
|
equals: props.user.customer.name
|
581
630
|
} : undefined,
|
631
|
+
stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? {
|
632
|
+
equals: props.user.customer.stripeCustomerId
|
633
|
+
} : undefined,
|
634
|
+
stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? {
|
635
|
+
equals: props.user.customer.stripeSubscriptionId
|
636
|
+
} : undefined,
|
637
|
+
stripePriceId: props.user.customer.stripePriceId !== undefined ? {
|
638
|
+
equals: props.user.customer.stripePriceId
|
639
|
+
} : undefined,
|
582
640
|
},
|
583
641
|
update: {
|
584
642
|
authUserId: props.user.customer.authUserId !== undefined ? {
|
@@ -618,6 +676,12 @@ export const Authenticator = {
|
|
618
676
|
upsert: props.user.accounts.map((item) => ({
|
619
677
|
where: {
|
620
678
|
id: item.id !== undefined ? item.id : undefined,
|
679
|
+
userId: item.userId !== undefined ? {
|
680
|
+
equals: item.userId
|
681
|
+
} : undefined,
|
682
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
683
|
+
equals: item.providerAccountId
|
684
|
+
} : undefined,
|
621
685
|
},
|
622
686
|
update: {
|
623
687
|
id: item.id !== undefined ? {
|
@@ -672,6 +736,9 @@ export const Authenticator = {
|
|
672
736
|
upsert: props.user.sessions.map((item) => ({
|
673
737
|
where: {
|
674
738
|
id: item.id !== undefined ? item.id : undefined,
|
739
|
+
userId: item.userId !== undefined ? {
|
740
|
+
equals: item.userId
|
741
|
+
} : undefined,
|
675
742
|
},
|
676
743
|
update: {
|
677
744
|
id: item.id !== undefined ? {
|
@@ -694,6 +761,9 @@ export const Authenticator = {
|
|
694
761
|
upsert: props.user.alpacaAccounts.map((item) => ({
|
695
762
|
where: {
|
696
763
|
id: item.id !== undefined ? item.id : undefined,
|
764
|
+
userId: item.userId !== undefined ? {
|
765
|
+
equals: item.userId
|
766
|
+
} : undefined,
|
697
767
|
},
|
698
768
|
update: {
|
699
769
|
id: item.id !== undefined ? {
|
@@ -730,6 +800,12 @@ export const Authenticator = {
|
|
730
800
|
upsert: item.trades.map((item) => ({
|
731
801
|
where: {
|
732
802
|
id: item.id !== undefined ? item.id : undefined,
|
803
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
804
|
+
equals: item.alpacaAccountId
|
805
|
+
} : undefined,
|
806
|
+
assetId: item.assetId !== undefined ? {
|
807
|
+
equals: item.assetId
|
808
|
+
} : undefined,
|
733
809
|
},
|
734
810
|
update: {
|
735
811
|
id: item.id !== undefined ? {
|
@@ -788,6 +864,15 @@ export const Authenticator = {
|
|
788
864
|
upsert: item.orders.map((item) => ({
|
789
865
|
where: {
|
790
866
|
id: item.id !== undefined ? item.id : undefined,
|
867
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
868
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
869
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
870
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
871
|
+
equals: item.alpacaAccountId
|
872
|
+
} : undefined,
|
873
|
+
assetId: item.assetId !== undefined ? {
|
874
|
+
equals: item.assetId
|
875
|
+
} : undefined,
|
791
876
|
},
|
792
877
|
update: {
|
793
878
|
id: item.id !== undefined ? {
|
@@ -890,6 +975,12 @@ export const Authenticator = {
|
|
890
975
|
upsert: item.positions.map((item) => ({
|
891
976
|
where: {
|
892
977
|
id: item.id !== undefined ? item.id : undefined,
|
978
|
+
assetId: item.assetId !== undefined ? {
|
979
|
+
equals: item.assetId
|
980
|
+
} : undefined,
|
981
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
982
|
+
equals: item.alpacaAccountId
|
983
|
+
} : undefined,
|
893
984
|
},
|
894
985
|
update: {
|
895
986
|
id: item.id !== undefined ? {
|
@@ -956,6 +1047,9 @@ export const Authenticator = {
|
|
956
1047
|
upsert: item.alerts.map((item) => ({
|
957
1048
|
where: {
|
958
1049
|
id: item.id !== undefined ? item.id : undefined,
|
1050
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1051
|
+
equals: item.alpacaAccountId
|
1052
|
+
} : undefined,
|
959
1053
|
},
|
960
1054
|
update: {
|
961
1055
|
id: item.id !== undefined ? {
|
@@ -998,6 +1092,12 @@ export const Authenticator = {
|
|
998
1092
|
: { connectOrCreate: item.trades.map((item) => ({
|
999
1093
|
where: {
|
1000
1094
|
id: item.id !== undefined ? item.id : undefined,
|
1095
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1096
|
+
equals: item.alpacaAccountId
|
1097
|
+
} : undefined,
|
1098
|
+
assetId: item.assetId !== undefined ? {
|
1099
|
+
equals: item.assetId
|
1100
|
+
} : undefined,
|
1001
1101
|
},
|
1002
1102
|
create: {
|
1003
1103
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1023,6 +1123,15 @@ export const Authenticator = {
|
|
1023
1123
|
: { connectOrCreate: item.orders.map((item) => ({
|
1024
1124
|
where: {
|
1025
1125
|
id: item.id !== undefined ? item.id : undefined,
|
1126
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1127
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1128
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1129
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1130
|
+
equals: item.alpacaAccountId
|
1131
|
+
} : undefined,
|
1132
|
+
assetId: item.assetId !== undefined ? {
|
1133
|
+
equals: item.assetId
|
1134
|
+
} : undefined,
|
1026
1135
|
},
|
1027
1136
|
create: {
|
1028
1137
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -1059,6 +1168,12 @@ export const Authenticator = {
|
|
1059
1168
|
: { connectOrCreate: item.positions.map((item) => ({
|
1060
1169
|
where: {
|
1061
1170
|
id: item.id !== undefined ? item.id : undefined,
|
1171
|
+
assetId: item.assetId !== undefined ? {
|
1172
|
+
equals: item.assetId
|
1173
|
+
} : undefined,
|
1174
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1175
|
+
equals: item.alpacaAccountId
|
1176
|
+
} : undefined,
|
1062
1177
|
},
|
1063
1178
|
create: {
|
1064
1179
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1086,6 +1201,9 @@ export const Authenticator = {
|
|
1086
1201
|
: { connectOrCreate: item.alerts.map((item) => ({
|
1087
1202
|
where: {
|
1088
1203
|
id: item.id !== undefined ? item.id : undefined,
|
1204
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1205
|
+
equals: item.alpacaAccountId
|
1206
|
+
} : undefined,
|
1089
1207
|
},
|
1090
1208
|
create: {
|
1091
1209
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -1119,9 +1237,17 @@ export const Authenticator = {
|
|
1119
1237
|
: { connectOrCreate: {
|
1120
1238
|
where: {
|
1121
1239
|
id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
|
1240
|
+
stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
|
1241
|
+
stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
|
1242
|
+
authUserId: props.user.customer.authUserId !== undefined ? {
|
1243
|
+
equals: props.user.customer.authUserId
|
1244
|
+
} : undefined,
|
1122
1245
|
name: props.user.customer.name !== undefined ? {
|
1123
1246
|
equals: props.user.customer.name
|
1124
1247
|
} : undefined,
|
1248
|
+
stripePriceId: props.user.customer.stripePriceId !== undefined ? {
|
1249
|
+
equals: props.user.customer.stripePriceId
|
1250
|
+
} : undefined,
|
1125
1251
|
},
|
1126
1252
|
create: {
|
1127
1253
|
authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
|
@@ -1143,6 +1269,12 @@ export const Authenticator = {
|
|
1143
1269
|
: { connectOrCreate: props.user.accounts.map((item) => ({
|
1144
1270
|
where: {
|
1145
1271
|
id: item.id !== undefined ? item.id : undefined,
|
1272
|
+
userId: item.userId !== undefined ? {
|
1273
|
+
equals: item.userId
|
1274
|
+
} : undefined,
|
1275
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
1276
|
+
equals: item.providerAccountId
|
1277
|
+
} : undefined,
|
1146
1278
|
},
|
1147
1279
|
create: {
|
1148
1280
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -1167,6 +1299,9 @@ export const Authenticator = {
|
|
1167
1299
|
: { connectOrCreate: props.user.sessions.map((item) => ({
|
1168
1300
|
where: {
|
1169
1301
|
id: item.id !== undefined ? item.id : undefined,
|
1302
|
+
userId: item.userId !== undefined ? {
|
1303
|
+
equals: item.userId
|
1304
|
+
} : undefined,
|
1170
1305
|
},
|
1171
1306
|
create: {
|
1172
1307
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -1183,6 +1318,9 @@ export const Authenticator = {
|
|
1183
1318
|
: { connectOrCreate: props.user.alpacaAccounts.map((item) => ({
|
1184
1319
|
where: {
|
1185
1320
|
id: item.id !== undefined ? item.id : undefined,
|
1321
|
+
userId: item.userId !== undefined ? {
|
1322
|
+
equals: item.userId
|
1323
|
+
} : undefined,
|
1186
1324
|
},
|
1187
1325
|
create: {
|
1188
1326
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -1203,6 +1341,12 @@ export const Authenticator = {
|
|
1203
1341
|
: { connectOrCreate: item.trades.map((item) => ({
|
1204
1342
|
where: {
|
1205
1343
|
id: item.id !== undefined ? item.id : undefined,
|
1344
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1345
|
+
equals: item.alpacaAccountId
|
1346
|
+
} : undefined,
|
1347
|
+
assetId: item.assetId !== undefined ? {
|
1348
|
+
equals: item.assetId
|
1349
|
+
} : undefined,
|
1206
1350
|
},
|
1207
1351
|
create: {
|
1208
1352
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1228,6 +1372,15 @@ export const Authenticator = {
|
|
1228
1372
|
: { connectOrCreate: item.orders.map((item) => ({
|
1229
1373
|
where: {
|
1230
1374
|
id: item.id !== undefined ? item.id : undefined,
|
1375
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1376
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1377
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1378
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1379
|
+
equals: item.alpacaAccountId
|
1380
|
+
} : undefined,
|
1381
|
+
assetId: item.assetId !== undefined ? {
|
1382
|
+
equals: item.assetId
|
1383
|
+
} : undefined,
|
1231
1384
|
},
|
1232
1385
|
create: {
|
1233
1386
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -1264,6 +1417,12 @@ export const Authenticator = {
|
|
1264
1417
|
: { connectOrCreate: item.positions.map((item) => ({
|
1265
1418
|
where: {
|
1266
1419
|
id: item.id !== undefined ? item.id : undefined,
|
1420
|
+
assetId: item.assetId !== undefined ? {
|
1421
|
+
equals: item.assetId
|
1422
|
+
} : undefined,
|
1423
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1424
|
+
equals: item.alpacaAccountId
|
1425
|
+
} : undefined,
|
1267
1426
|
},
|
1268
1427
|
create: {
|
1269
1428
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1291,6 +1450,9 @@ export const Authenticator = {
|
|
1291
1450
|
: { connectOrCreate: item.alerts.map((item) => ({
|
1292
1451
|
where: {
|
1293
1452
|
id: item.id !== undefined ? item.id : undefined,
|
1453
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1454
|
+
equals: item.alpacaAccountId
|
1455
|
+
} : undefined,
|
1294
1456
|
},
|
1295
1457
|
create: {
|
1296
1458
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -1341,7 +1503,9 @@ export const Authenticator = {
|
|
1341
1503
|
where: {
|
1342
1504
|
id: prop.id !== undefined ? prop.id : undefined,
|
1343
1505
|
credentialID: prop.credentialID !== undefined ? prop.credentialID : undefined,
|
1344
|
-
userId: prop.userId !== undefined ?
|
1506
|
+
userId: prop.userId !== undefined ? {
|
1507
|
+
equals: prop.userId
|
1508
|
+
} : undefined,
|
1345
1509
|
publicKey: prop.publicKey !== undefined ? prop.publicKey : undefined,
|
1346
1510
|
counter: prop.counter !== undefined ? prop.counter : undefined,
|
1347
1511
|
createdAt: prop.createdAt !== undefined ? prop.createdAt : undefined,
|
@@ -1422,9 +1586,21 @@ export const Authenticator = {
|
|
1422
1586
|
id: prop.user.customer.id !== undefined ? {
|
1423
1587
|
equals: prop.user.customer.id
|
1424
1588
|
} : undefined,
|
1589
|
+
authUserId: prop.user.customer.authUserId !== undefined ? {
|
1590
|
+
equals: prop.user.customer.authUserId
|
1591
|
+
} : undefined,
|
1425
1592
|
name: prop.user.customer.name !== undefined ? {
|
1426
1593
|
equals: prop.user.customer.name
|
1427
1594
|
} : undefined,
|
1595
|
+
stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? {
|
1596
|
+
equals: prop.user.customer.stripeCustomerId
|
1597
|
+
} : undefined,
|
1598
|
+
stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? {
|
1599
|
+
equals: prop.user.customer.stripeSubscriptionId
|
1600
|
+
} : undefined,
|
1601
|
+
stripePriceId: prop.user.customer.stripePriceId !== undefined ? {
|
1602
|
+
equals: prop.user.customer.stripePriceId
|
1603
|
+
} : undefined,
|
1428
1604
|
},
|
1429
1605
|
update: {
|
1430
1606
|
authUserId: prop.user.customer.authUserId !== undefined ? {
|
@@ -1464,6 +1640,12 @@ export const Authenticator = {
|
|
1464
1640
|
upsert: prop.user.accounts.map((item) => ({
|
1465
1641
|
where: {
|
1466
1642
|
id: item.id !== undefined ? item.id : undefined,
|
1643
|
+
userId: item.userId !== undefined ? {
|
1644
|
+
equals: item.userId
|
1645
|
+
} : undefined,
|
1646
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
1647
|
+
equals: item.providerAccountId
|
1648
|
+
} : undefined,
|
1467
1649
|
},
|
1468
1650
|
update: {
|
1469
1651
|
id: item.id !== undefined ? {
|
@@ -1518,6 +1700,9 @@ export const Authenticator = {
|
|
1518
1700
|
upsert: prop.user.sessions.map((item) => ({
|
1519
1701
|
where: {
|
1520
1702
|
id: item.id !== undefined ? item.id : undefined,
|
1703
|
+
userId: item.userId !== undefined ? {
|
1704
|
+
equals: item.userId
|
1705
|
+
} : undefined,
|
1521
1706
|
},
|
1522
1707
|
update: {
|
1523
1708
|
id: item.id !== undefined ? {
|
@@ -1540,6 +1725,9 @@ export const Authenticator = {
|
|
1540
1725
|
upsert: prop.user.alpacaAccounts.map((item) => ({
|
1541
1726
|
where: {
|
1542
1727
|
id: item.id !== undefined ? item.id : undefined,
|
1728
|
+
userId: item.userId !== undefined ? {
|
1729
|
+
equals: item.userId
|
1730
|
+
} : undefined,
|
1543
1731
|
},
|
1544
1732
|
update: {
|
1545
1733
|
id: item.id !== undefined ? {
|
@@ -1576,6 +1764,12 @@ export const Authenticator = {
|
|
1576
1764
|
upsert: item.trades.map((item) => ({
|
1577
1765
|
where: {
|
1578
1766
|
id: item.id !== undefined ? item.id : undefined,
|
1767
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1768
|
+
equals: item.alpacaAccountId
|
1769
|
+
} : undefined,
|
1770
|
+
assetId: item.assetId !== undefined ? {
|
1771
|
+
equals: item.assetId
|
1772
|
+
} : undefined,
|
1579
1773
|
},
|
1580
1774
|
update: {
|
1581
1775
|
id: item.id !== undefined ? {
|
@@ -1634,6 +1828,15 @@ export const Authenticator = {
|
|
1634
1828
|
upsert: item.orders.map((item) => ({
|
1635
1829
|
where: {
|
1636
1830
|
id: item.id !== undefined ? item.id : undefined,
|
1831
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1832
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1833
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1834
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1835
|
+
equals: item.alpacaAccountId
|
1836
|
+
} : undefined,
|
1837
|
+
assetId: item.assetId !== undefined ? {
|
1838
|
+
equals: item.assetId
|
1839
|
+
} : undefined,
|
1637
1840
|
},
|
1638
1841
|
update: {
|
1639
1842
|
id: item.id !== undefined ? {
|
@@ -1736,6 +1939,12 @@ export const Authenticator = {
|
|
1736
1939
|
upsert: item.positions.map((item) => ({
|
1737
1940
|
where: {
|
1738
1941
|
id: item.id !== undefined ? item.id : undefined,
|
1942
|
+
assetId: item.assetId !== undefined ? {
|
1943
|
+
equals: item.assetId
|
1944
|
+
} : undefined,
|
1945
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1946
|
+
equals: item.alpacaAccountId
|
1947
|
+
} : undefined,
|
1739
1948
|
},
|
1740
1949
|
update: {
|
1741
1950
|
id: item.id !== undefined ? {
|
@@ -1802,6 +2011,9 @@ export const Authenticator = {
|
|
1802
2011
|
upsert: item.alerts.map((item) => ({
|
1803
2012
|
where: {
|
1804
2013
|
id: item.id !== undefined ? item.id : undefined,
|
2014
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2015
|
+
equals: item.alpacaAccountId
|
2016
|
+
} : undefined,
|
1805
2017
|
},
|
1806
2018
|
update: {
|
1807
2019
|
id: item.id !== undefined ? {
|
@@ -1844,6 +2056,12 @@ export const Authenticator = {
|
|
1844
2056
|
: { connectOrCreate: item.trades.map((item) => ({
|
1845
2057
|
where: {
|
1846
2058
|
id: item.id !== undefined ? item.id : undefined,
|
2059
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2060
|
+
equals: item.alpacaAccountId
|
2061
|
+
} : undefined,
|
2062
|
+
assetId: item.assetId !== undefined ? {
|
2063
|
+
equals: item.assetId
|
2064
|
+
} : undefined,
|
1847
2065
|
},
|
1848
2066
|
create: {
|
1849
2067
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1869,6 +2087,15 @@ export const Authenticator = {
|
|
1869
2087
|
: { connectOrCreate: item.orders.map((item) => ({
|
1870
2088
|
where: {
|
1871
2089
|
id: item.id !== undefined ? item.id : undefined,
|
2090
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2091
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2092
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2093
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2094
|
+
equals: item.alpacaAccountId
|
2095
|
+
} : undefined,
|
2096
|
+
assetId: item.assetId !== undefined ? {
|
2097
|
+
equals: item.assetId
|
2098
|
+
} : undefined,
|
1872
2099
|
},
|
1873
2100
|
create: {
|
1874
2101
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -1905,6 +2132,12 @@ export const Authenticator = {
|
|
1905
2132
|
: { connectOrCreate: item.positions.map((item) => ({
|
1906
2133
|
where: {
|
1907
2134
|
id: item.id !== undefined ? item.id : undefined,
|
2135
|
+
assetId: item.assetId !== undefined ? {
|
2136
|
+
equals: item.assetId
|
2137
|
+
} : undefined,
|
2138
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2139
|
+
equals: item.alpacaAccountId
|
2140
|
+
} : undefined,
|
1908
2141
|
},
|
1909
2142
|
create: {
|
1910
2143
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1932,6 +2165,9 @@ export const Authenticator = {
|
|
1932
2165
|
: { connectOrCreate: item.alerts.map((item) => ({
|
1933
2166
|
where: {
|
1934
2167
|
id: item.id !== undefined ? item.id : undefined,
|
2168
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2169
|
+
equals: item.alpacaAccountId
|
2170
|
+
} : undefined,
|
1935
2171
|
},
|
1936
2172
|
create: {
|
1937
2173
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -1965,9 +2201,17 @@ export const Authenticator = {
|
|
1965
2201
|
: { connectOrCreate: {
|
1966
2202
|
where: {
|
1967
2203
|
id: prop.user.customer.id !== undefined ? prop.user.customer.id : undefined,
|
2204
|
+
stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? prop.user.customer.stripeCustomerId : undefined,
|
2205
|
+
stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? prop.user.customer.stripeSubscriptionId : undefined,
|
2206
|
+
authUserId: prop.user.customer.authUserId !== undefined ? {
|
2207
|
+
equals: prop.user.customer.authUserId
|
2208
|
+
} : undefined,
|
1968
2209
|
name: prop.user.customer.name !== undefined ? {
|
1969
2210
|
equals: prop.user.customer.name
|
1970
2211
|
} : undefined,
|
2212
|
+
stripePriceId: prop.user.customer.stripePriceId !== undefined ? {
|
2213
|
+
equals: prop.user.customer.stripePriceId
|
2214
|
+
} : undefined,
|
1971
2215
|
},
|
1972
2216
|
create: {
|
1973
2217
|
authUserId: prop.user.customer.authUserId !== undefined ? prop.user.customer.authUserId : undefined,
|
@@ -1989,6 +2233,12 @@ export const Authenticator = {
|
|
1989
2233
|
: { connectOrCreate: prop.user.accounts.map((item) => ({
|
1990
2234
|
where: {
|
1991
2235
|
id: item.id !== undefined ? item.id : undefined,
|
2236
|
+
userId: item.userId !== undefined ? {
|
2237
|
+
equals: item.userId
|
2238
|
+
} : undefined,
|
2239
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
2240
|
+
equals: item.providerAccountId
|
2241
|
+
} : undefined,
|
1992
2242
|
},
|
1993
2243
|
create: {
|
1994
2244
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -2013,6 +2263,9 @@ export const Authenticator = {
|
|
2013
2263
|
: { connectOrCreate: prop.user.sessions.map((item) => ({
|
2014
2264
|
where: {
|
2015
2265
|
id: item.id !== undefined ? item.id : undefined,
|
2266
|
+
userId: item.userId !== undefined ? {
|
2267
|
+
equals: item.userId
|
2268
|
+
} : undefined,
|
2016
2269
|
},
|
2017
2270
|
create: {
|
2018
2271
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -2029,6 +2282,9 @@ export const Authenticator = {
|
|
2029
2282
|
: { connectOrCreate: prop.user.alpacaAccounts.map((item) => ({
|
2030
2283
|
where: {
|
2031
2284
|
id: item.id !== undefined ? item.id : undefined,
|
2285
|
+
userId: item.userId !== undefined ? {
|
2286
|
+
equals: item.userId
|
2287
|
+
} : undefined,
|
2032
2288
|
},
|
2033
2289
|
create: {
|
2034
2290
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -2049,6 +2305,12 @@ export const Authenticator = {
|
|
2049
2305
|
: { connectOrCreate: item.trades.map((item) => ({
|
2050
2306
|
where: {
|
2051
2307
|
id: item.id !== undefined ? item.id : undefined,
|
2308
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2309
|
+
equals: item.alpacaAccountId
|
2310
|
+
} : undefined,
|
2311
|
+
assetId: item.assetId !== undefined ? {
|
2312
|
+
equals: item.assetId
|
2313
|
+
} : undefined,
|
2052
2314
|
},
|
2053
2315
|
create: {
|
2054
2316
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -2074,6 +2336,15 @@ export const Authenticator = {
|
|
2074
2336
|
: { connectOrCreate: item.orders.map((item) => ({
|
2075
2337
|
where: {
|
2076
2338
|
id: item.id !== undefined ? item.id : undefined,
|
2339
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2340
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2341
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2342
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2343
|
+
equals: item.alpacaAccountId
|
2344
|
+
} : undefined,
|
2345
|
+
assetId: item.assetId !== undefined ? {
|
2346
|
+
equals: item.assetId
|
2347
|
+
} : undefined,
|
2077
2348
|
},
|
2078
2349
|
create: {
|
2079
2350
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -2110,6 +2381,12 @@ export const Authenticator = {
|
|
2110
2381
|
: { connectOrCreate: item.positions.map((item) => ({
|
2111
2382
|
where: {
|
2112
2383
|
id: item.id !== undefined ? item.id : undefined,
|
2384
|
+
assetId: item.assetId !== undefined ? {
|
2385
|
+
equals: item.assetId
|
2386
|
+
} : undefined,
|
2387
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2388
|
+
equals: item.alpacaAccountId
|
2389
|
+
} : undefined,
|
2113
2390
|
},
|
2114
2391
|
create: {
|
2115
2392
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2137,6 +2414,9 @@ export const Authenticator = {
|
|
2137
2414
|
: { connectOrCreate: item.alerts.map((item) => ({
|
2138
2415
|
where: {
|
2139
2416
|
id: item.id !== undefined ? item.id : undefined,
|
2417
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2418
|
+
equals: item.alpacaAccountId
|
2419
|
+
} : undefined,
|
2140
2420
|
},
|
2141
2421
|
create: {
|
2142
2422
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -2222,7 +2502,9 @@ export const Authenticator = {
|
|
2222
2502
|
where: {
|
2223
2503
|
id: props.id !== undefined ? props.id : undefined,
|
2224
2504
|
credentialID: props.credentialID !== undefined ? props.credentialID : undefined,
|
2225
|
-
userId: props.userId !== undefined ?
|
2505
|
+
userId: props.userId !== undefined ? {
|
2506
|
+
equals: props.userId
|
2507
|
+
} : undefined,
|
2226
2508
|
publicKey: props.publicKey !== undefined ? props.publicKey : undefined,
|
2227
2509
|
counter: props.counter !== undefined ? props.counter : undefined,
|
2228
2510
|
createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
|
@@ -2292,7 +2574,9 @@ export const Authenticator = {
|
|
2292
2574
|
id: props.id !== undefined ? {
|
2293
2575
|
equals: props.id
|
2294
2576
|
} : undefined,
|
2295
|
-
userId: props.userId !== undefined ?
|
2577
|
+
userId: props.userId !== undefined ? {
|
2578
|
+
equals: props.userId
|
2579
|
+
} : undefined,
|
2296
2580
|
credentialID: props.credentialID !== undefined ? props.credentialID : undefined,
|
2297
2581
|
publicKey: props.publicKey !== undefined ? props.publicKey : undefined,
|
2298
2582
|
counter: props.counter !== undefined ? props.counter : undefined,
|