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.
- package/Account.cjs +36 -18
- package/Account.d.ts +19 -9
- package/Action.cjs +36 -18
- package/Action.d.ts +19 -9
- package/Alert.cjs +36 -18
- package/Alert.d.ts +19 -9
- package/AlpacaAccount.cjs +36 -18
- package/AlpacaAccount.d.ts +19 -9
- package/Asset.cjs +36 -18
- package/Asset.d.ts +19 -9
- package/Authenticator.cjs +36 -18
- package/Authenticator.d.ts +19 -9
- package/Contract.cjs +36 -18
- package/Contract.d.ts +19 -9
- package/Customer.cjs +36 -18
- package/Customer.d.ts +19 -9
- package/Deliverable.cjs +36 -18
- package/Deliverable.d.ts +19 -9
- package/EconomicEvent.cjs +36 -18
- package/EconomicEvent.d.ts +19 -9
- package/MarketSentiment.cjs +36 -18
- package/MarketSentiment.d.ts +19 -9
- package/NewsArticle.cjs +36 -18
- package/NewsArticle.d.ts +19 -9
- package/NewsArticleAssetSentiment.cjs +36 -18
- package/NewsArticleAssetSentiment.d.ts +19 -9
- package/Order.cjs +36 -18
- package/Order.d.ts +19 -9
- package/Position.cjs +36 -18
- package/Position.d.ts +19 -9
- package/ScheduledOptionOrder.cjs +36 -18
- package/ScheduledOptionOrder.d.ts +19 -9
- package/Session.cjs +36 -18
- package/Session.d.ts +19 -9
- package/StopLoss.cjs +36 -18
- package/StopLoss.d.ts +19 -9
- package/TakeProfit.cjs +36 -18
- package/TakeProfit.d.ts +19 -9
- package/Trade.cjs +36 -18
- package/Trade.d.ts +19 -9
- package/User.cjs +36 -18
- package/User.d.ts +19 -9
- package/VerificationToken.cjs +36 -18
- package/VerificationToken.d.ts +19 -9
- package/client.cjs +0 -1
- package/index.d.ts +198 -198
- package/package.json +1 -1
- package/server/Account.d.ts +19 -9
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +28 -10
- package/server/Action.d.ts +19 -9
- package/server/Action.d.ts.map +1 -1
- package/server/Action.js.map +1 -1
- package/server/Action.mjs +28 -10
- package/server/Alert.d.ts +19 -9
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +28 -10
- package/server/AlpacaAccount.d.ts +19 -9
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +28 -10
- package/server/Asset.d.ts +19 -9
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +28 -10
- package/server/Authenticator.d.ts +19 -9
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +28 -10
- package/server/Contract.d.ts +19 -9
- package/server/Contract.d.ts.map +1 -1
- package/server/Contract.js.map +1 -1
- package/server/Contract.mjs +28 -10
- package/server/Customer.d.ts +19 -9
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +28 -10
- package/server/Deliverable.d.ts +19 -9
- package/server/Deliverable.d.ts.map +1 -1
- package/server/Deliverable.js.map +1 -1
- package/server/Deliverable.mjs +28 -10
- package/server/EconomicEvent.d.ts +19 -9
- package/server/EconomicEvent.d.ts.map +1 -1
- package/server/EconomicEvent.js.map +1 -1
- package/server/EconomicEvent.mjs +28 -10
- package/server/MarketSentiment.d.ts +19 -9
- package/server/MarketSentiment.d.ts.map +1 -1
- package/server/MarketSentiment.js.map +1 -1
- package/server/MarketSentiment.mjs +28 -10
- package/server/NewsArticle.d.ts +19 -9
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +28 -10
- package/server/NewsArticleAssetSentiment.d.ts +19 -9
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +28 -10
- package/server/Order.d.ts +19 -9
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +28 -10
- package/server/Position.d.ts +19 -9
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +28 -10
- package/server/ScheduledOptionOrder.d.ts +19 -9
- package/server/ScheduledOptionOrder.d.ts.map +1 -1
- package/server/ScheduledOptionOrder.js.map +1 -1
- package/server/ScheduledOptionOrder.mjs +28 -10
- package/server/Session.d.ts +19 -9
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +28 -10
- package/server/StopLoss.d.ts +19 -9
- package/server/StopLoss.d.ts.map +1 -1
- package/server/StopLoss.js.map +1 -1
- package/server/StopLoss.mjs +28 -10
- package/server/TakeProfit.d.ts +19 -9
- package/server/TakeProfit.d.ts.map +1 -1
- package/server/TakeProfit.js.map +1 -1
- package/server/TakeProfit.mjs +28 -10
- package/server/Trade.d.ts +19 -9
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +28 -10
- package/server/User.d.ts +19 -9
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +28 -10
- package/server/VerificationToken.d.ts +19 -9
- package/server/VerificationToken.d.ts.map +1 -1
- package/server/VerificationToken.js.map +1 -1
- package/server/VerificationToken.mjs +28 -10
- package/server/client.d.ts.map +1 -1
- package/server/client.js.map +1 -1
- package/server/client.mjs +0 -1
- package/server/index.d.ts +198 -198
package/Account.cjs
CHANGED
@@ -192,9 +192,11 @@ exports.Account = {
|
|
192
192
|
/**
|
193
193
|
* Create a new Account record.
|
194
194
|
* @param props - Properties for the new record.
|
195
|
+
* @param client - Apollo Client instance.
|
195
196
|
* @returns The created Account 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_ACCOUNT = (0, client_1.gql) `
|
199
201
|
mutation createOneAccount($data: AccountCreateInput!) {
|
200
202
|
createOneAccount(data: $data) {
|
@@ -469,7 +471,7 @@ exports.Account = {
|
|
469
471
|
};
|
470
472
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
471
473
|
try {
|
472
|
-
const response = await
|
474
|
+
const response = await client.mutate({ mutation: CREATE_ONE_ACCOUNT, variables: filteredVariables });
|
473
475
|
if (response.errors && response.errors.length > 0)
|
474
476
|
throw new Error(response.errors[0].message);
|
475
477
|
if (response && response.data && response.data.createOneAccount) {
|
@@ -487,9 +489,11 @@ exports.Account = {
|
|
487
489
|
/**
|
488
490
|
* Create multiple Account records.
|
489
491
|
* @param props - Array of Account objects for the new records.
|
492
|
+
* @param globalClient - Apollo Client instance.
|
490
493
|
* @returns The count of created records or null.
|
491
494
|
*/
|
492
|
-
async createMany(props) {
|
495
|
+
async createMany(props, globalClient) {
|
496
|
+
const client = globalClient || client_2.client;
|
493
497
|
const CREATE_MANY_ACCOUNT = (0, client_1.gql) `
|
494
498
|
mutation createManyAccount($data: [AccountCreateManyInput!]!) {
|
495
499
|
createManyAccount(data: $data) {
|
@@ -513,7 +517,7 @@ exports.Account = {
|
|
513
517
|
};
|
514
518
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
515
519
|
try {
|
516
|
-
const response = await
|
520
|
+
const response = await client.mutate({ mutation: CREATE_MANY_ACCOUNT, variables: filteredVariables });
|
517
521
|
if (response.errors && response.errors.length > 0)
|
518
522
|
throw new Error(response.errors[0].message);
|
519
523
|
if (response && response.data && response.data.createManyAccount) {
|
@@ -531,9 +535,11 @@ exports.Account = {
|
|
531
535
|
/**
|
532
536
|
* Update a single Account record.
|
533
537
|
* @param props - Properties to update.
|
538
|
+
* @param globalClient - Apollo Client instance.
|
534
539
|
* @returns The updated Account or null.
|
535
540
|
*/
|
536
|
-
async update(props) {
|
541
|
+
async update(props, globalClient) {
|
542
|
+
const client = globalClient || client_2.client;
|
537
543
|
const UPDATE_ONE_ACCOUNT = (0, client_1.gql) `
|
538
544
|
mutation updateOneAccount($data: AccountUpdateInput!, $where: AccountWhereUniqueInput!) {
|
539
545
|
updateOneAccount(data: $data, where: $where) {
|
@@ -1507,7 +1513,7 @@ exports.Account = {
|
|
1507
1513
|
};
|
1508
1514
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
1509
1515
|
try {
|
1510
|
-
const response = await
|
1516
|
+
const response = await client.mutate({ mutation: UPDATE_ONE_ACCOUNT, variables: filteredVariables });
|
1511
1517
|
if (response.errors && response.errors.length > 0)
|
1512
1518
|
throw new Error(response.errors[0].message);
|
1513
1519
|
if (response && response.data && response.data.updateOneAccount) {
|
@@ -1525,9 +1531,11 @@ exports.Account = {
|
|
1525
1531
|
/**
|
1526
1532
|
* Upsert a single Account record.
|
1527
1533
|
* @param props - Properties to update.
|
1534
|
+
* @param globalClient - Apollo Client instance.
|
1528
1535
|
* @returns The updated Account or null.
|
1529
1536
|
*/
|
1530
|
-
async upsert(props) {
|
1537
|
+
async upsert(props, globalClient) {
|
1538
|
+
const client = globalClient || client_2.client;
|
1531
1539
|
const UPSERT_ONE_ACCOUNT = (0, client_1.gql) `
|
1532
1540
|
mutation upsertOneAccount($where: AccountWhereUniqueInput!, $create: AccountCreateInput!, $update: AccountUpdateInput!) {
|
1533
1541
|
upsertOneAccount(where: $where, create: $create, update: $update) {
|
@@ -2755,7 +2763,7 @@ exports.Account = {
|
|
2755
2763
|
};
|
2756
2764
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
2757
2765
|
try {
|
2758
|
-
const response = await
|
2766
|
+
const response = await client.mutate({ mutation: UPSERT_ONE_ACCOUNT, variables: filteredVariables });
|
2759
2767
|
if (response.errors && response.errors.length > 0)
|
2760
2768
|
throw new Error(response.errors[0].message);
|
2761
2769
|
if (response && response.data && response.data.upsertOneAccount) {
|
@@ -2773,9 +2781,11 @@ exports.Account = {
|
|
2773
2781
|
/**
|
2774
2782
|
* Update multiple Account records.
|
2775
2783
|
* @param props - Array of Account objects for the updated records.
|
2784
|
+
* @param globalClient - Apollo Client instance.
|
2776
2785
|
* @returns The count of created records or null.
|
2777
2786
|
*/
|
2778
|
-
async updateMany(props) {
|
2787
|
+
async updateMany(props, globalClient) {
|
2788
|
+
const client = globalClient || client_2.client;
|
2779
2789
|
const UPDATE_MANY_ACCOUNT = (0, client_1.gql) `
|
2780
2790
|
mutation updateManyAccount($data: [AccountCreateManyInput!]!) {
|
2781
2791
|
updateManyAccount(data: $data) {
|
@@ -3749,7 +3759,7 @@ exports.Account = {
|
|
3749
3759
|
}));
|
3750
3760
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3751
3761
|
try {
|
3752
|
-
const response = await
|
3762
|
+
const response = await client.mutate({ mutation: UPDATE_MANY_ACCOUNT, variables: filteredVariables });
|
3753
3763
|
if (response.errors && response.errors.length > 0)
|
3754
3764
|
throw new Error(response.errors[0].message);
|
3755
3765
|
if (response && response.data && response.data.updateManyAccount) {
|
@@ -3767,9 +3777,11 @@ exports.Account = {
|
|
3767
3777
|
/**
|
3768
3778
|
* Delete a single Account record.
|
3769
3779
|
* @param props - Properties to update.
|
3780
|
+
* @param globalClient - Apollo Client instance.
|
3770
3781
|
* @returns The deleted Account or null.
|
3771
3782
|
*/
|
3772
|
-
async delete(props) {
|
3783
|
+
async delete(props, globalClient) {
|
3784
|
+
const client = globalClient || client_2.client;
|
3773
3785
|
const DELETE_ONE_ACCOUNT = (0, client_1.gql) `
|
3774
3786
|
mutation deleteOneAccount($where: AccountWhereUniqueInput!) {
|
3775
3787
|
deleteOneAccount(where: $where) {
|
@@ -3783,7 +3795,7 @@ exports.Account = {
|
|
3783
3795
|
};
|
3784
3796
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3785
3797
|
try {
|
3786
|
-
const response = await
|
3798
|
+
const response = await client.mutate({ mutation: DELETE_ONE_ACCOUNT, variables: filteredVariables });
|
3787
3799
|
if (response.errors && response.errors.length > 0)
|
3788
3800
|
throw new Error(response.errors[0].message);
|
3789
3801
|
if (response && response.data && response.data.deleteOneAccount) {
|
@@ -3801,10 +3813,12 @@ exports.Account = {
|
|
3801
3813
|
/**
|
3802
3814
|
* Retrieve a single Account record by ID.
|
3803
3815
|
* @param props - Properties to update.
|
3816
|
+
* @param globalClient - Apollo Client instance.
|
3804
3817
|
* @returns The retrieved Account or null.
|
3805
3818
|
*/
|
3806
|
-
async get(props) {
|
3819
|
+
async get(props, globalClient) {
|
3807
3820
|
var _a, _b;
|
3821
|
+
const client = globalClient || client_2.client;
|
3808
3822
|
const GET_ACCOUNT = (0, client_1.gql) `
|
3809
3823
|
query getAccount($where: AccountWhereUniqueInput!) {
|
3810
3824
|
getAccount(where: $where) {
|
@@ -3824,7 +3838,7 @@ exports.Account = {
|
|
3824
3838
|
};
|
3825
3839
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3826
3840
|
try {
|
3827
|
-
const response = await
|
3841
|
+
const response = await client.query({ query: GET_ACCOUNT, variables: filteredVariables });
|
3828
3842
|
if (response.errors && response.errors.length > 0)
|
3829
3843
|
throw new Error(response.errors[0].message);
|
3830
3844
|
return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getAccount) !== null && _b !== void 0 ? _b : null;
|
@@ -3841,10 +3855,12 @@ exports.Account = {
|
|
3841
3855
|
},
|
3842
3856
|
/**
|
3843
3857
|
* Retrieve all Accounts records.
|
3858
|
+
* @param globalClient - Apollo Client instance.
|
3844
3859
|
* @returns An array of Account records or null.
|
3845
3860
|
*/
|
3846
|
-
async getAll() {
|
3861
|
+
async getAll(globalClient) {
|
3847
3862
|
var _a, _b;
|
3863
|
+
const client = globalClient || client_2.client;
|
3848
3864
|
const GET_ALL_ACCOUNT = (0, client_1.gql) `
|
3849
3865
|
query getAllAccount {
|
3850
3866
|
accounts {
|
@@ -3852,7 +3868,7 @@ exports.Account = {
|
|
3852
3868
|
}
|
3853
3869
|
}`;
|
3854
3870
|
try {
|
3855
|
-
const response = await
|
3871
|
+
const response = await client.query({ query: GET_ALL_ACCOUNT });
|
3856
3872
|
if (response.errors && response.errors.length > 0)
|
3857
3873
|
throw new Error(response.errors[0].message);
|
3858
3874
|
return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.accounts) !== null && _b !== void 0 ? _b : null;
|
@@ -3870,9 +3886,11 @@ exports.Account = {
|
|
3870
3886
|
/**
|
3871
3887
|
* Find multiple Account records based on conditions.
|
3872
3888
|
* @param props - Conditions to find records.
|
3889
|
+
* @param globalClient - Apollo Client instance.
|
3873
3890
|
* @returns An array of found Account records or null.
|
3874
3891
|
*/
|
3875
|
-
async findMany(props) {
|
3892
|
+
async findMany(props, globalClient) {
|
3893
|
+
const client = globalClient || client_2.client;
|
3876
3894
|
const FIND_MANY_ACCOUNT = (0, client_1.gql) `
|
3877
3895
|
query findManyAccount($where: AccountWhereInput!) {
|
3878
3896
|
accounts(where: $where) {
|
@@ -3894,7 +3912,7 @@ exports.Account = {
|
|
3894
3912
|
};
|
3895
3913
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3896
3914
|
try {
|
3897
|
-
const response = await
|
3915
|
+
const response = await client.query({ query: FIND_MANY_ACCOUNT, variables: filteredVariables });
|
3898
3916
|
if (response.errors && response.errors.length > 0)
|
3899
3917
|
throw new Error(response.errors[0].message);
|
3900
3918
|
if (response && response.data && response.data.Accounts) {
|
package/Account.d.ts
CHANGED
@@ -1,61 +1,71 @@
|
|
1
1
|
import { Account as AccountType } from './generated/typegraphql-prisma/models/Account';
|
2
|
+
import { ApolloClient } from '@apollo/client';
|
2
3
|
export declare const Account: {
|
3
4
|
/**
|
4
5
|
* Create a new Account record.
|
5
6
|
* @param props - Properties for the new record.
|
7
|
+
* @param client - Apollo Client instance.
|
6
8
|
* @returns The created Account or null.
|
7
9
|
*/
|
8
|
-
create(props: AccountType): Promise<AccountType>;
|
10
|
+
create(props: AccountType, globalClient?: ApolloClient<any>): Promise<AccountType>;
|
9
11
|
/**
|
10
12
|
* Create multiple Account records.
|
11
13
|
* @param props - Array of Account 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: AccountType[]): Promise<{
|
17
|
+
createMany(props: AccountType[], globalClient?: ApolloClient<any>): Promise<{
|
15
18
|
count: number;
|
16
19
|
} | null>;
|
17
20
|
/**
|
18
21
|
* Update a single Account record.
|
19
22
|
* @param props - Properties to update.
|
23
|
+
* @param globalClient - Apollo Client instance.
|
20
24
|
* @returns The updated Account or null.
|
21
25
|
*/
|
22
|
-
update(props: AccountType): Promise<AccountType>;
|
26
|
+
update(props: AccountType, globalClient?: ApolloClient<any>): Promise<AccountType>;
|
23
27
|
/**
|
24
28
|
* Upsert a single Account record.
|
25
29
|
* @param props - Properties to update.
|
30
|
+
* @param globalClient - Apollo Client instance.
|
26
31
|
* @returns The updated Account or null.
|
27
32
|
*/
|
28
|
-
upsert(props: AccountType): Promise<AccountType>;
|
33
|
+
upsert(props: AccountType, globalClient?: ApolloClient<any>): Promise<AccountType>;
|
29
34
|
/**
|
30
35
|
* Update multiple Account records.
|
31
36
|
* @param props - Array of Account 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: AccountType[]): Promise<{
|
40
|
+
updateMany(props: AccountType[], globalClient?: ApolloClient<any>): Promise<{
|
35
41
|
count: number;
|
36
42
|
} | null>;
|
37
43
|
/**
|
38
44
|
* Delete a single Account record.
|
39
45
|
* @param props - Properties to update.
|
46
|
+
* @param globalClient - Apollo Client instance.
|
40
47
|
* @returns The deleted Account or null.
|
41
48
|
*/
|
42
|
-
delete(props: AccountType): Promise<AccountType>;
|
49
|
+
delete(props: AccountType, globalClient?: ApolloClient<any>): Promise<AccountType>;
|
43
50
|
/**
|
44
51
|
* Retrieve a single Account record by ID.
|
45
52
|
* @param props - Properties to update.
|
53
|
+
* @param globalClient - Apollo Client instance.
|
46
54
|
* @returns The retrieved Account or null.
|
47
55
|
*/
|
48
|
-
get(props: AccountType): Promise<AccountType | null>;
|
56
|
+
get(props: AccountType, globalClient?: ApolloClient<any>): Promise<AccountType | null>;
|
49
57
|
/**
|
50
58
|
* Retrieve all Accounts records.
|
59
|
+
* @param globalClient - Apollo Client instance.
|
51
60
|
* @returns An array of Account records or null.
|
52
61
|
*/
|
53
|
-
getAll(): Promise<AccountType[] | null>;
|
62
|
+
getAll(globalClient?: ApolloClient<any>): Promise<AccountType[] | null>;
|
54
63
|
/**
|
55
64
|
* Find multiple Account 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 Account records or null.
|
58
68
|
*/
|
59
|
-
findMany(props: AccountType): Promise<AccountType[] | null>;
|
69
|
+
findMany(props: AccountType, globalClient?: ApolloClient<any>): Promise<AccountType[] | null>;
|
60
70
|
};
|
61
71
|
//# sourceMappingURL=Account.d.ts.map
|
package/Action.cjs
CHANGED
@@ -132,9 +132,11 @@ exports.Action = {
|
|
132
132
|
/**
|
133
133
|
* Create a new Action record.
|
134
134
|
* @param props - Properties for the new record.
|
135
|
+
* @param client - Apollo Client instance.
|
135
136
|
* @returns The created Action or null.
|
136
137
|
*/
|
137
|
-
async create(props) {
|
138
|
+
async create(props, globalClient) {
|
139
|
+
const client = globalClient || client_2.client;
|
138
140
|
const CREATE_ONE_ACTION = (0, client_1.gql) `
|
139
141
|
mutation createOneAction($data: ActionCreateInput!) {
|
140
142
|
createOneAction(data: $data) {
|
@@ -1094,7 +1096,7 @@ exports.Action = {
|
|
1094
1096
|
};
|
1095
1097
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
1096
1098
|
try {
|
1097
|
-
const response = await
|
1099
|
+
const response = await client.mutate({ mutation: CREATE_ONE_ACTION, variables: filteredVariables });
|
1098
1100
|
if (response.errors && response.errors.length > 0)
|
1099
1101
|
throw new Error(response.errors[0].message);
|
1100
1102
|
if (response && response.data && response.data.createOneAction) {
|
@@ -1112,9 +1114,11 @@ exports.Action = {
|
|
1112
1114
|
/**
|
1113
1115
|
* Create multiple Action records.
|
1114
1116
|
* @param props - Array of Action objects for the new records.
|
1117
|
+
* @param globalClient - Apollo Client instance.
|
1115
1118
|
* @returns The count of created records or null.
|
1116
1119
|
*/
|
1117
|
-
async createMany(props) {
|
1120
|
+
async createMany(props, globalClient) {
|
1121
|
+
const client = globalClient || client_2.client;
|
1118
1122
|
const CREATE_MANY_ACTION = (0, client_1.gql) `
|
1119
1123
|
mutation createManyAction($data: [ActionCreateManyInput!]!) {
|
1120
1124
|
createManyAction(data: $data) {
|
@@ -1133,7 +1137,7 @@ exports.Action = {
|
|
1133
1137
|
};
|
1134
1138
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
1135
1139
|
try {
|
1136
|
-
const response = await
|
1140
|
+
const response = await client.mutate({ mutation: CREATE_MANY_ACTION, variables: filteredVariables });
|
1137
1141
|
if (response.errors && response.errors.length > 0)
|
1138
1142
|
throw new Error(response.errors[0].message);
|
1139
1143
|
if (response && response.data && response.data.createManyAction) {
|
@@ -1151,9 +1155,11 @@ exports.Action = {
|
|
1151
1155
|
/**
|
1152
1156
|
* Update a single Action record.
|
1153
1157
|
* @param props - Properties to update.
|
1158
|
+
* @param globalClient - Apollo Client instance.
|
1154
1159
|
* @returns The updated Action or null.
|
1155
1160
|
*/
|
1156
|
-
async update(props) {
|
1161
|
+
async update(props, globalClient) {
|
1162
|
+
const client = globalClient || client_2.client;
|
1157
1163
|
const UPDATE_ONE_ACTION = (0, client_1.gql) `
|
1158
1164
|
mutation updateOneAction($data: ActionUpdateInput!, $where: ActionWhereUniqueInput!) {
|
1159
1165
|
updateOneAction(data: $data, where: $where) {
|
@@ -5208,7 +5214,7 @@ exports.Action = {
|
|
5208
5214
|
};
|
5209
5215
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
5210
5216
|
try {
|
5211
|
-
const response = await
|
5217
|
+
const response = await client.mutate({ mutation: UPDATE_ONE_ACTION, variables: filteredVariables });
|
5212
5218
|
if (response.errors && response.errors.length > 0)
|
5213
5219
|
throw new Error(response.errors[0].message);
|
5214
5220
|
if (response && response.data && response.data.updateOneAction) {
|
@@ -5226,9 +5232,11 @@ exports.Action = {
|
|
5226
5232
|
/**
|
5227
5233
|
* Upsert a single Action record.
|
5228
5234
|
* @param props - Properties to update.
|
5235
|
+
* @param globalClient - Apollo Client instance.
|
5229
5236
|
* @returns The updated Action or null.
|
5230
5237
|
*/
|
5231
|
-
async upsert(props) {
|
5238
|
+
async upsert(props, globalClient) {
|
5239
|
+
const client = globalClient || client_2.client;
|
5232
5240
|
const UPSERT_ONE_ACTION = (0, client_1.gql) `
|
5233
5241
|
mutation upsertOneAction($where: ActionWhereUniqueInput!, $create: ActionCreateInput!, $update: ActionUpdateInput!) {
|
5234
5242
|
upsertOneAction(where: $where, create: $create, update: $update) {
|
@@ -10228,7 +10236,7 @@ exports.Action = {
|
|
10228
10236
|
};
|
10229
10237
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
10230
10238
|
try {
|
10231
|
-
const response = await
|
10239
|
+
const response = await client.mutate({ mutation: UPSERT_ONE_ACTION, variables: filteredVariables });
|
10232
10240
|
if (response.errors && response.errors.length > 0)
|
10233
10241
|
throw new Error(response.errors[0].message);
|
10234
10242
|
if (response && response.data && response.data.upsertOneAction) {
|
@@ -10246,9 +10254,11 @@ exports.Action = {
|
|
10246
10254
|
/**
|
10247
10255
|
* Update multiple Action records.
|
10248
10256
|
* @param props - Array of Action objects for the updated records.
|
10257
|
+
* @param globalClient - Apollo Client instance.
|
10249
10258
|
* @returns The count of created records or null.
|
10250
10259
|
*/
|
10251
|
-
async updateMany(props) {
|
10260
|
+
async updateMany(props, globalClient) {
|
10261
|
+
const client = globalClient || client_2.client;
|
10252
10262
|
const UPDATE_MANY_ACTION = (0, client_1.gql) `
|
10253
10263
|
mutation updateManyAction($data: [ActionCreateManyInput!]!) {
|
10254
10264
|
updateManyAction(data: $data) {
|
@@ -14303,7 +14313,7 @@ exports.Action = {
|
|
14303
14313
|
}));
|
14304
14314
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
14305
14315
|
try {
|
14306
|
-
const response = await
|
14316
|
+
const response = await client.mutate({ mutation: UPDATE_MANY_ACTION, variables: filteredVariables });
|
14307
14317
|
if (response.errors && response.errors.length > 0)
|
14308
14318
|
throw new Error(response.errors[0].message);
|
14309
14319
|
if (response && response.data && response.data.updateManyAction) {
|
@@ -14321,9 +14331,11 @@ exports.Action = {
|
|
14321
14331
|
/**
|
14322
14332
|
* Delete a single Action record.
|
14323
14333
|
* @param props - Properties to update.
|
14334
|
+
* @param globalClient - Apollo Client instance.
|
14324
14335
|
* @returns The deleted Action or null.
|
14325
14336
|
*/
|
14326
|
-
async delete(props) {
|
14337
|
+
async delete(props, globalClient) {
|
14338
|
+
const client = globalClient || client_2.client;
|
14327
14339
|
const DELETE_ONE_ACTION = (0, client_1.gql) `
|
14328
14340
|
mutation deleteOneAction($where: ActionWhereUniqueInput!) {
|
14329
14341
|
deleteOneAction(where: $where) {
|
@@ -14337,7 +14349,7 @@ exports.Action = {
|
|
14337
14349
|
};
|
14338
14350
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
14339
14351
|
try {
|
14340
|
-
const response = await
|
14352
|
+
const response = await client.mutate({ mutation: DELETE_ONE_ACTION, variables: filteredVariables });
|
14341
14353
|
if (response.errors && response.errors.length > 0)
|
14342
14354
|
throw new Error(response.errors[0].message);
|
14343
14355
|
if (response && response.data && response.data.deleteOneAction) {
|
@@ -14355,10 +14367,12 @@ exports.Action = {
|
|
14355
14367
|
/**
|
14356
14368
|
* Retrieve a single Action record by ID.
|
14357
14369
|
* @param props - Properties to update.
|
14370
|
+
* @param globalClient - Apollo Client instance.
|
14358
14371
|
* @returns The retrieved Action or null.
|
14359
14372
|
*/
|
14360
|
-
async get(props) {
|
14373
|
+
async get(props, globalClient) {
|
14361
14374
|
var _a, _b;
|
14375
|
+
const client = globalClient || client_2.client;
|
14362
14376
|
const GET_ACTION = (0, client_1.gql) `
|
14363
14377
|
query getAction($where: ActionWhereUniqueInput!) {
|
14364
14378
|
getAction(where: $where) {
|
@@ -14375,7 +14389,7 @@ exports.Action = {
|
|
14375
14389
|
};
|
14376
14390
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
14377
14391
|
try {
|
14378
|
-
const response = await
|
14392
|
+
const response = await client.query({ query: GET_ACTION, variables: filteredVariables });
|
14379
14393
|
if (response.errors && response.errors.length > 0)
|
14380
14394
|
throw new Error(response.errors[0].message);
|
14381
14395
|
return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getAction) !== null && _b !== void 0 ? _b : null;
|
@@ -14392,10 +14406,12 @@ exports.Action = {
|
|
14392
14406
|
},
|
14393
14407
|
/**
|
14394
14408
|
* Retrieve all Actions records.
|
14409
|
+
* @param globalClient - Apollo Client instance.
|
14395
14410
|
* @returns An array of Action records or null.
|
14396
14411
|
*/
|
14397
|
-
async getAll() {
|
14412
|
+
async getAll(globalClient) {
|
14398
14413
|
var _a, _b;
|
14414
|
+
const client = globalClient || client_2.client;
|
14399
14415
|
const GET_ALL_ACTION = (0, client_1.gql) `
|
14400
14416
|
query getAllAction {
|
14401
14417
|
actions {
|
@@ -14403,7 +14419,7 @@ exports.Action = {
|
|
14403
14419
|
}
|
14404
14420
|
}`;
|
14405
14421
|
try {
|
14406
|
-
const response = await
|
14422
|
+
const response = await client.query({ query: GET_ALL_ACTION });
|
14407
14423
|
if (response.errors && response.errors.length > 0)
|
14408
14424
|
throw new Error(response.errors[0].message);
|
14409
14425
|
return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.actions) !== null && _b !== void 0 ? _b : null;
|
@@ -14421,9 +14437,11 @@ exports.Action = {
|
|
14421
14437
|
/**
|
14422
14438
|
* Find multiple Action records based on conditions.
|
14423
14439
|
* @param props - Conditions to find records.
|
14440
|
+
* @param globalClient - Apollo Client instance.
|
14424
14441
|
* @returns An array of found Action records or null.
|
14425
14442
|
*/
|
14426
|
-
async findMany(props) {
|
14443
|
+
async findMany(props, globalClient) {
|
14444
|
+
const client = globalClient || client_2.client;
|
14427
14445
|
const FIND_MANY_ACTION = (0, client_1.gql) `
|
14428
14446
|
query findManyAction($where: ActionWhereInput!) {
|
14429
14447
|
actions(where: $where) {
|
@@ -14442,7 +14460,7 @@ exports.Action = {
|
|
14442
14460
|
};
|
14443
14461
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
14444
14462
|
try {
|
14445
|
-
const response = await
|
14463
|
+
const response = await client.query({ query: FIND_MANY_ACTION, variables: filteredVariables });
|
14446
14464
|
if (response.errors && response.errors.length > 0)
|
14447
14465
|
throw new Error(response.errors[0].message);
|
14448
14466
|
if (response && response.data && response.data.Actions) {
|
package/Action.d.ts
CHANGED
@@ -1,61 +1,71 @@
|
|
1
1
|
import { Action as ActionType } from './generated/typegraphql-prisma/models/Action';
|
2
|
+
import { ApolloClient } from '@apollo/client';
|
2
3
|
export declare const Action: {
|
3
4
|
/**
|
4
5
|
* Create a new Action record.
|
5
6
|
* @param props - Properties for the new record.
|
7
|
+
* @param client - Apollo Client instance.
|
6
8
|
* @returns The created Action or null.
|
7
9
|
*/
|
8
|
-
create(props: ActionType): Promise<ActionType>;
|
10
|
+
create(props: ActionType, globalClient?: ApolloClient<any>): Promise<ActionType>;
|
9
11
|
/**
|
10
12
|
* Create multiple Action records.
|
11
13
|
* @param props - Array of Action 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: ActionType[]): Promise<{
|
17
|
+
createMany(props: ActionType[], globalClient?: ApolloClient<any>): Promise<{
|
15
18
|
count: number;
|
16
19
|
} | null>;
|
17
20
|
/**
|
18
21
|
* Update a single Action record.
|
19
22
|
* @param props - Properties to update.
|
23
|
+
* @param globalClient - Apollo Client instance.
|
20
24
|
* @returns The updated Action or null.
|
21
25
|
*/
|
22
|
-
update(props: ActionType): Promise<ActionType>;
|
26
|
+
update(props: ActionType, globalClient?: ApolloClient<any>): Promise<ActionType>;
|
23
27
|
/**
|
24
28
|
* Upsert a single Action record.
|
25
29
|
* @param props - Properties to update.
|
30
|
+
* @param globalClient - Apollo Client instance.
|
26
31
|
* @returns The updated Action or null.
|
27
32
|
*/
|
28
|
-
upsert(props: ActionType): Promise<ActionType>;
|
33
|
+
upsert(props: ActionType, globalClient?: ApolloClient<any>): Promise<ActionType>;
|
29
34
|
/**
|
30
35
|
* Update multiple Action records.
|
31
36
|
* @param props - Array of Action 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: ActionType[]): Promise<{
|
40
|
+
updateMany(props: ActionType[], globalClient?: ApolloClient<any>): Promise<{
|
35
41
|
count: number;
|
36
42
|
} | null>;
|
37
43
|
/**
|
38
44
|
* Delete a single Action record.
|
39
45
|
* @param props - Properties to update.
|
46
|
+
* @param globalClient - Apollo Client instance.
|
40
47
|
* @returns The deleted Action or null.
|
41
48
|
*/
|
42
|
-
delete(props: ActionType): Promise<ActionType>;
|
49
|
+
delete(props: ActionType, globalClient?: ApolloClient<any>): Promise<ActionType>;
|
43
50
|
/**
|
44
51
|
* Retrieve a single Action record by ID.
|
45
52
|
* @param props - Properties to update.
|
53
|
+
* @param globalClient - Apollo Client instance.
|
46
54
|
* @returns The retrieved Action or null.
|
47
55
|
*/
|
48
|
-
get(props: ActionType): Promise<ActionType | null>;
|
56
|
+
get(props: ActionType, globalClient?: ApolloClient<any>): Promise<ActionType | null>;
|
49
57
|
/**
|
50
58
|
* Retrieve all Actions records.
|
59
|
+
* @param globalClient - Apollo Client instance.
|
51
60
|
* @returns An array of Action records or null.
|
52
61
|
*/
|
53
|
-
getAll(): Promise<ActionType[] | null>;
|
62
|
+
getAll(globalClient?: ApolloClient<any>): Promise<ActionType[] | null>;
|
54
63
|
/**
|
55
64
|
* Find multiple Action 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 Action records or null.
|
58
68
|
*/
|
59
|
-
findMany(props: ActionType): Promise<ActionType[] | null>;
|
69
|
+
findMany(props: ActionType, globalClient?: ApolloClient<any>): Promise<ActionType[] | null>;
|
60
70
|
};
|
61
71
|
//# sourceMappingURL=Action.d.ts.map
|