adaptic-backend 1.0.159 → 1.0.160

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/Account.cjs +435 -58
  2. package/Action.cjs +966 -121
  3. package/Alert.cjs +593 -89
  4. package/AlpacaAccount.cjs +1161 -134
  5. package/Asset.cjs +1029 -129
  6. package/Authenticator.cjs +438 -54
  7. package/Customer.cjs +435 -64
  8. package/EconomicEvent.cjs +9 -3
  9. package/NewsArticle.cjs +255 -30
  10. package/NewsArticleAssetSentiment.cjs +427 -65
  11. package/Order.cjs +867 -129
  12. package/Position.cjs +945 -141
  13. package/Session.cjs +438 -54
  14. package/StopLoss.cjs +552 -69
  15. package/TakeProfit.cjs +552 -69
  16. package/Trade.cjs +1042 -153
  17. package/User.cjs +480 -73
  18. package/VerificationToken.cjs +9 -3
  19. package/package.json +1 -1
  20. package/server/Account.d.ts.map +1 -1
  21. package/server/Account.js.map +1 -1
  22. package/server/Account.mjs +435 -58
  23. package/server/Action.d.ts.map +1 -1
  24. package/server/Action.js.map +1 -1
  25. package/server/Action.mjs +966 -121
  26. package/server/Alert.d.ts.map +1 -1
  27. package/server/Alert.js.map +1 -1
  28. package/server/Alert.mjs +593 -89
  29. package/server/AlpacaAccount.d.ts.map +1 -1
  30. package/server/AlpacaAccount.js.map +1 -1
  31. package/server/AlpacaAccount.mjs +1161 -134
  32. package/server/Asset.d.ts.map +1 -1
  33. package/server/Asset.js.map +1 -1
  34. package/server/Asset.mjs +1029 -129
  35. package/server/Authenticator.d.ts.map +1 -1
  36. package/server/Authenticator.js.map +1 -1
  37. package/server/Authenticator.mjs +438 -54
  38. package/server/Customer.d.ts.map +1 -1
  39. package/server/Customer.js.map +1 -1
  40. package/server/Customer.mjs +435 -64
  41. package/server/EconomicEvent.d.ts.map +1 -1
  42. package/server/EconomicEvent.js.map +1 -1
  43. package/server/EconomicEvent.mjs +9 -3
  44. package/server/NewsArticle.d.ts.map +1 -1
  45. package/server/NewsArticle.js.map +1 -1
  46. package/server/NewsArticle.mjs +255 -30
  47. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  48. package/server/NewsArticleAssetSentiment.js.map +1 -1
  49. package/server/NewsArticleAssetSentiment.mjs +427 -65
  50. package/server/Order.d.ts.map +1 -1
  51. package/server/Order.js.map +1 -1
  52. package/server/Order.mjs +867 -129
  53. package/server/Position.d.ts.map +1 -1
  54. package/server/Position.js.map +1 -1
  55. package/server/Position.mjs +945 -141
  56. package/server/Session.d.ts.map +1 -1
  57. package/server/Session.js.map +1 -1
  58. package/server/Session.mjs +438 -54
  59. package/server/StopLoss.d.ts.map +1 -1
  60. package/server/StopLoss.js.map +1 -1
  61. package/server/StopLoss.mjs +552 -69
  62. package/server/TakeProfit.d.ts.map +1 -1
  63. package/server/TakeProfit.js.map +1 -1
  64. package/server/TakeProfit.mjs +552 -69
  65. package/server/Trade.d.ts.map +1 -1
  66. package/server/Trade.js.map +1 -1
  67. package/server/Trade.mjs +1042 -153
  68. package/server/User.d.ts.map +1 -1
  69. package/server/User.js.map +1 -1
  70. package/server/User.mjs +480 -73
  71. package/server/VerificationToken.d.ts.map +1 -1
  72. package/server/VerificationToken.js.map +1 -1
  73. package/server/VerificationToken.mjs +9 -3
@@ -208,7 +208,9 @@ export const Authenticator = {
208
208
  }
209
209
  : { connectOrCreate: {
210
210
  where: {
211
- id: props.user.id !== undefined ? props.user.id : undefined,
211
+ id: props.user.id !== undefined ? {
212
+ equals: props.user.id
213
+ } : undefined,
212
214
  email: props.user.email !== undefined ? props.user.email : undefined,
213
215
  name: props.user.name !== undefined ? {
214
216
  equals: props.user.name
@@ -234,10 +236,20 @@ export const Authenticator = {
234
236
  }
235
237
  : { connectOrCreate: {
236
238
  where: {
237
- id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
239
+ id: props.user.customer.id !== undefined ? {
240
+ equals: props.user.customer.id
241
+ } : undefined,
242
+ stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
243
+ stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
244
+ authUserId: props.user.customer.authUserId !== undefined ? {
245
+ equals: props.user.customer.authUserId
246
+ } : undefined,
238
247
  name: props.user.customer.name !== undefined ? {
239
248
  equals: props.user.customer.name
240
249
  } : undefined,
250
+ stripePriceId: props.user.customer.stripePriceId !== undefined ? {
251
+ equals: props.user.customer.stripePriceId
252
+ } : undefined,
241
253
  },
242
254
  create: {
243
255
  authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
@@ -258,7 +270,15 @@ export const Authenticator = {
258
270
  }
259
271
  : { connectOrCreate: props.user.accounts.map((item) => ({
260
272
  where: {
261
- id: item.id !== undefined ? item.id : undefined,
273
+ id: item.id !== undefined ? {
274
+ equals: item.id
275
+ } : undefined,
276
+ userId: item.userId !== undefined ? {
277
+ equals: item.userId
278
+ } : undefined,
279
+ providerAccountId: item.providerAccountId !== undefined ? {
280
+ equals: item.providerAccountId
281
+ } : undefined,
262
282
  },
263
283
  create: {
264
284
  type: item.type !== undefined ? item.type : undefined,
@@ -282,7 +302,12 @@ export const Authenticator = {
282
302
  }
283
303
  : { connectOrCreate: props.user.sessions.map((item) => ({
284
304
  where: {
285
- id: item.id !== undefined ? item.id : undefined,
305
+ id: item.id !== undefined ? {
306
+ equals: item.id
307
+ } : undefined,
308
+ userId: item.userId !== undefined ? {
309
+ equals: item.userId
310
+ } : undefined,
286
311
  },
287
312
  create: {
288
313
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -298,7 +323,12 @@ export const Authenticator = {
298
323
  }
299
324
  : { connectOrCreate: props.user.alpacaAccounts.map((item) => ({
300
325
  where: {
301
- id: item.id !== undefined ? item.id : undefined,
326
+ id: item.id !== undefined ? {
327
+ equals: item.id
328
+ } : undefined,
329
+ userId: item.userId !== undefined ? {
330
+ equals: item.userId
331
+ } : undefined,
302
332
  },
303
333
  create: {
304
334
  type: item.type !== undefined ? item.type : undefined,
@@ -318,7 +348,15 @@ export const Authenticator = {
318
348
  }
319
349
  : { connectOrCreate: item.trades.map((item) => ({
320
350
  where: {
321
- id: item.id !== undefined ? item.id : undefined,
351
+ id: item.id !== undefined ? {
352
+ equals: item.id
353
+ } : undefined,
354
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
355
+ equals: item.alpacaAccountId
356
+ } : undefined,
357
+ assetId: item.assetId !== undefined ? {
358
+ equals: item.assetId
359
+ } : undefined,
322
360
  },
323
361
  create: {
324
362
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -343,7 +381,18 @@ export const Authenticator = {
343
381
  }
344
382
  : { connectOrCreate: item.orders.map((item) => ({
345
383
  where: {
346
- id: item.id !== undefined ? item.id : undefined,
384
+ id: item.id !== undefined ? {
385
+ equals: item.id
386
+ } : undefined,
387
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
388
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
389
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
390
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
391
+ equals: item.alpacaAccountId
392
+ } : undefined,
393
+ assetId: item.assetId !== undefined ? {
394
+ equals: item.assetId
395
+ } : undefined,
347
396
  },
348
397
  create: {
349
398
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -379,7 +428,15 @@ export const Authenticator = {
379
428
  }
380
429
  : { connectOrCreate: item.positions.map((item) => ({
381
430
  where: {
382
- id: item.id !== undefined ? item.id : undefined,
431
+ id: item.id !== undefined ? {
432
+ equals: item.id
433
+ } : undefined,
434
+ assetId: item.assetId !== undefined ? {
435
+ equals: item.assetId
436
+ } : undefined,
437
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
438
+ equals: item.alpacaAccountId
439
+ } : undefined,
383
440
  },
384
441
  create: {
385
442
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -406,7 +463,12 @@ export const Authenticator = {
406
463
  }
407
464
  : { connectOrCreate: item.alerts.map((item) => ({
408
465
  where: {
409
- id: item.id !== undefined ? item.id : undefined,
466
+ id: item.id !== undefined ? {
467
+ equals: item.id
468
+ } : undefined,
469
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
470
+ equals: item.alpacaAccountId
471
+ } : undefined,
410
472
  },
411
473
  create: {
412
474
  message: item.message !== undefined ? item.message : undefined,
@@ -493,9 +555,13 @@ export const Authenticator = {
493
555
  }`;
494
556
  const variables = {
495
557
  where: {
496
- id: props.id !== undefined ? props.id : undefined,
558
+ id: props.id !== undefined ? {
559
+ equals: props.id
560
+ } : undefined,
497
561
  credentialID: props.credentialID !== undefined ? props.credentialID : undefined,
498
- userId: props.userId !== undefined ? props.userId : undefined,
562
+ userId: props.userId !== undefined ? {
563
+ equals: props.userId
564
+ } : undefined,
499
565
  publicKey: props.publicKey !== undefined ? props.publicKey : undefined,
500
566
  counter: props.counter !== undefined ? props.counter : undefined,
501
567
  createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
@@ -576,9 +642,21 @@ export const Authenticator = {
576
642
  id: props.user.customer.id !== undefined ? {
577
643
  equals: props.user.customer.id
578
644
  } : undefined,
645
+ authUserId: props.user.customer.authUserId !== undefined ? {
646
+ equals: props.user.customer.authUserId
647
+ } : undefined,
579
648
  name: props.user.customer.name !== undefined ? {
580
649
  equals: props.user.customer.name
581
650
  } : undefined,
651
+ stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? {
652
+ equals: props.user.customer.stripeCustomerId
653
+ } : undefined,
654
+ stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? {
655
+ equals: props.user.customer.stripeSubscriptionId
656
+ } : undefined,
657
+ stripePriceId: props.user.customer.stripePriceId !== undefined ? {
658
+ equals: props.user.customer.stripePriceId
659
+ } : undefined,
582
660
  },
583
661
  update: {
584
662
  authUserId: props.user.customer.authUserId !== undefined ? {
@@ -617,7 +695,15 @@ export const Authenticator = {
617
695
  accounts: props.user.accounts ? {
618
696
  upsert: props.user.accounts.map((item) => ({
619
697
  where: {
620
- id: item.id !== undefined ? item.id : undefined,
698
+ id: item.id !== undefined ? {
699
+ equals: item.id
700
+ } : undefined,
701
+ userId: item.userId !== undefined ? {
702
+ equals: item.userId
703
+ } : undefined,
704
+ providerAccountId: item.providerAccountId !== undefined ? {
705
+ equals: item.providerAccountId
706
+ } : undefined,
621
707
  },
622
708
  update: {
623
709
  id: item.id !== undefined ? {
@@ -671,7 +757,12 @@ export const Authenticator = {
671
757
  sessions: props.user.sessions ? {
672
758
  upsert: props.user.sessions.map((item) => ({
673
759
  where: {
674
- id: item.id !== undefined ? item.id : undefined,
760
+ id: item.id !== undefined ? {
761
+ equals: item.id
762
+ } : undefined,
763
+ userId: item.userId !== undefined ? {
764
+ equals: item.userId
765
+ } : undefined,
675
766
  },
676
767
  update: {
677
768
  id: item.id !== undefined ? {
@@ -693,7 +784,12 @@ export const Authenticator = {
693
784
  alpacaAccounts: props.user.alpacaAccounts ? {
694
785
  upsert: props.user.alpacaAccounts.map((item) => ({
695
786
  where: {
696
- id: item.id !== undefined ? item.id : undefined,
787
+ id: item.id !== undefined ? {
788
+ equals: item.id
789
+ } : undefined,
790
+ userId: item.userId !== undefined ? {
791
+ equals: item.userId
792
+ } : undefined,
697
793
  },
698
794
  update: {
699
795
  id: item.id !== undefined ? {
@@ -729,7 +825,15 @@ export const Authenticator = {
729
825
  trades: item.trades ? {
730
826
  upsert: item.trades.map((item) => ({
731
827
  where: {
732
- id: item.id !== undefined ? item.id : undefined,
828
+ id: item.id !== undefined ? {
829
+ equals: item.id
830
+ } : undefined,
831
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
832
+ equals: item.alpacaAccountId
833
+ } : undefined,
834
+ assetId: item.assetId !== undefined ? {
835
+ equals: item.assetId
836
+ } : undefined,
733
837
  },
734
838
  update: {
735
839
  id: item.id !== undefined ? {
@@ -787,7 +891,18 @@ export const Authenticator = {
787
891
  orders: item.orders ? {
788
892
  upsert: item.orders.map((item) => ({
789
893
  where: {
790
- id: item.id !== undefined ? item.id : undefined,
894
+ id: item.id !== undefined ? {
895
+ equals: item.id
896
+ } : undefined,
897
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
898
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
899
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
900
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
901
+ equals: item.alpacaAccountId
902
+ } : undefined,
903
+ assetId: item.assetId !== undefined ? {
904
+ equals: item.assetId
905
+ } : undefined,
791
906
  },
792
907
  update: {
793
908
  id: item.id !== undefined ? {
@@ -889,7 +1004,15 @@ export const Authenticator = {
889
1004
  positions: item.positions ? {
890
1005
  upsert: item.positions.map((item) => ({
891
1006
  where: {
892
- id: item.id !== undefined ? item.id : undefined,
1007
+ id: item.id !== undefined ? {
1008
+ equals: item.id
1009
+ } : undefined,
1010
+ assetId: item.assetId !== undefined ? {
1011
+ equals: item.assetId
1012
+ } : undefined,
1013
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1014
+ equals: item.alpacaAccountId
1015
+ } : undefined,
893
1016
  },
894
1017
  update: {
895
1018
  id: item.id !== undefined ? {
@@ -955,7 +1078,12 @@ export const Authenticator = {
955
1078
  alerts: item.alerts ? {
956
1079
  upsert: item.alerts.map((item) => ({
957
1080
  where: {
958
- id: item.id !== undefined ? item.id : undefined,
1081
+ id: item.id !== undefined ? {
1082
+ equals: item.id
1083
+ } : undefined,
1084
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1085
+ equals: item.alpacaAccountId
1086
+ } : undefined,
959
1087
  },
960
1088
  update: {
961
1089
  id: item.id !== undefined ? {
@@ -997,7 +1125,15 @@ export const Authenticator = {
997
1125
  }
998
1126
  : { connectOrCreate: item.trades.map((item) => ({
999
1127
  where: {
1000
- id: item.id !== undefined ? item.id : undefined,
1128
+ id: item.id !== undefined ? {
1129
+ equals: item.id
1130
+ } : undefined,
1131
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1132
+ equals: item.alpacaAccountId
1133
+ } : undefined,
1134
+ assetId: item.assetId !== undefined ? {
1135
+ equals: item.assetId
1136
+ } : undefined,
1001
1137
  },
1002
1138
  create: {
1003
1139
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -1022,7 +1158,18 @@ export const Authenticator = {
1022
1158
  }
1023
1159
  : { connectOrCreate: item.orders.map((item) => ({
1024
1160
  where: {
1025
- id: item.id !== undefined ? item.id : undefined,
1161
+ id: item.id !== undefined ? {
1162
+ equals: item.id
1163
+ } : undefined,
1164
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1165
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1166
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1167
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1168
+ equals: item.alpacaAccountId
1169
+ } : undefined,
1170
+ assetId: item.assetId !== undefined ? {
1171
+ equals: item.assetId
1172
+ } : undefined,
1026
1173
  },
1027
1174
  create: {
1028
1175
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1058,7 +1205,15 @@ export const Authenticator = {
1058
1205
  }
1059
1206
  : { connectOrCreate: item.positions.map((item) => ({
1060
1207
  where: {
1061
- id: item.id !== undefined ? item.id : undefined,
1208
+ id: item.id !== undefined ? {
1209
+ equals: item.id
1210
+ } : undefined,
1211
+ assetId: item.assetId !== undefined ? {
1212
+ equals: item.assetId
1213
+ } : undefined,
1214
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1215
+ equals: item.alpacaAccountId
1216
+ } : undefined,
1062
1217
  },
1063
1218
  create: {
1064
1219
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1085,7 +1240,12 @@ export const Authenticator = {
1085
1240
  }
1086
1241
  : { connectOrCreate: item.alerts.map((item) => ({
1087
1242
  where: {
1088
- id: item.id !== undefined ? item.id : undefined,
1243
+ id: item.id !== undefined ? {
1244
+ equals: item.id
1245
+ } : undefined,
1246
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1247
+ equals: item.alpacaAccountId
1248
+ } : undefined,
1089
1249
  },
1090
1250
  create: {
1091
1251
  message: item.message !== undefined ? item.message : undefined,
@@ -1118,10 +1278,20 @@ export const Authenticator = {
1118
1278
  }
1119
1279
  : { connectOrCreate: {
1120
1280
  where: {
1121
- id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
1281
+ id: props.user.customer.id !== undefined ? {
1282
+ equals: props.user.customer.id
1283
+ } : undefined,
1284
+ stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
1285
+ stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
1286
+ authUserId: props.user.customer.authUserId !== undefined ? {
1287
+ equals: props.user.customer.authUserId
1288
+ } : undefined,
1122
1289
  name: props.user.customer.name !== undefined ? {
1123
1290
  equals: props.user.customer.name
1124
1291
  } : undefined,
1292
+ stripePriceId: props.user.customer.stripePriceId !== undefined ? {
1293
+ equals: props.user.customer.stripePriceId
1294
+ } : undefined,
1125
1295
  },
1126
1296
  create: {
1127
1297
  authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
@@ -1142,7 +1312,15 @@ export const Authenticator = {
1142
1312
  }
1143
1313
  : { connectOrCreate: props.user.accounts.map((item) => ({
1144
1314
  where: {
1145
- id: item.id !== undefined ? item.id : undefined,
1315
+ id: item.id !== undefined ? {
1316
+ equals: item.id
1317
+ } : undefined,
1318
+ userId: item.userId !== undefined ? {
1319
+ equals: item.userId
1320
+ } : undefined,
1321
+ providerAccountId: item.providerAccountId !== undefined ? {
1322
+ equals: item.providerAccountId
1323
+ } : undefined,
1146
1324
  },
1147
1325
  create: {
1148
1326
  type: item.type !== undefined ? item.type : undefined,
@@ -1166,7 +1344,12 @@ export const Authenticator = {
1166
1344
  }
1167
1345
  : { connectOrCreate: props.user.sessions.map((item) => ({
1168
1346
  where: {
1169
- id: item.id !== undefined ? item.id : undefined,
1347
+ id: item.id !== undefined ? {
1348
+ equals: item.id
1349
+ } : undefined,
1350
+ userId: item.userId !== undefined ? {
1351
+ equals: item.userId
1352
+ } : undefined,
1170
1353
  },
1171
1354
  create: {
1172
1355
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -1182,7 +1365,12 @@ export const Authenticator = {
1182
1365
  }
1183
1366
  : { connectOrCreate: props.user.alpacaAccounts.map((item) => ({
1184
1367
  where: {
1185
- id: item.id !== undefined ? item.id : undefined,
1368
+ id: item.id !== undefined ? {
1369
+ equals: item.id
1370
+ } : undefined,
1371
+ userId: item.userId !== undefined ? {
1372
+ equals: item.userId
1373
+ } : undefined,
1186
1374
  },
1187
1375
  create: {
1188
1376
  type: item.type !== undefined ? item.type : undefined,
@@ -1202,7 +1390,15 @@ export const Authenticator = {
1202
1390
  }
1203
1391
  : { connectOrCreate: item.trades.map((item) => ({
1204
1392
  where: {
1205
- id: item.id !== undefined ? item.id : undefined,
1393
+ id: item.id !== undefined ? {
1394
+ equals: item.id
1395
+ } : undefined,
1396
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1397
+ equals: item.alpacaAccountId
1398
+ } : undefined,
1399
+ assetId: item.assetId !== undefined ? {
1400
+ equals: item.assetId
1401
+ } : undefined,
1206
1402
  },
1207
1403
  create: {
1208
1404
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -1227,7 +1423,18 @@ export const Authenticator = {
1227
1423
  }
1228
1424
  : { connectOrCreate: item.orders.map((item) => ({
1229
1425
  where: {
1230
- id: item.id !== undefined ? item.id : undefined,
1426
+ id: item.id !== undefined ? {
1427
+ equals: item.id
1428
+ } : undefined,
1429
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1430
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1431
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1432
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1433
+ equals: item.alpacaAccountId
1434
+ } : undefined,
1435
+ assetId: item.assetId !== undefined ? {
1436
+ equals: item.assetId
1437
+ } : undefined,
1231
1438
  },
1232
1439
  create: {
1233
1440
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1263,7 +1470,15 @@ export const Authenticator = {
1263
1470
  }
1264
1471
  : { connectOrCreate: item.positions.map((item) => ({
1265
1472
  where: {
1266
- id: item.id !== undefined ? item.id : undefined,
1473
+ id: item.id !== undefined ? {
1474
+ equals: item.id
1475
+ } : undefined,
1476
+ assetId: item.assetId !== undefined ? {
1477
+ equals: item.assetId
1478
+ } : undefined,
1479
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1480
+ equals: item.alpacaAccountId
1481
+ } : undefined,
1267
1482
  },
1268
1483
  create: {
1269
1484
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1290,7 +1505,12 @@ export const Authenticator = {
1290
1505
  }
1291
1506
  : { connectOrCreate: item.alerts.map((item) => ({
1292
1507
  where: {
1293
- id: item.id !== undefined ? item.id : undefined,
1508
+ id: item.id !== undefined ? {
1509
+ equals: item.id
1510
+ } : undefined,
1511
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1512
+ equals: item.alpacaAccountId
1513
+ } : undefined,
1294
1514
  },
1295
1515
  create: {
1296
1516
  message: item.message !== undefined ? item.message : undefined,
@@ -1339,9 +1559,13 @@ export const Authenticator = {
1339
1559
  }`;
1340
1560
  const variables = props.map(prop => ({
1341
1561
  where: {
1342
- id: prop.id !== undefined ? prop.id : undefined,
1562
+ id: prop.id !== undefined ? {
1563
+ equals: prop.id
1564
+ } : undefined,
1343
1565
  credentialID: prop.credentialID !== undefined ? prop.credentialID : undefined,
1344
- userId: prop.userId !== undefined ? prop.userId : undefined,
1566
+ userId: prop.userId !== undefined ? {
1567
+ equals: prop.userId
1568
+ } : undefined,
1345
1569
  publicKey: prop.publicKey !== undefined ? prop.publicKey : undefined,
1346
1570
  counter: prop.counter !== undefined ? prop.counter : undefined,
1347
1571
  createdAt: prop.createdAt !== undefined ? prop.createdAt : undefined,
@@ -1422,9 +1646,21 @@ export const Authenticator = {
1422
1646
  id: prop.user.customer.id !== undefined ? {
1423
1647
  equals: prop.user.customer.id
1424
1648
  } : undefined,
1649
+ authUserId: prop.user.customer.authUserId !== undefined ? {
1650
+ equals: prop.user.customer.authUserId
1651
+ } : undefined,
1425
1652
  name: prop.user.customer.name !== undefined ? {
1426
1653
  equals: prop.user.customer.name
1427
1654
  } : undefined,
1655
+ stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? {
1656
+ equals: prop.user.customer.stripeCustomerId
1657
+ } : undefined,
1658
+ stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? {
1659
+ equals: prop.user.customer.stripeSubscriptionId
1660
+ } : undefined,
1661
+ stripePriceId: prop.user.customer.stripePriceId !== undefined ? {
1662
+ equals: prop.user.customer.stripePriceId
1663
+ } : undefined,
1428
1664
  },
1429
1665
  update: {
1430
1666
  authUserId: prop.user.customer.authUserId !== undefined ? {
@@ -1463,7 +1699,15 @@ export const Authenticator = {
1463
1699
  accounts: prop.user.accounts ? {
1464
1700
  upsert: prop.user.accounts.map((item) => ({
1465
1701
  where: {
1466
- id: item.id !== undefined ? item.id : undefined,
1702
+ id: item.id !== undefined ? {
1703
+ equals: item.id
1704
+ } : undefined,
1705
+ userId: item.userId !== undefined ? {
1706
+ equals: item.userId
1707
+ } : undefined,
1708
+ providerAccountId: item.providerAccountId !== undefined ? {
1709
+ equals: item.providerAccountId
1710
+ } : undefined,
1467
1711
  },
1468
1712
  update: {
1469
1713
  id: item.id !== undefined ? {
@@ -1517,7 +1761,12 @@ export const Authenticator = {
1517
1761
  sessions: prop.user.sessions ? {
1518
1762
  upsert: prop.user.sessions.map((item) => ({
1519
1763
  where: {
1520
- id: item.id !== undefined ? item.id : undefined,
1764
+ id: item.id !== undefined ? {
1765
+ equals: item.id
1766
+ } : undefined,
1767
+ userId: item.userId !== undefined ? {
1768
+ equals: item.userId
1769
+ } : undefined,
1521
1770
  },
1522
1771
  update: {
1523
1772
  id: item.id !== undefined ? {
@@ -1539,7 +1788,12 @@ export const Authenticator = {
1539
1788
  alpacaAccounts: prop.user.alpacaAccounts ? {
1540
1789
  upsert: prop.user.alpacaAccounts.map((item) => ({
1541
1790
  where: {
1542
- id: item.id !== undefined ? item.id : undefined,
1791
+ id: item.id !== undefined ? {
1792
+ equals: item.id
1793
+ } : undefined,
1794
+ userId: item.userId !== undefined ? {
1795
+ equals: item.userId
1796
+ } : undefined,
1543
1797
  },
1544
1798
  update: {
1545
1799
  id: item.id !== undefined ? {
@@ -1575,7 +1829,15 @@ export const Authenticator = {
1575
1829
  trades: item.trades ? {
1576
1830
  upsert: item.trades.map((item) => ({
1577
1831
  where: {
1578
- id: item.id !== undefined ? item.id : undefined,
1832
+ id: item.id !== undefined ? {
1833
+ equals: item.id
1834
+ } : undefined,
1835
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1836
+ equals: item.alpacaAccountId
1837
+ } : undefined,
1838
+ assetId: item.assetId !== undefined ? {
1839
+ equals: item.assetId
1840
+ } : undefined,
1579
1841
  },
1580
1842
  update: {
1581
1843
  id: item.id !== undefined ? {
@@ -1633,7 +1895,18 @@ export const Authenticator = {
1633
1895
  orders: item.orders ? {
1634
1896
  upsert: item.orders.map((item) => ({
1635
1897
  where: {
1636
- id: item.id !== undefined ? item.id : undefined,
1898
+ id: item.id !== undefined ? {
1899
+ equals: item.id
1900
+ } : undefined,
1901
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1902
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1903
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1904
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1905
+ equals: item.alpacaAccountId
1906
+ } : undefined,
1907
+ assetId: item.assetId !== undefined ? {
1908
+ equals: item.assetId
1909
+ } : undefined,
1637
1910
  },
1638
1911
  update: {
1639
1912
  id: item.id !== undefined ? {
@@ -1735,7 +2008,15 @@ export const Authenticator = {
1735
2008
  positions: item.positions ? {
1736
2009
  upsert: item.positions.map((item) => ({
1737
2010
  where: {
1738
- id: item.id !== undefined ? item.id : undefined,
2011
+ id: item.id !== undefined ? {
2012
+ equals: item.id
2013
+ } : undefined,
2014
+ assetId: item.assetId !== undefined ? {
2015
+ equals: item.assetId
2016
+ } : undefined,
2017
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2018
+ equals: item.alpacaAccountId
2019
+ } : undefined,
1739
2020
  },
1740
2021
  update: {
1741
2022
  id: item.id !== undefined ? {
@@ -1801,7 +2082,12 @@ export const Authenticator = {
1801
2082
  alerts: item.alerts ? {
1802
2083
  upsert: item.alerts.map((item) => ({
1803
2084
  where: {
1804
- id: item.id !== undefined ? item.id : undefined,
2085
+ id: item.id !== undefined ? {
2086
+ equals: item.id
2087
+ } : undefined,
2088
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2089
+ equals: item.alpacaAccountId
2090
+ } : undefined,
1805
2091
  },
1806
2092
  update: {
1807
2093
  id: item.id !== undefined ? {
@@ -1843,7 +2129,15 @@ export const Authenticator = {
1843
2129
  }
1844
2130
  : { connectOrCreate: item.trades.map((item) => ({
1845
2131
  where: {
1846
- id: item.id !== undefined ? item.id : undefined,
2132
+ id: item.id !== undefined ? {
2133
+ equals: item.id
2134
+ } : undefined,
2135
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2136
+ equals: item.alpacaAccountId
2137
+ } : undefined,
2138
+ assetId: item.assetId !== undefined ? {
2139
+ equals: item.assetId
2140
+ } : undefined,
1847
2141
  },
1848
2142
  create: {
1849
2143
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -1868,7 +2162,18 @@ export const Authenticator = {
1868
2162
  }
1869
2163
  : { connectOrCreate: item.orders.map((item) => ({
1870
2164
  where: {
1871
- id: item.id !== undefined ? item.id : undefined,
2165
+ id: item.id !== undefined ? {
2166
+ equals: item.id
2167
+ } : undefined,
2168
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2169
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2170
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2171
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2172
+ equals: item.alpacaAccountId
2173
+ } : undefined,
2174
+ assetId: item.assetId !== undefined ? {
2175
+ equals: item.assetId
2176
+ } : undefined,
1872
2177
  },
1873
2178
  create: {
1874
2179
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1904,7 +2209,15 @@ export const Authenticator = {
1904
2209
  }
1905
2210
  : { connectOrCreate: item.positions.map((item) => ({
1906
2211
  where: {
1907
- id: item.id !== undefined ? item.id : undefined,
2212
+ id: item.id !== undefined ? {
2213
+ equals: item.id
2214
+ } : undefined,
2215
+ assetId: item.assetId !== undefined ? {
2216
+ equals: item.assetId
2217
+ } : undefined,
2218
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2219
+ equals: item.alpacaAccountId
2220
+ } : undefined,
1908
2221
  },
1909
2222
  create: {
1910
2223
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1931,7 +2244,12 @@ export const Authenticator = {
1931
2244
  }
1932
2245
  : { connectOrCreate: item.alerts.map((item) => ({
1933
2246
  where: {
1934
- id: item.id !== undefined ? item.id : undefined,
2247
+ id: item.id !== undefined ? {
2248
+ equals: item.id
2249
+ } : undefined,
2250
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2251
+ equals: item.alpacaAccountId
2252
+ } : undefined,
1935
2253
  },
1936
2254
  create: {
1937
2255
  message: item.message !== undefined ? item.message : undefined,
@@ -1964,10 +2282,20 @@ export const Authenticator = {
1964
2282
  }
1965
2283
  : { connectOrCreate: {
1966
2284
  where: {
1967
- id: prop.user.customer.id !== undefined ? prop.user.customer.id : undefined,
2285
+ id: prop.user.customer.id !== undefined ? {
2286
+ equals: prop.user.customer.id
2287
+ } : undefined,
2288
+ stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? prop.user.customer.stripeCustomerId : undefined,
2289
+ stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? prop.user.customer.stripeSubscriptionId : undefined,
2290
+ authUserId: prop.user.customer.authUserId !== undefined ? {
2291
+ equals: prop.user.customer.authUserId
2292
+ } : undefined,
1968
2293
  name: prop.user.customer.name !== undefined ? {
1969
2294
  equals: prop.user.customer.name
1970
2295
  } : undefined,
2296
+ stripePriceId: prop.user.customer.stripePriceId !== undefined ? {
2297
+ equals: prop.user.customer.stripePriceId
2298
+ } : undefined,
1971
2299
  },
1972
2300
  create: {
1973
2301
  authUserId: prop.user.customer.authUserId !== undefined ? prop.user.customer.authUserId : undefined,
@@ -1988,7 +2316,15 @@ export const Authenticator = {
1988
2316
  }
1989
2317
  : { connectOrCreate: prop.user.accounts.map((item) => ({
1990
2318
  where: {
1991
- id: item.id !== undefined ? item.id : undefined,
2319
+ id: item.id !== undefined ? {
2320
+ equals: item.id
2321
+ } : undefined,
2322
+ userId: item.userId !== undefined ? {
2323
+ equals: item.userId
2324
+ } : undefined,
2325
+ providerAccountId: item.providerAccountId !== undefined ? {
2326
+ equals: item.providerAccountId
2327
+ } : undefined,
1992
2328
  },
1993
2329
  create: {
1994
2330
  type: item.type !== undefined ? item.type : undefined,
@@ -2012,7 +2348,12 @@ export const Authenticator = {
2012
2348
  }
2013
2349
  : { connectOrCreate: prop.user.sessions.map((item) => ({
2014
2350
  where: {
2015
- id: item.id !== undefined ? item.id : undefined,
2351
+ id: item.id !== undefined ? {
2352
+ equals: item.id
2353
+ } : undefined,
2354
+ userId: item.userId !== undefined ? {
2355
+ equals: item.userId
2356
+ } : undefined,
2016
2357
  },
2017
2358
  create: {
2018
2359
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -2028,7 +2369,12 @@ export const Authenticator = {
2028
2369
  }
2029
2370
  : { connectOrCreate: prop.user.alpacaAccounts.map((item) => ({
2030
2371
  where: {
2031
- id: item.id !== undefined ? item.id : undefined,
2372
+ id: item.id !== undefined ? {
2373
+ equals: item.id
2374
+ } : undefined,
2375
+ userId: item.userId !== undefined ? {
2376
+ equals: item.userId
2377
+ } : undefined,
2032
2378
  },
2033
2379
  create: {
2034
2380
  type: item.type !== undefined ? item.type : undefined,
@@ -2048,7 +2394,15 @@ export const Authenticator = {
2048
2394
  }
2049
2395
  : { connectOrCreate: item.trades.map((item) => ({
2050
2396
  where: {
2051
- id: item.id !== undefined ? item.id : undefined,
2397
+ id: item.id !== undefined ? {
2398
+ equals: item.id
2399
+ } : undefined,
2400
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2401
+ equals: item.alpacaAccountId
2402
+ } : undefined,
2403
+ assetId: item.assetId !== undefined ? {
2404
+ equals: item.assetId
2405
+ } : undefined,
2052
2406
  },
2053
2407
  create: {
2054
2408
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2073,7 +2427,18 @@ export const Authenticator = {
2073
2427
  }
2074
2428
  : { connectOrCreate: item.orders.map((item) => ({
2075
2429
  where: {
2076
- id: item.id !== undefined ? item.id : undefined,
2430
+ id: item.id !== undefined ? {
2431
+ equals: item.id
2432
+ } : undefined,
2433
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2434
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2435
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2436
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2437
+ equals: item.alpacaAccountId
2438
+ } : undefined,
2439
+ assetId: item.assetId !== undefined ? {
2440
+ equals: item.assetId
2441
+ } : undefined,
2077
2442
  },
2078
2443
  create: {
2079
2444
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2109,7 +2474,15 @@ export const Authenticator = {
2109
2474
  }
2110
2475
  : { connectOrCreate: item.positions.map((item) => ({
2111
2476
  where: {
2112
- id: item.id !== undefined ? item.id : undefined,
2477
+ id: item.id !== undefined ? {
2478
+ equals: item.id
2479
+ } : undefined,
2480
+ assetId: item.assetId !== undefined ? {
2481
+ equals: item.assetId
2482
+ } : undefined,
2483
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2484
+ equals: item.alpacaAccountId
2485
+ } : undefined,
2113
2486
  },
2114
2487
  create: {
2115
2488
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2136,7 +2509,12 @@ export const Authenticator = {
2136
2509
  }
2137
2510
  : { connectOrCreate: item.alerts.map((item) => ({
2138
2511
  where: {
2139
- id: item.id !== undefined ? item.id : undefined,
2512
+ id: item.id !== undefined ? {
2513
+ equals: item.id
2514
+ } : undefined,
2515
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2516
+ equals: item.alpacaAccountId
2517
+ } : undefined,
2140
2518
  },
2141
2519
  create: {
2142
2520
  message: item.message !== undefined ? item.message : undefined,
@@ -2220,9 +2598,13 @@ export const Authenticator = {
2220
2598
  }`;
2221
2599
  const variables = {
2222
2600
  where: {
2223
- id: props.id !== undefined ? props.id : undefined,
2601
+ id: props.id !== undefined ? {
2602
+ equals: props.id
2603
+ } : undefined,
2224
2604
  credentialID: props.credentialID !== undefined ? props.credentialID : undefined,
2225
- userId: props.userId !== undefined ? props.userId : undefined,
2605
+ userId: props.userId !== undefined ? {
2606
+ equals: props.userId
2607
+ } : undefined,
2226
2608
  publicKey: props.publicKey !== undefined ? props.publicKey : undefined,
2227
2609
  counter: props.counter !== undefined ? props.counter : undefined,
2228
2610
  createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
@@ -2292,7 +2674,9 @@ export const Authenticator = {
2292
2674
  id: props.id !== undefined ? {
2293
2675
  equals: props.id
2294
2676
  } : undefined,
2295
- userId: props.userId !== undefined ? props.userId : undefined,
2677
+ userId: props.userId !== undefined ? {
2678
+ equals: props.userId
2679
+ } : undefined,
2296
2680
  credentialID: props.credentialID !== undefined ? props.credentialID : undefined,
2297
2681
  publicKey: props.publicKey !== undefined ? props.publicKey : undefined,
2298
2682
  counter: props.counter !== undefined ? props.counter : undefined,