adaptic-backend 1.0.179 → 1.0.180

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 (99) hide show
  1. package/Account.cjs +15 -37
  2. package/Action.cjs +23 -61
  3. package/Alert.cjs +13 -31
  4. package/AlpacaAccount.cjs +30 -82
  5. package/Asset.cjs +30 -82
  6. package/Authenticator.cjs +15 -37
  7. package/Customer.cjs +15 -37
  8. package/EconomicEvent.cjs +8 -16
  9. package/MarketSentiment.cjs +8 -16
  10. package/NewsArticle.cjs +15 -37
  11. package/NewsArticleAssetSentiment.cjs +13 -31
  12. package/Order.cjs +11 -25
  13. package/Position.cjs +18 -46
  14. package/ScheduledOptionOrder.cjs +8 -16
  15. package/Session.cjs +15 -37
  16. package/StopLoss.cjs +9 -19
  17. package/TakeProfit.cjs +9 -19
  18. package/Trade.cjs +21 -55
  19. package/User.cjs +13 -31
  20. package/VerificationToken.cjs +8 -16
  21. package/client.cjs +3 -0
  22. package/client.d.ts +1 -0
  23. package/generated/typegraphql-prisma/enhance.cjs +1 -1
  24. package/generated/typegraphql-prisma/enhance.js.map +1 -1
  25. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.cjs +6 -7
  26. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts +1 -2
  27. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts.map +1 -1
  28. package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.js.map +1 -1
  29. package/package.json +1 -1
  30. package/server/Account.d.ts.map +1 -1
  31. package/server/Account.js.map +1 -1
  32. package/server/Account.mjs +8 -30
  33. package/server/Action.d.ts.map +1 -1
  34. package/server/Action.js.map +1 -1
  35. package/server/Action.mjs +16 -54
  36. package/server/Alert.d.ts.map +1 -1
  37. package/server/Alert.js.map +1 -1
  38. package/server/Alert.mjs +6 -24
  39. package/server/AlpacaAccount.d.ts.map +1 -1
  40. package/server/AlpacaAccount.js.map +1 -1
  41. package/server/AlpacaAccount.mjs +23 -75
  42. package/server/Asset.d.ts.map +1 -1
  43. package/server/Asset.js.map +1 -1
  44. package/server/Asset.mjs +23 -75
  45. package/server/Authenticator.d.ts.map +1 -1
  46. package/server/Authenticator.js.map +1 -1
  47. package/server/Authenticator.mjs +8 -30
  48. package/server/Customer.d.ts.map +1 -1
  49. package/server/Customer.js.map +1 -1
  50. package/server/Customer.mjs +8 -30
  51. package/server/EconomicEvent.d.ts.map +1 -1
  52. package/server/EconomicEvent.js.map +1 -1
  53. package/server/EconomicEvent.mjs +1 -9
  54. package/server/MarketSentiment.d.ts.map +1 -1
  55. package/server/MarketSentiment.js.map +1 -1
  56. package/server/MarketSentiment.mjs +1 -9
  57. package/server/NewsArticle.d.ts.map +1 -1
  58. package/server/NewsArticle.js.map +1 -1
  59. package/server/NewsArticle.mjs +8 -30
  60. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  61. package/server/NewsArticleAssetSentiment.js.map +1 -1
  62. package/server/NewsArticleAssetSentiment.mjs +6 -24
  63. package/server/Order.d.ts.map +1 -1
  64. package/server/Order.js.map +1 -1
  65. package/server/Order.mjs +4 -18
  66. package/server/Position.d.ts.map +1 -1
  67. package/server/Position.js.map +1 -1
  68. package/server/Position.mjs +11 -39
  69. package/server/ScheduledOptionOrder.d.ts.map +1 -1
  70. package/server/ScheduledOptionOrder.js.map +1 -1
  71. package/server/ScheduledOptionOrder.mjs +1 -9
  72. package/server/Session.d.ts.map +1 -1
  73. package/server/Session.js.map +1 -1
  74. package/server/Session.mjs +8 -30
  75. package/server/StopLoss.d.ts.map +1 -1
  76. package/server/StopLoss.js.map +1 -1
  77. package/server/StopLoss.mjs +2 -12
  78. package/server/TakeProfit.d.ts.map +1 -1
  79. package/server/TakeProfit.js.map +1 -1
  80. package/server/TakeProfit.mjs +2 -12
  81. package/server/Trade.d.ts.map +1 -1
  82. package/server/Trade.js.map +1 -1
  83. package/server/Trade.mjs +14 -48
  84. package/server/User.d.ts.map +1 -1
  85. package/server/User.js.map +1 -1
  86. package/server/User.mjs +6 -24
  87. package/server/VerificationToken.d.ts.map +1 -1
  88. package/server/VerificationToken.js.map +1 -1
  89. package/server/VerificationToken.mjs +1 -9
  90. package/server/client.d.ts +1 -0
  91. package/server/client.d.ts.map +1 -1
  92. package/server/client.js.map +1 -1
  93. package/server/client.mjs +2 -0
  94. package/server/generated/typegraphql-prisma/enhance.js.map +1 -1
  95. package/server/generated/typegraphql-prisma/enhance.mjs +1 -1
  96. package/server/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts +1 -2
  97. package/server/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts.map +1 -1
  98. package/server/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.js.map +1 -1
  99. package/server/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.mjs +7 -8
package/Alert.cjs CHANGED
@@ -25,7 +25,6 @@ exports.Alert = {
25
25
  * @returns The created Alert or null.
26
26
  */
27
27
  async create(props) {
28
- const client = (0, client_2.createApolloClient)();
29
28
  const CREATE_ONE_ALERT = (0, client_1.gql) `
30
29
  mutation createOneAlert($data: AlertCreateInput!) {
31
30
  createOneAlert(data: $data) {
@@ -324,11 +323,9 @@ exports.Alert = {
324
323
  : { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
325
324
  where: {
326
325
  id: item.id !== undefined ? item.id : undefined,
326
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
327
327
  actionId: item.actionId !== undefined ? item.actionId : undefined,
328
328
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
329
- clientOrderId: item.clientOrderId !== undefined ? {
330
- equals: item.clientOrderId
331
- } : undefined,
332
329
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
333
330
  equals: item.alpacaAccountId
334
331
  } : undefined,
@@ -604,7 +601,7 @@ exports.Alert = {
604
601
  };
605
602
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
606
603
  try {
607
- const response = await client.mutate({ mutation: CREATE_ONE_ALERT, variables: filteredVariables });
604
+ const response = await client_2.client.mutate({ mutation: CREATE_ONE_ALERT, variables: filteredVariables });
608
605
  if (response.errors && response.errors.length > 0)
609
606
  throw new Error(response.errors[0].message);
610
607
  if (response && response.data && response.data.createOneAlert) {
@@ -625,7 +622,6 @@ exports.Alert = {
625
622
  * @returns The count of created records or null.
626
623
  */
627
624
  async createMany(props) {
628
- const client = (0, client_2.createApolloClient)();
629
625
  const CREATE_MANY_ALERT = (0, client_1.gql) `
630
626
  mutation createManyAlert($data: [AlertCreateManyInput!]!) {
631
627
  createManyAlert(data: $data) {
@@ -642,7 +638,7 @@ exports.Alert = {
642
638
  };
643
639
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
644
640
  try {
645
- const response = await client.mutate({ mutation: CREATE_MANY_ALERT, variables: filteredVariables });
641
+ const response = await client_2.client.mutate({ mutation: CREATE_MANY_ALERT, variables: filteredVariables });
646
642
  if (response.errors && response.errors.length > 0)
647
643
  throw new Error(response.errors[0].message);
648
644
  if (response && response.data && response.data.createManyAlert) {
@@ -663,7 +659,6 @@ exports.Alert = {
663
659
  * @returns The updated Alert or null.
664
660
  */
665
661
  async update(props) {
666
- const client = (0, client_2.createApolloClient)();
667
662
  const UPDATE_ONE_ALERT = (0, client_1.gql) `
668
663
  mutation updateOneAlert($data: AlertUpdateInput!, $where: AlertWhereUniqueInput!) {
669
664
  updateOneAlert(data: $data, where: $where) {
@@ -1518,11 +1513,9 @@ exports.Alert = {
1518
1513
  upsert: props.alpacaAccount.orders.map((item) => ({
1519
1514
  where: {
1520
1515
  id: item.id !== undefined ? item.id : undefined,
1516
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1521
1517
  actionId: item.actionId !== undefined ? item.actionId : undefined,
1522
1518
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1523
- clientOrderId: item.clientOrderId !== undefined ? {
1524
- equals: item.clientOrderId
1525
- } : undefined,
1526
1519
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
1527
1520
  equals: item.alpacaAccountId
1528
1521
  } : undefined,
@@ -2764,11 +2757,9 @@ exports.Alert = {
2764
2757
  : { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
2765
2758
  where: {
2766
2759
  id: item.id !== undefined ? item.id : undefined,
2760
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2767
2761
  actionId: item.actionId !== undefined ? item.actionId : undefined,
2768
2762
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2769
- clientOrderId: item.clientOrderId !== undefined ? {
2770
- equals: item.clientOrderId
2771
- } : undefined,
2772
2763
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
2773
2764
  equals: item.alpacaAccountId
2774
2765
  } : undefined,
@@ -3044,7 +3035,7 @@ exports.Alert = {
3044
3035
  };
3045
3036
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
3046
3037
  try {
3047
- const response = await client.mutate({ mutation: UPDATE_ONE_ALERT, variables: filteredVariables });
3038
+ const response = await client_2.client.mutate({ mutation: UPDATE_ONE_ALERT, variables: filteredVariables });
3048
3039
  if (response.errors && response.errors.length > 0)
3049
3040
  throw new Error(response.errors[0].message);
3050
3041
  if (response && response.data && response.data.updateOneAlert) {
@@ -3065,7 +3056,6 @@ exports.Alert = {
3065
3056
  * @returns The count of created records or null.
3066
3057
  */
3067
3058
  async updateMany(props) {
3068
- const client = (0, client_2.createApolloClient)();
3069
3059
  const UPDATE_MANY_ALERT = (0, client_1.gql) `
3070
3060
  mutation updateManyAlert($data: [AlertCreateManyInput!]!) {
3071
3061
  updateManyAlert(data: $data) {
@@ -3920,11 +3910,9 @@ exports.Alert = {
3920
3910
  upsert: prop.alpacaAccount.orders.map((item) => ({
3921
3911
  where: {
3922
3912
  id: item.id !== undefined ? item.id : undefined,
3913
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3923
3914
  actionId: item.actionId !== undefined ? item.actionId : undefined,
3924
3915
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3925
- clientOrderId: item.clientOrderId !== undefined ? {
3926
- equals: item.clientOrderId
3927
- } : undefined,
3928
3916
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
3929
3917
  equals: item.alpacaAccountId
3930
3918
  } : undefined,
@@ -5166,11 +5154,9 @@ exports.Alert = {
5166
5154
  : { connectOrCreate: prop.alpacaAccount.orders.map((item) => ({
5167
5155
  where: {
5168
5156
  id: item.id !== undefined ? item.id : undefined,
5157
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5169
5158
  actionId: item.actionId !== undefined ? item.actionId : undefined,
5170
5159
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5171
- clientOrderId: item.clientOrderId !== undefined ? {
5172
- equals: item.clientOrderId
5173
- } : undefined,
5174
5160
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
5175
5161
  equals: item.alpacaAccountId
5176
5162
  } : undefined,
@@ -5446,7 +5432,7 @@ exports.Alert = {
5446
5432
  }));
5447
5433
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
5448
5434
  try {
5449
- const response = await client.mutate({ mutation: UPDATE_MANY_ALERT, variables: filteredVariables });
5435
+ const response = await client_2.client.mutate({ mutation: UPDATE_MANY_ALERT, variables: filteredVariables });
5450
5436
  if (response.errors && response.errors.length > 0)
5451
5437
  throw new Error(response.errors[0].message);
5452
5438
  if (response && response.data && response.data.updateManyAlert) {
@@ -5467,7 +5453,6 @@ exports.Alert = {
5467
5453
  * @returns The deleted Alert or null.
5468
5454
  */
5469
5455
  async delete(props) {
5470
- const client = (0, client_2.createApolloClient)();
5471
5456
  const DELETE_ONE_ALERT = (0, client_1.gql) `
5472
5457
  mutation deleteOneAlert($where: AlertWhereUniqueInput!) {
5473
5458
  deleteOneAlert(where: $where) {
@@ -5481,7 +5466,7 @@ exports.Alert = {
5481
5466
  };
5482
5467
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
5483
5468
  try {
5484
- const response = await client.mutate({ mutation: DELETE_ONE_ALERT, variables: filteredVariables });
5469
+ const response = await client_2.client.mutate({ mutation: DELETE_ONE_ALERT, variables: filteredVariables });
5485
5470
  if (response.errors && response.errors.length > 0)
5486
5471
  throw new Error(response.errors[0].message);
5487
5472
  if (response && response.data && response.data.deleteOneAlert) {
@@ -5503,7 +5488,6 @@ exports.Alert = {
5503
5488
  */
5504
5489
  async get(props) {
5505
5490
  var _a, _b;
5506
- const client = (0, client_2.createApolloClient)();
5507
5491
  const GET_ALERT = (0, client_1.gql) `
5508
5492
  query getAlert($where: AlertWhereUniqueInput!) {
5509
5493
  getAlert(where: $where) {
@@ -5524,7 +5508,7 @@ exports.Alert = {
5524
5508
  };
5525
5509
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
5526
5510
  try {
5527
- const response = await client.query({ query: GET_ALERT, variables: filteredVariables });
5511
+ const response = await client_2.client.query({ query: GET_ALERT, variables: filteredVariables });
5528
5512
  if (response.errors && response.errors.length > 0)
5529
5513
  throw new Error(response.errors[0].message);
5530
5514
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getAlert) !== null && _b !== void 0 ? _b : null;
@@ -5545,7 +5529,6 @@ exports.Alert = {
5545
5529
  */
5546
5530
  async getAll() {
5547
5531
  var _a, _b;
5548
- const client = (0, client_2.createApolloClient)();
5549
5532
  const GET_ALL_ALERT = (0, client_1.gql) `
5550
5533
  query getAllAlert {
5551
5534
  alerts {
@@ -5553,7 +5536,7 @@ exports.Alert = {
5553
5536
  }
5554
5537
  }`;
5555
5538
  try {
5556
- const response = await client.query({ query: GET_ALL_ALERT });
5539
+ const response = await client_2.client.query({ query: GET_ALL_ALERT });
5557
5540
  if (response.errors && response.errors.length > 0)
5558
5541
  throw new Error(response.errors[0].message);
5559
5542
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.alerts) !== null && _b !== void 0 ? _b : null;
@@ -5574,7 +5557,6 @@ exports.Alert = {
5574
5557
  * @returns An array of found Alert records or null.
5575
5558
  */
5576
5559
  async findMany(props) {
5577
- const client = (0, client_2.createApolloClient)();
5578
5560
  const FIND_MANY_ALERT = (0, client_1.gql) `
5579
5561
  query findManyAlert($where: AlertWhereInput!) {
5580
5562
  alerts(where: $where) {
@@ -5597,7 +5579,7 @@ exports.Alert = {
5597
5579
  };
5598
5580
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
5599
5581
  try {
5600
- const response = await client.query({ query: FIND_MANY_ALERT, variables: filteredVariables });
5582
+ const response = await client_2.client.query({ query: FIND_MANY_ALERT, variables: filteredVariables });
5601
5583
  if (response.errors && response.errors.length > 0)
5602
5584
  throw new Error(response.errors[0].message);
5603
5585
  if (response && response.data && response.data.Alerts) {
package/AlpacaAccount.cjs CHANGED
@@ -466,7 +466,6 @@ exports.AlpacaAccount = {
466
466
  * @returns The created AlpacaAccount or null.
467
467
  */
468
468
  async create(props) {
469
- const client = (0, client_2.createApolloClient)();
470
469
  const CREATE_ONE_ALPACAACCOUNT = (0, client_1.gql) `
471
470
  mutation createOneAlpacaAccount($data: AlpacaAccountCreateInput!) {
472
471
  createOneAlpacaAccount(data: $data) {
@@ -720,11 +719,9 @@ exports.AlpacaAccount = {
720
719
  : { connectOrCreate: item.asset.orders.map((item) => ({
721
720
  where: {
722
721
  id: item.id !== undefined ? item.id : undefined,
722
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
723
723
  actionId: item.actionId !== undefined ? item.actionId : undefined,
724
724
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
725
- clientOrderId: item.clientOrderId !== undefined ? {
726
- equals: item.clientOrderId
727
- } : undefined,
728
725
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
729
726
  equals: item.alpacaAccountId
730
727
  } : undefined,
@@ -851,11 +848,9 @@ exports.AlpacaAccount = {
851
848
  : { connectOrCreate: {
852
849
  where: {
853
850
  id: item.order.id !== undefined ? item.order.id : undefined,
851
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
854
852
  actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
855
853
  stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
856
- clientOrderId: item.order.clientOrderId !== undefined ? {
857
- equals: item.order.clientOrderId
858
- } : undefined,
859
854
  alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
860
855
  equals: item.order.alpacaAccountId
861
856
  } : undefined,
@@ -907,11 +902,9 @@ exports.AlpacaAccount = {
907
902
  : { connectOrCreate: props.orders.map((item) => ({
908
903
  where: {
909
904
  id: item.id !== undefined ? item.id : undefined,
905
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
910
906
  actionId: item.actionId !== undefined ? item.actionId : undefined,
911
907
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
912
- clientOrderId: item.clientOrderId !== undefined ? {
913
- equals: item.clientOrderId
914
- } : undefined,
915
908
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
916
909
  equals: item.alpacaAccountId
917
910
  } : undefined,
@@ -1335,11 +1328,9 @@ exports.AlpacaAccount = {
1335
1328
  : { connectOrCreate: item.asset.orders.map((item) => ({
1336
1329
  where: {
1337
1330
  id: item.id !== undefined ? item.id : undefined,
1331
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1338
1332
  actionId: item.actionId !== undefined ? item.actionId : undefined,
1339
1333
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1340
- clientOrderId: item.clientOrderId !== undefined ? {
1341
- equals: item.clientOrderId
1342
- } : undefined,
1343
1334
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
1344
1335
  equals: item.alpacaAccountId
1345
1336
  } : undefined,
@@ -1431,7 +1422,7 @@ exports.AlpacaAccount = {
1431
1422
  };
1432
1423
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
1433
1424
  try {
1434
- const response = await client.mutate({ mutation: CREATE_ONE_ALPACAACCOUNT, variables: filteredVariables });
1425
+ const response = await client_2.client.mutate({ mutation: CREATE_ONE_ALPACAACCOUNT, variables: filteredVariables });
1435
1426
  if (response.errors && response.errors.length > 0)
1436
1427
  throw new Error(response.errors[0].message);
1437
1428
  if (response && response.data && response.data.createOneAlpacaAccount) {
@@ -1452,7 +1443,6 @@ exports.AlpacaAccount = {
1452
1443
  * @returns The count of created records or null.
1453
1444
  */
1454
1445
  async createMany(props) {
1455
- const client = (0, client_2.createApolloClient)();
1456
1446
  const CREATE_MANY_ALPACAACCOUNT = (0, client_1.gql) `
1457
1447
  mutation createManyAlpacaAccount($data: [AlpacaAccountCreateManyInput!]!) {
1458
1448
  createManyAlpacaAccount(data: $data) {
@@ -1475,7 +1465,7 @@ exports.AlpacaAccount = {
1475
1465
  };
1476
1466
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
1477
1467
  try {
1478
- const response = await client.mutate({ mutation: CREATE_MANY_ALPACAACCOUNT, variables: filteredVariables });
1468
+ const response = await client_2.client.mutate({ mutation: CREATE_MANY_ALPACAACCOUNT, variables: filteredVariables });
1479
1469
  if (response.errors && response.errors.length > 0)
1480
1470
  throw new Error(response.errors[0].message);
1481
1471
  if (response && response.data && response.data.createManyAlpacaAccount) {
@@ -1496,7 +1486,6 @@ exports.AlpacaAccount = {
1496
1486
  * @returns The updated AlpacaAccount or null.
1497
1487
  */
1498
1488
  async update(props) {
1499
- const client = (0, client_2.createApolloClient)();
1500
1489
  const UPDATE_ONE_ALPACAACCOUNT = (0, client_1.gql) `
1501
1490
  mutation updateOneAlpacaAccount($data: AlpacaAccountUpdateInput!, $where: AlpacaAccountWhereUniqueInput!) {
1502
1491
  updateOneAlpacaAccount(data: $data, where: $where) {
@@ -2128,11 +2117,9 @@ exports.AlpacaAccount = {
2128
2117
  upsert: item.asset.orders.map((item) => ({
2129
2118
  where: {
2130
2119
  id: item.id !== undefined ? item.id : undefined,
2120
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2131
2121
  actionId: item.actionId !== undefined ? item.actionId : undefined,
2132
2122
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2133
- clientOrderId: item.clientOrderId !== undefined ? {
2134
- equals: item.clientOrderId
2135
- } : undefined,
2136
2123
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
2137
2124
  equals: item.alpacaAccountId
2138
2125
  } : undefined,
@@ -2428,11 +2415,9 @@ exports.AlpacaAccount = {
2428
2415
  : { connectOrCreate: item.asset.orders.map((item) => ({
2429
2416
  where: {
2430
2417
  id: item.id !== undefined ? item.id : undefined,
2418
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2431
2419
  actionId: item.actionId !== undefined ? item.actionId : undefined,
2432
2420
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2433
- clientOrderId: item.clientOrderId !== undefined ? {
2434
- equals: item.clientOrderId
2435
- } : undefined,
2436
2421
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
2437
2422
  equals: item.alpacaAccountId
2438
2423
  } : undefined,
@@ -2699,11 +2684,9 @@ exports.AlpacaAccount = {
2699
2684
  : { connectOrCreate: {
2700
2685
  where: {
2701
2686
  id: item.order.id !== undefined ? item.order.id : undefined,
2687
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2702
2688
  actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2703
2689
  stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
2704
- clientOrderId: item.order.clientOrderId !== undefined ? {
2705
- equals: item.order.clientOrderId
2706
- } : undefined,
2707
2690
  alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2708
2691
  equals: item.order.alpacaAccountId
2709
2692
  } : undefined,
@@ -2833,11 +2816,9 @@ exports.AlpacaAccount = {
2833
2816
  : { connectOrCreate: item.asset.orders.map((item) => ({
2834
2817
  where: {
2835
2818
  id: item.id !== undefined ? item.id : undefined,
2819
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2836
2820
  actionId: item.actionId !== undefined ? item.actionId : undefined,
2837
2821
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2838
- clientOrderId: item.clientOrderId !== undefined ? {
2839
- equals: item.clientOrderId
2840
- } : undefined,
2841
2822
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
2842
2823
  equals: item.alpacaAccountId
2843
2824
  } : undefined,
@@ -2964,11 +2945,9 @@ exports.AlpacaAccount = {
2964
2945
  : { connectOrCreate: {
2965
2946
  where: {
2966
2947
  id: item.order.id !== undefined ? item.order.id : undefined,
2948
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2967
2949
  actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2968
2950
  stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
2969
- clientOrderId: item.order.clientOrderId !== undefined ? {
2970
- equals: item.order.clientOrderId
2971
- } : undefined,
2972
2951
  alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2973
2952
  equals: item.order.alpacaAccountId
2974
2953
  } : undefined,
@@ -3015,11 +2994,9 @@ exports.AlpacaAccount = {
3015
2994
  upsert: props.orders.map((item) => ({
3016
2995
  where: {
3017
2996
  id: item.id !== undefined ? item.id : undefined,
2997
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3018
2998
  actionId: item.actionId !== undefined ? item.actionId : undefined,
3019
2999
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3020
- clientOrderId: item.clientOrderId !== undefined ? {
3021
- equals: item.clientOrderId
3022
- } : undefined,
3023
3000
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
3024
3001
  equals: item.alpacaAccountId
3025
3002
  } : undefined,
@@ -4390,11 +4367,9 @@ exports.AlpacaAccount = {
4390
4367
  upsert: item.asset.orders.map((item) => ({
4391
4368
  where: {
4392
4369
  id: item.id !== undefined ? item.id : undefined,
4370
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4393
4371
  actionId: item.actionId !== undefined ? item.actionId : undefined,
4394
4372
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4395
- clientOrderId: item.clientOrderId !== undefined ? {
4396
- equals: item.clientOrderId
4397
- } : undefined,
4398
4373
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
4399
4374
  equals: item.alpacaAccountId
4400
4375
  } : undefined,
@@ -4645,11 +4620,9 @@ exports.AlpacaAccount = {
4645
4620
  : { connectOrCreate: item.asset.orders.map((item) => ({
4646
4621
  where: {
4647
4622
  id: item.id !== undefined ? item.id : undefined,
4623
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4648
4624
  actionId: item.actionId !== undefined ? item.actionId : undefined,
4649
4625
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4650
- clientOrderId: item.clientOrderId !== undefined ? {
4651
- equals: item.clientOrderId
4652
- } : undefined,
4653
4626
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
4654
4627
  equals: item.alpacaAccountId
4655
4628
  } : undefined,
@@ -4838,11 +4811,9 @@ exports.AlpacaAccount = {
4838
4811
  : { connectOrCreate: item.asset.orders.map((item) => ({
4839
4812
  where: {
4840
4813
  id: item.id !== undefined ? item.id : undefined,
4814
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4841
4815
  actionId: item.actionId !== undefined ? item.actionId : undefined,
4842
4816
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4843
- clientOrderId: item.clientOrderId !== undefined ? {
4844
- equals: item.clientOrderId
4845
- } : undefined,
4846
4817
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
4847
4818
  equals: item.alpacaAccountId
4848
4819
  } : undefined,
@@ -4943,7 +4914,7 @@ exports.AlpacaAccount = {
4943
4914
  };
4944
4915
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
4945
4916
  try {
4946
- const response = await client.mutate({ mutation: UPDATE_ONE_ALPACAACCOUNT, variables: filteredVariables });
4917
+ const response = await client_2.client.mutate({ mutation: UPDATE_ONE_ALPACAACCOUNT, variables: filteredVariables });
4947
4918
  if (response.errors && response.errors.length > 0)
4948
4919
  throw new Error(response.errors[0].message);
4949
4920
  if (response && response.data && response.data.updateOneAlpacaAccount) {
@@ -4964,7 +4935,6 @@ exports.AlpacaAccount = {
4964
4935
  * @returns The count of created records or null.
4965
4936
  */
4966
4937
  async updateMany(props) {
4967
- const client = (0, client_2.createApolloClient)();
4968
4938
  const UPDATE_MANY_ALPACAACCOUNT = (0, client_1.gql) `
4969
4939
  mutation updateManyAlpacaAccount($data: [AlpacaAccountCreateManyInput!]!) {
4970
4940
  updateManyAlpacaAccount(data: $data) {
@@ -5596,11 +5566,9 @@ exports.AlpacaAccount = {
5596
5566
  upsert: item.asset.orders.map((item) => ({
5597
5567
  where: {
5598
5568
  id: item.id !== undefined ? item.id : undefined,
5569
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5599
5570
  actionId: item.actionId !== undefined ? item.actionId : undefined,
5600
5571
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5601
- clientOrderId: item.clientOrderId !== undefined ? {
5602
- equals: item.clientOrderId
5603
- } : undefined,
5604
5572
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
5605
5573
  equals: item.alpacaAccountId
5606
5574
  } : undefined,
@@ -5896,11 +5864,9 @@ exports.AlpacaAccount = {
5896
5864
  : { connectOrCreate: item.asset.orders.map((item) => ({
5897
5865
  where: {
5898
5866
  id: item.id !== undefined ? item.id : undefined,
5867
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5899
5868
  actionId: item.actionId !== undefined ? item.actionId : undefined,
5900
5869
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5901
- clientOrderId: item.clientOrderId !== undefined ? {
5902
- equals: item.clientOrderId
5903
- } : undefined,
5904
5870
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
5905
5871
  equals: item.alpacaAccountId
5906
5872
  } : undefined,
@@ -6167,11 +6133,9 @@ exports.AlpacaAccount = {
6167
6133
  : { connectOrCreate: {
6168
6134
  where: {
6169
6135
  id: item.order.id !== undefined ? item.order.id : undefined,
6136
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
6170
6137
  actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
6171
6138
  stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
6172
- clientOrderId: item.order.clientOrderId !== undefined ? {
6173
- equals: item.order.clientOrderId
6174
- } : undefined,
6175
6139
  alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
6176
6140
  equals: item.order.alpacaAccountId
6177
6141
  } : undefined,
@@ -6301,11 +6265,9 @@ exports.AlpacaAccount = {
6301
6265
  : { connectOrCreate: item.asset.orders.map((item) => ({
6302
6266
  where: {
6303
6267
  id: item.id !== undefined ? item.id : undefined,
6268
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6304
6269
  actionId: item.actionId !== undefined ? item.actionId : undefined,
6305
6270
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6306
- clientOrderId: item.clientOrderId !== undefined ? {
6307
- equals: item.clientOrderId
6308
- } : undefined,
6309
6271
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
6310
6272
  equals: item.alpacaAccountId
6311
6273
  } : undefined,
@@ -6432,11 +6394,9 @@ exports.AlpacaAccount = {
6432
6394
  : { connectOrCreate: {
6433
6395
  where: {
6434
6396
  id: item.order.id !== undefined ? item.order.id : undefined,
6397
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
6435
6398
  actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
6436
6399
  stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
6437
- clientOrderId: item.order.clientOrderId !== undefined ? {
6438
- equals: item.order.clientOrderId
6439
- } : undefined,
6440
6400
  alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
6441
6401
  equals: item.order.alpacaAccountId
6442
6402
  } : undefined,
@@ -6483,11 +6443,9 @@ exports.AlpacaAccount = {
6483
6443
  upsert: prop.orders.map((item) => ({
6484
6444
  where: {
6485
6445
  id: item.id !== undefined ? item.id : undefined,
6446
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6486
6447
  actionId: item.actionId !== undefined ? item.actionId : undefined,
6487
6448
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6488
- clientOrderId: item.clientOrderId !== undefined ? {
6489
- equals: item.clientOrderId
6490
- } : undefined,
6491
6449
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
6492
6450
  equals: item.alpacaAccountId
6493
6451
  } : undefined,
@@ -7858,11 +7816,9 @@ exports.AlpacaAccount = {
7858
7816
  upsert: item.asset.orders.map((item) => ({
7859
7817
  where: {
7860
7818
  id: item.id !== undefined ? item.id : undefined,
7819
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
7861
7820
  actionId: item.actionId !== undefined ? item.actionId : undefined,
7862
7821
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
7863
- clientOrderId: item.clientOrderId !== undefined ? {
7864
- equals: item.clientOrderId
7865
- } : undefined,
7866
7822
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
7867
7823
  equals: item.alpacaAccountId
7868
7824
  } : undefined,
@@ -8113,11 +8069,9 @@ exports.AlpacaAccount = {
8113
8069
  : { connectOrCreate: item.asset.orders.map((item) => ({
8114
8070
  where: {
8115
8071
  id: item.id !== undefined ? item.id : undefined,
8072
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
8116
8073
  actionId: item.actionId !== undefined ? item.actionId : undefined,
8117
8074
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
8118
- clientOrderId: item.clientOrderId !== undefined ? {
8119
- equals: item.clientOrderId
8120
- } : undefined,
8121
8075
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
8122
8076
  equals: item.alpacaAccountId
8123
8077
  } : undefined,
@@ -8306,11 +8260,9 @@ exports.AlpacaAccount = {
8306
8260
  : { connectOrCreate: item.asset.orders.map((item) => ({
8307
8261
  where: {
8308
8262
  id: item.id !== undefined ? item.id : undefined,
8263
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
8309
8264
  actionId: item.actionId !== undefined ? item.actionId : undefined,
8310
8265
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
8311
- clientOrderId: item.clientOrderId !== undefined ? {
8312
- equals: item.clientOrderId
8313
- } : undefined,
8314
8266
  alpacaAccountId: item.alpacaAccountId !== undefined ? {
8315
8267
  equals: item.alpacaAccountId
8316
8268
  } : undefined,
@@ -8411,7 +8363,7 @@ exports.AlpacaAccount = {
8411
8363
  }));
8412
8364
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
8413
8365
  try {
8414
- const response = await client.mutate({ mutation: UPDATE_MANY_ALPACAACCOUNT, variables: filteredVariables });
8366
+ const response = await client_2.client.mutate({ mutation: UPDATE_MANY_ALPACAACCOUNT, variables: filteredVariables });
8415
8367
  if (response.errors && response.errors.length > 0)
8416
8368
  throw new Error(response.errors[0].message);
8417
8369
  if (response && response.data && response.data.updateManyAlpacaAccount) {
@@ -8432,7 +8384,6 @@ exports.AlpacaAccount = {
8432
8384
  * @returns The deleted AlpacaAccount or null.
8433
8385
  */
8434
8386
  async delete(props) {
8435
- const client = (0, client_2.createApolloClient)();
8436
8387
  const DELETE_ONE_ALPACAACCOUNT = (0, client_1.gql) `
8437
8388
  mutation deleteOneAlpacaAccount($where: AlpacaAccountWhereUniqueInput!) {
8438
8389
  deleteOneAlpacaAccount(where: $where) {
@@ -8446,7 +8397,7 @@ exports.AlpacaAccount = {
8446
8397
  };
8447
8398
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
8448
8399
  try {
8449
- const response = await client.mutate({ mutation: DELETE_ONE_ALPACAACCOUNT, variables: filteredVariables });
8400
+ const response = await client_2.client.mutate({ mutation: DELETE_ONE_ALPACAACCOUNT, variables: filteredVariables });
8450
8401
  if (response.errors && response.errors.length > 0)
8451
8402
  throw new Error(response.errors[0].message);
8452
8403
  if (response && response.data && response.data.deleteOneAlpacaAccount) {
@@ -8468,7 +8419,6 @@ exports.AlpacaAccount = {
8468
8419
  */
8469
8420
  async get(props) {
8470
8421
  var _a, _b;
8471
- const client = (0, client_2.createApolloClient)();
8472
8422
  const GET_ALPACAACCOUNT = (0, client_1.gql) `
8473
8423
  query getAlpacaAccount($where: AlpacaAccountWhereUniqueInput!) {
8474
8424
  getAlpacaAccount(where: $where) {
@@ -8495,7 +8445,7 @@ exports.AlpacaAccount = {
8495
8445
  };
8496
8446
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
8497
8447
  try {
8498
- const response = await client.query({ query: GET_ALPACAACCOUNT, variables: filteredVariables });
8448
+ const response = await client_2.client.query({ query: GET_ALPACAACCOUNT, variables: filteredVariables });
8499
8449
  if (response.errors && response.errors.length > 0)
8500
8450
  throw new Error(response.errors[0].message);
8501
8451
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getAlpacaAccount) !== null && _b !== void 0 ? _b : null;
@@ -8516,7 +8466,6 @@ exports.AlpacaAccount = {
8516
8466
  */
8517
8467
  async getAll() {
8518
8468
  var _a, _b;
8519
- const client = (0, client_2.createApolloClient)();
8520
8469
  const GET_ALL_ALPACAACCOUNT = (0, client_1.gql) `
8521
8470
  query getAllAlpacaAccount {
8522
8471
  alpacaAccounts {
@@ -8524,7 +8473,7 @@ exports.AlpacaAccount = {
8524
8473
  }
8525
8474
  }`;
8526
8475
  try {
8527
- const response = await client.query({ query: GET_ALL_ALPACAACCOUNT });
8476
+ const response = await client_2.client.query({ query: GET_ALL_ALPACAACCOUNT });
8528
8477
  if (response.errors && response.errors.length > 0)
8529
8478
  throw new Error(response.errors[0].message);
8530
8479
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.alpacaAccounts) !== null && _b !== void 0 ? _b : null;
@@ -8545,7 +8494,6 @@ exports.AlpacaAccount = {
8545
8494
  * @returns An array of found AlpacaAccount records or null.
8546
8495
  */
8547
8496
  async findMany(props) {
8548
- const client = (0, client_2.createApolloClient)();
8549
8497
  const FIND_MANY_ALPACAACCOUNT = (0, client_1.gql) `
8550
8498
  query findManyAlpacaAccount($where: AlpacaAccountWhereInput!) {
8551
8499
  alpacaAccounts(where: $where) {
@@ -8574,7 +8522,7 @@ exports.AlpacaAccount = {
8574
8522
  };
8575
8523
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
8576
8524
  try {
8577
- const response = await client.query({ query: FIND_MANY_ALPACAACCOUNT, variables: filteredVariables });
8525
+ const response = await client_2.client.query({ query: FIND_MANY_ALPACAACCOUNT, variables: filteredVariables });
8578
8526
  if (response.errors && response.errors.length > 0)
8579
8527
  throw new Error(response.errors[0].message);
8580
8528
  if (response && response.data && response.data.AlpacaAccounts) {