adaptic-backend 1.0.78 → 1.0.79

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 (53) hide show
  1. package/Account.cjs +45 -54
  2. package/Alert.cjs +45 -54
  3. package/AlpacaAccount.cjs +80 -96
  4. package/Asset.cjs +35 -42
  5. package/Authenticator.cjs +45 -54
  6. package/Customer.cjs +65 -78
  7. package/NewsArticle.cjs +5 -6
  8. package/NewsArticleAssetSentiment.cjs +45 -54
  9. package/Order.cjs +90 -108
  10. package/Position.cjs +90 -108
  11. package/Session.cjs +45 -54
  12. package/Trade.cjs +95 -114
  13. package/User.cjs +80 -96
  14. package/package.json +1 -1
  15. package/server/Account.d.ts.map +1 -1
  16. package/server/Account.js.map +1 -1
  17. package/server/Account.mjs +45 -54
  18. package/server/Alert.d.ts.map +1 -1
  19. package/server/Alert.js.map +1 -1
  20. package/server/Alert.mjs +45 -54
  21. package/server/AlpacaAccount.d.ts.map +1 -1
  22. package/server/AlpacaAccount.js.map +1 -1
  23. package/server/AlpacaAccount.mjs +80 -96
  24. package/server/Asset.d.ts.map +1 -1
  25. package/server/Asset.js.map +1 -1
  26. package/server/Asset.mjs +35 -42
  27. package/server/Authenticator.d.ts.map +1 -1
  28. package/server/Authenticator.js.map +1 -1
  29. package/server/Authenticator.mjs +45 -54
  30. package/server/Customer.d.ts.map +1 -1
  31. package/server/Customer.js.map +1 -1
  32. package/server/Customer.mjs +65 -78
  33. package/server/NewsArticle.d.ts.map +1 -1
  34. package/server/NewsArticle.js.map +1 -1
  35. package/server/NewsArticle.mjs +5 -6
  36. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  37. package/server/NewsArticleAssetSentiment.js.map +1 -1
  38. package/server/NewsArticleAssetSentiment.mjs +45 -54
  39. package/server/Order.d.ts.map +1 -1
  40. package/server/Order.js.map +1 -1
  41. package/server/Order.mjs +90 -108
  42. package/server/Position.d.ts.map +1 -1
  43. package/server/Position.js.map +1 -1
  44. package/server/Position.mjs +90 -108
  45. package/server/Session.d.ts.map +1 -1
  46. package/server/Session.js.map +1 -1
  47. package/server/Session.mjs +45 -54
  48. package/server/Trade.d.ts.map +1 -1
  49. package/server/Trade.js.map +1 -1
  50. package/server/Trade.mjs +95 -114
  51. package/server/User.d.ts.map +1 -1
  52. package/server/User.js.map +1 -1
  53. package/server/User.mjs +80 -96
package/AlpacaAccount.cjs CHANGED
@@ -349,12 +349,11 @@ exports.AlpacaAccount = {
349
349
  }
350
350
  } : undefined,
351
351
  accounts: props.user.accounts ?
352
- Array.isArray(props.user.accounts) && props.user.accounts.length > 0
353
- ? props.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
354
- connect: props.user.accounts.map((item) => ({
355
- id: item.id
356
- }))
357
- }
352
+ Array.isArray(props.user.accounts) && props.user.accounts.length > 0 && props.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
353
+ connect: props.user.accounts.map((item) => ({
354
+ id: item.id
355
+ }))
356
+ }
358
357
  : { connectOrCreate: props.user.accounts.map((item) => ({
359
358
  where: {
360
359
  id: item.id !== undefined ? item.id : undefined,
@@ -374,12 +373,11 @@ exports.AlpacaAccount = {
374
373
  }))
375
374
  } : undefined,
376
375
  sessions: props.user.sessions ?
377
- Array.isArray(props.user.sessions) && props.user.sessions.length > 0
378
- ? props.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
379
- connect: props.user.sessions.map((item) => ({
380
- id: item.id
381
- }))
382
- }
376
+ Array.isArray(props.user.sessions) && props.user.sessions.length > 0 && props.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
377
+ connect: props.user.sessions.map((item) => ({
378
+ id: item.id
379
+ }))
380
+ }
383
381
  : { connectOrCreate: props.user.sessions.map((item) => ({
384
382
  where: {
385
383
  id: item.id !== undefined ? item.id : undefined,
@@ -391,12 +389,11 @@ exports.AlpacaAccount = {
391
389
  }))
392
390
  } : undefined,
393
391
  authenticators: props.user.authenticators ?
394
- Array.isArray(props.user.authenticators) && props.user.authenticators.length > 0
395
- ? props.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
396
- connect: props.user.authenticators.map((item) => ({
397
- id: item.id
398
- }))
399
- }
392
+ Array.isArray(props.user.authenticators) && props.user.authenticators.length > 0 && props.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
393
+ connect: props.user.authenticators.map((item) => ({
394
+ id: item.id
395
+ }))
396
+ }
400
397
  : { connectOrCreate: props.user.authenticators.map((item) => ({
401
398
  where: {
402
399
  id: item.id !== undefined ? item.id : undefined,
@@ -412,12 +409,11 @@ exports.AlpacaAccount = {
412
409
  }
413
410
  } : undefined,
414
411
  trades: props.trades ?
415
- Array.isArray(props.trades) && props.trades.length > 0
416
- ? props.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
417
- connect: props.trades.map((item) => ({
418
- id: item.id
419
- }))
420
- }
412
+ Array.isArray(props.trades) && props.trades.length > 0 && props.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
413
+ connect: props.trades.map((item) => ({
414
+ id: item.id
415
+ }))
416
+ }
421
417
  : { connectOrCreate: props.trades.map((item) => ({
422
418
  where: {
423
419
  id: item.id !== undefined ? item.id : undefined,
@@ -505,12 +501,11 @@ exports.AlpacaAccount = {
505
501
  }
506
502
  } : undefined,
507
503
  actions: item.actions ?
508
- Array.isArray(item.actions) && item.actions.length > 0
509
- ? item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
510
- connect: item.actions.map((item) => ({
511
- id: item.id
512
- }))
513
- }
504
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
505
+ connect: item.actions.map((item) => ({
506
+ id: item.id
507
+ }))
508
+ }
514
509
  : { connectOrCreate: item.actions.map((item) => ({
515
510
  where: {
516
511
  id: item.id !== undefined ? item.id : undefined,
@@ -528,12 +523,11 @@ exports.AlpacaAccount = {
528
523
  }))
529
524
  } : undefined,
530
525
  orders: props.orders ?
531
- Array.isArray(props.orders) && props.orders.length > 0
532
- ? props.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
533
- connect: props.orders.map((item) => ({
534
- id: item.id
535
- }))
536
- }
526
+ Array.isArray(props.orders) && props.orders.length > 0 && props.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
527
+ connect: props.orders.map((item) => ({
528
+ id: item.id
529
+ }))
530
+ }
537
531
  : { connectOrCreate: props.orders.map((item) => ({
538
532
  where: {
539
533
  id: item.id !== undefined ? item.id : undefined,
@@ -649,12 +643,11 @@ exports.AlpacaAccount = {
649
643
  }))
650
644
  } : undefined,
651
645
  positions: props.positions ?
652
- Array.isArray(props.positions) && props.positions.length > 0
653
- ? props.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
654
- connect: props.positions.map((item) => ({
655
- id: item.id
656
- }))
657
- }
646
+ Array.isArray(props.positions) && props.positions.length > 0 && props.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
647
+ connect: props.positions.map((item) => ({
648
+ id: item.id
649
+ }))
650
+ }
658
651
  : { connectOrCreate: props.positions.map((item) => ({
659
652
  where: {
660
653
  id: item.id !== undefined ? item.id : undefined,
@@ -748,12 +741,11 @@ exports.AlpacaAccount = {
748
741
  }))
749
742
  } : undefined,
750
743
  alerts: props.alerts ?
751
- Array.isArray(props.alerts) && props.alerts.length > 0
752
- ? props.alerts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
753
- connect: props.alerts.map((item) => ({
754
- id: item.id
755
- }))
756
- }
744
+ Array.isArray(props.alerts) && props.alerts.length > 0 && props.alerts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
745
+ connect: props.alerts.map((item) => ({
746
+ id: item.id
747
+ }))
748
+ }
757
749
  : { connectOrCreate: props.alerts.map((item) => ({
758
750
  where: {
759
751
  id: item.id !== undefined ? item.id : undefined,
@@ -1363,12 +1355,11 @@ exports.AlpacaAccount = {
1363
1355
  }
1364
1356
  } : undefined,
1365
1357
  accounts: props.user.accounts ?
1366
- Array.isArray(props.user.accounts) && props.user.accounts.length > 0
1367
- ? props.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1368
- connect: props.user.accounts.map((item) => ({
1369
- id: item.id
1370
- }))
1371
- }
1358
+ Array.isArray(props.user.accounts) && props.user.accounts.length > 0 && props.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1359
+ connect: props.user.accounts.map((item) => ({
1360
+ id: item.id
1361
+ }))
1362
+ }
1372
1363
  : { connectOrCreate: props.user.accounts.map((item) => ({
1373
1364
  where: {
1374
1365
  id: item.id !== undefined ? item.id : undefined,
@@ -1388,12 +1379,11 @@ exports.AlpacaAccount = {
1388
1379
  }))
1389
1380
  } : undefined,
1390
1381
  sessions: props.user.sessions ?
1391
- Array.isArray(props.user.sessions) && props.user.sessions.length > 0
1392
- ? props.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1393
- connect: props.user.sessions.map((item) => ({
1394
- id: item.id
1395
- }))
1396
- }
1382
+ Array.isArray(props.user.sessions) && props.user.sessions.length > 0 && props.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1383
+ connect: props.user.sessions.map((item) => ({
1384
+ id: item.id
1385
+ }))
1386
+ }
1397
1387
  : { connectOrCreate: props.user.sessions.map((item) => ({
1398
1388
  where: {
1399
1389
  id: item.id !== undefined ? item.id : undefined,
@@ -1405,12 +1395,11 @@ exports.AlpacaAccount = {
1405
1395
  }))
1406
1396
  } : undefined,
1407
1397
  authenticators: props.user.authenticators ?
1408
- Array.isArray(props.user.authenticators) && props.user.authenticators.length > 0
1409
- ? props.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1410
- connect: props.user.authenticators.map((item) => ({
1411
- id: item.id
1412
- }))
1413
- }
1398
+ Array.isArray(props.user.authenticators) && props.user.authenticators.length > 0 && props.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1399
+ connect: props.user.authenticators.map((item) => ({
1400
+ id: item.id
1401
+ }))
1402
+ }
1414
1403
  : { connectOrCreate: props.user.authenticators.map((item) => ({
1415
1404
  where: {
1416
1405
  id: item.id !== undefined ? item.id : undefined,
@@ -1824,12 +1813,11 @@ exports.AlpacaAccount = {
1824
1813
  }
1825
1814
  } : undefined,
1826
1815
  actions: item.actions ?
1827
- Array.isArray(item.actions) && item.actions.length > 0
1828
- ? item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1829
- connect: item.actions.map((item) => ({
1830
- id: item.id
1831
- }))
1832
- }
1816
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1817
+ connect: item.actions.map((item) => ({
1818
+ id: item.id
1819
+ }))
1820
+ }
1833
1821
  : { connectOrCreate: item.actions.map((item) => ({
1834
1822
  where: {
1835
1823
  id: item.id !== undefined ? item.id : undefined,
@@ -2984,12 +2972,11 @@ exports.AlpacaAccount = {
2984
2972
  }
2985
2973
  } : undefined,
2986
2974
  accounts: prop.user.accounts ?
2987
- Array.isArray(prop.user.accounts) && prop.user.accounts.length > 0
2988
- ? prop.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
2989
- connect: prop.user.accounts.map((item) => ({
2990
- id: item.id
2991
- }))
2992
- }
2975
+ Array.isArray(prop.user.accounts) && prop.user.accounts.length > 0 && prop.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2976
+ connect: prop.user.accounts.map((item) => ({
2977
+ id: item.id
2978
+ }))
2979
+ }
2993
2980
  : { connectOrCreate: prop.user.accounts.map((item) => ({
2994
2981
  where: {
2995
2982
  id: item.id !== undefined ? item.id : undefined,
@@ -3009,12 +2996,11 @@ exports.AlpacaAccount = {
3009
2996
  }))
3010
2997
  } : undefined,
3011
2998
  sessions: prop.user.sessions ?
3012
- Array.isArray(prop.user.sessions) && prop.user.sessions.length > 0
3013
- ? prop.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
3014
- connect: prop.user.sessions.map((item) => ({
3015
- id: item.id
3016
- }))
3017
- }
2999
+ Array.isArray(prop.user.sessions) && prop.user.sessions.length > 0 && prop.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3000
+ connect: prop.user.sessions.map((item) => ({
3001
+ id: item.id
3002
+ }))
3003
+ }
3018
3004
  : { connectOrCreate: prop.user.sessions.map((item) => ({
3019
3005
  where: {
3020
3006
  id: item.id !== undefined ? item.id : undefined,
@@ -3026,12 +3012,11 @@ exports.AlpacaAccount = {
3026
3012
  }))
3027
3013
  } : undefined,
3028
3014
  authenticators: prop.user.authenticators ?
3029
- Array.isArray(prop.user.authenticators) && prop.user.authenticators.length > 0
3030
- ? prop.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
3031
- connect: prop.user.authenticators.map((item) => ({
3032
- id: item.id
3033
- }))
3034
- }
3015
+ Array.isArray(prop.user.authenticators) && prop.user.authenticators.length > 0 && prop.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3016
+ connect: prop.user.authenticators.map((item) => ({
3017
+ id: item.id
3018
+ }))
3019
+ }
3035
3020
  : { connectOrCreate: prop.user.authenticators.map((item) => ({
3036
3021
  where: {
3037
3022
  id: item.id !== undefined ? item.id : undefined,
@@ -3445,12 +3430,11 @@ exports.AlpacaAccount = {
3445
3430
  }
3446
3431
  } : undefined,
3447
3432
  actions: item.actions ?
3448
- Array.isArray(item.actions) && item.actions.length > 0
3449
- ? item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
3450
- connect: item.actions.map((item) => ({
3451
- id: item.id
3452
- }))
3453
- }
3433
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3434
+ connect: item.actions.map((item) => ({
3435
+ id: item.id
3436
+ }))
3437
+ }
3454
3438
  : { connectOrCreate: item.actions.map((item) => ({
3455
3439
  where: {
3456
3440
  id: item.id !== undefined ? item.id : undefined,
package/Asset.cjs CHANGED
@@ -324,12 +324,11 @@ exports.Asset = {
324
324
  sellPrice: props.sellPrice !== undefined ? props.sellPrice : undefined,
325
325
  buyPrice: props.buyPrice !== undefined ? props.buyPrice : undefined,
326
326
  trades: props.trades ?
327
- Array.isArray(props.trades) && props.trades.length > 0
328
- ? props.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
329
- connect: props.trades.map((item) => ({
330
- id: item.id
331
- }))
332
- }
327
+ Array.isArray(props.trades) && props.trades.length > 0 && props.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
328
+ connect: props.trades.map((item) => ({
329
+ id: item.id
330
+ }))
331
+ }
333
332
  : { connectOrCreate: props.trades.map((item) => ({
334
333
  where: {
335
334
  id: item.id !== undefined ? item.id : undefined,
@@ -365,12 +364,11 @@ exports.Asset = {
365
364
  }
366
365
  } : undefined,
367
366
  actions: item.actions ?
368
- Array.isArray(item.actions) && item.actions.length > 0
369
- ? item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
370
- connect: item.actions.map((item) => ({
371
- id: item.id
372
- }))
373
- }
367
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
368
+ connect: item.actions.map((item) => ({
369
+ id: item.id
370
+ }))
371
+ }
374
372
  : { connectOrCreate: item.actions.map((item) => ({
375
373
  where: {
376
374
  id: item.id !== undefined ? item.id : undefined,
@@ -388,12 +386,11 @@ exports.Asset = {
388
386
  }))
389
387
  } : undefined,
390
388
  orders: props.orders ?
391
- Array.isArray(props.orders) && props.orders.length > 0
392
- ? props.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
393
- connect: props.orders.map((item) => ({
394
- id: item.id
395
- }))
396
- }
389
+ Array.isArray(props.orders) && props.orders.length > 0 && props.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
390
+ connect: props.orders.map((item) => ({
391
+ id: item.id
392
+ }))
393
+ }
397
394
  : { connectOrCreate: props.orders.map((item) => ({
398
395
  where: {
399
396
  id: item.id !== undefined ? item.id : undefined,
@@ -457,12 +454,11 @@ exports.Asset = {
457
454
  }))
458
455
  } : undefined,
459
456
  positions: props.positions ?
460
- Array.isArray(props.positions) && props.positions.length > 0
461
- ? props.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
462
- connect: props.positions.map((item) => ({
463
- id: item.id
464
- }))
465
- }
457
+ Array.isArray(props.positions) && props.positions.length > 0 && props.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
458
+ connect: props.positions.map((item) => ({
459
+ id: item.id
460
+ }))
461
+ }
466
462
  : { connectOrCreate: props.positions.map((item) => ({
467
463
  where: {
468
464
  id: item.id !== undefined ? item.id : undefined,
@@ -504,12 +500,11 @@ exports.Asset = {
504
500
  }))
505
501
  } : undefined,
506
502
  newsMentions: props.newsMentions ?
507
- Array.isArray(props.newsMentions) && props.newsMentions.length > 0
508
- ? props.newsMentions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
509
- connect: props.newsMentions.map((item) => ({
510
- id: item.id
511
- }))
512
- }
503
+ Array.isArray(props.newsMentions) && props.newsMentions.length > 0 && props.newsMentions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
504
+ connect: props.newsMentions.map((item) => ({
505
+ id: item.id
506
+ }))
507
+ }
513
508
  : { connectOrCreate: props.newsMentions.map((item) => ({
514
509
  where: {
515
510
  id: item.id !== undefined ? item.id : undefined,
@@ -1241,12 +1236,11 @@ exports.Asset = {
1241
1236
  }
1242
1237
  } : undefined,
1243
1238
  actions: item.actions ?
1244
- Array.isArray(item.actions) && item.actions.length > 0
1245
- ? item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1246
- connect: item.actions.map((item) => ({
1247
- id: item.id
1248
- }))
1249
- }
1239
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1240
+ connect: item.actions.map((item) => ({
1241
+ id: item.id
1242
+ }))
1243
+ }
1250
1244
  : { connectOrCreate: item.actions.map((item) => ({
1251
1245
  where: {
1252
1246
  id: item.id !== undefined ? item.id : undefined,
@@ -2062,12 +2056,11 @@ exports.Asset = {
2062
2056
  }
2063
2057
  } : undefined,
2064
2058
  actions: item.actions ?
2065
- Array.isArray(item.actions) && item.actions.length > 0
2066
- ? item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
2067
- connect: item.actions.map((item) => ({
2068
- id: item.id
2069
- }))
2070
- }
2059
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2060
+ connect: item.actions.map((item) => ({
2061
+ id: item.id
2062
+ }))
2063
+ }
2071
2064
  : { connectOrCreate: item.actions.map((item) => ({
2072
2065
  where: {
2073
2066
  id: item.id !== undefined ? item.id : undefined,
package/Authenticator.cjs CHANGED
@@ -254,12 +254,11 @@ exports.Authenticator = {
254
254
  }
255
255
  } : undefined,
256
256
  accounts: props.user.accounts ?
257
- Array.isArray(props.user.accounts) && props.user.accounts.length > 0
258
- ? props.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
259
- connect: props.user.accounts.map((item) => ({
260
- id: item.id
261
- }))
262
- }
257
+ Array.isArray(props.user.accounts) && props.user.accounts.length > 0 && props.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
258
+ connect: props.user.accounts.map((item) => ({
259
+ id: item.id
260
+ }))
261
+ }
263
262
  : { connectOrCreate: props.user.accounts.map((item) => ({
264
263
  where: {
265
264
  id: item.id !== undefined ? item.id : undefined,
@@ -279,12 +278,11 @@ exports.Authenticator = {
279
278
  }))
280
279
  } : undefined,
281
280
  sessions: props.user.sessions ?
282
- Array.isArray(props.user.sessions) && props.user.sessions.length > 0
283
- ? props.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
284
- connect: props.user.sessions.map((item) => ({
285
- id: item.id
286
- }))
287
- }
281
+ Array.isArray(props.user.sessions) && props.user.sessions.length > 0 && props.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
282
+ connect: props.user.sessions.map((item) => ({
283
+ id: item.id
284
+ }))
285
+ }
288
286
  : { connectOrCreate: props.user.sessions.map((item) => ({
289
287
  where: {
290
288
  id: item.id !== undefined ? item.id : undefined,
@@ -296,12 +294,11 @@ exports.Authenticator = {
296
294
  }))
297
295
  } : undefined,
298
296
  alpacaAccounts: props.user.alpacaAccounts ?
299
- Array.isArray(props.user.alpacaAccounts) && props.user.alpacaAccounts.length > 0
300
- ? props.user.alpacaAccounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
301
- connect: props.user.alpacaAccounts.map((item) => ({
302
- id: item.id
303
- }))
304
- }
297
+ Array.isArray(props.user.alpacaAccounts) && props.user.alpacaAccounts.length > 0 && props.user.alpacaAccounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
298
+ connect: props.user.alpacaAccounts.map((item) => ({
299
+ id: item.id
300
+ }))
301
+ }
305
302
  : { connectOrCreate: props.user.alpacaAccounts.map((item) => ({
306
303
  where: {
307
304
  id: item.id !== undefined ? item.id : undefined,
@@ -823,12 +820,11 @@ exports.Authenticator = {
823
820
  }
824
821
  } : undefined,
825
822
  accounts: props.user.accounts ?
826
- Array.isArray(props.user.accounts) && props.user.accounts.length > 0
827
- ? props.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
828
- connect: props.user.accounts.map((item) => ({
829
- id: item.id
830
- }))
831
- }
823
+ Array.isArray(props.user.accounts) && props.user.accounts.length > 0 && props.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
824
+ connect: props.user.accounts.map((item) => ({
825
+ id: item.id
826
+ }))
827
+ }
832
828
  : { connectOrCreate: props.user.accounts.map((item) => ({
833
829
  where: {
834
830
  id: item.id !== undefined ? item.id : undefined,
@@ -848,12 +844,11 @@ exports.Authenticator = {
848
844
  }))
849
845
  } : undefined,
850
846
  sessions: props.user.sessions ?
851
- Array.isArray(props.user.sessions) && props.user.sessions.length > 0
852
- ? props.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
853
- connect: props.user.sessions.map((item) => ({
854
- id: item.id
855
- }))
856
- }
847
+ Array.isArray(props.user.sessions) && props.user.sessions.length > 0 && props.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
848
+ connect: props.user.sessions.map((item) => ({
849
+ id: item.id
850
+ }))
851
+ }
857
852
  : { connectOrCreate: props.user.sessions.map((item) => ({
858
853
  where: {
859
854
  id: item.id !== undefined ? item.id : undefined,
@@ -865,12 +860,11 @@ exports.Authenticator = {
865
860
  }))
866
861
  } : undefined,
867
862
  alpacaAccounts: props.user.alpacaAccounts ?
868
- Array.isArray(props.user.alpacaAccounts) && props.user.alpacaAccounts.length > 0
869
- ? props.user.alpacaAccounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
870
- connect: props.user.alpacaAccounts.map((item) => ({
871
- id: item.id
872
- }))
873
- }
863
+ Array.isArray(props.user.alpacaAccounts) && props.user.alpacaAccounts.length > 0 && props.user.alpacaAccounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
864
+ connect: props.user.alpacaAccounts.map((item) => ({
865
+ id: item.id
866
+ }))
867
+ }
874
868
  : { connectOrCreate: props.user.alpacaAccounts.map((item) => ({
875
869
  where: {
876
870
  id: item.id !== undefined ? item.id : undefined,
@@ -1176,12 +1170,11 @@ exports.Authenticator = {
1176
1170
  }
1177
1171
  } : undefined,
1178
1172
  accounts: prop.user.accounts ?
1179
- Array.isArray(prop.user.accounts) && prop.user.accounts.length > 0
1180
- ? prop.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1181
- connect: prop.user.accounts.map((item) => ({
1182
- id: item.id
1183
- }))
1184
- }
1173
+ Array.isArray(prop.user.accounts) && prop.user.accounts.length > 0 && prop.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1174
+ connect: prop.user.accounts.map((item) => ({
1175
+ id: item.id
1176
+ }))
1177
+ }
1185
1178
  : { connectOrCreate: prop.user.accounts.map((item) => ({
1186
1179
  where: {
1187
1180
  id: item.id !== undefined ? item.id : undefined,
@@ -1201,12 +1194,11 @@ exports.Authenticator = {
1201
1194
  }))
1202
1195
  } : undefined,
1203
1196
  sessions: prop.user.sessions ?
1204
- Array.isArray(prop.user.sessions) && prop.user.sessions.length > 0
1205
- ? prop.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1206
- connect: prop.user.sessions.map((item) => ({
1207
- id: item.id
1208
- }))
1209
- }
1197
+ Array.isArray(prop.user.sessions) && prop.user.sessions.length > 0 && prop.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1198
+ connect: prop.user.sessions.map((item) => ({
1199
+ id: item.id
1200
+ }))
1201
+ }
1210
1202
  : { connectOrCreate: prop.user.sessions.map((item) => ({
1211
1203
  where: {
1212
1204
  id: item.id !== undefined ? item.id : undefined,
@@ -1218,12 +1210,11 @@ exports.Authenticator = {
1218
1210
  }))
1219
1211
  } : undefined,
1220
1212
  alpacaAccounts: prop.user.alpacaAccounts ?
1221
- Array.isArray(prop.user.alpacaAccounts) && prop.user.alpacaAccounts.length > 0
1222
- ? prop.user.alpacaAccounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1223
- connect: prop.user.alpacaAccounts.map((item) => ({
1224
- id: item.id
1225
- }))
1226
- }
1213
+ Array.isArray(prop.user.alpacaAccounts) && prop.user.alpacaAccounts.length > 0 && prop.user.alpacaAccounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1214
+ connect: prop.user.alpacaAccounts.map((item) => ({
1215
+ id: item.id
1216
+ }))
1217
+ }
1227
1218
  : { connectOrCreate: prop.user.alpacaAccounts.map((item) => ({
1228
1219
  where: {
1229
1220
  id: item.id !== undefined ? item.id : undefined,