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
@@ -21,9 +21,11 @@ exports.MarketSentiment = {
21
21
  /**
22
22
  * Create a new MarketSentiment record.
23
23
  * @param props - Properties for the new record.
24
+ * @param client - Apollo Client instance.
24
25
  * @returns The created MarketSentiment 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_MARKETSENTIMENT = (0, client_1.gql) `
28
30
  mutation createOneMarketSentiment($data: MarketSentimentCreateInput!) {
29
31
  createOneMarketSentiment(data: $data) {
@@ -40,7 +42,7 @@ exports.MarketSentiment = {
40
42
  };
41
43
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
42
44
  try {
43
- const response = await client_2.client.mutate({ mutation: CREATE_ONE_MARKETSENTIMENT, variables: filteredVariables });
45
+ const response = await client.mutate({ mutation: CREATE_ONE_MARKETSENTIMENT, variables: filteredVariables });
44
46
  if (response.errors && response.errors.length > 0)
45
47
  throw new Error(response.errors[0].message);
46
48
  if (response && response.data && response.data.createOneMarketSentiment) {
@@ -58,9 +60,11 @@ exports.MarketSentiment = {
58
60
  /**
59
61
  * Create multiple MarketSentiment records.
60
62
  * @param props - Array of MarketSentiment objects for the new records.
63
+ * @param globalClient - Apollo Client instance.
61
64
  * @returns The count of created records or null.
62
65
  */
63
- async createMany(props) {
66
+ async createMany(props, globalClient) {
67
+ const client = globalClient || client_2.client;
64
68
  const CREATE_MANY_MARKETSENTIMENT = (0, client_1.gql) `
65
69
  mutation createManyMarketSentiment($data: [MarketSentimentCreateManyInput!]!) {
66
70
  createManyMarketSentiment(data: $data) {
@@ -76,7 +80,7 @@ exports.MarketSentiment = {
76
80
  };
77
81
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
78
82
  try {
79
- const response = await client_2.client.mutate({ mutation: CREATE_MANY_MARKETSENTIMENT, variables: filteredVariables });
83
+ const response = await client.mutate({ mutation: CREATE_MANY_MARKETSENTIMENT, variables: filteredVariables });
80
84
  if (response.errors && response.errors.length > 0)
81
85
  throw new Error(response.errors[0].message);
82
86
  if (response && response.data && response.data.createManyMarketSentiment) {
@@ -94,9 +98,11 @@ exports.MarketSentiment = {
94
98
  /**
95
99
  * Update a single MarketSentiment record.
96
100
  * @param props - Properties to update.
101
+ * @param globalClient - Apollo Client instance.
97
102
  * @returns The updated MarketSentiment or null.
98
103
  */
99
- async update(props) {
104
+ async update(props, globalClient) {
105
+ const client = globalClient || client_2.client;
100
106
  const UPDATE_ONE_MARKETSENTIMENT = (0, client_1.gql) `
101
107
  mutation updateOneMarketSentiment($data: MarketSentimentUpdateInput!, $where: MarketSentimentWhereUniqueInput!) {
102
108
  updateOneMarketSentiment(data: $data, where: $where) {
@@ -130,7 +136,7 @@ exports.MarketSentiment = {
130
136
  };
131
137
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
132
138
  try {
133
- const response = await client_2.client.mutate({ mutation: UPDATE_ONE_MARKETSENTIMENT, variables: filteredVariables });
139
+ const response = await client.mutate({ mutation: UPDATE_ONE_MARKETSENTIMENT, variables: filteredVariables });
134
140
  if (response.errors && response.errors.length > 0)
135
141
  throw new Error(response.errors[0].message);
136
142
  if (response && response.data && response.data.updateOneMarketSentiment) {
@@ -148,9 +154,11 @@ exports.MarketSentiment = {
148
154
  /**
149
155
  * Upsert a single MarketSentiment record.
150
156
  * @param props - Properties to update.
157
+ * @param globalClient - Apollo Client instance.
151
158
  * @returns The updated MarketSentiment or null.
152
159
  */
153
- async upsert(props) {
160
+ async upsert(props, globalClient) {
161
+ const client = globalClient || client_2.client;
154
162
  const UPSERT_ONE_MARKETSENTIMENT = (0, client_1.gql) `
155
163
  mutation upsertOneMarketSentiment($where: MarketSentimentWhereUniqueInput!, $create: MarketSentimentCreateInput!, $update: MarketSentimentUpdateInput!) {
156
164
  upsertOneMarketSentiment(where: $where, create: $create, update: $update) {
@@ -180,7 +188,7 @@ exports.MarketSentiment = {
180
188
  };
181
189
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
182
190
  try {
183
- const response = await client_2.client.mutate({ mutation: UPSERT_ONE_MARKETSENTIMENT, variables: filteredVariables });
191
+ const response = await client.mutate({ mutation: UPSERT_ONE_MARKETSENTIMENT, variables: filteredVariables });
184
192
  if (response.errors && response.errors.length > 0)
185
193
  throw new Error(response.errors[0].message);
186
194
  if (response && response.data && response.data.upsertOneMarketSentiment) {
@@ -198,9 +206,11 @@ exports.MarketSentiment = {
198
206
  /**
199
207
  * Update multiple MarketSentiment records.
200
208
  * @param props - Array of MarketSentiment objects for the updated records.
209
+ * @param globalClient - Apollo Client instance.
201
210
  * @returns The count of created records or null.
202
211
  */
203
- async updateMany(props) {
212
+ async updateMany(props, globalClient) {
213
+ const client = globalClient || client_2.client;
204
214
  const UPDATE_MANY_MARKETSENTIMENT = (0, client_1.gql) `
205
215
  mutation updateManyMarketSentiment($data: [MarketSentimentCreateManyInput!]!) {
206
216
  updateManyMarketSentiment(data: $data) {
@@ -234,7 +244,7 @@ exports.MarketSentiment = {
234
244
  }));
235
245
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
236
246
  try {
237
- const response = await client_2.client.mutate({ mutation: UPDATE_MANY_MARKETSENTIMENT, variables: filteredVariables });
247
+ const response = await client.mutate({ mutation: UPDATE_MANY_MARKETSENTIMENT, variables: filteredVariables });
238
248
  if (response.errors && response.errors.length > 0)
239
249
  throw new Error(response.errors[0].message);
240
250
  if (response && response.data && response.data.updateManyMarketSentiment) {
@@ -252,9 +262,11 @@ exports.MarketSentiment = {
252
262
  /**
253
263
  * Delete a single MarketSentiment record.
254
264
  * @param props - Properties to update.
265
+ * @param globalClient - Apollo Client instance.
255
266
  * @returns The deleted MarketSentiment or null.
256
267
  */
257
- async delete(props) {
268
+ async delete(props, globalClient) {
269
+ const client = globalClient || client_2.client;
258
270
  const DELETE_ONE_MARKETSENTIMENT = (0, client_1.gql) `
259
271
  mutation deleteOneMarketSentiment($where: MarketSentimentWhereUniqueInput!) {
260
272
  deleteOneMarketSentiment(where: $where) {
@@ -268,7 +280,7 @@ exports.MarketSentiment = {
268
280
  };
269
281
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
270
282
  try {
271
- const response = await client_2.client.mutate({ mutation: DELETE_ONE_MARKETSENTIMENT, variables: filteredVariables });
283
+ const response = await client.mutate({ mutation: DELETE_ONE_MARKETSENTIMENT, variables: filteredVariables });
272
284
  if (response.errors && response.errors.length > 0)
273
285
  throw new Error(response.errors[0].message);
274
286
  if (response && response.data && response.data.deleteOneMarketSentiment) {
@@ -286,10 +298,12 @@ exports.MarketSentiment = {
286
298
  /**
287
299
  * Retrieve a single MarketSentiment record by ID.
288
300
  * @param props - Properties to update.
301
+ * @param globalClient - Apollo Client instance.
289
302
  * @returns The retrieved MarketSentiment or null.
290
303
  */
291
- async get(props) {
304
+ async get(props, globalClient) {
292
305
  var _a, _b;
306
+ const client = globalClient || client_2.client;
293
307
  const GET_MARKETSENTIMENT = (0, client_1.gql) `
294
308
  query getMarketSentiment($where: MarketSentimentWhereUniqueInput!) {
295
309
  getMarketSentiment(where: $where) {
@@ -303,7 +317,7 @@ exports.MarketSentiment = {
303
317
  };
304
318
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
305
319
  try {
306
- const response = await client_2.client.query({ query: GET_MARKETSENTIMENT, variables: filteredVariables });
320
+ const response = await client.query({ query: GET_MARKETSENTIMENT, variables: filteredVariables });
307
321
  if (response.errors && response.errors.length > 0)
308
322
  throw new Error(response.errors[0].message);
309
323
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getMarketSentiment) !== null && _b !== void 0 ? _b : null;
@@ -320,10 +334,12 @@ exports.MarketSentiment = {
320
334
  },
321
335
  /**
322
336
  * Retrieve all MarketSentiments records.
337
+ * @param globalClient - Apollo Client instance.
323
338
  * @returns An array of MarketSentiment records or null.
324
339
  */
325
- async getAll() {
340
+ async getAll(globalClient) {
326
341
  var _a, _b;
342
+ const client = globalClient || client_2.client;
327
343
  const GET_ALL_MARKETSENTIMENT = (0, client_1.gql) `
328
344
  query getAllMarketSentiment {
329
345
  marketSentiments {
@@ -331,7 +347,7 @@ exports.MarketSentiment = {
331
347
  }
332
348
  }`;
333
349
  try {
334
- const response = await client_2.client.query({ query: GET_ALL_MARKETSENTIMENT });
350
+ const response = await client.query({ query: GET_ALL_MARKETSENTIMENT });
335
351
  if (response.errors && response.errors.length > 0)
336
352
  throw new Error(response.errors[0].message);
337
353
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.marketSentiments) !== null && _b !== void 0 ? _b : null;
@@ -349,9 +365,11 @@ exports.MarketSentiment = {
349
365
  /**
350
366
  * Find multiple MarketSentiment records based on conditions.
351
367
  * @param props - Conditions to find records.
368
+ * @param globalClient - Apollo Client instance.
352
369
  * @returns An array of found MarketSentiment records or null.
353
370
  */
354
- async findMany(props) {
371
+ async findMany(props, globalClient) {
372
+ const client = globalClient || client_2.client;
355
373
  const FIND_MANY_MARKETSENTIMENT = (0, client_1.gql) `
356
374
  query findManyMarketSentiment($where: MarketSentimentWhereInput!) {
357
375
  marketSentiments(where: $where) {
@@ -367,7 +385,7 @@ exports.MarketSentiment = {
367
385
  };
368
386
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
369
387
  try {
370
- const response = await client_2.client.query({ query: FIND_MANY_MARKETSENTIMENT, variables: filteredVariables });
388
+ const response = await client.query({ query: FIND_MANY_MARKETSENTIMENT, variables: filteredVariables });
371
389
  if (response.errors && response.errors.length > 0)
372
390
  throw new Error(response.errors[0].message);
373
391
  if (response && response.data && response.data.MarketSentiments) {
@@ -1,61 +1,71 @@
1
1
  import { MarketSentiment as MarketSentimentType } from './generated/typegraphql-prisma/models/MarketSentiment';
2
+ import { ApolloClient } from '@apollo/client';
2
3
  export declare const MarketSentiment: {
3
4
  /**
4
5
  * Create a new MarketSentiment record.
5
6
  * @param props - Properties for the new record.
7
+ * @param client - Apollo Client instance.
6
8
  * @returns The created MarketSentiment or null.
7
9
  */
8
- create(props: MarketSentimentType): Promise<MarketSentimentType>;
10
+ create(props: MarketSentimentType, globalClient?: ApolloClient<any>): Promise<MarketSentimentType>;
9
11
  /**
10
12
  * Create multiple MarketSentiment records.
11
13
  * @param props - Array of MarketSentiment 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: MarketSentimentType[]): Promise<{
17
+ createMany(props: MarketSentimentType[], globalClient?: ApolloClient<any>): Promise<{
15
18
  count: number;
16
19
  } | null>;
17
20
  /**
18
21
  * Update a single MarketSentiment record.
19
22
  * @param props - Properties to update.
23
+ * @param globalClient - Apollo Client instance.
20
24
  * @returns The updated MarketSentiment or null.
21
25
  */
22
- update(props: MarketSentimentType): Promise<MarketSentimentType>;
26
+ update(props: MarketSentimentType, globalClient?: ApolloClient<any>): Promise<MarketSentimentType>;
23
27
  /**
24
28
  * Upsert a single MarketSentiment record.
25
29
  * @param props - Properties to update.
30
+ * @param globalClient - Apollo Client instance.
26
31
  * @returns The updated MarketSentiment or null.
27
32
  */
28
- upsert(props: MarketSentimentType): Promise<MarketSentimentType>;
33
+ upsert(props: MarketSentimentType, globalClient?: ApolloClient<any>): Promise<MarketSentimentType>;
29
34
  /**
30
35
  * Update multiple MarketSentiment records.
31
36
  * @param props - Array of MarketSentiment 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: MarketSentimentType[]): Promise<{
40
+ updateMany(props: MarketSentimentType[], globalClient?: ApolloClient<any>): Promise<{
35
41
  count: number;
36
42
  } | null>;
37
43
  /**
38
44
  * Delete a single MarketSentiment record.
39
45
  * @param props - Properties to update.
46
+ * @param globalClient - Apollo Client instance.
40
47
  * @returns The deleted MarketSentiment or null.
41
48
  */
42
- delete(props: MarketSentimentType): Promise<MarketSentimentType>;
49
+ delete(props: MarketSentimentType, globalClient?: ApolloClient<any>): Promise<MarketSentimentType>;
43
50
  /**
44
51
  * Retrieve a single MarketSentiment record by ID.
45
52
  * @param props - Properties to update.
53
+ * @param globalClient - Apollo Client instance.
46
54
  * @returns The retrieved MarketSentiment or null.
47
55
  */
48
- get(props: MarketSentimentType): Promise<MarketSentimentType | null>;
56
+ get(props: MarketSentimentType, globalClient?: ApolloClient<any>): Promise<MarketSentimentType | null>;
49
57
  /**
50
58
  * Retrieve all MarketSentiments records.
59
+ * @param globalClient - Apollo Client instance.
51
60
  * @returns An array of MarketSentiment records or null.
52
61
  */
53
- getAll(): Promise<MarketSentimentType[] | null>;
62
+ getAll(globalClient?: ApolloClient<any>): Promise<MarketSentimentType[] | null>;
54
63
  /**
55
64
  * Find multiple MarketSentiment 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 MarketSentiment records or null.
58
68
  */
59
- findMany(props: MarketSentimentType): Promise<MarketSentimentType[] | null>;
69
+ findMany(props: MarketSentimentType, globalClient?: ApolloClient<any>): Promise<MarketSentimentType[] | null>;
60
70
  };
61
71
  //# sourceMappingURL=MarketSentiment.d.ts.map
package/NewsArticle.cjs CHANGED
@@ -100,9 +100,11 @@ exports.NewsArticle = {
100
100
  /**
101
101
  * Create a new NewsArticle record.
102
102
  * @param props - Properties for the new record.
103
+ * @param client - Apollo Client instance.
103
104
  * @returns The created NewsArticle or null.
104
105
  */
105
- async create(props) {
106
+ async create(props, globalClient) {
107
+ const client = globalClient || client_2.client;
106
108
  const CREATE_ONE_NEWSARTICLE = (0, client_1.gql) `
107
109
  mutation createOneNewsArticle($data: NewsArticleCreateInput!) {
108
110
  createOneNewsArticle(data: $data) {
@@ -369,7 +371,7 @@ exports.NewsArticle = {
369
371
  };
370
372
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
371
373
  try {
372
- const response = await client_2.client.mutate({ mutation: CREATE_ONE_NEWSARTICLE, variables: filteredVariables });
374
+ const response = await client.mutate({ mutation: CREATE_ONE_NEWSARTICLE, variables: filteredVariables });
373
375
  if (response.errors && response.errors.length > 0)
374
376
  throw new Error(response.errors[0].message);
375
377
  if (response && response.data && response.data.createOneNewsArticle) {
@@ -387,9 +389,11 @@ exports.NewsArticle = {
387
389
  /**
388
390
  * Create multiple NewsArticle records.
389
391
  * @param props - Array of NewsArticle objects for the new records.
392
+ * @param globalClient - Apollo Client instance.
390
393
  * @returns The count of created records or null.
391
394
  */
392
- async createMany(props) {
395
+ async createMany(props, globalClient) {
396
+ const client = globalClient || client_2.client;
393
397
  const CREATE_MANY_NEWSARTICLE = (0, client_1.gql) `
394
398
  mutation createManyNewsArticle($data: [NewsArticleCreateManyInput!]!) {
395
399
  createManyNewsArticle(data: $data) {
@@ -415,7 +419,7 @@ exports.NewsArticle = {
415
419
  };
416
420
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
417
421
  try {
418
- const response = await client_2.client.mutate({ mutation: CREATE_MANY_NEWSARTICLE, variables: filteredVariables });
422
+ const response = await client.mutate({ mutation: CREATE_MANY_NEWSARTICLE, variables: filteredVariables });
419
423
  if (response.errors && response.errors.length > 0)
420
424
  throw new Error(response.errors[0].message);
421
425
  if (response && response.data && response.data.createManyNewsArticle) {
@@ -433,9 +437,11 @@ exports.NewsArticle = {
433
437
  /**
434
438
  * Update a single NewsArticle record.
435
439
  * @param props - Properties to update.
440
+ * @param globalClient - Apollo Client instance.
436
441
  * @returns The updated NewsArticle or null.
437
442
  */
438
- async update(props) {
443
+ async update(props, globalClient) {
444
+ const client = globalClient || client_2.client;
439
445
  const UPDATE_ONE_NEWSARTICLE = (0, client_1.gql) `
440
446
  mutation updateOneNewsArticle($data: NewsArticleUpdateInput!, $where: NewsArticleWhereUniqueInput!) {
441
447
  updateOneNewsArticle(data: $data, where: $where) {
@@ -1541,7 +1547,7 @@ exports.NewsArticle = {
1541
1547
  };
1542
1548
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
1543
1549
  try {
1544
- const response = await client_2.client.mutate({ mutation: UPDATE_ONE_NEWSARTICLE, variables: filteredVariables });
1550
+ const response = await client.mutate({ mutation: UPDATE_ONE_NEWSARTICLE, variables: filteredVariables });
1545
1551
  if (response.errors && response.errors.length > 0)
1546
1552
  throw new Error(response.errors[0].message);
1547
1553
  if (response && response.data && response.data.updateOneNewsArticle) {
@@ -1559,9 +1565,11 @@ exports.NewsArticle = {
1559
1565
  /**
1560
1566
  * Upsert a single NewsArticle record.
1561
1567
  * @param props - Properties to update.
1568
+ * @param globalClient - Apollo Client instance.
1562
1569
  * @returns The updated NewsArticle or null.
1563
1570
  */
1564
- async upsert(props) {
1571
+ async upsert(props, globalClient) {
1572
+ const client = globalClient || client_2.client;
1565
1573
  const UPSERT_ONE_NEWSARTICLE = (0, client_1.gql) `
1566
1574
  mutation upsertOneNewsArticle($where: NewsArticleWhereUniqueInput!, $create: NewsArticleCreateInput!, $update: NewsArticleUpdateInput!) {
1567
1575
  upsertOneNewsArticle(where: $where, create: $create, update: $update) {
@@ -2913,7 +2921,7 @@ exports.NewsArticle = {
2913
2921
  };
2914
2922
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
2915
2923
  try {
2916
- const response = await client_2.client.mutate({ mutation: UPSERT_ONE_NEWSARTICLE, variables: filteredVariables });
2924
+ const response = await client.mutate({ mutation: UPSERT_ONE_NEWSARTICLE, variables: filteredVariables });
2917
2925
  if (response.errors && response.errors.length > 0)
2918
2926
  throw new Error(response.errors[0].message);
2919
2927
  if (response && response.data && response.data.upsertOneNewsArticle) {
@@ -2931,9 +2939,11 @@ exports.NewsArticle = {
2931
2939
  /**
2932
2940
  * Update multiple NewsArticle records.
2933
2941
  * @param props - Array of NewsArticle objects for the updated records.
2942
+ * @param globalClient - Apollo Client instance.
2934
2943
  * @returns The count of created records or null.
2935
2944
  */
2936
- async updateMany(props) {
2945
+ async updateMany(props, globalClient) {
2946
+ const client = globalClient || client_2.client;
2937
2947
  const UPDATE_MANY_NEWSARTICLE = (0, client_1.gql) `
2938
2948
  mutation updateManyNewsArticle($data: [NewsArticleCreateManyInput!]!) {
2939
2949
  updateManyNewsArticle(data: $data) {
@@ -4039,7 +4049,7 @@ exports.NewsArticle = {
4039
4049
  }));
4040
4050
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
4041
4051
  try {
4042
- const response = await client_2.client.mutate({ mutation: UPDATE_MANY_NEWSARTICLE, variables: filteredVariables });
4052
+ const response = await client.mutate({ mutation: UPDATE_MANY_NEWSARTICLE, variables: filteredVariables });
4043
4053
  if (response.errors && response.errors.length > 0)
4044
4054
  throw new Error(response.errors[0].message);
4045
4055
  if (response && response.data && response.data.updateManyNewsArticle) {
@@ -4057,9 +4067,11 @@ exports.NewsArticle = {
4057
4067
  /**
4058
4068
  * Delete a single NewsArticle record.
4059
4069
  * @param props - Properties to update.
4070
+ * @param globalClient - Apollo Client instance.
4060
4071
  * @returns The deleted NewsArticle or null.
4061
4072
  */
4062
- async delete(props) {
4073
+ async delete(props, globalClient) {
4074
+ const client = globalClient || client_2.client;
4063
4075
  const DELETE_ONE_NEWSARTICLE = (0, client_1.gql) `
4064
4076
  mutation deleteOneNewsArticle($where: NewsArticleWhereUniqueInput!) {
4065
4077
  deleteOneNewsArticle(where: $where) {
@@ -4073,7 +4085,7 @@ exports.NewsArticle = {
4073
4085
  };
4074
4086
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
4075
4087
  try {
4076
- const response = await client_2.client.mutate({ mutation: DELETE_ONE_NEWSARTICLE, variables: filteredVariables });
4088
+ const response = await client.mutate({ mutation: DELETE_ONE_NEWSARTICLE, variables: filteredVariables });
4077
4089
  if (response.errors && response.errors.length > 0)
4078
4090
  throw new Error(response.errors[0].message);
4079
4091
  if (response && response.data && response.data.deleteOneNewsArticle) {
@@ -4091,10 +4103,12 @@ exports.NewsArticle = {
4091
4103
  /**
4092
4104
  * Retrieve a single NewsArticle record by ID.
4093
4105
  * @param props - Properties to update.
4106
+ * @param globalClient - Apollo Client instance.
4094
4107
  * @returns The retrieved NewsArticle or null.
4095
4108
  */
4096
- async get(props) {
4109
+ async get(props, globalClient) {
4097
4110
  var _a, _b;
4111
+ const client = globalClient || client_2.client;
4098
4112
  const GET_NEWSARTICLE = (0, client_1.gql) `
4099
4113
  query getNewsArticle($where: NewsArticleWhereUniqueInput!) {
4100
4114
  getNewsArticle(where: $where) {
@@ -4112,7 +4126,7 @@ exports.NewsArticle = {
4112
4126
  };
4113
4127
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
4114
4128
  try {
4115
- const response = await client_2.client.query({ query: GET_NEWSARTICLE, variables: filteredVariables });
4129
+ const response = await client.query({ query: GET_NEWSARTICLE, variables: filteredVariables });
4116
4130
  if (response.errors && response.errors.length > 0)
4117
4131
  throw new Error(response.errors[0].message);
4118
4132
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getNewsArticle) !== null && _b !== void 0 ? _b : null;
@@ -4129,10 +4143,12 @@ exports.NewsArticle = {
4129
4143
  },
4130
4144
  /**
4131
4145
  * Retrieve all NewsArticles records.
4146
+ * @param globalClient - Apollo Client instance.
4132
4147
  * @returns An array of NewsArticle records or null.
4133
4148
  */
4134
- async getAll() {
4149
+ async getAll(globalClient) {
4135
4150
  var _a, _b;
4151
+ const client = globalClient || client_2.client;
4136
4152
  const GET_ALL_NEWSARTICLE = (0, client_1.gql) `
4137
4153
  query getAllNewsArticle {
4138
4154
  newsArticles {
@@ -4140,7 +4156,7 @@ exports.NewsArticle = {
4140
4156
  }
4141
4157
  }`;
4142
4158
  try {
4143
- const response = await client_2.client.query({ query: GET_ALL_NEWSARTICLE });
4159
+ const response = await client.query({ query: GET_ALL_NEWSARTICLE });
4144
4160
  if (response.errors && response.errors.length > 0)
4145
4161
  throw new Error(response.errors[0].message);
4146
4162
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.newsArticles) !== null && _b !== void 0 ? _b : null;
@@ -4158,9 +4174,11 @@ exports.NewsArticle = {
4158
4174
  /**
4159
4175
  * Find multiple NewsArticle records based on conditions.
4160
4176
  * @param props - Conditions to find records.
4177
+ * @param globalClient - Apollo Client instance.
4161
4178
  * @returns An array of found NewsArticle records or null.
4162
4179
  */
4163
- async findMany(props) {
4180
+ async findMany(props, globalClient) {
4181
+ const client = globalClient || client_2.client;
4164
4182
  const FIND_MANY_NEWSARTICLE = (0, client_1.gql) `
4165
4183
  query findManyNewsArticle($where: NewsArticleWhereInput!) {
4166
4184
  newsArticles(where: $where) {
@@ -4182,7 +4200,7 @@ exports.NewsArticle = {
4182
4200
  };
4183
4201
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
4184
4202
  try {
4185
- const response = await client_2.client.query({ query: FIND_MANY_NEWSARTICLE, variables: filteredVariables });
4203
+ const response = await client.query({ query: FIND_MANY_NEWSARTICLE, variables: filteredVariables });
4186
4204
  if (response.errors && response.errors.length > 0)
4187
4205
  throw new Error(response.errors[0].message);
4188
4206
  if (response && response.data && response.data.NewsArticles) {
package/NewsArticle.d.ts CHANGED
@@ -1,61 +1,71 @@
1
1
  import { NewsArticle as NewsArticleType } from './generated/typegraphql-prisma/models/NewsArticle';
2
+ import { ApolloClient } from '@apollo/client';
2
3
  export declare const NewsArticle: {
3
4
  /**
4
5
  * Create a new NewsArticle record.
5
6
  * @param props - Properties for the new record.
7
+ * @param client - Apollo Client instance.
6
8
  * @returns The created NewsArticle or null.
7
9
  */
8
- create(props: NewsArticleType): Promise<NewsArticleType>;
10
+ create(props: NewsArticleType, globalClient?: ApolloClient<any>): Promise<NewsArticleType>;
9
11
  /**
10
12
  * Create multiple NewsArticle records.
11
13
  * @param props - Array of NewsArticle 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: NewsArticleType[]): Promise<{
17
+ createMany(props: NewsArticleType[], globalClient?: ApolloClient<any>): Promise<{
15
18
  count: number;
16
19
  } | null>;
17
20
  /**
18
21
  * Update a single NewsArticle record.
19
22
  * @param props - Properties to update.
23
+ * @param globalClient - Apollo Client instance.
20
24
  * @returns The updated NewsArticle or null.
21
25
  */
22
- update(props: NewsArticleType): Promise<NewsArticleType>;
26
+ update(props: NewsArticleType, globalClient?: ApolloClient<any>): Promise<NewsArticleType>;
23
27
  /**
24
28
  * Upsert a single NewsArticle record.
25
29
  * @param props - Properties to update.
30
+ * @param globalClient - Apollo Client instance.
26
31
  * @returns The updated NewsArticle or null.
27
32
  */
28
- upsert(props: NewsArticleType): Promise<NewsArticleType>;
33
+ upsert(props: NewsArticleType, globalClient?: ApolloClient<any>): Promise<NewsArticleType>;
29
34
  /**
30
35
  * Update multiple NewsArticle records.
31
36
  * @param props - Array of NewsArticle 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: NewsArticleType[]): Promise<{
40
+ updateMany(props: NewsArticleType[], globalClient?: ApolloClient<any>): Promise<{
35
41
  count: number;
36
42
  } | null>;
37
43
  /**
38
44
  * Delete a single NewsArticle record.
39
45
  * @param props - Properties to update.
46
+ * @param globalClient - Apollo Client instance.
40
47
  * @returns The deleted NewsArticle or null.
41
48
  */
42
- delete(props: NewsArticleType): Promise<NewsArticleType>;
49
+ delete(props: NewsArticleType, globalClient?: ApolloClient<any>): Promise<NewsArticleType>;
43
50
  /**
44
51
  * Retrieve a single NewsArticle record by ID.
45
52
  * @param props - Properties to update.
53
+ * @param globalClient - Apollo Client instance.
46
54
  * @returns The retrieved NewsArticle or null.
47
55
  */
48
- get(props: NewsArticleType): Promise<NewsArticleType | null>;
56
+ get(props: NewsArticleType, globalClient?: ApolloClient<any>): Promise<NewsArticleType | null>;
49
57
  /**
50
58
  * Retrieve all NewsArticles records.
59
+ * @param globalClient - Apollo Client instance.
51
60
  * @returns An array of NewsArticle records or null.
52
61
  */
53
- getAll(): Promise<NewsArticleType[] | null>;
62
+ getAll(globalClient?: ApolloClient<any>): Promise<NewsArticleType[] | null>;
54
63
  /**
55
64
  * Find multiple NewsArticle 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 NewsArticle records or null.
58
68
  */
59
- findMany(props: NewsArticleType): Promise<NewsArticleType[] | null>;
69
+ findMany(props: NewsArticleType, globalClient?: ApolloClient<any>): Promise<NewsArticleType[] | null>;
60
70
  };
61
71
  //# sourceMappingURL=NewsArticle.d.ts.map