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