adaptic-backend 1.0.233 → 1.0.235

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 (139) hide show
  1. package/Account.cjs +36 -18
  2. package/Account.d.ts +19 -9
  3. package/Action.cjs +36 -18
  4. package/Action.d.ts +19 -9
  5. package/Alert.cjs +36 -18
  6. package/Alert.d.ts +19 -9
  7. package/AlpacaAccount.cjs +36 -18
  8. package/AlpacaAccount.d.ts +19 -9
  9. package/Asset.cjs +36 -18
  10. package/Asset.d.ts +19 -9
  11. package/Authenticator.cjs +36 -18
  12. package/Authenticator.d.ts +19 -9
  13. package/Contract.cjs +36 -18
  14. package/Contract.d.ts +19 -9
  15. package/Customer.cjs +36 -18
  16. package/Customer.d.ts +19 -9
  17. package/Deliverable.cjs +36 -18
  18. package/Deliverable.d.ts +19 -9
  19. package/EconomicEvent.cjs +36 -18
  20. package/EconomicEvent.d.ts +19 -9
  21. package/MarketSentiment.cjs +36 -18
  22. package/MarketSentiment.d.ts +19 -9
  23. package/NewsArticle.cjs +36 -18
  24. package/NewsArticle.d.ts +19 -9
  25. package/NewsArticleAssetSentiment.cjs +36 -18
  26. package/NewsArticleAssetSentiment.d.ts +19 -9
  27. package/Order.cjs +36 -18
  28. package/Order.d.ts +19 -9
  29. package/Position.cjs +36 -18
  30. package/Position.d.ts +19 -9
  31. package/ScheduledOptionOrder.cjs +36 -18
  32. package/ScheduledOptionOrder.d.ts +19 -9
  33. package/Session.cjs +36 -18
  34. package/Session.d.ts +19 -9
  35. package/StopLoss.cjs +36 -18
  36. package/StopLoss.d.ts +19 -9
  37. package/TakeProfit.cjs +36 -18
  38. package/TakeProfit.d.ts +19 -9
  39. package/Trade.cjs +36 -18
  40. package/Trade.d.ts +19 -9
  41. package/User.cjs +36 -18
  42. package/User.d.ts +19 -9
  43. package/VerificationToken.cjs +36 -18
  44. package/VerificationToken.d.ts +19 -9
  45. package/client.cjs +0 -1
  46. package/index.d.ts +198 -198
  47. package/package.json +1 -1
  48. package/server/Account.d.ts +19 -9
  49. package/server/Account.d.ts.map +1 -1
  50. package/server/Account.js.map +1 -1
  51. package/server/Account.mjs +28 -10
  52. package/server/Action.d.ts +19 -9
  53. package/server/Action.d.ts.map +1 -1
  54. package/server/Action.js.map +1 -1
  55. package/server/Action.mjs +28 -10
  56. package/server/Alert.d.ts +19 -9
  57. package/server/Alert.d.ts.map +1 -1
  58. package/server/Alert.js.map +1 -1
  59. package/server/Alert.mjs +28 -10
  60. package/server/AlpacaAccount.d.ts +19 -9
  61. package/server/AlpacaAccount.d.ts.map +1 -1
  62. package/server/AlpacaAccount.js.map +1 -1
  63. package/server/AlpacaAccount.mjs +28 -10
  64. package/server/Asset.d.ts +19 -9
  65. package/server/Asset.d.ts.map +1 -1
  66. package/server/Asset.js.map +1 -1
  67. package/server/Asset.mjs +28 -10
  68. package/server/Authenticator.d.ts +19 -9
  69. package/server/Authenticator.d.ts.map +1 -1
  70. package/server/Authenticator.js.map +1 -1
  71. package/server/Authenticator.mjs +28 -10
  72. package/server/Contract.d.ts +19 -9
  73. package/server/Contract.d.ts.map +1 -1
  74. package/server/Contract.js.map +1 -1
  75. package/server/Contract.mjs +28 -10
  76. package/server/Customer.d.ts +19 -9
  77. package/server/Customer.d.ts.map +1 -1
  78. package/server/Customer.js.map +1 -1
  79. package/server/Customer.mjs +28 -10
  80. package/server/Deliverable.d.ts +19 -9
  81. package/server/Deliverable.d.ts.map +1 -1
  82. package/server/Deliverable.js.map +1 -1
  83. package/server/Deliverable.mjs +28 -10
  84. package/server/EconomicEvent.d.ts +19 -9
  85. package/server/EconomicEvent.d.ts.map +1 -1
  86. package/server/EconomicEvent.js.map +1 -1
  87. package/server/EconomicEvent.mjs +28 -10
  88. package/server/MarketSentiment.d.ts +19 -9
  89. package/server/MarketSentiment.d.ts.map +1 -1
  90. package/server/MarketSentiment.js.map +1 -1
  91. package/server/MarketSentiment.mjs +28 -10
  92. package/server/NewsArticle.d.ts +19 -9
  93. package/server/NewsArticle.d.ts.map +1 -1
  94. package/server/NewsArticle.js.map +1 -1
  95. package/server/NewsArticle.mjs +28 -10
  96. package/server/NewsArticleAssetSentiment.d.ts +19 -9
  97. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  98. package/server/NewsArticleAssetSentiment.js.map +1 -1
  99. package/server/NewsArticleAssetSentiment.mjs +28 -10
  100. package/server/Order.d.ts +19 -9
  101. package/server/Order.d.ts.map +1 -1
  102. package/server/Order.js.map +1 -1
  103. package/server/Order.mjs +28 -10
  104. package/server/Position.d.ts +19 -9
  105. package/server/Position.d.ts.map +1 -1
  106. package/server/Position.js.map +1 -1
  107. package/server/Position.mjs +28 -10
  108. package/server/ScheduledOptionOrder.d.ts +19 -9
  109. package/server/ScheduledOptionOrder.d.ts.map +1 -1
  110. package/server/ScheduledOptionOrder.js.map +1 -1
  111. package/server/ScheduledOptionOrder.mjs +28 -10
  112. package/server/Session.d.ts +19 -9
  113. package/server/Session.d.ts.map +1 -1
  114. package/server/Session.js.map +1 -1
  115. package/server/Session.mjs +28 -10
  116. package/server/StopLoss.d.ts +19 -9
  117. package/server/StopLoss.d.ts.map +1 -1
  118. package/server/StopLoss.js.map +1 -1
  119. package/server/StopLoss.mjs +28 -10
  120. package/server/TakeProfit.d.ts +19 -9
  121. package/server/TakeProfit.d.ts.map +1 -1
  122. package/server/TakeProfit.js.map +1 -1
  123. package/server/TakeProfit.mjs +28 -10
  124. package/server/Trade.d.ts +19 -9
  125. package/server/Trade.d.ts.map +1 -1
  126. package/server/Trade.js.map +1 -1
  127. package/server/Trade.mjs +28 -10
  128. package/server/User.d.ts +19 -9
  129. package/server/User.d.ts.map +1 -1
  130. package/server/User.js.map +1 -1
  131. package/server/User.mjs +28 -10
  132. package/server/VerificationToken.d.ts +19 -9
  133. package/server/VerificationToken.d.ts.map +1 -1
  134. package/server/VerificationToken.js.map +1 -1
  135. package/server/VerificationToken.mjs +28 -10
  136. package/server/client.d.ts.map +1 -1
  137. package/server/client.js.map +1 -1
  138. package/server/client.mjs +0 -1
  139. package/server/index.d.ts +198 -198
package/Session.cjs CHANGED
@@ -78,9 +78,11 @@ exports.Session = {
78
78
  /**
79
79
  * Create a new Session record.
80
80
  * @param props - Properties for the new record.
81
+ * @param client - Apollo Client instance.
81
82
  * @returns The created Session or null.
82
83
  */
83
- async create(props) {
84
+ async create(props, globalClient) {
85
+ const client = globalClient || client_2.client;
84
86
  const CREATE_ONE_SESSION = (0, client_1.gql) `
85
87
  mutation createOneSession($data: SessionCreateInput!) {
86
88
  createOneSession(data: $data) {
@@ -358,7 +360,7 @@ exports.Session = {
358
360
  };
359
361
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
360
362
  try {
361
- const response = await client_2.client.mutate({ mutation: CREATE_ONE_SESSION, variables: filteredVariables });
363
+ const response = await client.mutate({ mutation: CREATE_ONE_SESSION, variables: filteredVariables });
362
364
  if (response.errors && response.errors.length > 0)
363
365
  throw new Error(response.errors[0].message);
364
366
  if (response && response.data && response.data.createOneSession) {
@@ -376,9 +378,11 @@ exports.Session = {
376
378
  /**
377
379
  * Create multiple Session records.
378
380
  * @param props - Array of Session objects for the new records.
381
+ * @param globalClient - Apollo Client instance.
379
382
  * @returns The count of created records or null.
380
383
  */
381
- async createMany(props) {
384
+ async createMany(props, globalClient) {
385
+ const client = globalClient || client_2.client;
382
386
  const CREATE_MANY_SESSION = (0, client_1.gql) `
383
387
  mutation createManySession($data: [SessionCreateManyInput!]!) {
384
388
  createManySession(data: $data) {
@@ -394,7 +398,7 @@ exports.Session = {
394
398
  };
395
399
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
396
400
  try {
397
- const response = await client_2.client.mutate({ mutation: CREATE_MANY_SESSION, variables: filteredVariables });
401
+ const response = await client.mutate({ mutation: CREATE_MANY_SESSION, variables: filteredVariables });
398
402
  if (response.errors && response.errors.length > 0)
399
403
  throw new Error(response.errors[0].message);
400
404
  if (response && response.data && response.data.createManySession) {
@@ -412,9 +416,11 @@ exports.Session = {
412
416
  /**
413
417
  * Update a single Session record.
414
418
  * @param props - Properties to update.
419
+ * @param globalClient - Apollo Client instance.
415
420
  * @returns The updated Session or null.
416
421
  */
417
- async update(props) {
422
+ async update(props, globalClient) {
423
+ const client = globalClient || client_2.client;
418
424
  const UPDATE_ONE_SESSION = (0, client_1.gql) `
419
425
  mutation updateOneSession($data: SessionUpdateInput!, $where: SessionWhereUniqueInput!) {
420
426
  updateOneSession(data: $data, where: $where) {
@@ -1407,7 +1413,7 @@ exports.Session = {
1407
1413
  };
1408
1414
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
1409
1415
  try {
1410
- const response = await client_2.client.mutate({ mutation: UPDATE_ONE_SESSION, variables: filteredVariables });
1416
+ const response = await client.mutate({ mutation: UPDATE_ONE_SESSION, variables: filteredVariables });
1411
1417
  if (response.errors && response.errors.length > 0)
1412
1418
  throw new Error(response.errors[0].message);
1413
1419
  if (response && response.data && response.data.updateOneSession) {
@@ -1425,9 +1431,11 @@ exports.Session = {
1425
1431
  /**
1426
1432
  * Upsert a single Session record.
1427
1433
  * @param props - Properties to update.
1434
+ * @param globalClient - Apollo Client instance.
1428
1435
  * @returns The updated Session or null.
1429
1436
  */
1430
- async upsert(props) {
1437
+ async upsert(props, globalClient) {
1438
+ const client = globalClient || client_2.client;
1431
1439
  const UPSERT_ONE_SESSION = (0, client_1.gql) `
1432
1440
  mutation upsertOneSession($where: SessionWhereUniqueInput!, $create: SessionCreateInput!, $update: SessionUpdateInput!) {
1433
1441
  upsertOneSession(where: $where, create: $create, update: $update) {
@@ -2677,7 +2685,7 @@ exports.Session = {
2677
2685
  };
2678
2686
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
2679
2687
  try {
2680
- const response = await client_2.client.mutate({ mutation: UPSERT_ONE_SESSION, variables: filteredVariables });
2688
+ const response = await client.mutate({ mutation: UPSERT_ONE_SESSION, variables: filteredVariables });
2681
2689
  if (response.errors && response.errors.length > 0)
2682
2690
  throw new Error(response.errors[0].message);
2683
2691
  if (response && response.data && response.data.upsertOneSession) {
@@ -2695,9 +2703,11 @@ exports.Session = {
2695
2703
  /**
2696
2704
  * Update multiple Session records.
2697
2705
  * @param props - Array of Session objects for the updated records.
2706
+ * @param globalClient - Apollo Client instance.
2698
2707
  * @returns The count of created records or null.
2699
2708
  */
2700
- async updateMany(props) {
2709
+ async updateMany(props, globalClient) {
2710
+ const client = globalClient || client_2.client;
2701
2711
  const UPDATE_MANY_SESSION = (0, client_1.gql) `
2702
2712
  mutation updateManySession($data: [SessionCreateManyInput!]!) {
2703
2713
  updateManySession(data: $data) {
@@ -3690,7 +3700,7 @@ exports.Session = {
3690
3700
  }));
3691
3701
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
3692
3702
  try {
3693
- const response = await client_2.client.mutate({ mutation: UPDATE_MANY_SESSION, variables: filteredVariables });
3703
+ const response = await client.mutate({ mutation: UPDATE_MANY_SESSION, variables: filteredVariables });
3694
3704
  if (response.errors && response.errors.length > 0)
3695
3705
  throw new Error(response.errors[0].message);
3696
3706
  if (response && response.data && response.data.updateManySession) {
@@ -3708,9 +3718,11 @@ exports.Session = {
3708
3718
  /**
3709
3719
  * Delete a single Session record.
3710
3720
  * @param props - Properties to update.
3721
+ * @param globalClient - Apollo Client instance.
3711
3722
  * @returns The deleted Session or null.
3712
3723
  */
3713
- async delete(props) {
3724
+ async delete(props, globalClient) {
3725
+ const client = globalClient || client_2.client;
3714
3726
  const DELETE_ONE_SESSION = (0, client_1.gql) `
3715
3727
  mutation deleteOneSession($where: SessionWhereUniqueInput!) {
3716
3728
  deleteOneSession(where: $where) {
@@ -3724,7 +3736,7 @@ exports.Session = {
3724
3736
  };
3725
3737
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
3726
3738
  try {
3727
- const response = await client_2.client.mutate({ mutation: DELETE_ONE_SESSION, variables: filteredVariables });
3739
+ const response = await client.mutate({ mutation: DELETE_ONE_SESSION, variables: filteredVariables });
3728
3740
  if (response.errors && response.errors.length > 0)
3729
3741
  throw new Error(response.errors[0].message);
3730
3742
  if (response && response.data && response.data.deleteOneSession) {
@@ -3742,10 +3754,12 @@ exports.Session = {
3742
3754
  /**
3743
3755
  * Retrieve a single Session record by ID.
3744
3756
  * @param props - Properties to update.
3757
+ * @param globalClient - Apollo Client instance.
3745
3758
  * @returns The retrieved Session or null.
3746
3759
  */
3747
- async get(props) {
3760
+ async get(props, globalClient) {
3748
3761
  var _a, _b;
3762
+ const client = globalClient || client_2.client;
3749
3763
  const GET_SESSION = (0, client_1.gql) `
3750
3764
  query getSession($where: SessionWhereUniqueInput!) {
3751
3765
  getSession(where: $where) {
@@ -3762,7 +3776,7 @@ exports.Session = {
3762
3776
  };
3763
3777
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
3764
3778
  try {
3765
- const response = await client_2.client.query({ query: GET_SESSION, variables: filteredVariables });
3779
+ const response = await client.query({ query: GET_SESSION, variables: filteredVariables });
3766
3780
  if (response.errors && response.errors.length > 0)
3767
3781
  throw new Error(response.errors[0].message);
3768
3782
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getSession) !== null && _b !== void 0 ? _b : null;
@@ -3779,10 +3793,12 @@ exports.Session = {
3779
3793
  },
3780
3794
  /**
3781
3795
  * Retrieve all Sessions records.
3796
+ * @param globalClient - Apollo Client instance.
3782
3797
  * @returns An array of Session records or null.
3783
3798
  */
3784
- async getAll() {
3799
+ async getAll(globalClient) {
3785
3800
  var _a, _b;
3801
+ const client = globalClient || client_2.client;
3786
3802
  const GET_ALL_SESSION = (0, client_1.gql) `
3787
3803
  query getAllSession {
3788
3804
  sessions {
@@ -3790,7 +3806,7 @@ exports.Session = {
3790
3806
  }
3791
3807
  }`;
3792
3808
  try {
3793
- const response = await client_2.client.query({ query: GET_ALL_SESSION });
3809
+ const response = await client.query({ query: GET_ALL_SESSION });
3794
3810
  if (response.errors && response.errors.length > 0)
3795
3811
  throw new Error(response.errors[0].message);
3796
3812
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.sessions) !== null && _b !== void 0 ? _b : null;
@@ -3808,9 +3824,11 @@ exports.Session = {
3808
3824
  /**
3809
3825
  * Find multiple Session records based on conditions.
3810
3826
  * @param props - Conditions to find records.
3827
+ * @param globalClient - Apollo Client instance.
3811
3828
  * @returns An array of found Session records or null.
3812
3829
  */
3813
- async findMany(props) {
3830
+ async findMany(props, globalClient) {
3831
+ const client = globalClient || client_2.client;
3814
3832
  const FIND_MANY_SESSION = (0, client_1.gql) `
3815
3833
  query findManySession($where: SessionWhereInput!) {
3816
3834
  sessions(where: $where) {
@@ -3829,7 +3847,7 @@ exports.Session = {
3829
3847
  };
3830
3848
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
3831
3849
  try {
3832
- const response = await client_2.client.query({ query: FIND_MANY_SESSION, variables: filteredVariables });
3850
+ const response = await client.query({ query: FIND_MANY_SESSION, variables: filteredVariables });
3833
3851
  if (response.errors && response.errors.length > 0)
3834
3852
  throw new Error(response.errors[0].message);
3835
3853
  if (response && response.data && response.data.Sessions) {
package/Session.d.ts CHANGED
@@ -1,61 +1,71 @@
1
1
  import { Session as SessionType } from './generated/typegraphql-prisma/models/Session';
2
+ import { ApolloClient } from '@apollo/client';
2
3
  export declare const Session: {
3
4
  /**
4
5
  * Create a new Session record.
5
6
  * @param props - Properties for the new record.
7
+ * @param client - Apollo Client instance.
6
8
  * @returns The created Session or null.
7
9
  */
8
- create(props: SessionType): Promise<SessionType>;
10
+ create(props: SessionType, globalClient?: ApolloClient<any>): Promise<SessionType>;
9
11
  /**
10
12
  * Create multiple Session records.
11
13
  * @param props - Array of Session objects for the new records.
14
+ * @param globalClient - Apollo Client instance.
12
15
  * @returns The count of created records or null.
13
16
  */
14
- createMany(props: SessionType[]): Promise<{
17
+ createMany(props: SessionType[], globalClient?: ApolloClient<any>): Promise<{
15
18
  count: number;
16
19
  } | null>;
17
20
  /**
18
21
  * Update a single Session record.
19
22
  * @param props - Properties to update.
23
+ * @param globalClient - Apollo Client instance.
20
24
  * @returns The updated Session or null.
21
25
  */
22
- update(props: SessionType): Promise<SessionType>;
26
+ update(props: SessionType, globalClient?: ApolloClient<any>): Promise<SessionType>;
23
27
  /**
24
28
  * Upsert a single Session record.
25
29
  * @param props - Properties to update.
30
+ * @param globalClient - Apollo Client instance.
26
31
  * @returns The updated Session or null.
27
32
  */
28
- upsert(props: SessionType): Promise<SessionType>;
33
+ upsert(props: SessionType, globalClient?: ApolloClient<any>): Promise<SessionType>;
29
34
  /**
30
35
  * Update multiple Session records.
31
36
  * @param props - Array of Session objects for the updated records.
37
+ * @param globalClient - Apollo Client instance.
32
38
  * @returns The count of created records or null.
33
39
  */
34
- updateMany(props: SessionType[]): Promise<{
40
+ updateMany(props: SessionType[], globalClient?: ApolloClient<any>): Promise<{
35
41
  count: number;
36
42
  } | null>;
37
43
  /**
38
44
  * Delete a single Session record.
39
45
  * @param props - Properties to update.
46
+ * @param globalClient - Apollo Client instance.
40
47
  * @returns The deleted Session or null.
41
48
  */
42
- delete(props: SessionType): Promise<SessionType>;
49
+ delete(props: SessionType, globalClient?: ApolloClient<any>): Promise<SessionType>;
43
50
  /**
44
51
  * Retrieve a single Session record by ID.
45
52
  * @param props - Properties to update.
53
+ * @param globalClient - Apollo Client instance.
46
54
  * @returns The retrieved Session or null.
47
55
  */
48
- get(props: SessionType): Promise<SessionType | null>;
56
+ get(props: SessionType, globalClient?: ApolloClient<any>): Promise<SessionType | null>;
49
57
  /**
50
58
  * Retrieve all Sessions records.
59
+ * @param globalClient - Apollo Client instance.
51
60
  * @returns An array of Session records or null.
52
61
  */
53
- getAll(): Promise<SessionType[] | null>;
62
+ getAll(globalClient?: ApolloClient<any>): Promise<SessionType[] | null>;
54
63
  /**
55
64
  * Find multiple Session records based on conditions.
56
65
  * @param props - Conditions to find records.
66
+ * @param globalClient - Apollo Client instance.
57
67
  * @returns An array of found Session records or null.
58
68
  */
59
- findMany(props: SessionType): Promise<SessionType[] | null>;
69
+ findMany(props: SessionType, globalClient?: ApolloClient<any>): Promise<SessionType[] | null>;
60
70
  };
61
71
  //# sourceMappingURL=Session.d.ts.map
package/StopLoss.cjs CHANGED
@@ -21,9 +21,11 @@ exports.StopLoss = {
21
21
  /**
22
22
  * Create a new StopLoss record.
23
23
  * @param props - Properties for the new record.
24
+ * @param client - Apollo Client instance.
24
25
  * @returns The created StopLoss or null.
25
26
  */
26
- async create(props) {
27
+ async create(props, globalClient) {
28
+ const client = globalClient || client_2.client;
27
29
  const CREATE_ONE_STOPLOSS = (0, client_1.gql) `
28
30
  mutation createOneStopLoss($data: StopLossCreateInput!) {
29
31
  createOneStopLoss(data: $data) {
@@ -621,7 +623,7 @@ exports.StopLoss = {
621
623
  };
622
624
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
623
625
  try {
624
- const response = await client_2.client.mutate({ mutation: CREATE_ONE_STOPLOSS, variables: filteredVariables });
626
+ const response = await client.mutate({ mutation: CREATE_ONE_STOPLOSS, variables: filteredVariables });
625
627
  if (response.errors && response.errors.length > 0)
626
628
  throw new Error(response.errors[0].message);
627
629
  if (response && response.data && response.data.createOneStopLoss) {
@@ -639,9 +641,11 @@ exports.StopLoss = {
639
641
  /**
640
642
  * Create multiple StopLoss records.
641
643
  * @param props - Array of StopLoss objects for the new records.
644
+ * @param globalClient - Apollo Client instance.
642
645
  * @returns The count of created records or null.
643
646
  */
644
- async createMany(props) {
647
+ async createMany(props, globalClient) {
648
+ const client = globalClient || client_2.client;
645
649
  const CREATE_MANY_STOPLOSS = (0, client_1.gql) `
646
650
  mutation createManyStopLoss($data: [StopLossCreateManyInput!]!) {
647
651
  createManyStopLoss(data: $data) {
@@ -657,7 +661,7 @@ exports.StopLoss = {
657
661
  };
658
662
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
659
663
  try {
660
- const response = await client_2.client.mutate({ mutation: CREATE_MANY_STOPLOSS, variables: filteredVariables });
664
+ const response = await client.mutate({ mutation: CREATE_MANY_STOPLOSS, variables: filteredVariables });
661
665
  if (response.errors && response.errors.length > 0)
662
666
  throw new Error(response.errors[0].message);
663
667
  if (response && response.data && response.data.createManyStopLoss) {
@@ -675,9 +679,11 @@ exports.StopLoss = {
675
679
  /**
676
680
  * Update a single StopLoss record.
677
681
  * @param props - Properties to update.
682
+ * @param globalClient - Apollo Client instance.
678
683
  * @returns The updated StopLoss or null.
679
684
  */
680
- async update(props) {
685
+ async update(props, globalClient) {
686
+ const client = globalClient || client_2.client;
681
687
  const UPDATE_ONE_STOPLOSS = (0, client_1.gql) `
682
688
  mutation updateOneStopLoss($data: StopLossUpdateInput!, $where: StopLossWhereUniqueInput!) {
683
689
  updateOneStopLoss(data: $data, where: $where) {
@@ -3180,7 +3186,7 @@ exports.StopLoss = {
3180
3186
  };
3181
3187
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
3182
3188
  try {
3183
- const response = await client_2.client.mutate({ mutation: UPDATE_ONE_STOPLOSS, variables: filteredVariables });
3189
+ const response = await client.mutate({ mutation: UPDATE_ONE_STOPLOSS, variables: filteredVariables });
3184
3190
  if (response.errors && response.errors.length > 0)
3185
3191
  throw new Error(response.errors[0].message);
3186
3192
  if (response && response.data && response.data.updateOneStopLoss) {
@@ -3198,9 +3204,11 @@ exports.StopLoss = {
3198
3204
  /**
3199
3205
  * Upsert a single StopLoss record.
3200
3206
  * @param props - Properties to update.
3207
+ * @param globalClient - Apollo Client instance.
3201
3208
  * @returns The updated StopLoss or null.
3202
3209
  */
3203
- async upsert(props) {
3210
+ async upsert(props, globalClient) {
3211
+ const client = globalClient || client_2.client;
3204
3212
  const UPSERT_ONE_STOPLOSS = (0, client_1.gql) `
3205
3213
  mutation upsertOneStopLoss($where: StopLossWhereUniqueInput!, $create: StopLossCreateInput!, $update: StopLossUpdateInput!) {
3206
3214
  upsertOneStopLoss(where: $where, create: $create, update: $update) {
@@ -6280,7 +6288,7 @@ exports.StopLoss = {
6280
6288
  };
6281
6289
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
6282
6290
  try {
6283
- const response = await client_2.client.mutate({ mutation: UPSERT_ONE_STOPLOSS, variables: filteredVariables });
6291
+ const response = await client.mutate({ mutation: UPSERT_ONE_STOPLOSS, variables: filteredVariables });
6284
6292
  if (response.errors && response.errors.length > 0)
6285
6293
  throw new Error(response.errors[0].message);
6286
6294
  if (response && response.data && response.data.upsertOneStopLoss) {
@@ -6298,9 +6306,11 @@ exports.StopLoss = {
6298
6306
  /**
6299
6307
  * Update multiple StopLoss records.
6300
6308
  * @param props - Array of StopLoss objects for the updated records.
6309
+ * @param globalClient - Apollo Client instance.
6301
6310
  * @returns The count of created records or null.
6302
6311
  */
6303
- async updateMany(props) {
6312
+ async updateMany(props, globalClient) {
6313
+ const client = globalClient || client_2.client;
6304
6314
  const UPDATE_MANY_STOPLOSS = (0, client_1.gql) `
6305
6315
  mutation updateManyStopLoss($data: [StopLossCreateManyInput!]!) {
6306
6316
  updateManyStopLoss(data: $data) {
@@ -8803,7 +8813,7 @@ exports.StopLoss = {
8803
8813
  }));
8804
8814
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
8805
8815
  try {
8806
- const response = await client_2.client.mutate({ mutation: UPDATE_MANY_STOPLOSS, variables: filteredVariables });
8816
+ const response = await client.mutate({ mutation: UPDATE_MANY_STOPLOSS, variables: filteredVariables });
8807
8817
  if (response.errors && response.errors.length > 0)
8808
8818
  throw new Error(response.errors[0].message);
8809
8819
  if (response && response.data && response.data.updateManyStopLoss) {
@@ -8821,9 +8831,11 @@ exports.StopLoss = {
8821
8831
  /**
8822
8832
  * Delete a single StopLoss record.
8823
8833
  * @param props - Properties to update.
8834
+ * @param globalClient - Apollo Client instance.
8824
8835
  * @returns The deleted StopLoss or null.
8825
8836
  */
8826
- async delete(props) {
8837
+ async delete(props, globalClient) {
8838
+ const client = globalClient || client_2.client;
8827
8839
  const DELETE_ONE_STOPLOSS = (0, client_1.gql) `
8828
8840
  mutation deleteOneStopLoss($where: StopLossWhereUniqueInput!) {
8829
8841
  deleteOneStopLoss(where: $where) {
@@ -8837,7 +8849,7 @@ exports.StopLoss = {
8837
8849
  };
8838
8850
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
8839
8851
  try {
8840
- const response = await client_2.client.mutate({ mutation: DELETE_ONE_STOPLOSS, variables: filteredVariables });
8852
+ const response = await client.mutate({ mutation: DELETE_ONE_STOPLOSS, variables: filteredVariables });
8841
8853
  if (response.errors && response.errors.length > 0)
8842
8854
  throw new Error(response.errors[0].message);
8843
8855
  if (response && response.data && response.data.deleteOneStopLoss) {
@@ -8855,10 +8867,12 @@ exports.StopLoss = {
8855
8867
  /**
8856
8868
  * Retrieve a single StopLoss record by ID.
8857
8869
  * @param props - Properties to update.
8870
+ * @param globalClient - Apollo Client instance.
8858
8871
  * @returns The retrieved StopLoss or null.
8859
8872
  */
8860
- async get(props) {
8873
+ async get(props, globalClient) {
8861
8874
  var _a, _b;
8875
+ const client = globalClient || client_2.client;
8862
8876
  const GET_STOPLOSS = (0, client_1.gql) `
8863
8877
  query getStopLoss($where: StopLossWhereUniqueInput!) {
8864
8878
  getStopLoss(where: $where) {
@@ -8873,7 +8887,7 @@ exports.StopLoss = {
8873
8887
  };
8874
8888
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
8875
8889
  try {
8876
- const response = await client_2.client.query({ query: GET_STOPLOSS, variables: filteredVariables });
8890
+ const response = await client.query({ query: GET_STOPLOSS, variables: filteredVariables });
8877
8891
  if (response.errors && response.errors.length > 0)
8878
8892
  throw new Error(response.errors[0].message);
8879
8893
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getStopLoss) !== null && _b !== void 0 ? _b : null;
@@ -8890,10 +8904,12 @@ exports.StopLoss = {
8890
8904
  },
8891
8905
  /**
8892
8906
  * Retrieve all StopLosses records.
8907
+ * @param globalClient - Apollo Client instance.
8893
8908
  * @returns An array of StopLoss records or null.
8894
8909
  */
8895
- async getAll() {
8910
+ async getAll(globalClient) {
8896
8911
  var _a, _b;
8912
+ const client = globalClient || client_2.client;
8897
8913
  const GET_ALL_STOPLOSS = (0, client_1.gql) `
8898
8914
  query getAllStopLoss {
8899
8915
  stopLosses {
@@ -8901,7 +8917,7 @@ exports.StopLoss = {
8901
8917
  }
8902
8918
  }`;
8903
8919
  try {
8904
- const response = await client_2.client.query({ query: GET_ALL_STOPLOSS });
8920
+ const response = await client.query({ query: GET_ALL_STOPLOSS });
8905
8921
  if (response.errors && response.errors.length > 0)
8906
8922
  throw new Error(response.errors[0].message);
8907
8923
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.stopLosses) !== null && _b !== void 0 ? _b : null;
@@ -8919,9 +8935,11 @@ exports.StopLoss = {
8919
8935
  /**
8920
8936
  * Find multiple StopLoss records based on conditions.
8921
8937
  * @param props - Conditions to find records.
8938
+ * @param globalClient - Apollo Client instance.
8922
8939
  * @returns An array of found StopLoss records or null.
8923
8940
  */
8924
- async findMany(props) {
8941
+ async findMany(props, globalClient) {
8942
+ const client = globalClient || client_2.client;
8925
8943
  const FIND_MANY_STOPLOSS = (0, client_1.gql) `
8926
8944
  query findManyStopLoss($where: StopLossWhereInput!) {
8927
8945
  stopLosses(where: $where) {
@@ -8940,7 +8958,7 @@ exports.StopLoss = {
8940
8958
  };
8941
8959
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
8942
8960
  try {
8943
- const response = await client_2.client.query({ query: FIND_MANY_STOPLOSS, variables: filteredVariables });
8961
+ const response = await client.query({ query: FIND_MANY_STOPLOSS, variables: filteredVariables });
8944
8962
  if (response.errors && response.errors.length > 0)
8945
8963
  throw new Error(response.errors[0].message);
8946
8964
  if (response && response.data && response.data.StopLosses) {
package/StopLoss.d.ts CHANGED
@@ -1,61 +1,71 @@
1
1
  import { StopLoss as StopLossType } from './generated/typegraphql-prisma/models/StopLoss';
2
+ import { ApolloClient } from '@apollo/client';
2
3
  export declare const StopLoss: {
3
4
  /**
4
5
  * Create a new StopLoss record.
5
6
  * @param props - Properties for the new record.
7
+ * @param client - Apollo Client instance.
6
8
  * @returns The created StopLoss or null.
7
9
  */
8
- create(props: StopLossType): Promise<StopLossType>;
10
+ create(props: StopLossType, globalClient?: ApolloClient<any>): Promise<StopLossType>;
9
11
  /**
10
12
  * Create multiple StopLoss records.
11
13
  * @param props - Array of StopLoss objects for the new records.
14
+ * @param globalClient - Apollo Client instance.
12
15
  * @returns The count of created records or null.
13
16
  */
14
- createMany(props: StopLossType[]): Promise<{
17
+ createMany(props: StopLossType[], globalClient?: ApolloClient<any>): Promise<{
15
18
  count: number;
16
19
  } | null>;
17
20
  /**
18
21
  * Update a single StopLoss record.
19
22
  * @param props - Properties to update.
23
+ * @param globalClient - Apollo Client instance.
20
24
  * @returns The updated StopLoss or null.
21
25
  */
22
- update(props: StopLossType): Promise<StopLossType>;
26
+ update(props: StopLossType, globalClient?: ApolloClient<any>): Promise<StopLossType>;
23
27
  /**
24
28
  * Upsert a single StopLoss record.
25
29
  * @param props - Properties to update.
30
+ * @param globalClient - Apollo Client instance.
26
31
  * @returns The updated StopLoss or null.
27
32
  */
28
- upsert(props: StopLossType): Promise<StopLossType>;
33
+ upsert(props: StopLossType, globalClient?: ApolloClient<any>): Promise<StopLossType>;
29
34
  /**
30
35
  * Update multiple StopLoss records.
31
36
  * @param props - Array of StopLoss objects for the updated records.
37
+ * @param globalClient - Apollo Client instance.
32
38
  * @returns The count of created records or null.
33
39
  */
34
- updateMany(props: StopLossType[]): Promise<{
40
+ updateMany(props: StopLossType[], globalClient?: ApolloClient<any>): Promise<{
35
41
  count: number;
36
42
  } | null>;
37
43
  /**
38
44
  * Delete a single StopLoss record.
39
45
  * @param props - Properties to update.
46
+ * @param globalClient - Apollo Client instance.
40
47
  * @returns The deleted StopLoss or null.
41
48
  */
42
- delete(props: StopLossType): Promise<StopLossType>;
49
+ delete(props: StopLossType, globalClient?: ApolloClient<any>): Promise<StopLossType>;
43
50
  /**
44
51
  * Retrieve a single StopLoss record by ID.
45
52
  * @param props - Properties to update.
53
+ * @param globalClient - Apollo Client instance.
46
54
  * @returns The retrieved StopLoss or null.
47
55
  */
48
- get(props: StopLossType): Promise<StopLossType | null>;
56
+ get(props: StopLossType, globalClient?: ApolloClient<any>): Promise<StopLossType | null>;
49
57
  /**
50
58
  * Retrieve all StopLosses records.
59
+ * @param globalClient - Apollo Client instance.
51
60
  * @returns An array of StopLoss records or null.
52
61
  */
53
- getAll(): Promise<StopLossType[] | null>;
62
+ getAll(globalClient?: ApolloClient<any>): Promise<StopLossType[] | null>;
54
63
  /**
55
64
  * Find multiple StopLoss records based on conditions.
56
65
  * @param props - Conditions to find records.
66
+ * @param globalClient - Apollo Client instance.
57
67
  * @returns An array of found StopLoss records or null.
58
68
  */
59
- findMany(props: StopLossType): Promise<StopLossType[] | null>;
69
+ findMany(props: StopLossType, globalClient?: ApolloClient<any>): Promise<StopLossType[] | null>;
60
70
  };
61
71
  //# sourceMappingURL=StopLoss.d.ts.map