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
@@ -347,12 +347,11 @@ export const AlpacaAccount = {
347
347
  }
348
348
  } : undefined,
349
349
  accounts: props.user.accounts ?
350
- Array.isArray(props.user.accounts) && props.user.accounts.length > 0
351
- ? props.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
352
- connect: props.user.accounts.map((item) => ({
353
- id: item.id
354
- }))
355
- }
350
+ 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) ? {
351
+ connect: props.user.accounts.map((item) => ({
352
+ id: item.id
353
+ }))
354
+ }
356
355
  : { connectOrCreate: props.user.accounts.map((item) => ({
357
356
  where: {
358
357
  id: item.id !== undefined ? item.id : undefined,
@@ -372,12 +371,11 @@ export const AlpacaAccount = {
372
371
  }))
373
372
  } : undefined,
374
373
  sessions: props.user.sessions ?
375
- Array.isArray(props.user.sessions) && props.user.sessions.length > 0
376
- ? 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
- }
374
+ 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) ? {
375
+ connect: props.user.sessions.map((item) => ({
376
+ id: item.id
377
+ }))
378
+ }
381
379
  : { connectOrCreate: props.user.sessions.map((item) => ({
382
380
  where: {
383
381
  id: item.id !== undefined ? item.id : undefined,
@@ -389,12 +387,11 @@ export const AlpacaAccount = {
389
387
  }))
390
388
  } : undefined,
391
389
  authenticators: props.user.authenticators ?
392
- Array.isArray(props.user.authenticators) && props.user.authenticators.length > 0
393
- ? props.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
394
- connect: props.user.authenticators.map((item) => ({
395
- id: item.id
396
- }))
397
- }
390
+ 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) ? {
391
+ connect: props.user.authenticators.map((item) => ({
392
+ id: item.id
393
+ }))
394
+ }
398
395
  : { connectOrCreate: props.user.authenticators.map((item) => ({
399
396
  where: {
400
397
  id: item.id !== undefined ? item.id : undefined,
@@ -410,12 +407,11 @@ export const AlpacaAccount = {
410
407
  }
411
408
  } : undefined,
412
409
  trades: props.trades ?
413
- Array.isArray(props.trades) && props.trades.length > 0
414
- ? props.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
415
- connect: props.trades.map((item) => ({
416
- id: item.id
417
- }))
418
- }
410
+ Array.isArray(props.trades) && props.trades.length > 0 && props.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
411
+ connect: props.trades.map((item) => ({
412
+ id: item.id
413
+ }))
414
+ }
419
415
  : { connectOrCreate: props.trades.map((item) => ({
420
416
  where: {
421
417
  id: item.id !== undefined ? item.id : undefined,
@@ -503,12 +499,11 @@ export const AlpacaAccount = {
503
499
  }
504
500
  } : undefined,
505
501
  actions: item.actions ?
506
- Array.isArray(item.actions) && item.actions.length > 0
507
- ? item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
508
- connect: item.actions.map((item) => ({
509
- id: item.id
510
- }))
511
- }
502
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
503
+ connect: item.actions.map((item) => ({
504
+ id: item.id
505
+ }))
506
+ }
512
507
  : { connectOrCreate: item.actions.map((item) => ({
513
508
  where: {
514
509
  id: item.id !== undefined ? item.id : undefined,
@@ -526,12 +521,11 @@ export const AlpacaAccount = {
526
521
  }))
527
522
  } : undefined,
528
523
  orders: props.orders ?
529
- Array.isArray(props.orders) && props.orders.length > 0
530
- ? props.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
531
- connect: props.orders.map((item) => ({
532
- id: item.id
533
- }))
534
- }
524
+ Array.isArray(props.orders) && props.orders.length > 0 && props.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
525
+ connect: props.orders.map((item) => ({
526
+ id: item.id
527
+ }))
528
+ }
535
529
  : { connectOrCreate: props.orders.map((item) => ({
536
530
  where: {
537
531
  id: item.id !== undefined ? item.id : undefined,
@@ -647,12 +641,11 @@ export const AlpacaAccount = {
647
641
  }))
648
642
  } : undefined,
649
643
  positions: props.positions ?
650
- Array.isArray(props.positions) && props.positions.length > 0
651
- ? props.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
652
- connect: props.positions.map((item) => ({
653
- id: item.id
654
- }))
655
- }
644
+ Array.isArray(props.positions) && props.positions.length > 0 && props.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
645
+ connect: props.positions.map((item) => ({
646
+ id: item.id
647
+ }))
648
+ }
656
649
  : { connectOrCreate: props.positions.map((item) => ({
657
650
  where: {
658
651
  id: item.id !== undefined ? item.id : undefined,
@@ -746,12 +739,11 @@ export const AlpacaAccount = {
746
739
  }))
747
740
  } : undefined,
748
741
  alerts: props.alerts ?
749
- Array.isArray(props.alerts) && props.alerts.length > 0
750
- ? props.alerts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
751
- connect: props.alerts.map((item) => ({
752
- id: item.id
753
- }))
754
- }
742
+ Array.isArray(props.alerts) && props.alerts.length > 0 && props.alerts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
743
+ connect: props.alerts.map((item) => ({
744
+ id: item.id
745
+ }))
746
+ }
755
747
  : { connectOrCreate: props.alerts.map((item) => ({
756
748
  where: {
757
749
  id: item.id !== undefined ? item.id : undefined,
@@ -1361,12 +1353,11 @@ export const AlpacaAccount = {
1361
1353
  }
1362
1354
  } : undefined,
1363
1355
  accounts: props.user.accounts ?
1364
- Array.isArray(props.user.accounts) && props.user.accounts.length > 0
1365
- ? props.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1366
- connect: props.user.accounts.map((item) => ({
1367
- id: item.id
1368
- }))
1369
- }
1356
+ 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) ? {
1357
+ connect: props.user.accounts.map((item) => ({
1358
+ id: item.id
1359
+ }))
1360
+ }
1370
1361
  : { connectOrCreate: props.user.accounts.map((item) => ({
1371
1362
  where: {
1372
1363
  id: item.id !== undefined ? item.id : undefined,
@@ -1386,12 +1377,11 @@ export const AlpacaAccount = {
1386
1377
  }))
1387
1378
  } : undefined,
1388
1379
  sessions: props.user.sessions ?
1389
- Array.isArray(props.user.sessions) && props.user.sessions.length > 0
1390
- ? props.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1391
- connect: props.user.sessions.map((item) => ({
1392
- id: item.id
1393
- }))
1394
- }
1380
+ 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) ? {
1381
+ connect: props.user.sessions.map((item) => ({
1382
+ id: item.id
1383
+ }))
1384
+ }
1395
1385
  : { connectOrCreate: props.user.sessions.map((item) => ({
1396
1386
  where: {
1397
1387
  id: item.id !== undefined ? item.id : undefined,
@@ -1403,12 +1393,11 @@ export const AlpacaAccount = {
1403
1393
  }))
1404
1394
  } : undefined,
1405
1395
  authenticators: props.user.authenticators ?
1406
- Array.isArray(props.user.authenticators) && props.user.authenticators.length > 0
1407
- ? props.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1408
- connect: props.user.authenticators.map((item) => ({
1409
- id: item.id
1410
- }))
1411
- }
1396
+ 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) ? {
1397
+ connect: props.user.authenticators.map((item) => ({
1398
+ id: item.id
1399
+ }))
1400
+ }
1412
1401
  : { connectOrCreate: props.user.authenticators.map((item) => ({
1413
1402
  where: {
1414
1403
  id: item.id !== undefined ? item.id : undefined,
@@ -1822,12 +1811,11 @@ export const AlpacaAccount = {
1822
1811
  }
1823
1812
  } : undefined,
1824
1813
  actions: item.actions ?
1825
- Array.isArray(item.actions) && item.actions.length > 0
1826
- ? item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
1827
- connect: item.actions.map((item) => ({
1828
- id: item.id
1829
- }))
1830
- }
1814
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1815
+ connect: item.actions.map((item) => ({
1816
+ id: item.id
1817
+ }))
1818
+ }
1831
1819
  : { connectOrCreate: item.actions.map((item) => ({
1832
1820
  where: {
1833
1821
  id: item.id !== undefined ? item.id : undefined,
@@ -2982,12 +2970,11 @@ export const AlpacaAccount = {
2982
2970
  }
2983
2971
  } : undefined,
2984
2972
  accounts: prop.user.accounts ?
2985
- Array.isArray(prop.user.accounts) && prop.user.accounts.length > 0
2986
- ? prop.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
2987
- connect: prop.user.accounts.map((item) => ({
2988
- id: item.id
2989
- }))
2990
- }
2973
+ 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) ? {
2974
+ connect: prop.user.accounts.map((item) => ({
2975
+ id: item.id
2976
+ }))
2977
+ }
2991
2978
  : { connectOrCreate: prop.user.accounts.map((item) => ({
2992
2979
  where: {
2993
2980
  id: item.id !== undefined ? item.id : undefined,
@@ -3007,12 +2994,11 @@ export const AlpacaAccount = {
3007
2994
  }))
3008
2995
  } : undefined,
3009
2996
  sessions: prop.user.sessions ?
3010
- Array.isArray(prop.user.sessions) && prop.user.sessions.length > 0
3011
- ? prop.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
3012
- connect: prop.user.sessions.map((item) => ({
3013
- id: item.id
3014
- }))
3015
- }
2997
+ 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) ? {
2998
+ connect: prop.user.sessions.map((item) => ({
2999
+ id: item.id
3000
+ }))
3001
+ }
3016
3002
  : { connectOrCreate: prop.user.sessions.map((item) => ({
3017
3003
  where: {
3018
3004
  id: item.id !== undefined ? item.id : undefined,
@@ -3024,12 +3010,11 @@ export const AlpacaAccount = {
3024
3010
  }))
3025
3011
  } : undefined,
3026
3012
  authenticators: prop.user.authenticators ?
3027
- Array.isArray(prop.user.authenticators) && prop.user.authenticators.length > 0
3028
- ? prop.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
3029
- connect: prop.user.authenticators.map((item) => ({
3030
- id: item.id
3031
- }))
3032
- }
3013
+ 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) ? {
3014
+ connect: prop.user.authenticators.map((item) => ({
3015
+ id: item.id
3016
+ }))
3017
+ }
3033
3018
  : { connectOrCreate: prop.user.authenticators.map((item) => ({
3034
3019
  where: {
3035
3020
  id: item.id !== undefined ? item.id : undefined,
@@ -3443,12 +3428,11 @@ export const AlpacaAccount = {
3443
3428
  }
3444
3429
  } : undefined,
3445
3430
  actions: item.actions ?
3446
- Array.isArray(item.actions) && item.actions.length > 0
3447
- ? item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
3448
- connect: item.actions.map((item) => ({
3449
- id: item.id
3450
- }))
3451
- }
3431
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3432
+ connect: item.actions.map((item) => ({
3433
+ id: item.id
3434
+ }))
3435
+ }
3452
3436
  : { connectOrCreate: item.actions.map((item) => ({
3453
3437
  where: {
3454
3438
  id: item.id !== undefined ? item.id : undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../src/Asset.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAKjF;;GAEG;AAEH,eAAO,MAAM,KAAK;IAEhB;;;;OAIG;kBAEiB,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAojBlD;;;;OAIG;sBACqB,SAAS,EAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAuFvE;;;;OAIG;kBACiB,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAuiClD;;;;OAIG;sBACqB,SAAS,EAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAszBvE;;;;OAIG;kBACiB,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAqRlD;;;;OAIG;eACc,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAsRtD;;;OAGG;cACa,OAAO,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC;IA6Q3C;;;;OAIG;oBACmB,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC;CAgS9D,CAAC"}
1
+ {"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../src/Asset.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAKjF;;GAEG;AAEH,eAAO,MAAM,KAAK;IAEhB;;;;OAIG;kBAEiB,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IA+iBlD;;;;OAIG;sBACqB,SAAS,EAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAuFvE;;;;OAIG;kBACiB,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAsiClD;;;;OAIG;sBACqB,SAAS,EAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAqzBvE;;;;OAIG;kBACiB,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAqRlD;;;;OAIG;eACc,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAsRtD;;;OAGG;cACa,OAAO,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC;IA6Q3C;;;;OAIG;oBACmB,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC;CAgS9D,CAAC"}