adaptic-backend 1.0.78 → 1.0.80
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 +983 -54
- package/Action.cjs +3226 -0
- package/Alert.cjs +3589 -54
- package/AlpacaAccount.cjs +2695 -96
- package/Asset.cjs +3343 -42
- package/Authenticator.cjs +983 -54
- package/Customer.cjs +1003 -78
- package/NewsArticle.cjs +806 -6
- package/NewsArticleAssetSentiment.cjs +876 -54
- package/Order.cjs +4434 -108
- package/Position.cjs +3762 -108
- package/Session.cjs +983 -54
- package/Trade.cjs +4447 -114
- package/User.cjs +2927 -96
- package/package.json +1 -1
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +983 -54
- package/server/Action.d.ts.map +1 -1
- package/server/Action.js.map +1 -1
- package/server/Action.mjs +3226 -0
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +3589 -54
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +2695 -96
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +3343 -42
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +983 -54
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +1003 -78
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +806 -6
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +876 -54
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +4434 -108
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +3762 -108
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +983 -54
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +4447 -114
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +2927 -96
@@ -334,12 +334,11 @@ export const NewsArticleAssetSentiment = {
|
|
334
334
|
sellPrice: props.asset.sellPrice !== undefined ? props.asset.sellPrice : undefined,
|
335
335
|
buyPrice: props.asset.buyPrice !== undefined ? props.asset.buyPrice : undefined,
|
336
336
|
trades: props.asset.trades ?
|
337
|
-
Array.isArray(props.asset.trades) && props.asset.trades.length > 0
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
}
|
337
|
+
Array.isArray(props.asset.trades) && props.asset.trades.length > 0 && props.asset.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
338
|
+
connect: props.asset.trades.map((item) => ({
|
339
|
+
id: item.id
|
340
|
+
}))
|
341
|
+
}
|
343
342
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
344
343
|
where: {
|
345
344
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -355,16 +354,53 @@ export const NewsArticleAssetSentiment = {
|
|
355
354
|
timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
|
356
355
|
status: item.status !== undefined ? item.status : undefined,
|
357
356
|
optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
|
357
|
+
alpacaAccount: item.alpacaAccount ?
|
358
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
359
|
+
? { connect: {
|
360
|
+
id: item.alpacaAccount.id
|
361
|
+
}
|
362
|
+
}
|
363
|
+
: { connectOrCreate: {
|
364
|
+
where: {
|
365
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
366
|
+
},
|
367
|
+
create: {
|
368
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
369
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
370
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
371
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
372
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
373
|
+
},
|
374
|
+
}
|
375
|
+
} : undefined,
|
376
|
+
actions: item.actions ?
|
377
|
+
Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
378
|
+
connect: item.actions.map((item) => ({
|
379
|
+
id: item.id
|
380
|
+
}))
|
381
|
+
}
|
382
|
+
: { connectOrCreate: item.actions.map((item) => ({
|
383
|
+
where: {
|
384
|
+
id: item.id !== undefined ? item.id : undefined,
|
385
|
+
},
|
386
|
+
create: {
|
387
|
+
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
388
|
+
type: item.type !== undefined ? item.type : undefined,
|
389
|
+
note: item.note !== undefined ? item.note : undefined,
|
390
|
+
status: item.status !== undefined ? item.status : undefined,
|
391
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
392
|
+
},
|
393
|
+
}))
|
394
|
+
} : undefined,
|
358
395
|
},
|
359
396
|
}))
|
360
397
|
} : undefined,
|
361
398
|
orders: props.asset.orders ?
|
362
|
-
Array.isArray(props.asset.orders) && props.asset.orders.length > 0
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
}
|
399
|
+
Array.isArray(props.asset.orders) && props.asset.orders.length > 0 && props.asset.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
400
|
+
connect: props.asset.orders.map((item) => ({
|
401
|
+
id: item.id
|
402
|
+
}))
|
403
|
+
}
|
368
404
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
369
405
|
where: {
|
370
406
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -386,16 +422,53 @@ export const NewsArticleAssetSentiment = {
|
|
386
422
|
filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
|
387
423
|
filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
|
388
424
|
fee: item.fee !== undefined ? item.fee : undefined,
|
425
|
+
alpacaAccount: item.alpacaAccount ?
|
426
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
427
|
+
? { connect: {
|
428
|
+
id: item.alpacaAccount.id
|
429
|
+
}
|
430
|
+
}
|
431
|
+
: { connectOrCreate: {
|
432
|
+
where: {
|
433
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
434
|
+
},
|
435
|
+
create: {
|
436
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
437
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
438
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
439
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
440
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
441
|
+
},
|
442
|
+
}
|
443
|
+
} : undefined,
|
444
|
+
action: item.action ?
|
445
|
+
typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
|
446
|
+
? { connect: {
|
447
|
+
id: item.action.id
|
448
|
+
}
|
449
|
+
}
|
450
|
+
: { connectOrCreate: {
|
451
|
+
where: {
|
452
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
453
|
+
},
|
454
|
+
create: {
|
455
|
+
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
456
|
+
type: item.action.type !== undefined ? item.action.type : undefined,
|
457
|
+
note: item.action.note !== undefined ? item.action.note : undefined,
|
458
|
+
status: item.action.status !== undefined ? item.action.status : undefined,
|
459
|
+
fee: item.action.fee !== undefined ? item.action.fee : undefined,
|
460
|
+
},
|
461
|
+
}
|
462
|
+
} : undefined,
|
389
463
|
},
|
390
464
|
}))
|
391
465
|
} : undefined,
|
392
466
|
positions: props.asset.positions ?
|
393
|
-
Array.isArray(props.asset.positions) && props.asset.positions.length > 0
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
}
|
467
|
+
Array.isArray(props.asset.positions) && props.asset.positions.length > 0 && props.asset.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
468
|
+
connect: props.asset.positions.map((item) => ({
|
469
|
+
id: item.id
|
470
|
+
}))
|
471
|
+
}
|
399
472
|
: { connectOrCreate: props.asset.positions.map((item) => ({
|
400
473
|
where: {
|
401
474
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -414,6 +487,25 @@ export const NewsArticleAssetSentiment = {
|
|
414
487
|
lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
|
415
488
|
changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
|
416
489
|
assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
|
490
|
+
alpacaAccount: item.alpacaAccount ?
|
491
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
492
|
+
? { connect: {
|
493
|
+
id: item.alpacaAccount.id
|
494
|
+
}
|
495
|
+
}
|
496
|
+
: { connectOrCreate: {
|
497
|
+
where: {
|
498
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
499
|
+
},
|
500
|
+
create: {
|
501
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
502
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
503
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
504
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
505
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
506
|
+
},
|
507
|
+
}
|
508
|
+
} : undefined,
|
417
509
|
},
|
418
510
|
}))
|
419
511
|
} : undefined,
|
@@ -1016,6 +1108,76 @@ export const NewsArticleAssetSentiment = {
|
|
1016
1108
|
optionContractType: item.optionContractType !== undefined ? {
|
1017
1109
|
set: item.optionContractType
|
1018
1110
|
} : undefined,
|
1111
|
+
alpacaAccount: item.alpacaAccount ? {
|
1112
|
+
upsert: {
|
1113
|
+
where: {
|
1114
|
+
id: item.alpacaAccount.id !== undefined ? {
|
1115
|
+
equals: item.alpacaAccount.id
|
1116
|
+
} : undefined,
|
1117
|
+
},
|
1118
|
+
update: {
|
1119
|
+
id: item.alpacaAccount.id !== undefined ? {
|
1120
|
+
set: item.alpacaAccount.id
|
1121
|
+
} : undefined,
|
1122
|
+
type: item.alpacaAccount.type !== undefined ? {
|
1123
|
+
set: item.alpacaAccount.type
|
1124
|
+
} : undefined,
|
1125
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? {
|
1126
|
+
set: item.alpacaAccount.APIKey
|
1127
|
+
} : undefined,
|
1128
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? {
|
1129
|
+
set: item.alpacaAccount.APISecret
|
1130
|
+
} : undefined,
|
1131
|
+
configuration: item.alpacaAccount.configuration !== undefined ? {
|
1132
|
+
set: item.alpacaAccount.configuration
|
1133
|
+
} : undefined,
|
1134
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? {
|
1135
|
+
set: item.alpacaAccount.marketOpen
|
1136
|
+
} : undefined,
|
1137
|
+
},
|
1138
|
+
create: {
|
1139
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1140
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1141
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1142
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1143
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1144
|
+
},
|
1145
|
+
}
|
1146
|
+
} : undefined,
|
1147
|
+
actions: item.actions ? {
|
1148
|
+
upsert: item.actions.map((item) => ({
|
1149
|
+
where: {
|
1150
|
+
id: item.id !== undefined ? item.id : undefined,
|
1151
|
+
},
|
1152
|
+
update: {
|
1153
|
+
id: item.id !== undefined ? {
|
1154
|
+
set: item.id
|
1155
|
+
} : undefined,
|
1156
|
+
sequence: item.sequence !== undefined ? {
|
1157
|
+
set: item.sequence
|
1158
|
+
} : undefined,
|
1159
|
+
type: item.type !== undefined ? {
|
1160
|
+
set: item.type
|
1161
|
+
} : undefined,
|
1162
|
+
note: item.note !== undefined ? {
|
1163
|
+
set: item.note
|
1164
|
+
} : undefined,
|
1165
|
+
status: item.status !== undefined ? {
|
1166
|
+
set: item.status
|
1167
|
+
} : undefined,
|
1168
|
+
fee: item.fee !== undefined ? {
|
1169
|
+
set: item.fee
|
1170
|
+
} : undefined,
|
1171
|
+
},
|
1172
|
+
create: {
|
1173
|
+
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
1174
|
+
type: item.type !== undefined ? item.type : undefined,
|
1175
|
+
note: item.note !== undefined ? item.note : undefined,
|
1176
|
+
status: item.status !== undefined ? item.status : undefined,
|
1177
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
1178
|
+
},
|
1179
|
+
}))
|
1180
|
+
} : undefined,
|
1019
1181
|
},
|
1020
1182
|
create: {
|
1021
1183
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1028,6 +1190,44 @@ export const NewsArticleAssetSentiment = {
|
|
1028
1190
|
timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
|
1029
1191
|
status: item.status !== undefined ? item.status : undefined,
|
1030
1192
|
optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
|
1193
|
+
alpacaAccount: item.alpacaAccount ?
|
1194
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
1195
|
+
? { connect: {
|
1196
|
+
id: item.alpacaAccount.id
|
1197
|
+
}
|
1198
|
+
}
|
1199
|
+
: { connectOrCreate: {
|
1200
|
+
where: {
|
1201
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1202
|
+
},
|
1203
|
+
create: {
|
1204
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1205
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1206
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1207
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1208
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1209
|
+
},
|
1210
|
+
}
|
1211
|
+
} : undefined,
|
1212
|
+
actions: item.actions ?
|
1213
|
+
Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1214
|
+
connect: item.actions.map((item) => ({
|
1215
|
+
id: item.id
|
1216
|
+
}))
|
1217
|
+
}
|
1218
|
+
: { connectOrCreate: item.actions.map((item) => ({
|
1219
|
+
where: {
|
1220
|
+
id: item.id !== undefined ? item.id : undefined,
|
1221
|
+
},
|
1222
|
+
create: {
|
1223
|
+
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
1224
|
+
type: item.type !== undefined ? item.type : undefined,
|
1225
|
+
note: item.note !== undefined ? item.note : undefined,
|
1226
|
+
status: item.status !== undefined ? item.status : undefined,
|
1227
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
1228
|
+
},
|
1229
|
+
}))
|
1230
|
+
} : undefined,
|
1031
1231
|
},
|
1032
1232
|
}))
|
1033
1233
|
} : undefined,
|
@@ -1088,6 +1288,78 @@ export const NewsArticleAssetSentiment = {
|
|
1088
1288
|
fee: item.fee !== undefined ? {
|
1089
1289
|
set: item.fee
|
1090
1290
|
} : undefined,
|
1291
|
+
alpacaAccount: item.alpacaAccount ? {
|
1292
|
+
upsert: {
|
1293
|
+
where: {
|
1294
|
+
id: item.alpacaAccount.id !== undefined ? {
|
1295
|
+
equals: item.alpacaAccount.id
|
1296
|
+
} : undefined,
|
1297
|
+
},
|
1298
|
+
update: {
|
1299
|
+
id: item.alpacaAccount.id !== undefined ? {
|
1300
|
+
set: item.alpacaAccount.id
|
1301
|
+
} : undefined,
|
1302
|
+
type: item.alpacaAccount.type !== undefined ? {
|
1303
|
+
set: item.alpacaAccount.type
|
1304
|
+
} : undefined,
|
1305
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? {
|
1306
|
+
set: item.alpacaAccount.APIKey
|
1307
|
+
} : undefined,
|
1308
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? {
|
1309
|
+
set: item.alpacaAccount.APISecret
|
1310
|
+
} : undefined,
|
1311
|
+
configuration: item.alpacaAccount.configuration !== undefined ? {
|
1312
|
+
set: item.alpacaAccount.configuration
|
1313
|
+
} : undefined,
|
1314
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? {
|
1315
|
+
set: item.alpacaAccount.marketOpen
|
1316
|
+
} : undefined,
|
1317
|
+
},
|
1318
|
+
create: {
|
1319
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1320
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1321
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1322
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1323
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1324
|
+
},
|
1325
|
+
}
|
1326
|
+
} : undefined,
|
1327
|
+
action: item.action ? {
|
1328
|
+
upsert: {
|
1329
|
+
where: {
|
1330
|
+
id: item.action.id !== undefined ? {
|
1331
|
+
equals: item.action.id
|
1332
|
+
} : undefined,
|
1333
|
+
},
|
1334
|
+
update: {
|
1335
|
+
id: item.action.id !== undefined ? {
|
1336
|
+
set: item.action.id
|
1337
|
+
} : undefined,
|
1338
|
+
sequence: item.action.sequence !== undefined ? {
|
1339
|
+
set: item.action.sequence
|
1340
|
+
} : undefined,
|
1341
|
+
type: item.action.type !== undefined ? {
|
1342
|
+
set: item.action.type
|
1343
|
+
} : undefined,
|
1344
|
+
note: item.action.note !== undefined ? {
|
1345
|
+
set: item.action.note
|
1346
|
+
} : undefined,
|
1347
|
+
status: item.action.status !== undefined ? {
|
1348
|
+
set: item.action.status
|
1349
|
+
} : undefined,
|
1350
|
+
fee: item.action.fee !== undefined ? {
|
1351
|
+
set: item.action.fee
|
1352
|
+
} : undefined,
|
1353
|
+
},
|
1354
|
+
create: {
|
1355
|
+
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
1356
|
+
type: item.action.type !== undefined ? item.action.type : undefined,
|
1357
|
+
note: item.action.note !== undefined ? item.action.note : undefined,
|
1358
|
+
status: item.action.status !== undefined ? item.action.status : undefined,
|
1359
|
+
fee: item.action.fee !== undefined ? item.action.fee : undefined,
|
1360
|
+
},
|
1361
|
+
}
|
1362
|
+
} : undefined,
|
1091
1363
|
},
|
1092
1364
|
create: {
|
1093
1365
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1106,6 +1378,44 @@ export const NewsArticleAssetSentiment = {
|
|
1106
1378
|
filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
|
1107
1379
|
filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
|
1108
1380
|
fee: item.fee !== undefined ? item.fee : undefined,
|
1381
|
+
alpacaAccount: item.alpacaAccount ?
|
1382
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
1383
|
+
? { connect: {
|
1384
|
+
id: item.alpacaAccount.id
|
1385
|
+
}
|
1386
|
+
}
|
1387
|
+
: { connectOrCreate: {
|
1388
|
+
where: {
|
1389
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1390
|
+
},
|
1391
|
+
create: {
|
1392
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1393
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1394
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1395
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1396
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1397
|
+
},
|
1398
|
+
}
|
1399
|
+
} : undefined,
|
1400
|
+
action: item.action ?
|
1401
|
+
typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
|
1402
|
+
? { connect: {
|
1403
|
+
id: item.action.id
|
1404
|
+
}
|
1405
|
+
}
|
1406
|
+
: { connectOrCreate: {
|
1407
|
+
where: {
|
1408
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
1409
|
+
},
|
1410
|
+
create: {
|
1411
|
+
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
1412
|
+
type: item.action.type !== undefined ? item.action.type : undefined,
|
1413
|
+
note: item.action.note !== undefined ? item.action.note : undefined,
|
1414
|
+
status: item.action.status !== undefined ? item.action.status : undefined,
|
1415
|
+
fee: item.action.fee !== undefined ? item.action.fee : undefined,
|
1416
|
+
},
|
1417
|
+
}
|
1418
|
+
} : undefined,
|
1109
1419
|
},
|
1110
1420
|
}))
|
1111
1421
|
} : undefined,
|
@@ -1157,6 +1467,42 @@ export const NewsArticleAssetSentiment = {
|
|
1157
1467
|
assetMarginable: item.assetMarginable !== undefined ? {
|
1158
1468
|
set: item.assetMarginable
|
1159
1469
|
} : undefined,
|
1470
|
+
alpacaAccount: item.alpacaAccount ? {
|
1471
|
+
upsert: {
|
1472
|
+
where: {
|
1473
|
+
id: item.alpacaAccount.id !== undefined ? {
|
1474
|
+
equals: item.alpacaAccount.id
|
1475
|
+
} : undefined,
|
1476
|
+
},
|
1477
|
+
update: {
|
1478
|
+
id: item.alpacaAccount.id !== undefined ? {
|
1479
|
+
set: item.alpacaAccount.id
|
1480
|
+
} : undefined,
|
1481
|
+
type: item.alpacaAccount.type !== undefined ? {
|
1482
|
+
set: item.alpacaAccount.type
|
1483
|
+
} : undefined,
|
1484
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? {
|
1485
|
+
set: item.alpacaAccount.APIKey
|
1486
|
+
} : undefined,
|
1487
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? {
|
1488
|
+
set: item.alpacaAccount.APISecret
|
1489
|
+
} : undefined,
|
1490
|
+
configuration: item.alpacaAccount.configuration !== undefined ? {
|
1491
|
+
set: item.alpacaAccount.configuration
|
1492
|
+
} : undefined,
|
1493
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? {
|
1494
|
+
set: item.alpacaAccount.marketOpen
|
1495
|
+
} : undefined,
|
1496
|
+
},
|
1497
|
+
create: {
|
1498
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1499
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1500
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1501
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1502
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1503
|
+
},
|
1504
|
+
}
|
1505
|
+
} : undefined,
|
1160
1506
|
},
|
1161
1507
|
create: {
|
1162
1508
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1172,6 +1518,25 @@ export const NewsArticleAssetSentiment = {
|
|
1172
1518
|
lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
|
1173
1519
|
changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
|
1174
1520
|
assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
|
1521
|
+
alpacaAccount: item.alpacaAccount ?
|
1522
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
1523
|
+
? { connect: {
|
1524
|
+
id: item.alpacaAccount.id
|
1525
|
+
}
|
1526
|
+
}
|
1527
|
+
: { connectOrCreate: {
|
1528
|
+
where: {
|
1529
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1530
|
+
},
|
1531
|
+
create: {
|
1532
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1533
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1534
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1535
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1536
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1537
|
+
},
|
1538
|
+
}
|
1539
|
+
} : undefined,
|
1175
1540
|
},
|
1176
1541
|
}))
|
1177
1542
|
} : undefined,
|
@@ -1233,12 +1598,11 @@ export const NewsArticleAssetSentiment = {
|
|
1233
1598
|
sellPrice: props.asset.sellPrice !== undefined ? props.asset.sellPrice : undefined,
|
1234
1599
|
buyPrice: props.asset.buyPrice !== undefined ? props.asset.buyPrice : undefined,
|
1235
1600
|
trades: props.asset.trades ?
|
1236
|
-
Array.isArray(props.asset.trades) && props.asset.trades.length > 0
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
}
|
1601
|
+
Array.isArray(props.asset.trades) && props.asset.trades.length > 0 && props.asset.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1602
|
+
connect: props.asset.trades.map((item) => ({
|
1603
|
+
id: item.id
|
1604
|
+
}))
|
1605
|
+
}
|
1242
1606
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
1243
1607
|
where: {
|
1244
1608
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1254,16 +1618,53 @@ export const NewsArticleAssetSentiment = {
|
|
1254
1618
|
timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
|
1255
1619
|
status: item.status !== undefined ? item.status : undefined,
|
1256
1620
|
optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
|
1621
|
+
alpacaAccount: item.alpacaAccount ?
|
1622
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
1623
|
+
? { connect: {
|
1624
|
+
id: item.alpacaAccount.id
|
1625
|
+
}
|
1626
|
+
}
|
1627
|
+
: { connectOrCreate: {
|
1628
|
+
where: {
|
1629
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1630
|
+
},
|
1631
|
+
create: {
|
1632
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1633
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1634
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1635
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1636
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1637
|
+
},
|
1638
|
+
}
|
1639
|
+
} : undefined,
|
1640
|
+
actions: item.actions ?
|
1641
|
+
Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1642
|
+
connect: item.actions.map((item) => ({
|
1643
|
+
id: item.id
|
1644
|
+
}))
|
1645
|
+
}
|
1646
|
+
: { connectOrCreate: item.actions.map((item) => ({
|
1647
|
+
where: {
|
1648
|
+
id: item.id !== undefined ? item.id : undefined,
|
1649
|
+
},
|
1650
|
+
create: {
|
1651
|
+
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
1652
|
+
type: item.type !== undefined ? item.type : undefined,
|
1653
|
+
note: item.note !== undefined ? item.note : undefined,
|
1654
|
+
status: item.status !== undefined ? item.status : undefined,
|
1655
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
1656
|
+
},
|
1657
|
+
}))
|
1658
|
+
} : undefined,
|
1257
1659
|
},
|
1258
1660
|
}))
|
1259
1661
|
} : undefined,
|
1260
1662
|
orders: props.asset.orders ?
|
1261
|
-
Array.isArray(props.asset.orders) && props.asset.orders.length > 0
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
}
|
1663
|
+
Array.isArray(props.asset.orders) && props.asset.orders.length > 0 && props.asset.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1664
|
+
connect: props.asset.orders.map((item) => ({
|
1665
|
+
id: item.id
|
1666
|
+
}))
|
1667
|
+
}
|
1267
1668
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
1268
1669
|
where: {
|
1269
1670
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1285,16 +1686,53 @@ export const NewsArticleAssetSentiment = {
|
|
1285
1686
|
filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
|
1286
1687
|
filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
|
1287
1688
|
fee: item.fee !== undefined ? item.fee : undefined,
|
1689
|
+
alpacaAccount: item.alpacaAccount ?
|
1690
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
1691
|
+
? { connect: {
|
1692
|
+
id: item.alpacaAccount.id
|
1693
|
+
}
|
1694
|
+
}
|
1695
|
+
: { connectOrCreate: {
|
1696
|
+
where: {
|
1697
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1698
|
+
},
|
1699
|
+
create: {
|
1700
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1701
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1702
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1703
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1704
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1705
|
+
},
|
1706
|
+
}
|
1707
|
+
} : undefined,
|
1708
|
+
action: item.action ?
|
1709
|
+
typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
|
1710
|
+
? { connect: {
|
1711
|
+
id: item.action.id
|
1712
|
+
}
|
1713
|
+
}
|
1714
|
+
: { connectOrCreate: {
|
1715
|
+
where: {
|
1716
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
1717
|
+
},
|
1718
|
+
create: {
|
1719
|
+
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
1720
|
+
type: item.action.type !== undefined ? item.action.type : undefined,
|
1721
|
+
note: item.action.note !== undefined ? item.action.note : undefined,
|
1722
|
+
status: item.action.status !== undefined ? item.action.status : undefined,
|
1723
|
+
fee: item.action.fee !== undefined ? item.action.fee : undefined,
|
1724
|
+
},
|
1725
|
+
}
|
1726
|
+
} : undefined,
|
1288
1727
|
},
|
1289
1728
|
}))
|
1290
1729
|
} : undefined,
|
1291
1730
|
positions: props.asset.positions ?
|
1292
|
-
Array.isArray(props.asset.positions) && props.asset.positions.length > 0
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
}
|
1731
|
+
Array.isArray(props.asset.positions) && props.asset.positions.length > 0 && props.asset.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
1732
|
+
connect: props.asset.positions.map((item) => ({
|
1733
|
+
id: item.id
|
1734
|
+
}))
|
1735
|
+
}
|
1298
1736
|
: { connectOrCreate: props.asset.positions.map((item) => ({
|
1299
1737
|
where: {
|
1300
1738
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1313,6 +1751,25 @@ export const NewsArticleAssetSentiment = {
|
|
1313
1751
|
lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
|
1314
1752
|
changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
|
1315
1753
|
assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
|
1754
|
+
alpacaAccount: item.alpacaAccount ?
|
1755
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
1756
|
+
? { connect: {
|
1757
|
+
id: item.alpacaAccount.id
|
1758
|
+
}
|
1759
|
+
}
|
1760
|
+
: { connectOrCreate: {
|
1761
|
+
where: {
|
1762
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1763
|
+
},
|
1764
|
+
create: {
|
1765
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1766
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1767
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1768
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1769
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1770
|
+
},
|
1771
|
+
}
|
1772
|
+
} : undefined,
|
1316
1773
|
},
|
1317
1774
|
}))
|
1318
1775
|
} : undefined,
|
@@ -1667,6 +2124,76 @@ export const NewsArticleAssetSentiment = {
|
|
1667
2124
|
optionContractType: item.optionContractType !== undefined ? {
|
1668
2125
|
set: item.optionContractType
|
1669
2126
|
} : undefined,
|
2127
|
+
alpacaAccount: item.alpacaAccount ? {
|
2128
|
+
upsert: {
|
2129
|
+
where: {
|
2130
|
+
id: item.alpacaAccount.id !== undefined ? {
|
2131
|
+
equals: item.alpacaAccount.id
|
2132
|
+
} : undefined,
|
2133
|
+
},
|
2134
|
+
update: {
|
2135
|
+
id: item.alpacaAccount.id !== undefined ? {
|
2136
|
+
set: item.alpacaAccount.id
|
2137
|
+
} : undefined,
|
2138
|
+
type: item.alpacaAccount.type !== undefined ? {
|
2139
|
+
set: item.alpacaAccount.type
|
2140
|
+
} : undefined,
|
2141
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? {
|
2142
|
+
set: item.alpacaAccount.APIKey
|
2143
|
+
} : undefined,
|
2144
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? {
|
2145
|
+
set: item.alpacaAccount.APISecret
|
2146
|
+
} : undefined,
|
2147
|
+
configuration: item.alpacaAccount.configuration !== undefined ? {
|
2148
|
+
set: item.alpacaAccount.configuration
|
2149
|
+
} : undefined,
|
2150
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? {
|
2151
|
+
set: item.alpacaAccount.marketOpen
|
2152
|
+
} : undefined,
|
2153
|
+
},
|
2154
|
+
create: {
|
2155
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2156
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2157
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2158
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2159
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2160
|
+
},
|
2161
|
+
}
|
2162
|
+
} : undefined,
|
2163
|
+
actions: item.actions ? {
|
2164
|
+
upsert: item.actions.map((item) => ({
|
2165
|
+
where: {
|
2166
|
+
id: item.id !== undefined ? item.id : undefined,
|
2167
|
+
},
|
2168
|
+
update: {
|
2169
|
+
id: item.id !== undefined ? {
|
2170
|
+
set: item.id
|
2171
|
+
} : undefined,
|
2172
|
+
sequence: item.sequence !== undefined ? {
|
2173
|
+
set: item.sequence
|
2174
|
+
} : undefined,
|
2175
|
+
type: item.type !== undefined ? {
|
2176
|
+
set: item.type
|
2177
|
+
} : undefined,
|
2178
|
+
note: item.note !== undefined ? {
|
2179
|
+
set: item.note
|
2180
|
+
} : undefined,
|
2181
|
+
status: item.status !== undefined ? {
|
2182
|
+
set: item.status
|
2183
|
+
} : undefined,
|
2184
|
+
fee: item.fee !== undefined ? {
|
2185
|
+
set: item.fee
|
2186
|
+
} : undefined,
|
2187
|
+
},
|
2188
|
+
create: {
|
2189
|
+
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
2190
|
+
type: item.type !== undefined ? item.type : undefined,
|
2191
|
+
note: item.note !== undefined ? item.note : undefined,
|
2192
|
+
status: item.status !== undefined ? item.status : undefined,
|
2193
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
2194
|
+
},
|
2195
|
+
}))
|
2196
|
+
} : undefined,
|
1670
2197
|
},
|
1671
2198
|
create: {
|
1672
2199
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1679,6 +2206,44 @@ export const NewsArticleAssetSentiment = {
|
|
1679
2206
|
timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
|
1680
2207
|
status: item.status !== undefined ? item.status : undefined,
|
1681
2208
|
optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
|
2209
|
+
alpacaAccount: item.alpacaAccount ?
|
2210
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
2211
|
+
? { connect: {
|
2212
|
+
id: item.alpacaAccount.id
|
2213
|
+
}
|
2214
|
+
}
|
2215
|
+
: { connectOrCreate: {
|
2216
|
+
where: {
|
2217
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2218
|
+
},
|
2219
|
+
create: {
|
2220
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2221
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2222
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2223
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2224
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2225
|
+
},
|
2226
|
+
}
|
2227
|
+
} : undefined,
|
2228
|
+
actions: item.actions ?
|
2229
|
+
Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
2230
|
+
connect: item.actions.map((item) => ({
|
2231
|
+
id: item.id
|
2232
|
+
}))
|
2233
|
+
}
|
2234
|
+
: { connectOrCreate: item.actions.map((item) => ({
|
2235
|
+
where: {
|
2236
|
+
id: item.id !== undefined ? item.id : undefined,
|
2237
|
+
},
|
2238
|
+
create: {
|
2239
|
+
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
2240
|
+
type: item.type !== undefined ? item.type : undefined,
|
2241
|
+
note: item.note !== undefined ? item.note : undefined,
|
2242
|
+
status: item.status !== undefined ? item.status : undefined,
|
2243
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
2244
|
+
},
|
2245
|
+
}))
|
2246
|
+
} : undefined,
|
1682
2247
|
},
|
1683
2248
|
}))
|
1684
2249
|
} : undefined,
|
@@ -1739,6 +2304,78 @@ export const NewsArticleAssetSentiment = {
|
|
1739
2304
|
fee: item.fee !== undefined ? {
|
1740
2305
|
set: item.fee
|
1741
2306
|
} : undefined,
|
2307
|
+
alpacaAccount: item.alpacaAccount ? {
|
2308
|
+
upsert: {
|
2309
|
+
where: {
|
2310
|
+
id: item.alpacaAccount.id !== undefined ? {
|
2311
|
+
equals: item.alpacaAccount.id
|
2312
|
+
} : undefined,
|
2313
|
+
},
|
2314
|
+
update: {
|
2315
|
+
id: item.alpacaAccount.id !== undefined ? {
|
2316
|
+
set: item.alpacaAccount.id
|
2317
|
+
} : undefined,
|
2318
|
+
type: item.alpacaAccount.type !== undefined ? {
|
2319
|
+
set: item.alpacaAccount.type
|
2320
|
+
} : undefined,
|
2321
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? {
|
2322
|
+
set: item.alpacaAccount.APIKey
|
2323
|
+
} : undefined,
|
2324
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? {
|
2325
|
+
set: item.alpacaAccount.APISecret
|
2326
|
+
} : undefined,
|
2327
|
+
configuration: item.alpacaAccount.configuration !== undefined ? {
|
2328
|
+
set: item.alpacaAccount.configuration
|
2329
|
+
} : undefined,
|
2330
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? {
|
2331
|
+
set: item.alpacaAccount.marketOpen
|
2332
|
+
} : undefined,
|
2333
|
+
},
|
2334
|
+
create: {
|
2335
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2336
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2337
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2338
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2339
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2340
|
+
},
|
2341
|
+
}
|
2342
|
+
} : undefined,
|
2343
|
+
action: item.action ? {
|
2344
|
+
upsert: {
|
2345
|
+
where: {
|
2346
|
+
id: item.action.id !== undefined ? {
|
2347
|
+
equals: item.action.id
|
2348
|
+
} : undefined,
|
2349
|
+
},
|
2350
|
+
update: {
|
2351
|
+
id: item.action.id !== undefined ? {
|
2352
|
+
set: item.action.id
|
2353
|
+
} : undefined,
|
2354
|
+
sequence: item.action.sequence !== undefined ? {
|
2355
|
+
set: item.action.sequence
|
2356
|
+
} : undefined,
|
2357
|
+
type: item.action.type !== undefined ? {
|
2358
|
+
set: item.action.type
|
2359
|
+
} : undefined,
|
2360
|
+
note: item.action.note !== undefined ? {
|
2361
|
+
set: item.action.note
|
2362
|
+
} : undefined,
|
2363
|
+
status: item.action.status !== undefined ? {
|
2364
|
+
set: item.action.status
|
2365
|
+
} : undefined,
|
2366
|
+
fee: item.action.fee !== undefined ? {
|
2367
|
+
set: item.action.fee
|
2368
|
+
} : undefined,
|
2369
|
+
},
|
2370
|
+
create: {
|
2371
|
+
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
2372
|
+
type: item.action.type !== undefined ? item.action.type : undefined,
|
2373
|
+
note: item.action.note !== undefined ? item.action.note : undefined,
|
2374
|
+
status: item.action.status !== undefined ? item.action.status : undefined,
|
2375
|
+
fee: item.action.fee !== undefined ? item.action.fee : undefined,
|
2376
|
+
},
|
2377
|
+
}
|
2378
|
+
} : undefined,
|
1742
2379
|
},
|
1743
2380
|
create: {
|
1744
2381
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1757,6 +2394,44 @@ export const NewsArticleAssetSentiment = {
|
|
1757
2394
|
filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
|
1758
2395
|
filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
|
1759
2396
|
fee: item.fee !== undefined ? item.fee : undefined,
|
2397
|
+
alpacaAccount: item.alpacaAccount ?
|
2398
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
2399
|
+
? { connect: {
|
2400
|
+
id: item.alpacaAccount.id
|
2401
|
+
}
|
2402
|
+
}
|
2403
|
+
: { connectOrCreate: {
|
2404
|
+
where: {
|
2405
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2406
|
+
},
|
2407
|
+
create: {
|
2408
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2409
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2410
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2411
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2412
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2413
|
+
},
|
2414
|
+
}
|
2415
|
+
} : undefined,
|
2416
|
+
action: item.action ?
|
2417
|
+
typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
|
2418
|
+
? { connect: {
|
2419
|
+
id: item.action.id
|
2420
|
+
}
|
2421
|
+
}
|
2422
|
+
: { connectOrCreate: {
|
2423
|
+
where: {
|
2424
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
2425
|
+
},
|
2426
|
+
create: {
|
2427
|
+
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
2428
|
+
type: item.action.type !== undefined ? item.action.type : undefined,
|
2429
|
+
note: item.action.note !== undefined ? item.action.note : undefined,
|
2430
|
+
status: item.action.status !== undefined ? item.action.status : undefined,
|
2431
|
+
fee: item.action.fee !== undefined ? item.action.fee : undefined,
|
2432
|
+
},
|
2433
|
+
}
|
2434
|
+
} : undefined,
|
1760
2435
|
},
|
1761
2436
|
}))
|
1762
2437
|
} : undefined,
|
@@ -1808,6 +2483,42 @@ export const NewsArticleAssetSentiment = {
|
|
1808
2483
|
assetMarginable: item.assetMarginable !== undefined ? {
|
1809
2484
|
set: item.assetMarginable
|
1810
2485
|
} : undefined,
|
2486
|
+
alpacaAccount: item.alpacaAccount ? {
|
2487
|
+
upsert: {
|
2488
|
+
where: {
|
2489
|
+
id: item.alpacaAccount.id !== undefined ? {
|
2490
|
+
equals: item.alpacaAccount.id
|
2491
|
+
} : undefined,
|
2492
|
+
},
|
2493
|
+
update: {
|
2494
|
+
id: item.alpacaAccount.id !== undefined ? {
|
2495
|
+
set: item.alpacaAccount.id
|
2496
|
+
} : undefined,
|
2497
|
+
type: item.alpacaAccount.type !== undefined ? {
|
2498
|
+
set: item.alpacaAccount.type
|
2499
|
+
} : undefined,
|
2500
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? {
|
2501
|
+
set: item.alpacaAccount.APIKey
|
2502
|
+
} : undefined,
|
2503
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? {
|
2504
|
+
set: item.alpacaAccount.APISecret
|
2505
|
+
} : undefined,
|
2506
|
+
configuration: item.alpacaAccount.configuration !== undefined ? {
|
2507
|
+
set: item.alpacaAccount.configuration
|
2508
|
+
} : undefined,
|
2509
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? {
|
2510
|
+
set: item.alpacaAccount.marketOpen
|
2511
|
+
} : undefined,
|
2512
|
+
},
|
2513
|
+
create: {
|
2514
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2515
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2516
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2517
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2518
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2519
|
+
},
|
2520
|
+
}
|
2521
|
+
} : undefined,
|
1811
2522
|
},
|
1812
2523
|
create: {
|
1813
2524
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1823,6 +2534,25 @@ export const NewsArticleAssetSentiment = {
|
|
1823
2534
|
lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
|
1824
2535
|
changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
|
1825
2536
|
assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
|
2537
|
+
alpacaAccount: item.alpacaAccount ?
|
2538
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
2539
|
+
? { connect: {
|
2540
|
+
id: item.alpacaAccount.id
|
2541
|
+
}
|
2542
|
+
}
|
2543
|
+
: { connectOrCreate: {
|
2544
|
+
where: {
|
2545
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2546
|
+
},
|
2547
|
+
create: {
|
2548
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2549
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2550
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2551
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2552
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2553
|
+
},
|
2554
|
+
}
|
2555
|
+
} : undefined,
|
1826
2556
|
},
|
1827
2557
|
}))
|
1828
2558
|
} : undefined,
|
@@ -1884,12 +2614,11 @@ export const NewsArticleAssetSentiment = {
|
|
1884
2614
|
sellPrice: prop.asset.sellPrice !== undefined ? prop.asset.sellPrice : undefined,
|
1885
2615
|
buyPrice: prop.asset.buyPrice !== undefined ? prop.asset.buyPrice : undefined,
|
1886
2616
|
trades: prop.asset.trades ?
|
1887
|
-
Array.isArray(prop.asset.trades) && prop.asset.trades.length > 0
|
1888
|
-
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
}
|
2617
|
+
Array.isArray(prop.asset.trades) && prop.asset.trades.length > 0 && prop.asset.trades.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
2618
|
+
connect: prop.asset.trades.map((item) => ({
|
2619
|
+
id: item.id
|
2620
|
+
}))
|
2621
|
+
}
|
1893
2622
|
: { connectOrCreate: prop.asset.trades.map((item) => ({
|
1894
2623
|
where: {
|
1895
2624
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1905,16 +2634,53 @@ export const NewsArticleAssetSentiment = {
|
|
1905
2634
|
timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
|
1906
2635
|
status: item.status !== undefined ? item.status : undefined,
|
1907
2636
|
optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
|
2637
|
+
alpacaAccount: item.alpacaAccount ?
|
2638
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
2639
|
+
? { connect: {
|
2640
|
+
id: item.alpacaAccount.id
|
2641
|
+
}
|
2642
|
+
}
|
2643
|
+
: { connectOrCreate: {
|
2644
|
+
where: {
|
2645
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2646
|
+
},
|
2647
|
+
create: {
|
2648
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2649
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2650
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2651
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2652
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2653
|
+
},
|
2654
|
+
}
|
2655
|
+
} : undefined,
|
2656
|
+
actions: item.actions ?
|
2657
|
+
Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
2658
|
+
connect: item.actions.map((item) => ({
|
2659
|
+
id: item.id
|
2660
|
+
}))
|
2661
|
+
}
|
2662
|
+
: { connectOrCreate: item.actions.map((item) => ({
|
2663
|
+
where: {
|
2664
|
+
id: item.id !== undefined ? item.id : undefined,
|
2665
|
+
},
|
2666
|
+
create: {
|
2667
|
+
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
2668
|
+
type: item.type !== undefined ? item.type : undefined,
|
2669
|
+
note: item.note !== undefined ? item.note : undefined,
|
2670
|
+
status: item.status !== undefined ? item.status : undefined,
|
2671
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
2672
|
+
},
|
2673
|
+
}))
|
2674
|
+
} : undefined,
|
1908
2675
|
},
|
1909
2676
|
}))
|
1910
2677
|
} : undefined,
|
1911
2678
|
orders: prop.asset.orders ?
|
1912
|
-
Array.isArray(prop.asset.orders) && prop.asset.orders.length > 0
|
1913
|
-
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
}
|
2679
|
+
Array.isArray(prop.asset.orders) && prop.asset.orders.length > 0 && prop.asset.orders.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
2680
|
+
connect: prop.asset.orders.map((item) => ({
|
2681
|
+
id: item.id
|
2682
|
+
}))
|
2683
|
+
}
|
1918
2684
|
: { connectOrCreate: prop.asset.orders.map((item) => ({
|
1919
2685
|
where: {
|
1920
2686
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1936,16 +2702,53 @@ export const NewsArticleAssetSentiment = {
|
|
1936
2702
|
filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
|
1937
2703
|
filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
|
1938
2704
|
fee: item.fee !== undefined ? item.fee : undefined,
|
2705
|
+
alpacaAccount: item.alpacaAccount ?
|
2706
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
2707
|
+
? { connect: {
|
2708
|
+
id: item.alpacaAccount.id
|
2709
|
+
}
|
2710
|
+
}
|
2711
|
+
: { connectOrCreate: {
|
2712
|
+
where: {
|
2713
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2714
|
+
},
|
2715
|
+
create: {
|
2716
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2717
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2718
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2719
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2720
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2721
|
+
},
|
2722
|
+
}
|
2723
|
+
} : undefined,
|
2724
|
+
action: item.action ?
|
2725
|
+
typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
|
2726
|
+
? { connect: {
|
2727
|
+
id: item.action.id
|
2728
|
+
}
|
2729
|
+
}
|
2730
|
+
: { connectOrCreate: {
|
2731
|
+
where: {
|
2732
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
2733
|
+
},
|
2734
|
+
create: {
|
2735
|
+
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
2736
|
+
type: item.action.type !== undefined ? item.action.type : undefined,
|
2737
|
+
note: item.action.note !== undefined ? item.action.note : undefined,
|
2738
|
+
status: item.action.status !== undefined ? item.action.status : undefined,
|
2739
|
+
fee: item.action.fee !== undefined ? item.action.fee : undefined,
|
2740
|
+
},
|
2741
|
+
}
|
2742
|
+
} : undefined,
|
1939
2743
|
},
|
1940
2744
|
}))
|
1941
2745
|
} : undefined,
|
1942
2746
|
positions: prop.asset.positions ?
|
1943
|
-
Array.isArray(prop.asset.positions) && prop.asset.positions.length > 0
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
}
|
2747
|
+
Array.isArray(prop.asset.positions) && prop.asset.positions.length > 0 && prop.asset.positions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
|
2748
|
+
connect: prop.asset.positions.map((item) => ({
|
2749
|
+
id: item.id
|
2750
|
+
}))
|
2751
|
+
}
|
1949
2752
|
: { connectOrCreate: prop.asset.positions.map((item) => ({
|
1950
2753
|
where: {
|
1951
2754
|
id: item.id !== undefined ? item.id : undefined,
|
@@ -1964,6 +2767,25 @@ export const NewsArticleAssetSentiment = {
|
|
1964
2767
|
lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
|
1965
2768
|
changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
|
1966
2769
|
assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
|
2770
|
+
alpacaAccount: item.alpacaAccount ?
|
2771
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
2772
|
+
? { connect: {
|
2773
|
+
id: item.alpacaAccount.id
|
2774
|
+
}
|
2775
|
+
}
|
2776
|
+
: { connectOrCreate: {
|
2777
|
+
where: {
|
2778
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2779
|
+
},
|
2780
|
+
create: {
|
2781
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2782
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2783
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2784
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2785
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2786
|
+
},
|
2787
|
+
}
|
2788
|
+
} : undefined,
|
1967
2789
|
},
|
1968
2790
|
}))
|
1969
2791
|
} : undefined,
|