adaptic-backend 1.0.75 → 1.0.77
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 +264 -190
- package/Action.cjs +594 -524
- package/Alert.cjs +352 -278
- package/AlpacaAccount.cjs +1197 -1021
- package/Asset.cjs +485 -368
- package/Authenticator.cjs +285 -211
- package/Customer.cjs +268 -190
- package/NewsArticle.cjs +233 -212
- package/NewsArticleAssetSentiment.cjs +354 -290
- package/Order.cjs +694 -541
- package/Position.cjs +621 -488
- package/Session.cjs +288 -214
- package/Trade.cjs +767 -613
- package/User.cjs +410 -309
- package/package.json +1 -1
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +264 -190
- package/server/Action.d.ts.map +1 -1
- package/server/Action.js.map +1 -1
- package/server/Action.mjs +594 -524
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +352 -278
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +1197 -1021
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +485 -368
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +285 -211
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +268 -190
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +233 -212
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +354 -290
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +694 -541
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +621 -488
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +288 -214
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +767 -613
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +410 -309
package/server/Alert.mjs
CHANGED
@@ -284,108 +284,136 @@ export const Alert = {
|
|
284
284
|
message: props.message !== undefined ? props.message : undefined,
|
285
285
|
type: props.type !== undefined ? props.type : undefined,
|
286
286
|
isRead: props.isRead !== undefined ? props.isRead : undefined,
|
287
|
-
alpacaAccount: props.alpacaAccount ?
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
287
|
+
alpacaAccount: props.alpacaAccount ?
|
288
|
+
typeof props.alpacaAccount === 'object' && Object.keys(props.alpacaAccount).length === 1 && Object.keys(props.alpacaAccount)[0] === 'id'
|
289
|
+
? { connect: {
|
290
|
+
id: props.alpacaAccount.id
|
291
|
+
}
|
292
|
+
}
|
293
|
+
: { connectOrCreate: {
|
294
|
+
where: {
|
295
|
+
id: props.alpacaAccount.id !== undefined ? props.alpacaAccount.id : undefined,
|
296
|
+
},
|
297
|
+
create: {
|
298
|
+
type: props.alpacaAccount.type !== undefined ? props.alpacaAccount.type : undefined,
|
299
|
+
APIKey: props.alpacaAccount.APIKey !== undefined ? props.alpacaAccount.APIKey : undefined,
|
300
|
+
APISecret: props.alpacaAccount.APISecret !== undefined ? props.alpacaAccount.APISecret : undefined,
|
301
|
+
configuration: props.alpacaAccount.configuration !== undefined ? props.alpacaAccount.configuration : undefined,
|
302
|
+
marketOpen: props.alpacaAccount.marketOpen !== undefined ? props.alpacaAccount.marketOpen : undefined,
|
303
|
+
user: props.alpacaAccount.user ?
|
304
|
+
typeof props.alpacaAccount.user === 'object' && Object.keys(props.alpacaAccount.user).length === 1 && Object.keys(props.alpacaAccount.user)[0] === 'id'
|
305
|
+
? { connect: {
|
306
|
+
id: props.alpacaAccount.user.id
|
307
|
+
}
|
308
|
+
}
|
309
|
+
: { connectOrCreate: {
|
310
|
+
where: {
|
311
|
+
id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
|
312
|
+
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
313
|
+
name: props.alpacaAccount.user.name !== undefined ? {
|
314
|
+
equals: props.alpacaAccount.user.name
|
315
|
+
} : undefined,
|
316
|
+
},
|
317
|
+
create: {
|
318
|
+
name: props.alpacaAccount.user.name !== undefined ? props.alpacaAccount.user.name : undefined,
|
319
|
+
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
320
|
+
emailVerified: props.alpacaAccount.user.emailVerified !== undefined ? props.alpacaAccount.user.emailVerified : undefined,
|
321
|
+
image: props.alpacaAccount.user.image !== undefined ? props.alpacaAccount.user.image : undefined,
|
322
|
+
role: props.alpacaAccount.user.role !== undefined ? props.alpacaAccount.user.role : undefined,
|
323
|
+
bio: props.alpacaAccount.user.bio !== undefined ? props.alpacaAccount.user.bio : undefined,
|
324
|
+
jobTitle: props.alpacaAccount.user.jobTitle !== undefined ? props.alpacaAccount.user.jobTitle : undefined,
|
325
|
+
currentAccount: props.alpacaAccount.user.currentAccount !== undefined ? props.alpacaAccount.user.currentAccount : undefined,
|
326
|
+
plan: props.alpacaAccount.user.plan !== undefined ? props.alpacaAccount.user.plan : undefined,
|
327
|
+
},
|
328
|
+
}
|
329
|
+
} : undefined,
|
330
|
+
trades: props.alpacaAccount.trades ?
|
331
|
+
Array.isArray(props.alpacaAccount.trades) && props.alpacaAccount.trades.length > 0
|
332
|
+
? props.alpacaAccount.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
|
333
|
+
connect: props.alpacaAccount.trades.map((item) => ({
|
334
|
+
id: item.id
|
335
|
+
}))
|
336
|
+
}
|
337
|
+
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
338
|
+
where: {
|
339
|
+
id: item.id !== undefined ? item.id : undefined,
|
340
|
+
},
|
341
|
+
create: {
|
342
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
343
|
+
price: item.price !== undefined ? item.price : undefined,
|
344
|
+
total: item.total !== undefined ? item.total : undefined,
|
345
|
+
signal: item.signal !== undefined ? item.signal : undefined,
|
346
|
+
strategy: item.strategy !== undefined ? item.strategy : undefined,
|
347
|
+
analysis: item.analysis !== undefined ? item.analysis : undefined,
|
348
|
+
confidence: item.confidence !== undefined ? item.confidence : undefined,
|
349
|
+
timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
|
350
|
+
status: item.status !== undefined ? item.status : undefined,
|
351
|
+
optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
|
352
|
+
},
|
353
|
+
}))
|
354
|
+
} : undefined,
|
355
|
+
orders: props.alpacaAccount.orders ?
|
356
|
+
Array.isArray(props.alpacaAccount.orders) && props.alpacaAccount.orders.length > 0
|
357
|
+
? props.alpacaAccount.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
|
358
|
+
connect: props.alpacaAccount.orders.map((item) => ({
|
359
|
+
id: item.id
|
360
|
+
}))
|
361
|
+
}
|
362
|
+
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
363
|
+
where: {
|
364
|
+
id: item.id !== undefined ? item.id : undefined,
|
365
|
+
},
|
366
|
+
create: {
|
367
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
368
|
+
notional: item.notional !== undefined ? item.notional : undefined,
|
369
|
+
side: item.side !== undefined ? item.side : undefined,
|
370
|
+
type: item.type !== undefined ? item.type : undefined,
|
371
|
+
timeInForce: item.timeInForce !== undefined ? item.timeInForce : undefined,
|
372
|
+
limitPrice: item.limitPrice !== undefined ? item.limitPrice : undefined,
|
373
|
+
stopPrice: item.stopPrice !== undefined ? item.stopPrice : undefined,
|
374
|
+
trailPrice: item.trailPrice !== undefined ? item.trailPrice : undefined,
|
375
|
+
trailPercent: item.trailPercent !== undefined ? item.trailPercent : undefined,
|
376
|
+
extendedHours: item.extendedHours !== undefined ? item.extendedHours : undefined,
|
377
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
378
|
+
status: item.status !== undefined ? item.status : undefined,
|
379
|
+
submittedAt: item.submittedAt !== undefined ? item.submittedAt : undefined,
|
380
|
+
filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
|
381
|
+
filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
|
382
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
383
|
+
},
|
384
|
+
}))
|
385
|
+
} : undefined,
|
386
|
+
positions: props.alpacaAccount.positions ?
|
387
|
+
Array.isArray(props.alpacaAccount.positions) && props.alpacaAccount.positions.length > 0
|
388
|
+
? props.alpacaAccount.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
|
389
|
+
connect: props.alpacaAccount.positions.map((item) => ({
|
390
|
+
id: item.id
|
391
|
+
}))
|
392
|
+
}
|
393
|
+
: { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
|
394
|
+
where: {
|
395
|
+
id: item.id !== undefined ? item.id : undefined,
|
396
|
+
},
|
397
|
+
create: {
|
398
|
+
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
399
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
400
|
+
qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
|
401
|
+
marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
|
402
|
+
costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
|
403
|
+
unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
|
404
|
+
unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
|
405
|
+
unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
|
406
|
+
unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
|
407
|
+
currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
|
408
|
+
lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
|
409
|
+
changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
|
410
|
+
assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
|
411
|
+
},
|
412
|
+
}))
|
413
|
+
} : undefined,
|
414
|
+
},
|
415
|
+
}
|
416
|
+
} : undefined,
|
389
417
|
},
|
390
418
|
};
|
391
419
|
const filteredVariables = removeUndefinedProps(variables);
|
@@ -1027,94 +1055,117 @@ export const Alert = {
|
|
1027
1055
|
APISecret: props.alpacaAccount.APISecret !== undefined ? props.alpacaAccount.APISecret : undefined,
|
1028
1056
|
configuration: props.alpacaAccount.configuration !== undefined ? props.alpacaAccount.configuration : undefined,
|
1029
1057
|
marketOpen: props.alpacaAccount.marketOpen !== undefined ? props.alpacaAccount.marketOpen : undefined,
|
1030
|
-
user: props.alpacaAccount.user ?
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
},
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1058
|
+
user: props.alpacaAccount.user ?
|
1059
|
+
typeof props.alpacaAccount.user === 'object' && Object.keys(props.alpacaAccount.user).length === 1 && Object.keys(props.alpacaAccount.user)[0] === 'id'
|
1060
|
+
? { connect: {
|
1061
|
+
id: props.alpacaAccount.user.id
|
1062
|
+
}
|
1063
|
+
}
|
1064
|
+
: { connectOrCreate: {
|
1065
|
+
where: {
|
1066
|
+
id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
|
1067
|
+
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
1068
|
+
name: props.alpacaAccount.user.name !== undefined ? {
|
1069
|
+
equals: props.alpacaAccount.user.name
|
1070
|
+
} : undefined,
|
1071
|
+
},
|
1072
|
+
create: {
|
1073
|
+
name: props.alpacaAccount.user.name !== undefined ? props.alpacaAccount.user.name : undefined,
|
1074
|
+
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
1075
|
+
emailVerified: props.alpacaAccount.user.emailVerified !== undefined ? props.alpacaAccount.user.emailVerified : undefined,
|
1076
|
+
image: props.alpacaAccount.user.image !== undefined ? props.alpacaAccount.user.image : undefined,
|
1077
|
+
role: props.alpacaAccount.user.role !== undefined ? props.alpacaAccount.user.role : undefined,
|
1078
|
+
bio: props.alpacaAccount.user.bio !== undefined ? props.alpacaAccount.user.bio : undefined,
|
1079
|
+
jobTitle: props.alpacaAccount.user.jobTitle !== undefined ? props.alpacaAccount.user.jobTitle : undefined,
|
1080
|
+
currentAccount: props.alpacaAccount.user.currentAccount !== undefined ? props.alpacaAccount.user.currentAccount : undefined,
|
1081
|
+
plan: props.alpacaAccount.user.plan !== undefined ? props.alpacaAccount.user.plan : undefined,
|
1082
|
+
},
|
1083
|
+
}
|
1084
|
+
} : undefined,
|
1085
|
+
trades: props.alpacaAccount.trades ?
|
1086
|
+
Array.isArray(props.alpacaAccount.trades) && props.alpacaAccount.trades.length > 0
|
1087
|
+
? props.alpacaAccount.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
|
1088
|
+
connect: props.alpacaAccount.trades.map((item) => ({
|
1089
|
+
id: item.id
|
1090
|
+
}))
|
1091
|
+
}
|
1092
|
+
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
1093
|
+
where: {
|
1094
|
+
id: item.id !== undefined ? item.id : undefined,
|
1095
|
+
},
|
1096
|
+
create: {
|
1097
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
1098
|
+
price: item.price !== undefined ? item.price : undefined,
|
1099
|
+
total: item.total !== undefined ? item.total : undefined,
|
1100
|
+
signal: item.signal !== undefined ? item.signal : undefined,
|
1101
|
+
strategy: item.strategy !== undefined ? item.strategy : undefined,
|
1102
|
+
analysis: item.analysis !== undefined ? item.analysis : undefined,
|
1103
|
+
confidence: item.confidence !== undefined ? item.confidence : undefined,
|
1104
|
+
timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
|
1105
|
+
status: item.status !== undefined ? item.status : undefined,
|
1106
|
+
optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
|
1107
|
+
},
|
1108
|
+
}))
|
1109
|
+
} : undefined,
|
1110
|
+
orders: props.alpacaAccount.orders ?
|
1111
|
+
Array.isArray(props.alpacaAccount.orders) && props.alpacaAccount.orders.length > 0
|
1112
|
+
? props.alpacaAccount.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
|
1113
|
+
connect: props.alpacaAccount.orders.map((item) => ({
|
1114
|
+
id: item.id
|
1115
|
+
}))
|
1116
|
+
}
|
1117
|
+
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
1118
|
+
where: {
|
1119
|
+
id: item.id !== undefined ? item.id : undefined,
|
1120
|
+
},
|
1121
|
+
create: {
|
1122
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
1123
|
+
notional: item.notional !== undefined ? item.notional : undefined,
|
1124
|
+
side: item.side !== undefined ? item.side : undefined,
|
1125
|
+
type: item.type !== undefined ? item.type : undefined,
|
1126
|
+
timeInForce: item.timeInForce !== undefined ? item.timeInForce : undefined,
|
1127
|
+
limitPrice: item.limitPrice !== undefined ? item.limitPrice : undefined,
|
1128
|
+
stopPrice: item.stopPrice !== undefined ? item.stopPrice : undefined,
|
1129
|
+
trailPrice: item.trailPrice !== undefined ? item.trailPrice : undefined,
|
1130
|
+
trailPercent: item.trailPercent !== undefined ? item.trailPercent : undefined,
|
1131
|
+
extendedHours: item.extendedHours !== undefined ? item.extendedHours : undefined,
|
1132
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1133
|
+
status: item.status !== undefined ? item.status : undefined,
|
1134
|
+
submittedAt: item.submittedAt !== undefined ? item.submittedAt : undefined,
|
1135
|
+
filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
|
1136
|
+
filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
|
1137
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
1138
|
+
},
|
1139
|
+
}))
|
1140
|
+
} : undefined,
|
1141
|
+
positions: props.alpacaAccount.positions ?
|
1142
|
+
Array.isArray(props.alpacaAccount.positions) && props.alpacaAccount.positions.length > 0
|
1143
|
+
? props.alpacaAccount.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
|
1144
|
+
connect: props.alpacaAccount.positions.map((item) => ({
|
1145
|
+
id: item.id
|
1146
|
+
}))
|
1147
|
+
}
|
1148
|
+
: { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
|
1149
|
+
where: {
|
1150
|
+
id: item.id !== undefined ? item.id : undefined,
|
1151
|
+
},
|
1152
|
+
create: {
|
1153
|
+
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
1154
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
1155
|
+
qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
|
1156
|
+
marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
|
1157
|
+
costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
|
1158
|
+
unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
|
1159
|
+
unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
|
1160
|
+
unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
|
1161
|
+
unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
|
1162
|
+
currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
|
1163
|
+
lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
|
1164
|
+
changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
|
1165
|
+
assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
|
1166
|
+
},
|
1167
|
+
}))
|
1168
|
+
} : undefined,
|
1118
1169
|
},
|
1119
1170
|
}
|
1120
1171
|
} : undefined,
|
@@ -1462,94 +1513,117 @@ export const Alert = {
|
|
1462
1513
|
APISecret: prop.alpacaAccount.APISecret !== undefined ? prop.alpacaAccount.APISecret : undefined,
|
1463
1514
|
configuration: prop.alpacaAccount.configuration !== undefined ? prop.alpacaAccount.configuration : undefined,
|
1464
1515
|
marketOpen: prop.alpacaAccount.marketOpen !== undefined ? prop.alpacaAccount.marketOpen : undefined,
|
1465
|
-
user: prop.alpacaAccount.user ?
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
},
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1516
|
+
user: prop.alpacaAccount.user ?
|
1517
|
+
typeof prop.alpacaAccount.user === 'object' && Object.keys(prop.alpacaAccount.user).length === 1 && Object.keys(prop.alpacaAccount.user)[0] === 'id'
|
1518
|
+
? { connect: {
|
1519
|
+
id: prop.alpacaAccount.user.id
|
1520
|
+
}
|
1521
|
+
}
|
1522
|
+
: { connectOrCreate: {
|
1523
|
+
where: {
|
1524
|
+
id: prop.alpacaAccount.user.id !== undefined ? prop.alpacaAccount.user.id : undefined,
|
1525
|
+
email: prop.alpacaAccount.user.email !== undefined ? prop.alpacaAccount.user.email : undefined,
|
1526
|
+
name: prop.alpacaAccount.user.name !== undefined ? {
|
1527
|
+
equals: prop.alpacaAccount.user.name
|
1528
|
+
} : undefined,
|
1529
|
+
},
|
1530
|
+
create: {
|
1531
|
+
name: prop.alpacaAccount.user.name !== undefined ? prop.alpacaAccount.user.name : undefined,
|
1532
|
+
email: prop.alpacaAccount.user.email !== undefined ? prop.alpacaAccount.user.email : undefined,
|
1533
|
+
emailVerified: prop.alpacaAccount.user.emailVerified !== undefined ? prop.alpacaAccount.user.emailVerified : undefined,
|
1534
|
+
image: prop.alpacaAccount.user.image !== undefined ? prop.alpacaAccount.user.image : undefined,
|
1535
|
+
role: prop.alpacaAccount.user.role !== undefined ? prop.alpacaAccount.user.role : undefined,
|
1536
|
+
bio: prop.alpacaAccount.user.bio !== undefined ? prop.alpacaAccount.user.bio : undefined,
|
1537
|
+
jobTitle: prop.alpacaAccount.user.jobTitle !== undefined ? prop.alpacaAccount.user.jobTitle : undefined,
|
1538
|
+
currentAccount: prop.alpacaAccount.user.currentAccount !== undefined ? prop.alpacaAccount.user.currentAccount : undefined,
|
1539
|
+
plan: prop.alpacaAccount.user.plan !== undefined ? prop.alpacaAccount.user.plan : undefined,
|
1540
|
+
},
|
1541
|
+
}
|
1542
|
+
} : undefined,
|
1543
|
+
trades: prop.alpacaAccount.trades ?
|
1544
|
+
Array.isArray(prop.alpacaAccount.trades) && prop.alpacaAccount.trades.length > 0
|
1545
|
+
? prop.alpacaAccount.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
|
1546
|
+
connect: prop.alpacaAccount.trades.map((item) => ({
|
1547
|
+
id: item.id
|
1548
|
+
}))
|
1549
|
+
}
|
1550
|
+
: { connectOrCreate: prop.alpacaAccount.trades.map((item) => ({
|
1551
|
+
where: {
|
1552
|
+
id: item.id !== undefined ? item.id : undefined,
|
1553
|
+
},
|
1554
|
+
create: {
|
1555
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
1556
|
+
price: item.price !== undefined ? item.price : undefined,
|
1557
|
+
total: item.total !== undefined ? item.total : undefined,
|
1558
|
+
signal: item.signal !== undefined ? item.signal : undefined,
|
1559
|
+
strategy: item.strategy !== undefined ? item.strategy : undefined,
|
1560
|
+
analysis: item.analysis !== undefined ? item.analysis : undefined,
|
1561
|
+
confidence: item.confidence !== undefined ? item.confidence : undefined,
|
1562
|
+
timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
|
1563
|
+
status: item.status !== undefined ? item.status : undefined,
|
1564
|
+
optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
|
1565
|
+
},
|
1566
|
+
}))
|
1567
|
+
} : undefined,
|
1568
|
+
orders: prop.alpacaAccount.orders ?
|
1569
|
+
Array.isArray(prop.alpacaAccount.orders) && prop.alpacaAccount.orders.length > 0
|
1570
|
+
? prop.alpacaAccount.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
|
1571
|
+
connect: prop.alpacaAccount.orders.map((item) => ({
|
1572
|
+
id: item.id
|
1573
|
+
}))
|
1574
|
+
}
|
1575
|
+
: { connectOrCreate: prop.alpacaAccount.orders.map((item) => ({
|
1576
|
+
where: {
|
1577
|
+
id: item.id !== undefined ? item.id : undefined,
|
1578
|
+
},
|
1579
|
+
create: {
|
1580
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
1581
|
+
notional: item.notional !== undefined ? item.notional : undefined,
|
1582
|
+
side: item.side !== undefined ? item.side : undefined,
|
1583
|
+
type: item.type !== undefined ? item.type : undefined,
|
1584
|
+
timeInForce: item.timeInForce !== undefined ? item.timeInForce : undefined,
|
1585
|
+
limitPrice: item.limitPrice !== undefined ? item.limitPrice : undefined,
|
1586
|
+
stopPrice: item.stopPrice !== undefined ? item.stopPrice : undefined,
|
1587
|
+
trailPrice: item.trailPrice !== undefined ? item.trailPrice : undefined,
|
1588
|
+
trailPercent: item.trailPercent !== undefined ? item.trailPercent : undefined,
|
1589
|
+
extendedHours: item.extendedHours !== undefined ? item.extendedHours : undefined,
|
1590
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1591
|
+
status: item.status !== undefined ? item.status : undefined,
|
1592
|
+
submittedAt: item.submittedAt !== undefined ? item.submittedAt : undefined,
|
1593
|
+
filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
|
1594
|
+
filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
|
1595
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
1596
|
+
},
|
1597
|
+
}))
|
1598
|
+
} : undefined,
|
1599
|
+
positions: prop.alpacaAccount.positions ?
|
1600
|
+
Array.isArray(prop.alpacaAccount.positions) && prop.alpacaAccount.positions.length > 0
|
1601
|
+
? prop.alpacaAccount.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) && {
|
1602
|
+
connect: prop.alpacaAccount.positions.map((item) => ({
|
1603
|
+
id: item.id
|
1604
|
+
}))
|
1605
|
+
}
|
1606
|
+
: { connectOrCreate: prop.alpacaAccount.positions.map((item) => ({
|
1607
|
+
where: {
|
1608
|
+
id: item.id !== undefined ? item.id : undefined,
|
1609
|
+
},
|
1610
|
+
create: {
|
1611
|
+
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
1612
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
1613
|
+
qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
|
1614
|
+
marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
|
1615
|
+
costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
|
1616
|
+
unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
|
1617
|
+
unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
|
1618
|
+
unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
|
1619
|
+
unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
|
1620
|
+
currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
|
1621
|
+
lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
|
1622
|
+
changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
|
1623
|
+
assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
|
1624
|
+
},
|
1625
|
+
}))
|
1626
|
+
} : undefined,
|
1553
1627
|
},
|
1554
1628
|
}
|
1555
1629
|
} : undefined,
|