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/Contract.cjs CHANGED
@@ -235,9 +235,11 @@ exports.Contract = {
235
235
  /**
236
236
  * Create a new Contract record.
237
237
  * @param props - Properties for the new record.
238
+ * @param client - Apollo Client instance.
238
239
  * @returns The created Contract or null.
239
240
  */
240
- async create(props) {
241
+ async create(props, globalClient) {
242
+ const client = globalClient || client_2.client;
241
243
  const CREATE_ONE_CONTRACT = (0, client_1.gql) `
242
244
  mutation createOneContract($data: ContractCreateInput!) {
243
245
  createOneContract(data: $data) {
@@ -1184,7 +1186,7 @@ exports.Contract = {
1184
1186
  };
1185
1187
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
1186
1188
  try {
1187
- const response = await client_2.client.mutate({ mutation: CREATE_ONE_CONTRACT, variables: filteredVariables });
1189
+ const response = await client.mutate({ mutation: CREATE_ONE_CONTRACT, variables: filteredVariables });
1188
1190
  if (response.errors && response.errors.length > 0)
1189
1191
  throw new Error(response.errors[0].message);
1190
1192
  if (response && response.data && response.data.createOneContract) {
@@ -1202,9 +1204,11 @@ exports.Contract = {
1202
1204
  /**
1203
1205
  * Create multiple Contract records.
1204
1206
  * @param props - Array of Contract objects for the new records.
1207
+ * @param globalClient - Apollo Client instance.
1205
1208
  * @returns The count of created records or null.
1206
1209
  */
1207
- async createMany(props) {
1210
+ async createMany(props, globalClient) {
1211
+ const client = globalClient || client_2.client;
1208
1212
  const CREATE_MANY_CONTRACT = (0, client_1.gql) `
1209
1213
  mutation createManyContract($data: [ContractCreateManyInput!]!) {
1210
1214
  createManyContract(data: $data) {
@@ -1238,7 +1242,7 @@ exports.Contract = {
1238
1242
  };
1239
1243
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
1240
1244
  try {
1241
- const response = await client_2.client.mutate({ mutation: CREATE_MANY_CONTRACT, variables: filteredVariables });
1245
+ const response = await client.mutate({ mutation: CREATE_MANY_CONTRACT, variables: filteredVariables });
1242
1246
  if (response.errors && response.errors.length > 0)
1243
1247
  throw new Error(response.errors[0].message);
1244
1248
  if (response && response.data && response.data.createManyContract) {
@@ -1256,9 +1260,11 @@ exports.Contract = {
1256
1260
  /**
1257
1261
  * Update a single Contract record.
1258
1262
  * @param props - Properties to update.
1263
+ * @param globalClient - Apollo Client instance.
1259
1264
  * @returns The updated Contract or null.
1260
1265
  */
1261
- async update(props) {
1266
+ async update(props, globalClient) {
1267
+ const client = globalClient || client_2.client;
1262
1268
  const UPDATE_ONE_CONTRACT = (0, client_1.gql) `
1263
1269
  mutation updateOneContract($data: ContractUpdateInput!, $where: ContractWhereUniqueInput!) {
1264
1270
  updateOneContract(data: $data, where: $where) {
@@ -4944,7 +4950,7 @@ exports.Contract = {
4944
4950
  };
4945
4951
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
4946
4952
  try {
4947
- const response = await client_2.client.mutate({ mutation: UPDATE_ONE_CONTRACT, variables: filteredVariables });
4953
+ const response = await client.mutate({ mutation: UPDATE_ONE_CONTRACT, variables: filteredVariables });
4948
4954
  if (response.errors && response.errors.length > 0)
4949
4955
  throw new Error(response.errors[0].message);
4950
4956
  if (response && response.data && response.data.updateOneContract) {
@@ -4962,9 +4968,11 @@ exports.Contract = {
4962
4968
  /**
4963
4969
  * Upsert a single Contract record.
4964
4970
  * @param props - Properties to update.
4971
+ * @param globalClient - Apollo Client instance.
4965
4972
  * @returns The updated Contract or null.
4966
4973
  */
4967
- async upsert(props) {
4974
+ async upsert(props, globalClient) {
4975
+ const client = globalClient || client_2.client;
4968
4976
  const UPSERT_ONE_CONTRACT = (0, client_1.gql) `
4969
4977
  mutation upsertOneContract($where: ContractWhereUniqueInput!, $create: ContractCreateInput!, $update: ContractUpdateInput!) {
4970
4978
  upsertOneContract(where: $where, create: $create, update: $update) {
@@ -9576,7 +9584,7 @@ exports.Contract = {
9576
9584
  };
9577
9585
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
9578
9586
  try {
9579
- const response = await client_2.client.mutate({ mutation: UPSERT_ONE_CONTRACT, variables: filteredVariables });
9587
+ const response = await client.mutate({ mutation: UPSERT_ONE_CONTRACT, variables: filteredVariables });
9580
9588
  if (response.errors && response.errors.length > 0)
9581
9589
  throw new Error(response.errors[0].message);
9582
9590
  if (response && response.data && response.data.upsertOneContract) {
@@ -9594,9 +9602,11 @@ exports.Contract = {
9594
9602
  /**
9595
9603
  * Update multiple Contract records.
9596
9604
  * @param props - Array of Contract objects for the updated records.
9605
+ * @param globalClient - Apollo Client instance.
9597
9606
  * @returns The count of created records or null.
9598
9607
  */
9599
- async updateMany(props) {
9608
+ async updateMany(props, globalClient) {
9609
+ const client = globalClient || client_2.client;
9600
9610
  const UPDATE_MANY_CONTRACT = (0, client_1.gql) `
9601
9611
  mutation updateManyContract($data: [ContractCreateManyInput!]!) {
9602
9612
  updateManyContract(data: $data) {
@@ -13282,7 +13292,7 @@ exports.Contract = {
13282
13292
  }));
13283
13293
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
13284
13294
  try {
13285
- const response = await client_2.client.mutate({ mutation: UPDATE_MANY_CONTRACT, variables: filteredVariables });
13295
+ const response = await client.mutate({ mutation: UPDATE_MANY_CONTRACT, variables: filteredVariables });
13286
13296
  if (response.errors && response.errors.length > 0)
13287
13297
  throw new Error(response.errors[0].message);
13288
13298
  if (response && response.data && response.data.updateManyContract) {
@@ -13300,9 +13310,11 @@ exports.Contract = {
13300
13310
  /**
13301
13311
  * Delete a single Contract record.
13302
13312
  * @param props - Properties to update.
13313
+ * @param globalClient - Apollo Client instance.
13303
13314
  * @returns The deleted Contract or null.
13304
13315
  */
13305
- async delete(props) {
13316
+ async delete(props, globalClient) {
13317
+ const client = globalClient || client_2.client;
13306
13318
  const DELETE_ONE_CONTRACT = (0, client_1.gql) `
13307
13319
  mutation deleteOneContract($where: ContractWhereUniqueInput!) {
13308
13320
  deleteOneContract(where: $where) {
@@ -13316,7 +13328,7 @@ exports.Contract = {
13316
13328
  };
13317
13329
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
13318
13330
  try {
13319
- const response = await client_2.client.mutate({ mutation: DELETE_ONE_CONTRACT, variables: filteredVariables });
13331
+ const response = await client.mutate({ mutation: DELETE_ONE_CONTRACT, variables: filteredVariables });
13320
13332
  if (response.errors && response.errors.length > 0)
13321
13333
  throw new Error(response.errors[0].message);
13322
13334
  if (response && response.data && response.data.deleteOneContract) {
@@ -13334,10 +13346,12 @@ exports.Contract = {
13334
13346
  /**
13335
13347
  * Retrieve a single Contract record by ID.
13336
13348
  * @param props - Properties to update.
13349
+ * @param globalClient - Apollo Client instance.
13337
13350
  * @returns The retrieved Contract or null.
13338
13351
  */
13339
- async get(props) {
13352
+ async get(props, globalClient) {
13340
13353
  var _a, _b;
13354
+ const client = globalClient || client_2.client;
13341
13355
  const GET_CONTRACT = (0, client_1.gql) `
13342
13356
  query getContract($where: ContractWhereUniqueInput!) {
13343
13357
  getContract(where: $where) {
@@ -13359,7 +13373,7 @@ exports.Contract = {
13359
13373
  };
13360
13374
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
13361
13375
  try {
13362
- const response = await client_2.client.query({ query: GET_CONTRACT, variables: filteredVariables });
13376
+ const response = await client.query({ query: GET_CONTRACT, variables: filteredVariables });
13363
13377
  if (response.errors && response.errors.length > 0)
13364
13378
  throw new Error(response.errors[0].message);
13365
13379
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getContract) !== null && _b !== void 0 ? _b : null;
@@ -13376,10 +13390,12 @@ exports.Contract = {
13376
13390
  },
13377
13391
  /**
13378
13392
  * Retrieve all Contracts records.
13393
+ * @param globalClient - Apollo Client instance.
13379
13394
  * @returns An array of Contract records or null.
13380
13395
  */
13381
- async getAll() {
13396
+ async getAll(globalClient) {
13382
13397
  var _a, _b;
13398
+ const client = globalClient || client_2.client;
13383
13399
  const GET_ALL_CONTRACT = (0, client_1.gql) `
13384
13400
  query getAllContract {
13385
13401
  contracts {
@@ -13387,7 +13403,7 @@ exports.Contract = {
13387
13403
  }
13388
13404
  }`;
13389
13405
  try {
13390
- const response = await client_2.client.query({ query: GET_ALL_CONTRACT });
13406
+ const response = await client.query({ query: GET_ALL_CONTRACT });
13391
13407
  if (response.errors && response.errors.length > 0)
13392
13408
  throw new Error(response.errors[0].message);
13393
13409
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.contracts) !== null && _b !== void 0 ? _b : null;
@@ -13405,9 +13421,11 @@ exports.Contract = {
13405
13421
  /**
13406
13422
  * Find multiple Contract records based on conditions.
13407
13423
  * @param props - Conditions to find records.
13424
+ * @param globalClient - Apollo Client instance.
13408
13425
  * @returns An array of found Contract records or null.
13409
13426
  */
13410
- async findMany(props) {
13427
+ async findMany(props, globalClient) {
13428
+ const client = globalClient || client_2.client;
13411
13429
  const FIND_MANY_CONTRACT = (0, client_1.gql) `
13412
13430
  query findManyContract($where: ContractWhereInput!) {
13413
13431
  contracts(where: $where) {
@@ -13435,7 +13453,7 @@ exports.Contract = {
13435
13453
  };
13436
13454
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
13437
13455
  try {
13438
- const response = await client_2.client.query({ query: FIND_MANY_CONTRACT, variables: filteredVariables });
13456
+ const response = await client.query({ query: FIND_MANY_CONTRACT, variables: filteredVariables });
13439
13457
  if (response.errors && response.errors.length > 0)
13440
13458
  throw new Error(response.errors[0].message);
13441
13459
  if (response && response.data && response.data.Contracts) {
package/Contract.d.ts CHANGED
@@ -1,61 +1,71 @@
1
1
  import { Contract as ContractType } from './generated/typegraphql-prisma/models/Contract';
2
+ import { ApolloClient } from '@apollo/client';
2
3
  export declare const Contract: {
3
4
  /**
4
5
  * Create a new Contract record.
5
6
  * @param props - Properties for the new record.
7
+ * @param client - Apollo Client instance.
6
8
  * @returns The created Contract or null.
7
9
  */
8
- create(props: ContractType): Promise<ContractType>;
10
+ create(props: ContractType, globalClient?: ApolloClient<any>): Promise<ContractType>;
9
11
  /**
10
12
  * Create multiple Contract records.
11
13
  * @param props - Array of Contract 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: ContractType[]): Promise<{
17
+ createMany(props: ContractType[], globalClient?: ApolloClient<any>): Promise<{
15
18
  count: number;
16
19
  } | null>;
17
20
  /**
18
21
  * Update a single Contract record.
19
22
  * @param props - Properties to update.
23
+ * @param globalClient - Apollo Client instance.
20
24
  * @returns The updated Contract or null.
21
25
  */
22
- update(props: ContractType): Promise<ContractType>;
26
+ update(props: ContractType, globalClient?: ApolloClient<any>): Promise<ContractType>;
23
27
  /**
24
28
  * Upsert a single Contract record.
25
29
  * @param props - Properties to update.
30
+ * @param globalClient - Apollo Client instance.
26
31
  * @returns The updated Contract or null.
27
32
  */
28
- upsert(props: ContractType): Promise<ContractType>;
33
+ upsert(props: ContractType, globalClient?: ApolloClient<any>): Promise<ContractType>;
29
34
  /**
30
35
  * Update multiple Contract records.
31
36
  * @param props - Array of Contract 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: ContractType[]): Promise<{
40
+ updateMany(props: ContractType[], globalClient?: ApolloClient<any>): Promise<{
35
41
  count: number;
36
42
  } | null>;
37
43
  /**
38
44
  * Delete a single Contract record.
39
45
  * @param props - Properties to update.
46
+ * @param globalClient - Apollo Client instance.
40
47
  * @returns The deleted Contract or null.
41
48
  */
42
- delete(props: ContractType): Promise<ContractType>;
49
+ delete(props: ContractType, globalClient?: ApolloClient<any>): Promise<ContractType>;
43
50
  /**
44
51
  * Retrieve a single Contract record by ID.
45
52
  * @param props - Properties to update.
53
+ * @param globalClient - Apollo Client instance.
46
54
  * @returns The retrieved Contract or null.
47
55
  */
48
- get(props: ContractType): Promise<ContractType | null>;
56
+ get(props: ContractType, globalClient?: ApolloClient<any>): Promise<ContractType | null>;
49
57
  /**
50
58
  * Retrieve all Contracts records.
59
+ * @param globalClient - Apollo Client instance.
51
60
  * @returns An array of Contract records or null.
52
61
  */
53
- getAll(): Promise<ContractType[] | null>;
62
+ getAll(globalClient?: ApolloClient<any>): Promise<ContractType[] | null>;
54
63
  /**
55
64
  * Find multiple Contract 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 Contract records or null.
58
68
  */
59
- findMany(props: ContractType): Promise<ContractType[] | null>;
69
+ findMany(props: ContractType, globalClient?: ApolloClient<any>): Promise<ContractType[] | null>;
60
70
  };
61
71
  //# sourceMappingURL=Contract.d.ts.map
package/Customer.cjs CHANGED
@@ -192,9 +192,11 @@ exports.Customer = {
192
192
  /**
193
193
  * Create a new Customer record.
194
194
  * @param props - Properties for the new record.
195
+ * @param client - Apollo Client instance.
195
196
  * @returns The created Customer or null.
196
197
  */
197
- async create(props) {
198
+ async create(props, globalClient) {
199
+ const client = globalClient || client_2.client;
198
200
  const CREATE_ONE_CUSTOMER = (0, client_1.gql) `
199
201
  mutation createOneCustomer($data: CustomerCreateInput!) {
200
202
  createOneCustomer(data: $data) {
@@ -464,7 +466,7 @@ exports.Customer = {
464
466
  };
465
467
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
466
468
  try {
467
- const response = await client_2.client.mutate({ mutation: CREATE_ONE_CUSTOMER, variables: filteredVariables });
469
+ const response = await client.mutate({ mutation: CREATE_ONE_CUSTOMER, variables: filteredVariables });
468
470
  if (response.errors && response.errors.length > 0)
469
471
  throw new Error(response.errors[0].message);
470
472
  if (response && response.data && response.data.createOneCustomer) {
@@ -482,9 +484,11 @@ exports.Customer = {
482
484
  /**
483
485
  * Create multiple Customer records.
484
486
  * @param props - Array of Customer objects for the new records.
487
+ * @param globalClient - Apollo Client instance.
485
488
  * @returns The count of created records or null.
486
489
  */
487
- async createMany(props) {
490
+ async createMany(props, globalClient) {
491
+ const client = globalClient || client_2.client;
488
492
  const CREATE_MANY_CUSTOMER = (0, client_1.gql) `
489
493
  mutation createManyCustomer($data: [CustomerCreateManyInput!]!) {
490
494
  createManyCustomer(data: $data) {
@@ -504,7 +508,7 @@ exports.Customer = {
504
508
  };
505
509
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
506
510
  try {
507
- const response = await client_2.client.mutate({ mutation: CREATE_MANY_CUSTOMER, variables: filteredVariables });
511
+ const response = await client.mutate({ mutation: CREATE_MANY_CUSTOMER, variables: filteredVariables });
508
512
  if (response.errors && response.errors.length > 0)
509
513
  throw new Error(response.errors[0].message);
510
514
  if (response && response.data && response.data.createManyCustomer) {
@@ -522,9 +526,11 @@ exports.Customer = {
522
526
  /**
523
527
  * Update a single Customer record.
524
528
  * @param props - Properties to update.
529
+ * @param globalClient - Apollo Client instance.
525
530
  * @returns The updated Customer or null.
526
531
  */
527
- async update(props) {
532
+ async update(props, globalClient) {
533
+ const client = globalClient || client_2.client;
528
534
  const UPDATE_ONE_CUSTOMER = (0, client_1.gql) `
529
535
  mutation updateOneCustomer($data: CustomerUpdateInput!, $where: CustomerWhereUniqueInput!) {
530
536
  updateOneCustomer(data: $data, where: $where) {
@@ -1487,7 +1493,7 @@ exports.Customer = {
1487
1493
  };
1488
1494
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
1489
1495
  try {
1490
- const response = await client_2.client.mutate({ mutation: UPDATE_ONE_CUSTOMER, variables: filteredVariables });
1496
+ const response = await client.mutate({ mutation: UPDATE_ONE_CUSTOMER, variables: filteredVariables });
1491
1497
  if (response.errors && response.errors.length > 0)
1492
1498
  throw new Error(response.errors[0].message);
1493
1499
  if (response && response.data && response.data.updateOneCustomer) {
@@ -1505,9 +1511,11 @@ exports.Customer = {
1505
1511
  /**
1506
1512
  * Upsert a single Customer record.
1507
1513
  * @param props - Properties to update.
1514
+ * @param globalClient - Apollo Client instance.
1508
1515
  * @returns The updated Customer or null.
1509
1516
  */
1510
- async upsert(props) {
1517
+ async upsert(props, globalClient) {
1518
+ const client = globalClient || client_2.client;
1511
1519
  const UPSERT_ONE_CUSTOMER = (0, client_1.gql) `
1512
1520
  mutation upsertOneCustomer($where: CustomerWhereUniqueInput!, $create: CustomerCreateInput!, $update: CustomerUpdateInput!) {
1513
1521
  upsertOneCustomer(where: $where, create: $create, update: $update) {
@@ -2722,7 +2730,7 @@ exports.Customer = {
2722
2730
  };
2723
2731
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
2724
2732
  try {
2725
- const response = await client_2.client.mutate({ mutation: UPSERT_ONE_CUSTOMER, variables: filteredVariables });
2733
+ const response = await client.mutate({ mutation: UPSERT_ONE_CUSTOMER, variables: filteredVariables });
2726
2734
  if (response.errors && response.errors.length > 0)
2727
2735
  throw new Error(response.errors[0].message);
2728
2736
  if (response && response.data && response.data.upsertOneCustomer) {
@@ -2740,9 +2748,11 @@ exports.Customer = {
2740
2748
  /**
2741
2749
  * Update multiple Customer records.
2742
2750
  * @param props - Array of Customer objects for the updated records.
2751
+ * @param globalClient - Apollo Client instance.
2743
2752
  * @returns The count of created records or null.
2744
2753
  */
2745
- async updateMany(props) {
2754
+ async updateMany(props, globalClient) {
2755
+ const client = globalClient || client_2.client;
2746
2756
  const UPDATE_MANY_CUSTOMER = (0, client_1.gql) `
2747
2757
  mutation updateManyCustomer($data: [CustomerCreateManyInput!]!) {
2748
2758
  updateManyCustomer(data: $data) {
@@ -3705,7 +3715,7 @@ exports.Customer = {
3705
3715
  }));
3706
3716
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
3707
3717
  try {
3708
- const response = await client_2.client.mutate({ mutation: UPDATE_MANY_CUSTOMER, variables: filteredVariables });
3718
+ const response = await client.mutate({ mutation: UPDATE_MANY_CUSTOMER, variables: filteredVariables });
3709
3719
  if (response.errors && response.errors.length > 0)
3710
3720
  throw new Error(response.errors[0].message);
3711
3721
  if (response && response.data && response.data.updateManyCustomer) {
@@ -3723,9 +3733,11 @@ exports.Customer = {
3723
3733
  /**
3724
3734
  * Delete a single Customer record.
3725
3735
  * @param props - Properties to update.
3736
+ * @param globalClient - Apollo Client instance.
3726
3737
  * @returns The deleted Customer or null.
3727
3738
  */
3728
- async delete(props) {
3739
+ async delete(props, globalClient) {
3740
+ const client = globalClient || client_2.client;
3729
3741
  const DELETE_ONE_CUSTOMER = (0, client_1.gql) `
3730
3742
  mutation deleteOneCustomer($where: CustomerWhereUniqueInput!) {
3731
3743
  deleteOneCustomer(where: $where) {
@@ -3739,7 +3751,7 @@ exports.Customer = {
3739
3751
  };
3740
3752
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
3741
3753
  try {
3742
- const response = await client_2.client.mutate({ mutation: DELETE_ONE_CUSTOMER, variables: filteredVariables });
3754
+ const response = await client.mutate({ mutation: DELETE_ONE_CUSTOMER, variables: filteredVariables });
3743
3755
  if (response.errors && response.errors.length > 0)
3744
3756
  throw new Error(response.errors[0].message);
3745
3757
  if (response && response.data && response.data.deleteOneCustomer) {
@@ -3757,10 +3769,12 @@ exports.Customer = {
3757
3769
  /**
3758
3770
  * Retrieve a single Customer record by ID.
3759
3771
  * @param props - Properties to update.
3772
+ * @param globalClient - Apollo Client instance.
3760
3773
  * @returns The retrieved Customer or null.
3761
3774
  */
3762
- async get(props) {
3775
+ async get(props, globalClient) {
3763
3776
  var _a, _b;
3777
+ const client = globalClient || client_2.client;
3764
3778
  const GET_CUSTOMER = (0, client_1.gql) `
3765
3779
  query getCustomer($where: CustomerWhereUniqueInput!) {
3766
3780
  getCustomer(where: $where) {
@@ -3785,7 +3799,7 @@ exports.Customer = {
3785
3799
  };
3786
3800
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
3787
3801
  try {
3788
- const response = await client_2.client.query({ query: GET_CUSTOMER, variables: filteredVariables });
3802
+ const response = await client.query({ query: GET_CUSTOMER, variables: filteredVariables });
3789
3803
  if (response.errors && response.errors.length > 0)
3790
3804
  throw new Error(response.errors[0].message);
3791
3805
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getCustomer) !== null && _b !== void 0 ? _b : null;
@@ -3802,10 +3816,12 @@ exports.Customer = {
3802
3816
  },
3803
3817
  /**
3804
3818
  * Retrieve all Customers records.
3819
+ * @param globalClient - Apollo Client instance.
3805
3820
  * @returns An array of Customer records or null.
3806
3821
  */
3807
- async getAll() {
3822
+ async getAll(globalClient) {
3808
3823
  var _a, _b;
3824
+ const client = globalClient || client_2.client;
3809
3825
  const GET_ALL_CUSTOMER = (0, client_1.gql) `
3810
3826
  query getAllCustomer {
3811
3827
  customers {
@@ -3813,7 +3829,7 @@ exports.Customer = {
3813
3829
  }
3814
3830
  }`;
3815
3831
  try {
3816
- const response = await client_2.client.query({ query: GET_ALL_CUSTOMER });
3832
+ const response = await client.query({ query: GET_ALL_CUSTOMER });
3817
3833
  if (response.errors && response.errors.length > 0)
3818
3834
  throw new Error(response.errors[0].message);
3819
3835
  return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.customers) !== null && _b !== void 0 ? _b : null;
@@ -3831,9 +3847,11 @@ exports.Customer = {
3831
3847
  /**
3832
3848
  * Find multiple Customer records based on conditions.
3833
3849
  * @param props - Conditions to find records.
3850
+ * @param globalClient - Apollo Client instance.
3834
3851
  * @returns An array of found Customer records or null.
3835
3852
  */
3836
- async findMany(props) {
3853
+ async findMany(props, globalClient) {
3854
+ const client = globalClient || client_2.client;
3837
3855
  const FIND_MANY_CUSTOMER = (0, client_1.gql) `
3838
3856
  query findManyCustomer($where: CustomerWhereInput!) {
3839
3857
  customers(where: $where) {
@@ -3864,7 +3882,7 @@ exports.Customer = {
3864
3882
  };
3865
3883
  const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
3866
3884
  try {
3867
- const response = await client_2.client.query({ query: FIND_MANY_CUSTOMER, variables: filteredVariables });
3885
+ const response = await client.query({ query: FIND_MANY_CUSTOMER, variables: filteredVariables });
3868
3886
  if (response.errors && response.errors.length > 0)
3869
3887
  throw new Error(response.errors[0].message);
3870
3888
  if (response && response.data && response.data.Customers) {
package/Customer.d.ts CHANGED
@@ -1,61 +1,71 @@
1
1
  import { Customer as CustomerType } from './generated/typegraphql-prisma/models/Customer';
2
+ import { ApolloClient } from '@apollo/client';
2
3
  export declare const Customer: {
3
4
  /**
4
5
  * Create a new Customer record.
5
6
  * @param props - Properties for the new record.
7
+ * @param client - Apollo Client instance.
6
8
  * @returns The created Customer or null.
7
9
  */
8
- create(props: CustomerType): Promise<CustomerType>;
10
+ create(props: CustomerType, globalClient?: ApolloClient<any>): Promise<CustomerType>;
9
11
  /**
10
12
  * Create multiple Customer records.
11
13
  * @param props - Array of Customer 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: CustomerType[]): Promise<{
17
+ createMany(props: CustomerType[], globalClient?: ApolloClient<any>): Promise<{
15
18
  count: number;
16
19
  } | null>;
17
20
  /**
18
21
  * Update a single Customer record.
19
22
  * @param props - Properties to update.
23
+ * @param globalClient - Apollo Client instance.
20
24
  * @returns The updated Customer or null.
21
25
  */
22
- update(props: CustomerType): Promise<CustomerType>;
26
+ update(props: CustomerType, globalClient?: ApolloClient<any>): Promise<CustomerType>;
23
27
  /**
24
28
  * Upsert a single Customer record.
25
29
  * @param props - Properties to update.
30
+ * @param globalClient - Apollo Client instance.
26
31
  * @returns The updated Customer or null.
27
32
  */
28
- upsert(props: CustomerType): Promise<CustomerType>;
33
+ upsert(props: CustomerType, globalClient?: ApolloClient<any>): Promise<CustomerType>;
29
34
  /**
30
35
  * Update multiple Customer records.
31
36
  * @param props - Array of Customer 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: CustomerType[]): Promise<{
40
+ updateMany(props: CustomerType[], globalClient?: ApolloClient<any>): Promise<{
35
41
  count: number;
36
42
  } | null>;
37
43
  /**
38
44
  * Delete a single Customer record.
39
45
  * @param props - Properties to update.
46
+ * @param globalClient - Apollo Client instance.
40
47
  * @returns The deleted Customer or null.
41
48
  */
42
- delete(props: CustomerType): Promise<CustomerType>;
49
+ delete(props: CustomerType, globalClient?: ApolloClient<any>): Promise<CustomerType>;
43
50
  /**
44
51
  * Retrieve a single Customer record by ID.
45
52
  * @param props - Properties to update.
53
+ * @param globalClient - Apollo Client instance.
46
54
  * @returns The retrieved Customer or null.
47
55
  */
48
- get(props: CustomerType): Promise<CustomerType | null>;
56
+ get(props: CustomerType, globalClient?: ApolloClient<any>): Promise<CustomerType | null>;
49
57
  /**
50
58
  * Retrieve all Customers records.
59
+ * @param globalClient - Apollo Client instance.
51
60
  * @returns An array of Customer records or null.
52
61
  */
53
- getAll(): Promise<CustomerType[] | null>;
62
+ getAll(globalClient?: ApolloClient<any>): Promise<CustomerType[] | null>;
54
63
  /**
55
64
  * Find multiple Customer 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 Customer records or null.
58
68
  */
59
- findMany(props: CustomerType): Promise<CustomerType[] | null>;
69
+ findMany(props: CustomerType, globalClient?: ApolloClient<any>): Promise<CustomerType[] | null>;
60
70
  };
61
71
  //# sourceMappingURL=Customer.d.ts.map