adaptic-backend 1.0.179 → 1.0.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Account.cjs +15 -37
- package/Action.cjs +23 -61
- package/Alert.cjs +13 -31
- package/AlpacaAccount.cjs +30 -82
- package/Asset.cjs +30 -82
- package/Authenticator.cjs +15 -37
- package/Customer.cjs +15 -37
- package/EconomicEvent.cjs +8 -16
- package/MarketSentiment.cjs +8 -16
- package/NewsArticle.cjs +15 -37
- package/NewsArticleAssetSentiment.cjs +13 -31
- package/Order.cjs +11 -25
- package/Position.cjs +18 -46
- package/ScheduledOptionOrder.cjs +8 -16
- package/Session.cjs +15 -37
- package/StopLoss.cjs +9 -19
- package/TakeProfit.cjs +9 -19
- package/Trade.cjs +21 -55
- package/User.cjs +13 -31
- package/VerificationToken.cjs +8 -16
- package/client.cjs +3 -0
- package/client.d.ts +1 -0
- package/generated/typegraphql-prisma/enhance.cjs +1 -1
- package/generated/typegraphql-prisma/enhance.js.map +1 -1
- package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.cjs +6 -7
- package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts +1 -2
- package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts.map +1 -1
- package/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.js.map +1 -1
- package/package.json +1 -1
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +8 -30
- package/server/Action.d.ts.map +1 -1
- package/server/Action.js.map +1 -1
- package/server/Action.mjs +16 -54
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +6 -24
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +23 -75
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +23 -75
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +8 -30
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +8 -30
- package/server/EconomicEvent.d.ts.map +1 -1
- package/server/EconomicEvent.js.map +1 -1
- package/server/EconomicEvent.mjs +1 -9
- package/server/MarketSentiment.d.ts.map +1 -1
- package/server/MarketSentiment.js.map +1 -1
- package/server/MarketSentiment.mjs +1 -9
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +8 -30
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +6 -24
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +4 -18
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +11 -39
- package/server/ScheduledOptionOrder.d.ts.map +1 -1
- package/server/ScheduledOptionOrder.js.map +1 -1
- package/server/ScheduledOptionOrder.mjs +1 -9
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +8 -30
- package/server/StopLoss.d.ts.map +1 -1
- package/server/StopLoss.js.map +1 -1
- package/server/StopLoss.mjs +2 -12
- package/server/TakeProfit.d.ts.map +1 -1
- package/server/TakeProfit.js.map +1 -1
- package/server/TakeProfit.mjs +2 -12
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +14 -48
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +6 -24
- package/server/VerificationToken.d.ts.map +1 -1
- package/server/VerificationToken.js.map +1 -1
- package/server/VerificationToken.mjs +1 -9
- package/server/client.d.ts +1 -0
- package/server/client.d.ts.map +1 -1
- package/server/client.js.map +1 -1
- package/server/client.mjs +2 -0
- package/server/generated/typegraphql-prisma/enhance.js.map +1 -1
- package/server/generated/typegraphql-prisma/enhance.mjs +1 -1
- package/server/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts +1 -2
- package/server/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.d.ts.map +1 -1
- package/server/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.js.map +1 -1
- package/server/generated/typegraphql-prisma/resolvers/inputs/OrderWhereUniqueInput.mjs +7 -8
package/StopLoss.cjs
CHANGED
@@ -24,7 +24,6 @@ exports.StopLoss = {
|
|
24
24
|
* @returns The created StopLoss or null.
|
25
25
|
*/
|
26
26
|
async create(props) {
|
27
|
-
const client = (0, client_2.createApolloClient)();
|
28
27
|
const CREATE_ONE_STOPLOSS = (0, client_1.gql) `
|
29
28
|
mutation createOneStopLoss($data: StopLossCreateInput!) {
|
30
29
|
createOneStopLoss(data: $data) {
|
@@ -45,11 +44,9 @@ exports.StopLoss = {
|
|
45
44
|
: { connectOrCreate: {
|
46
45
|
where: {
|
47
46
|
id: props.Order.id !== undefined ? props.Order.id : undefined,
|
47
|
+
clientOrderId: props.Order.clientOrderId !== undefined ? props.Order.clientOrderId : undefined,
|
48
48
|
actionId: props.Order.actionId !== undefined ? props.Order.actionId : undefined,
|
49
49
|
stopLossId: props.Order.stopLossId !== undefined ? props.Order.stopLossId : undefined,
|
50
|
-
clientOrderId: props.Order.clientOrderId !== undefined ? {
|
51
|
-
equals: props.Order.clientOrderId
|
52
|
-
} : undefined,
|
53
50
|
alpacaAccountId: props.Order.alpacaAccountId !== undefined ? {
|
54
51
|
equals: props.Order.alpacaAccountId
|
55
52
|
} : undefined,
|
@@ -461,7 +458,7 @@ exports.StopLoss = {
|
|
461
458
|
};
|
462
459
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
463
460
|
try {
|
464
|
-
const response = await client.mutate({ mutation: CREATE_ONE_STOPLOSS, variables: filteredVariables });
|
461
|
+
const response = await client_2.client.mutate({ mutation: CREATE_ONE_STOPLOSS, variables: filteredVariables });
|
465
462
|
if (response.errors && response.errors.length > 0)
|
466
463
|
throw new Error(response.errors[0].message);
|
467
464
|
if (response && response.data && response.data.createOneStopLoss) {
|
@@ -482,7 +479,6 @@ exports.StopLoss = {
|
|
482
479
|
* @returns The count of created records or null.
|
483
480
|
*/
|
484
481
|
async createMany(props) {
|
485
|
-
const client = (0, client_2.createApolloClient)();
|
486
482
|
const CREATE_MANY_STOPLOSS = (0, client_1.gql) `
|
487
483
|
mutation createManyStopLoss($data: [StopLossCreateManyInput!]!) {
|
488
484
|
createManyStopLoss(data: $data) {
|
@@ -498,7 +494,7 @@ exports.StopLoss = {
|
|
498
494
|
};
|
499
495
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
500
496
|
try {
|
501
|
-
const response = await client.mutate({ mutation: CREATE_MANY_STOPLOSS, variables: filteredVariables });
|
497
|
+
const response = await client_2.client.mutate({ mutation: CREATE_MANY_STOPLOSS, variables: filteredVariables });
|
502
498
|
if (response.errors && response.errors.length > 0)
|
503
499
|
throw new Error(response.errors[0].message);
|
504
500
|
if (response && response.data && response.data.createManyStopLoss) {
|
@@ -519,7 +515,6 @@ exports.StopLoss = {
|
|
519
515
|
* @returns The updated StopLoss or null.
|
520
516
|
*/
|
521
517
|
async update(props) {
|
522
|
-
const client = (0, client_2.createApolloClient)();
|
523
518
|
const UPDATE_ONE_STOPLOSS = (0, client_1.gql) `
|
524
519
|
mutation updateOneStopLoss($data: StopLossUpdateInput!, $where: StopLossWhereUniqueInput!) {
|
525
520
|
updateOneStopLoss(data: $data, where: $where) {
|
@@ -2125,7 +2120,7 @@ exports.StopLoss = {
|
|
2125
2120
|
};
|
2126
2121
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
2127
2122
|
try {
|
2128
|
-
const response = await client.mutate({ mutation: UPDATE_ONE_STOPLOSS, variables: filteredVariables });
|
2123
|
+
const response = await client_2.client.mutate({ mutation: UPDATE_ONE_STOPLOSS, variables: filteredVariables });
|
2129
2124
|
if (response.errors && response.errors.length > 0)
|
2130
2125
|
throw new Error(response.errors[0].message);
|
2131
2126
|
if (response && response.data && response.data.updateOneStopLoss) {
|
@@ -2146,7 +2141,6 @@ exports.StopLoss = {
|
|
2146
2141
|
* @returns The count of created records or null.
|
2147
2142
|
*/
|
2148
2143
|
async updateMany(props) {
|
2149
|
-
const client = (0, client_2.createApolloClient)();
|
2150
2144
|
const UPDATE_MANY_STOPLOSS = (0, client_1.gql) `
|
2151
2145
|
mutation updateManyStopLoss($data: [StopLossCreateManyInput!]!) {
|
2152
2146
|
updateManyStopLoss(data: $data) {
|
@@ -3752,7 +3746,7 @@ exports.StopLoss = {
|
|
3752
3746
|
}));
|
3753
3747
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3754
3748
|
try {
|
3755
|
-
const response = await client.mutate({ mutation: UPDATE_MANY_STOPLOSS, variables: filteredVariables });
|
3749
|
+
const response = await client_2.client.mutate({ mutation: UPDATE_MANY_STOPLOSS, variables: filteredVariables });
|
3756
3750
|
if (response.errors && response.errors.length > 0)
|
3757
3751
|
throw new Error(response.errors[0].message);
|
3758
3752
|
if (response && response.data && response.data.updateManyStopLoss) {
|
@@ -3773,7 +3767,6 @@ exports.StopLoss = {
|
|
3773
3767
|
* @returns The deleted StopLoss or null.
|
3774
3768
|
*/
|
3775
3769
|
async delete(props) {
|
3776
|
-
const client = (0, client_2.createApolloClient)();
|
3777
3770
|
const DELETE_ONE_STOPLOSS = (0, client_1.gql) `
|
3778
3771
|
mutation deleteOneStopLoss($where: StopLossWhereUniqueInput!) {
|
3779
3772
|
deleteOneStopLoss(where: $where) {
|
@@ -3787,7 +3780,7 @@ exports.StopLoss = {
|
|
3787
3780
|
};
|
3788
3781
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3789
3782
|
try {
|
3790
|
-
const response = await client.mutate({ mutation: DELETE_ONE_STOPLOSS, variables: filteredVariables });
|
3783
|
+
const response = await client_2.client.mutate({ mutation: DELETE_ONE_STOPLOSS, variables: filteredVariables });
|
3791
3784
|
if (response.errors && response.errors.length > 0)
|
3792
3785
|
throw new Error(response.errors[0].message);
|
3793
3786
|
if (response && response.data && response.data.deleteOneStopLoss) {
|
@@ -3809,7 +3802,6 @@ exports.StopLoss = {
|
|
3809
3802
|
*/
|
3810
3803
|
async get(props) {
|
3811
3804
|
var _a, _b;
|
3812
|
-
const client = (0, client_2.createApolloClient)();
|
3813
3805
|
const GET_STOPLOSS = (0, client_1.gql) `
|
3814
3806
|
query getStopLoss($where: StopLossWhereUniqueInput!) {
|
3815
3807
|
getStopLoss(where: $where) {
|
@@ -3826,7 +3818,7 @@ exports.StopLoss = {
|
|
3826
3818
|
};
|
3827
3819
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3828
3820
|
try {
|
3829
|
-
const response = await client.query({ query: GET_STOPLOSS, variables: filteredVariables });
|
3821
|
+
const response = await client_2.client.query({ query: GET_STOPLOSS, variables: filteredVariables });
|
3830
3822
|
if (response.errors && response.errors.length > 0)
|
3831
3823
|
throw new Error(response.errors[0].message);
|
3832
3824
|
return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getStopLoss) !== null && _b !== void 0 ? _b : null;
|
@@ -3847,7 +3839,6 @@ exports.StopLoss = {
|
|
3847
3839
|
*/
|
3848
3840
|
async getAll() {
|
3849
3841
|
var _a, _b;
|
3850
|
-
const client = (0, client_2.createApolloClient)();
|
3851
3842
|
const GET_ALL_STOPLOSS = (0, client_1.gql) `
|
3852
3843
|
query getAllStopLoss {
|
3853
3844
|
stopLosses {
|
@@ -3855,7 +3846,7 @@ exports.StopLoss = {
|
|
3855
3846
|
}
|
3856
3847
|
}`;
|
3857
3848
|
try {
|
3858
|
-
const response = await client.query({ query: GET_ALL_STOPLOSS });
|
3849
|
+
const response = await client_2.client.query({ query: GET_ALL_STOPLOSS });
|
3859
3850
|
if (response.errors && response.errors.length > 0)
|
3860
3851
|
throw new Error(response.errors[0].message);
|
3861
3852
|
return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.stopLosses) !== null && _b !== void 0 ? _b : null;
|
@@ -3876,7 +3867,6 @@ exports.StopLoss = {
|
|
3876
3867
|
* @returns An array of found StopLoss records or null.
|
3877
3868
|
*/
|
3878
3869
|
async findMany(props) {
|
3879
|
-
const client = (0, client_2.createApolloClient)();
|
3880
3870
|
const FIND_MANY_STOPLOSS = (0, client_1.gql) `
|
3881
3871
|
query findManyStopLoss($where: StopLossWhereInput!) {
|
3882
3872
|
stopLosses(where: $where) {
|
@@ -3897,7 +3887,7 @@ exports.StopLoss = {
|
|
3897
3887
|
};
|
3898
3888
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3899
3889
|
try {
|
3900
|
-
const response = await client.query({ query: FIND_MANY_STOPLOSS, variables: filteredVariables });
|
3890
|
+
const response = await client_2.client.query({ query: FIND_MANY_STOPLOSS, variables: filteredVariables });
|
3901
3891
|
if (response.errors && response.errors.length > 0)
|
3902
3892
|
throw new Error(response.errors[0].message);
|
3903
3893
|
if (response && response.data && response.data.StopLosses) {
|
package/TakeProfit.cjs
CHANGED
@@ -24,7 +24,6 @@ exports.TakeProfit = {
|
|
24
24
|
* @returns The created TakeProfit or null.
|
25
25
|
*/
|
26
26
|
async create(props) {
|
27
|
-
const client = (0, client_2.createApolloClient)();
|
28
27
|
const CREATE_ONE_TAKEPROFIT = (0, client_1.gql) `
|
29
28
|
mutation createOneTakeProfit($data: TakeProfitCreateInput!) {
|
30
29
|
createOneTakeProfit(data: $data) {
|
@@ -45,11 +44,9 @@ exports.TakeProfit = {
|
|
45
44
|
: { connectOrCreate: {
|
46
45
|
where: {
|
47
46
|
id: props.Order.id !== undefined ? props.Order.id : undefined,
|
47
|
+
clientOrderId: props.Order.clientOrderId !== undefined ? props.Order.clientOrderId : undefined,
|
48
48
|
actionId: props.Order.actionId !== undefined ? props.Order.actionId : undefined,
|
49
49
|
stopLossId: props.Order.stopLossId !== undefined ? props.Order.stopLossId : undefined,
|
50
|
-
clientOrderId: props.Order.clientOrderId !== undefined ? {
|
51
|
-
equals: props.Order.clientOrderId
|
52
|
-
} : undefined,
|
53
50
|
alpacaAccountId: props.Order.alpacaAccountId !== undefined ? {
|
54
51
|
equals: props.Order.alpacaAccountId
|
55
52
|
} : undefined,
|
@@ -461,7 +458,7 @@ exports.TakeProfit = {
|
|
461
458
|
};
|
462
459
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
463
460
|
try {
|
464
|
-
const response = await client.mutate({ mutation: CREATE_ONE_TAKEPROFIT, variables: filteredVariables });
|
461
|
+
const response = await client_2.client.mutate({ mutation: CREATE_ONE_TAKEPROFIT, variables: filteredVariables });
|
465
462
|
if (response.errors && response.errors.length > 0)
|
466
463
|
throw new Error(response.errors[0].message);
|
467
464
|
if (response && response.data && response.data.createOneTakeProfit) {
|
@@ -482,7 +479,6 @@ exports.TakeProfit = {
|
|
482
479
|
* @returns The count of created records or null.
|
483
480
|
*/
|
484
481
|
async createMany(props) {
|
485
|
-
const client = (0, client_2.createApolloClient)();
|
486
482
|
const CREATE_MANY_TAKEPROFIT = (0, client_1.gql) `
|
487
483
|
mutation createManyTakeProfit($data: [TakeProfitCreateManyInput!]!) {
|
488
484
|
createManyTakeProfit(data: $data) {
|
@@ -498,7 +494,7 @@ exports.TakeProfit = {
|
|
498
494
|
};
|
499
495
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
500
496
|
try {
|
501
|
-
const response = await client.mutate({ mutation: CREATE_MANY_TAKEPROFIT, variables: filteredVariables });
|
497
|
+
const response = await client_2.client.mutate({ mutation: CREATE_MANY_TAKEPROFIT, variables: filteredVariables });
|
502
498
|
if (response.errors && response.errors.length > 0)
|
503
499
|
throw new Error(response.errors[0].message);
|
504
500
|
if (response && response.data && response.data.createManyTakeProfit) {
|
@@ -519,7 +515,6 @@ exports.TakeProfit = {
|
|
519
515
|
* @returns The updated TakeProfit or null.
|
520
516
|
*/
|
521
517
|
async update(props) {
|
522
|
-
const client = (0, client_2.createApolloClient)();
|
523
518
|
const UPDATE_ONE_TAKEPROFIT = (0, client_1.gql) `
|
524
519
|
mutation updateOneTakeProfit($data: TakeProfitUpdateInput!, $where: TakeProfitWhereUniqueInput!) {
|
525
520
|
updateOneTakeProfit(data: $data, where: $where) {
|
@@ -2125,7 +2120,7 @@ exports.TakeProfit = {
|
|
2125
2120
|
};
|
2126
2121
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
2127
2122
|
try {
|
2128
|
-
const response = await client.mutate({ mutation: UPDATE_ONE_TAKEPROFIT, variables: filteredVariables });
|
2123
|
+
const response = await client_2.client.mutate({ mutation: UPDATE_ONE_TAKEPROFIT, variables: filteredVariables });
|
2129
2124
|
if (response.errors && response.errors.length > 0)
|
2130
2125
|
throw new Error(response.errors[0].message);
|
2131
2126
|
if (response && response.data && response.data.updateOneTakeProfit) {
|
@@ -2146,7 +2141,6 @@ exports.TakeProfit = {
|
|
2146
2141
|
* @returns The count of created records or null.
|
2147
2142
|
*/
|
2148
2143
|
async updateMany(props) {
|
2149
|
-
const client = (0, client_2.createApolloClient)();
|
2150
2144
|
const UPDATE_MANY_TAKEPROFIT = (0, client_1.gql) `
|
2151
2145
|
mutation updateManyTakeProfit($data: [TakeProfitCreateManyInput!]!) {
|
2152
2146
|
updateManyTakeProfit(data: $data) {
|
@@ -3752,7 +3746,7 @@ exports.TakeProfit = {
|
|
3752
3746
|
}));
|
3753
3747
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3754
3748
|
try {
|
3755
|
-
const response = await client.mutate({ mutation: UPDATE_MANY_TAKEPROFIT, variables: filteredVariables });
|
3749
|
+
const response = await client_2.client.mutate({ mutation: UPDATE_MANY_TAKEPROFIT, variables: filteredVariables });
|
3756
3750
|
if (response.errors && response.errors.length > 0)
|
3757
3751
|
throw new Error(response.errors[0].message);
|
3758
3752
|
if (response && response.data && response.data.updateManyTakeProfit) {
|
@@ -3773,7 +3767,6 @@ exports.TakeProfit = {
|
|
3773
3767
|
* @returns The deleted TakeProfit or null.
|
3774
3768
|
*/
|
3775
3769
|
async delete(props) {
|
3776
|
-
const client = (0, client_2.createApolloClient)();
|
3777
3770
|
const DELETE_ONE_TAKEPROFIT = (0, client_1.gql) `
|
3778
3771
|
mutation deleteOneTakeProfit($where: TakeProfitWhereUniqueInput!) {
|
3779
3772
|
deleteOneTakeProfit(where: $where) {
|
@@ -3787,7 +3780,7 @@ exports.TakeProfit = {
|
|
3787
3780
|
};
|
3788
3781
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3789
3782
|
try {
|
3790
|
-
const response = await client.mutate({ mutation: DELETE_ONE_TAKEPROFIT, variables: filteredVariables });
|
3783
|
+
const response = await client_2.client.mutate({ mutation: DELETE_ONE_TAKEPROFIT, variables: filteredVariables });
|
3791
3784
|
if (response.errors && response.errors.length > 0)
|
3792
3785
|
throw new Error(response.errors[0].message);
|
3793
3786
|
if (response && response.data && response.data.deleteOneTakeProfit) {
|
@@ -3809,7 +3802,6 @@ exports.TakeProfit = {
|
|
3809
3802
|
*/
|
3810
3803
|
async get(props) {
|
3811
3804
|
var _a, _b;
|
3812
|
-
const client = (0, client_2.createApolloClient)();
|
3813
3805
|
const GET_TAKEPROFIT = (0, client_1.gql) `
|
3814
3806
|
query getTakeProfit($where: TakeProfitWhereUniqueInput!) {
|
3815
3807
|
getTakeProfit(where: $where) {
|
@@ -3826,7 +3818,7 @@ exports.TakeProfit = {
|
|
3826
3818
|
};
|
3827
3819
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3828
3820
|
try {
|
3829
|
-
const response = await client.query({ query: GET_TAKEPROFIT, variables: filteredVariables });
|
3821
|
+
const response = await client_2.client.query({ query: GET_TAKEPROFIT, variables: filteredVariables });
|
3830
3822
|
if (response.errors && response.errors.length > 0)
|
3831
3823
|
throw new Error(response.errors[0].message);
|
3832
3824
|
return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getTakeProfit) !== null && _b !== void 0 ? _b : null;
|
@@ -3847,7 +3839,6 @@ exports.TakeProfit = {
|
|
3847
3839
|
*/
|
3848
3840
|
async getAll() {
|
3849
3841
|
var _a, _b;
|
3850
|
-
const client = (0, client_2.createApolloClient)();
|
3851
3842
|
const GET_ALL_TAKEPROFIT = (0, client_1.gql) `
|
3852
3843
|
query getAllTakeProfit {
|
3853
3844
|
takeProfits {
|
@@ -3855,7 +3846,7 @@ exports.TakeProfit = {
|
|
3855
3846
|
}
|
3856
3847
|
}`;
|
3857
3848
|
try {
|
3858
|
-
const response = await client.query({ query: GET_ALL_TAKEPROFIT });
|
3849
|
+
const response = await client_2.client.query({ query: GET_ALL_TAKEPROFIT });
|
3859
3850
|
if (response.errors && response.errors.length > 0)
|
3860
3851
|
throw new Error(response.errors[0].message);
|
3861
3852
|
return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.takeProfits) !== null && _b !== void 0 ? _b : null;
|
@@ -3876,7 +3867,6 @@ exports.TakeProfit = {
|
|
3876
3867
|
* @returns An array of found TakeProfit records or null.
|
3877
3868
|
*/
|
3878
3869
|
async findMany(props) {
|
3879
|
-
const client = (0, client_2.createApolloClient)();
|
3880
3870
|
const FIND_MANY_TAKEPROFIT = (0, client_1.gql) `
|
3881
3871
|
query findManyTakeProfit($where: TakeProfitWhereInput!) {
|
3882
3872
|
takeProfits(where: $where) {
|
@@ -3897,7 +3887,7 @@ exports.TakeProfit = {
|
|
3897
3887
|
};
|
3898
3888
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
3899
3889
|
try {
|
3900
|
-
const response = await client.query({ query: FIND_MANY_TAKEPROFIT, variables: filteredVariables });
|
3890
|
+
const response = await client_2.client.query({ query: FIND_MANY_TAKEPROFIT, variables: filteredVariables });
|
3901
3891
|
if (response.errors && response.errors.length > 0)
|
3902
3892
|
throw new Error(response.errors[0].message);
|
3903
3893
|
if (response && response.data && response.data.TakeProfits) {
|
package/Trade.cjs
CHANGED
@@ -269,7 +269,6 @@ exports.Trade = {
|
|
269
269
|
* @returns The created Trade or null.
|
270
270
|
*/
|
271
271
|
async create(props) {
|
272
|
-
const client = (0, client_2.createApolloClient)();
|
273
272
|
const CREATE_ONE_TRADE = (0, client_1.gql) `
|
274
273
|
mutation createOneTrade($data: TradeCreateInput!) {
|
275
274
|
createOneTrade(data: $data) {
|
@@ -452,11 +451,9 @@ exports.Trade = {
|
|
452
451
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
453
452
|
where: {
|
454
453
|
id: item.id !== undefined ? item.id : undefined,
|
454
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
455
455
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
456
456
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
457
|
-
clientOrderId: item.clientOrderId !== undefined ? {
|
458
|
-
equals: item.clientOrderId
|
459
|
-
} : undefined,
|
460
457
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
461
458
|
equals: item.alpacaAccountId
|
462
459
|
} : undefined,
|
@@ -825,11 +822,9 @@ exports.Trade = {
|
|
825
822
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
826
823
|
where: {
|
827
824
|
id: item.id !== undefined ? item.id : undefined,
|
825
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
828
826
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
829
827
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
830
|
-
clientOrderId: item.clientOrderId !== undefined ? {
|
831
|
-
equals: item.clientOrderId
|
832
|
-
} : undefined,
|
833
828
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
834
829
|
equals: item.alpacaAccountId
|
835
830
|
} : undefined,
|
@@ -1095,11 +1090,9 @@ exports.Trade = {
|
|
1095
1090
|
: { connectOrCreate: {
|
1096
1091
|
where: {
|
1097
1092
|
id: item.order.id !== undefined ? item.order.id : undefined,
|
1093
|
+
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
1098
1094
|
actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
|
1099
1095
|
stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
|
1100
|
-
clientOrderId: item.order.clientOrderId !== undefined ? {
|
1101
|
-
equals: item.order.clientOrderId
|
1102
|
-
} : undefined,
|
1103
1096
|
alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
|
1104
1097
|
equals: item.order.alpacaAccountId
|
1105
1098
|
} : undefined,
|
@@ -1274,7 +1267,7 @@ exports.Trade = {
|
|
1274
1267
|
};
|
1275
1268
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
1276
1269
|
try {
|
1277
|
-
const response = await client.mutate({ mutation: CREATE_ONE_TRADE, variables: filteredVariables });
|
1270
|
+
const response = await client_2.client.mutate({ mutation: CREATE_ONE_TRADE, variables: filteredVariables });
|
1278
1271
|
if (response.errors && response.errors.length > 0)
|
1279
1272
|
throw new Error(response.errors[0].message);
|
1280
1273
|
if (response && response.data && response.data.createOneTrade) {
|
@@ -1295,7 +1288,6 @@ exports.Trade = {
|
|
1295
1288
|
* @returns The count of created records or null.
|
1296
1289
|
*/
|
1297
1290
|
async createMany(props) {
|
1298
|
-
const client = (0, client_2.createApolloClient)();
|
1299
1291
|
const CREATE_MANY_TRADE = (0, client_1.gql) `
|
1300
1292
|
mutation createManyTrade($data: [TradeCreateManyInput!]!) {
|
1301
1293
|
createManyTrade(data: $data) {
|
@@ -1321,7 +1313,7 @@ exports.Trade = {
|
|
1321
1313
|
};
|
1322
1314
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
1323
1315
|
try {
|
1324
|
-
const response = await client.mutate({ mutation: CREATE_MANY_TRADE, variables: filteredVariables });
|
1316
|
+
const response = await client_2.client.mutate({ mutation: CREATE_MANY_TRADE, variables: filteredVariables });
|
1325
1317
|
if (response.errors && response.errors.length > 0)
|
1326
1318
|
throw new Error(response.errors[0].message);
|
1327
1319
|
if (response && response.data && response.data.createManyTrade) {
|
@@ -1342,7 +1334,6 @@ exports.Trade = {
|
|
1342
1334
|
* @returns The updated Trade or null.
|
1343
1335
|
*/
|
1344
1336
|
async update(props) {
|
1345
|
-
const client = (0, client_2.createApolloClient)();
|
1346
1337
|
const UPDATE_ONE_TRADE = (0, client_1.gql) `
|
1347
1338
|
mutation updateOneTrade($data: TradeUpdateInput!, $where: TradeWhereUniqueInput!) {
|
1348
1339
|
updateOneTrade(data: $data, where: $where) {
|
@@ -1797,11 +1788,9 @@ exports.Trade = {
|
|
1797
1788
|
upsert: props.alpacaAccount.orders.map((item) => ({
|
1798
1789
|
where: {
|
1799
1790
|
id: item.id !== undefined ? item.id : undefined,
|
1791
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1800
1792
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1801
1793
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1802
|
-
clientOrderId: item.clientOrderId !== undefined ? {
|
1803
|
-
equals: item.clientOrderId
|
1804
|
-
} : undefined,
|
1805
1794
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1806
1795
|
equals: item.alpacaAccountId
|
1807
1796
|
} : undefined,
|
@@ -2948,11 +2937,9 @@ exports.Trade = {
|
|
2948
2937
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
2949
2938
|
where: {
|
2950
2939
|
id: item.id !== undefined ? item.id : undefined,
|
2940
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2951
2941
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2952
2942
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2953
|
-
clientOrderId: item.clientOrderId !== undefined ? {
|
2954
|
-
equals: item.clientOrderId
|
2955
|
-
} : undefined,
|
2956
2943
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2957
2944
|
equals: item.alpacaAccountId
|
2958
2945
|
} : undefined,
|
@@ -3430,11 +3417,9 @@ exports.Trade = {
|
|
3430
3417
|
upsert: props.asset.orders.map((item) => ({
|
3431
3418
|
where: {
|
3432
3419
|
id: item.id !== undefined ? item.id : undefined,
|
3420
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
3433
3421
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
3434
3422
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
3435
|
-
clientOrderId: item.clientOrderId !== undefined ? {
|
3436
|
-
equals: item.clientOrderId
|
3437
|
-
} : undefined,
|
3438
3423
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3439
3424
|
equals: item.alpacaAccountId
|
3440
3425
|
} : undefined,
|
@@ -4146,11 +4131,9 @@ exports.Trade = {
|
|
4146
4131
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
4147
4132
|
where: {
|
4148
4133
|
id: item.id !== undefined ? item.id : undefined,
|
4134
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4149
4135
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4150
4136
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4151
|
-
clientOrderId: item.clientOrderId !== undefined ? {
|
4152
|
-
equals: item.clientOrderId
|
4153
|
-
} : undefined,
|
4154
4137
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4155
4138
|
equals: item.alpacaAccountId
|
4156
4139
|
} : undefined,
|
@@ -5038,11 +5021,9 @@ exports.Trade = {
|
|
5038
5021
|
: { connectOrCreate: {
|
5039
5022
|
where: {
|
5040
5023
|
id: item.order.id !== undefined ? item.order.id : undefined,
|
5024
|
+
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
5041
5025
|
actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
|
5042
5026
|
stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
|
5043
|
-
clientOrderId: item.order.clientOrderId !== undefined ? {
|
5044
|
-
equals: item.order.clientOrderId
|
5045
|
-
} : undefined,
|
5046
5027
|
alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
|
5047
5028
|
equals: item.order.alpacaAccountId
|
5048
5029
|
} : undefined,
|
@@ -5217,7 +5198,7 @@ exports.Trade = {
|
|
5217
5198
|
};
|
5218
5199
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
5219
5200
|
try {
|
5220
|
-
const response = await client.mutate({ mutation: UPDATE_ONE_TRADE, variables: filteredVariables });
|
5201
|
+
const response = await client_2.client.mutate({ mutation: UPDATE_ONE_TRADE, variables: filteredVariables });
|
5221
5202
|
if (response.errors && response.errors.length > 0)
|
5222
5203
|
throw new Error(response.errors[0].message);
|
5223
5204
|
if (response && response.data && response.data.updateOneTrade) {
|
@@ -5238,7 +5219,6 @@ exports.Trade = {
|
|
5238
5219
|
* @returns The count of created records or null.
|
5239
5220
|
*/
|
5240
5221
|
async updateMany(props) {
|
5241
|
-
const client = (0, client_2.createApolloClient)();
|
5242
5222
|
const UPDATE_MANY_TRADE = (0, client_1.gql) `
|
5243
5223
|
mutation updateManyTrade($data: [TradeCreateManyInput!]!) {
|
5244
5224
|
updateManyTrade(data: $data) {
|
@@ -5693,11 +5673,9 @@ exports.Trade = {
|
|
5693
5673
|
upsert: prop.alpacaAccount.orders.map((item) => ({
|
5694
5674
|
where: {
|
5695
5675
|
id: item.id !== undefined ? item.id : undefined,
|
5676
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5696
5677
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5697
5678
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
5698
|
-
clientOrderId: item.clientOrderId !== undefined ? {
|
5699
|
-
equals: item.clientOrderId
|
5700
|
-
} : undefined,
|
5701
5679
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5702
5680
|
equals: item.alpacaAccountId
|
5703
5681
|
} : undefined,
|
@@ -6844,11 +6822,9 @@ exports.Trade = {
|
|
6844
6822
|
: { connectOrCreate: prop.alpacaAccount.orders.map((item) => ({
|
6845
6823
|
where: {
|
6846
6824
|
id: item.id !== undefined ? item.id : undefined,
|
6825
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
6847
6826
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
6848
6827
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
6849
|
-
clientOrderId: item.clientOrderId !== undefined ? {
|
6850
|
-
equals: item.clientOrderId
|
6851
|
-
} : undefined,
|
6852
6828
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6853
6829
|
equals: item.alpacaAccountId
|
6854
6830
|
} : undefined,
|
@@ -7326,11 +7302,9 @@ exports.Trade = {
|
|
7326
7302
|
upsert: prop.asset.orders.map((item) => ({
|
7327
7303
|
where: {
|
7328
7304
|
id: item.id !== undefined ? item.id : undefined,
|
7305
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
7329
7306
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
7330
7307
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
7331
|
-
clientOrderId: item.clientOrderId !== undefined ? {
|
7332
|
-
equals: item.clientOrderId
|
7333
|
-
} : undefined,
|
7334
7308
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7335
7309
|
equals: item.alpacaAccountId
|
7336
7310
|
} : undefined,
|
@@ -8042,11 +8016,9 @@ exports.Trade = {
|
|
8042
8016
|
: { connectOrCreate: prop.asset.orders.map((item) => ({
|
8043
8017
|
where: {
|
8044
8018
|
id: item.id !== undefined ? item.id : undefined,
|
8019
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
8045
8020
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
8046
8021
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
8047
|
-
clientOrderId: item.clientOrderId !== undefined ? {
|
8048
|
-
equals: item.clientOrderId
|
8049
|
-
} : undefined,
|
8050
8022
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
8051
8023
|
equals: item.alpacaAccountId
|
8052
8024
|
} : undefined,
|
@@ -8934,11 +8906,9 @@ exports.Trade = {
|
|
8934
8906
|
: { connectOrCreate: {
|
8935
8907
|
where: {
|
8936
8908
|
id: item.order.id !== undefined ? item.order.id : undefined,
|
8909
|
+
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
8937
8910
|
actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
|
8938
8911
|
stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
|
8939
|
-
clientOrderId: item.order.clientOrderId !== undefined ? {
|
8940
|
-
equals: item.order.clientOrderId
|
8941
|
-
} : undefined,
|
8942
8912
|
alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
|
8943
8913
|
equals: item.order.alpacaAccountId
|
8944
8914
|
} : undefined,
|
@@ -9113,7 +9083,7 @@ exports.Trade = {
|
|
9113
9083
|
}));
|
9114
9084
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
9115
9085
|
try {
|
9116
|
-
const response = await client.mutate({ mutation: UPDATE_MANY_TRADE, variables: filteredVariables });
|
9086
|
+
const response = await client_2.client.mutate({ mutation: UPDATE_MANY_TRADE, variables: filteredVariables });
|
9117
9087
|
if (response.errors && response.errors.length > 0)
|
9118
9088
|
throw new Error(response.errors[0].message);
|
9119
9089
|
if (response && response.data && response.data.updateManyTrade) {
|
@@ -9134,7 +9104,6 @@ exports.Trade = {
|
|
9134
9104
|
* @returns The deleted Trade or null.
|
9135
9105
|
*/
|
9136
9106
|
async delete(props) {
|
9137
|
-
const client = (0, client_2.createApolloClient)();
|
9138
9107
|
const DELETE_ONE_TRADE = (0, client_1.gql) `
|
9139
9108
|
mutation deleteOneTrade($where: TradeWhereUniqueInput!) {
|
9140
9109
|
deleteOneTrade(where: $where) {
|
@@ -9148,7 +9117,7 @@ exports.Trade = {
|
|
9148
9117
|
};
|
9149
9118
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
9150
9119
|
try {
|
9151
|
-
const response = await client.mutate({ mutation: DELETE_ONE_TRADE, variables: filteredVariables });
|
9120
|
+
const response = await client_2.client.mutate({ mutation: DELETE_ONE_TRADE, variables: filteredVariables });
|
9152
9121
|
if (response.errors && response.errors.length > 0)
|
9153
9122
|
throw new Error(response.errors[0].message);
|
9154
9123
|
if (response && response.data && response.data.deleteOneTrade) {
|
@@ -9170,7 +9139,6 @@ exports.Trade = {
|
|
9170
9139
|
*/
|
9171
9140
|
async get(props) {
|
9172
9141
|
var _a, _b;
|
9173
|
-
const client = (0, client_2.createApolloClient)();
|
9174
9142
|
const GET_TRADE = (0, client_1.gql) `
|
9175
9143
|
query getTrade($where: TradeWhereUniqueInput!) {
|
9176
9144
|
getTrade(where: $where) {
|
@@ -9203,7 +9171,7 @@ exports.Trade = {
|
|
9203
9171
|
};
|
9204
9172
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
9205
9173
|
try {
|
9206
|
-
const response = await client.query({ query: GET_TRADE, variables: filteredVariables });
|
9174
|
+
const response = await client_2.client.query({ query: GET_TRADE, variables: filteredVariables });
|
9207
9175
|
if (response.errors && response.errors.length > 0)
|
9208
9176
|
throw new Error(response.errors[0].message);
|
9209
9177
|
return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.getTrade) !== null && _b !== void 0 ? _b : null;
|
@@ -9224,7 +9192,6 @@ exports.Trade = {
|
|
9224
9192
|
*/
|
9225
9193
|
async getAll() {
|
9226
9194
|
var _a, _b;
|
9227
|
-
const client = (0, client_2.createApolloClient)();
|
9228
9195
|
const GET_ALL_TRADE = (0, client_1.gql) `
|
9229
9196
|
query getAllTrade {
|
9230
9197
|
trades {
|
@@ -9232,7 +9199,7 @@ exports.Trade = {
|
|
9232
9199
|
}
|
9233
9200
|
}`;
|
9234
9201
|
try {
|
9235
|
-
const response = await client.query({ query: GET_ALL_TRADE });
|
9202
|
+
const response = await client_2.client.query({ query: GET_ALL_TRADE });
|
9236
9203
|
if (response.errors && response.errors.length > 0)
|
9237
9204
|
throw new Error(response.errors[0].message);
|
9238
9205
|
return (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.trades) !== null && _b !== void 0 ? _b : null;
|
@@ -9253,7 +9220,6 @@ exports.Trade = {
|
|
9253
9220
|
* @returns An array of found Trade records or null.
|
9254
9221
|
*/
|
9255
9222
|
async findMany(props) {
|
9256
|
-
const client = (0, client_2.createApolloClient)();
|
9257
9223
|
const FIND_MANY_TRADE = (0, client_1.gql) `
|
9258
9224
|
query findManyTrade($where: TradeWhereInput!) {
|
9259
9225
|
trades(where: $where) {
|
@@ -9288,7 +9254,7 @@ exports.Trade = {
|
|
9288
9254
|
};
|
9289
9255
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
9290
9256
|
try {
|
9291
|
-
const response = await client.query({ query: FIND_MANY_TRADE, variables: filteredVariables });
|
9257
|
+
const response = await client_2.client.query({ query: FIND_MANY_TRADE, variables: filteredVariables });
|
9292
9258
|
if (response.errors && response.errors.length > 0)
|
9293
9259
|
throw new Error(response.errors[0].message);
|
9294
9260
|
if (response && response.data && response.data.Trades) {
|