adaptic-backend 1.0.75 → 1.0.76
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 +255 -190
- package/Action.cjs +594 -524
- package/Alert.cjs +343 -278
- package/AlpacaAccount.cjs +1181 -1021
- package/Asset.cjs +478 -368
- package/Authenticator.cjs +276 -211
- package/Customer.cjs +255 -190
- package/NewsArticle.cjs +232 -212
- package/NewsArticleAssetSentiment.cjs +345 -290
- package/Order.cjs +676 -541
- package/Position.cjs +603 -488
- package/Session.cjs +279 -214
- package/Trade.cjs +748 -613
- package/User.cjs +394 -309
- package/package.json +1 -1
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +255 -190
- package/server/Action.d.ts.map +1 -1
- package/server/Action.js.map +1 -1
- package/server/Action.mjs +594 -524
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +343 -278
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +1181 -1021
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +478 -368
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +276 -211
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +255 -190
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +232 -212
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +345 -290
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +676 -541
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +603 -488
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +279 -214
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +748 -613
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +394 -309
package/Asset.cjs
CHANGED
@@ -323,182 +323,232 @@ exports.Asset = {
|
|
323
323
|
exDividendDate: props.exDividendDate !== undefined ? props.exDividendDate : undefined,
|
324
324
|
sellPrice: props.sellPrice !== undefined ? props.sellPrice : undefined,
|
325
325
|
buyPrice: props.buyPrice !== undefined ? props.buyPrice : undefined,
|
326
|
-
trades: props.trades ?
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
326
|
+
trades: props.trades ?
|
327
|
+
typeof props.trades[0] === 'object' && Object.keys(props.trades).length === 1 && Object.keys(props.trades)[0] === 'id'
|
328
|
+
? { connect: props.trades.map((item) => ({
|
329
|
+
id: item.id
|
330
|
+
}))
|
331
|
+
}
|
332
|
+
: { connectOrCreate: props.trades.map((item) => ({
|
333
|
+
where: {
|
334
|
+
id: item.id !== undefined ? item.id : undefined,
|
335
|
+
},
|
336
|
+
create: {
|
337
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
338
|
+
price: item.price !== undefined ? item.price : undefined,
|
339
|
+
total: item.total !== undefined ? item.total : undefined,
|
340
|
+
signal: item.signal !== undefined ? item.signal : undefined,
|
341
|
+
strategy: item.strategy !== undefined ? item.strategy : undefined,
|
342
|
+
analysis: item.analysis !== undefined ? item.analysis : undefined,
|
343
|
+
confidence: item.confidence !== undefined ? item.confidence : undefined,
|
344
|
+
timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
|
345
|
+
status: item.status !== undefined ? item.status : undefined,
|
346
|
+
optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
|
347
|
+
alpacaAccount: item.alpacaAccount ?
|
348
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
349
|
+
? { connect: {
|
350
|
+
id: item.alpacaAccount.id
|
351
|
+
}
|
352
|
+
}
|
353
|
+
: { connectOrCreate: {
|
354
|
+
where: {
|
355
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
356
|
+
},
|
357
|
+
create: {
|
358
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
359
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
360
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
361
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
362
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
363
|
+
},
|
364
|
+
}
|
365
|
+
} : undefined,
|
366
|
+
actions: item.actions ?
|
367
|
+
typeof item.actions[0] === 'object' && Object.keys(item.actions).length === 1 && Object.keys(item.actions)[0] === 'id'
|
368
|
+
? { connect: item.actions.map((item) => ({
|
369
|
+
id: item.id
|
370
|
+
}))
|
371
|
+
}
|
372
|
+
: { connectOrCreate: item.actions.map((item) => ({
|
373
|
+
where: {
|
374
|
+
id: item.id !== undefined ? item.id : undefined,
|
375
|
+
},
|
376
|
+
create: {
|
377
|
+
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
378
|
+
type: item.type !== undefined ? item.type : undefined,
|
379
|
+
note: item.note !== undefined ? item.note : undefined,
|
380
|
+
status: item.status !== undefined ? item.status : undefined,
|
381
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
382
|
+
},
|
383
|
+
}))
|
384
|
+
} : undefined,
|
385
|
+
},
|
386
|
+
}))
|
387
|
+
} : undefined,
|
388
|
+
orders: props.orders ?
|
389
|
+
typeof props.orders[0] === 'object' && Object.keys(props.orders).length === 1 && Object.keys(props.orders)[0] === 'id'
|
390
|
+
? { connect: props.orders.map((item) => ({
|
391
|
+
id: item.id
|
392
|
+
}))
|
393
|
+
}
|
394
|
+
: { connectOrCreate: props.orders.map((item) => ({
|
395
|
+
where: {
|
396
|
+
id: item.id !== undefined ? item.id : undefined,
|
397
|
+
},
|
398
|
+
create: {
|
399
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
400
|
+
notional: item.notional !== undefined ? item.notional : undefined,
|
401
|
+
side: item.side !== undefined ? item.side : undefined,
|
402
|
+
type: item.type !== undefined ? item.type : undefined,
|
403
|
+
timeInForce: item.timeInForce !== undefined ? item.timeInForce : undefined,
|
404
|
+
limitPrice: item.limitPrice !== undefined ? item.limitPrice : undefined,
|
405
|
+
stopPrice: item.stopPrice !== undefined ? item.stopPrice : undefined,
|
406
|
+
trailPrice: item.trailPrice !== undefined ? item.trailPrice : undefined,
|
407
|
+
trailPercent: item.trailPercent !== undefined ? item.trailPercent : undefined,
|
408
|
+
extendedHours: item.extendedHours !== undefined ? item.extendedHours : undefined,
|
409
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
410
|
+
status: item.status !== undefined ? item.status : undefined,
|
411
|
+
submittedAt: item.submittedAt !== undefined ? item.submittedAt : undefined,
|
412
|
+
filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
|
413
|
+
filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
|
414
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
415
|
+
alpacaAccount: item.alpacaAccount ?
|
416
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
417
|
+
? { connect: {
|
418
|
+
id: item.alpacaAccount.id
|
419
|
+
}
|
420
|
+
}
|
421
|
+
: { connectOrCreate: {
|
422
|
+
where: {
|
423
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
424
|
+
},
|
425
|
+
create: {
|
426
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
427
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
428
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
429
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
430
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
431
|
+
},
|
432
|
+
}
|
433
|
+
} : undefined,
|
434
|
+
action: item.action ?
|
435
|
+
typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
|
436
|
+
? { connect: {
|
437
|
+
id: item.action.id
|
438
|
+
}
|
439
|
+
}
|
440
|
+
: { connectOrCreate: {
|
441
|
+
where: {
|
442
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
443
|
+
},
|
444
|
+
create: {
|
445
|
+
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
446
|
+
type: item.action.type !== undefined ? item.action.type : undefined,
|
447
|
+
note: item.action.note !== undefined ? item.action.note : undefined,
|
448
|
+
status: item.action.status !== undefined ? item.action.status : undefined,
|
449
|
+
fee: item.action.fee !== undefined ? item.action.fee : undefined,
|
450
|
+
},
|
451
|
+
}
|
452
|
+
} : undefined,
|
453
|
+
},
|
454
|
+
}))
|
455
|
+
} : undefined,
|
456
|
+
positions: props.positions ?
|
457
|
+
typeof props.positions[0] === 'object' && Object.keys(props.positions).length === 1 && Object.keys(props.positions)[0] === 'id'
|
458
|
+
? { connect: props.positions.map((item) => ({
|
459
|
+
id: item.id
|
460
|
+
}))
|
461
|
+
}
|
462
|
+
: { connectOrCreate: props.positions.map((item) => ({
|
463
|
+
where: {
|
464
|
+
id: item.id !== undefined ? item.id : undefined,
|
465
|
+
},
|
466
|
+
create: {
|
467
|
+
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
468
|
+
qty: item.qty !== undefined ? item.qty : undefined,
|
469
|
+
qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
|
470
|
+
marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
|
471
|
+
costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
|
472
|
+
unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
|
473
|
+
unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
|
474
|
+
unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
|
475
|
+
unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
|
476
|
+
currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
|
477
|
+
lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
|
478
|
+
changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
|
479
|
+
assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
|
480
|
+
alpacaAccount: item.alpacaAccount ?
|
481
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
482
|
+
? { connect: {
|
483
|
+
id: item.alpacaAccount.id
|
484
|
+
}
|
485
|
+
}
|
486
|
+
: { connectOrCreate: {
|
487
|
+
where: {
|
488
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
489
|
+
},
|
490
|
+
create: {
|
491
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
492
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
493
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
494
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
495
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
496
|
+
},
|
497
|
+
}
|
498
|
+
} : undefined,
|
499
|
+
},
|
500
|
+
}))
|
501
|
+
} : undefined,
|
502
|
+
newsMentions: props.newsMentions ?
|
503
|
+
typeof props.newsMentions[0] === 'object' && Object.keys(props.newsMentions).length === 1 && Object.keys(props.newsMentions)[0] === 'id'
|
504
|
+
? { connect: props.newsMentions.map((item) => ({
|
505
|
+
id: item.id
|
506
|
+
}))
|
507
|
+
}
|
508
|
+
: { connectOrCreate: props.newsMentions.map((item) => ({
|
509
|
+
where: {
|
510
|
+
id: item.id !== undefined ? item.id : undefined,
|
511
|
+
url: item.url !== undefined ? item.url : undefined,
|
512
|
+
},
|
513
|
+
create: {
|
514
|
+
url: item.url !== undefined ? item.url : undefined,
|
515
|
+
relevancyScore: item.relevancyScore !== undefined ? item.relevancyScore : undefined,
|
516
|
+
sentimentScore: item.sentimentScore !== undefined ? item.sentimentScore : undefined,
|
517
|
+
sentimentLabel: item.sentimentLabel !== undefined ? item.sentimentLabel : undefined,
|
518
|
+
news: item.news ?
|
519
|
+
typeof item.news === 'object' && Object.keys(item.news).length === 1 && Object.keys(item.news)[0] === 'id'
|
520
|
+
? { connect: {
|
521
|
+
id: item.news.id
|
522
|
+
}
|
523
|
+
}
|
524
|
+
: { connectOrCreate: {
|
525
|
+
where: {
|
526
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
527
|
+
url: item.news.url !== undefined ? item.news.url : undefined,
|
528
|
+
title: item.news.title !== undefined ? {
|
529
|
+
equals: item.news.title
|
530
|
+
} : undefined,
|
531
|
+
},
|
532
|
+
create: {
|
533
|
+
title: item.news.title !== undefined ? item.news.title : undefined,
|
534
|
+
content: item.news.content !== undefined ? item.news.content : undefined,
|
535
|
+
source: item.news.source !== undefined ? item.news.source : undefined,
|
536
|
+
sourceDomain: item.news.sourceDomain !== undefined ? item.news.sourceDomain : undefined,
|
537
|
+
url: item.news.url !== undefined ? item.news.url : undefined,
|
538
|
+
sentiment: item.news.sentiment !== undefined ? item.news.sentiment : undefined,
|
539
|
+
authors: item.news.authors !== undefined ? item.news.authors : undefined,
|
540
|
+
summary: item.news.summary !== undefined ? item.news.summary : undefined,
|
541
|
+
bannerImage: item.news.bannerImage !== undefined ? item.news.bannerImage : undefined,
|
542
|
+
timePublished: item.news.timePublished !== undefined ? item.news.timePublished : undefined,
|
543
|
+
category: item.news.category !== undefined ? item.news.category : undefined,
|
544
|
+
topics: item.news.topics !== undefined ? item.news.topics : undefined,
|
545
|
+
logo: item.news.logo !== undefined ? item.news.logo : undefined,
|
546
|
+
},
|
547
|
+
}
|
548
|
+
} : undefined,
|
549
|
+
},
|
550
|
+
}))
|
551
|
+
} : undefined,
|
502
552
|
},
|
503
553
|
};
|
504
554
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
@@ -1166,34 +1216,44 @@ exports.Asset = {
|
|
1166
1216
|
timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
|
1167
1217
|
status: item.status !== undefined ? item.status : undefined,
|
1168
1218
|
optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
|
1169
|
-
alpacaAccount: item.alpacaAccount ?
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
},
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1219
|
+
alpacaAccount: item.alpacaAccount ?
|
1220
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
1221
|
+
? { connect: {
|
1222
|
+
id: item.alpacaAccount.id
|
1223
|
+
}
|
1224
|
+
}
|
1225
|
+
: { connectOrCreate: {
|
1226
|
+
where: {
|
1227
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1228
|
+
},
|
1229
|
+
create: {
|
1230
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1231
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1232
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1233
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1234
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1235
|
+
},
|
1236
|
+
}
|
1237
|
+
} : undefined,
|
1238
|
+
actions: item.actions ?
|
1239
|
+
typeof item.actions[0] === 'object' && Object.keys(item.actions).length === 1 && Object.keys(item.actions)[0] === 'id'
|
1240
|
+
? { connect: item.actions.map((item) => ({
|
1241
|
+
id: item.id
|
1242
|
+
}))
|
1243
|
+
}
|
1244
|
+
: { connectOrCreate: item.actions.map((item) => ({
|
1245
|
+
where: {
|
1246
|
+
id: item.id !== undefined ? item.id : undefined,
|
1247
|
+
},
|
1248
|
+
create: {
|
1249
|
+
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
1250
|
+
type: item.type !== undefined ? item.type : undefined,
|
1251
|
+
note: item.note !== undefined ? item.note : undefined,
|
1252
|
+
status: item.status !== undefined ? item.status : undefined,
|
1253
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
1254
|
+
},
|
1255
|
+
}))
|
1256
|
+
} : undefined,
|
1197
1257
|
},
|
1198
1258
|
}))
|
1199
1259
|
} : undefined,
|
@@ -1344,34 +1404,44 @@ exports.Asset = {
|
|
1344
1404
|
filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
|
1345
1405
|
filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
|
1346
1406
|
fee: item.fee !== undefined ? item.fee : undefined,
|
1347
|
-
alpacaAccount: item.alpacaAccount ?
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
},
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1407
|
+
alpacaAccount: item.alpacaAccount ?
|
1408
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
1409
|
+
? { connect: {
|
1410
|
+
id: item.alpacaAccount.id
|
1411
|
+
}
|
1412
|
+
}
|
1413
|
+
: { connectOrCreate: {
|
1414
|
+
where: {
|
1415
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1416
|
+
},
|
1417
|
+
create: {
|
1418
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1419
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1420
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1421
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1422
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1423
|
+
},
|
1424
|
+
}
|
1425
|
+
} : undefined,
|
1426
|
+
action: item.action ?
|
1427
|
+
typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
|
1428
|
+
? { connect: {
|
1429
|
+
id: item.action.id
|
1430
|
+
}
|
1431
|
+
}
|
1432
|
+
: { connectOrCreate: {
|
1433
|
+
where: {
|
1434
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
1435
|
+
},
|
1436
|
+
create: {
|
1437
|
+
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
1438
|
+
type: item.action.type !== undefined ? item.action.type : undefined,
|
1439
|
+
note: item.action.note !== undefined ? item.action.note : undefined,
|
1440
|
+
status: item.action.status !== undefined ? item.action.status : undefined,
|
1441
|
+
fee: item.action.fee !== undefined ? item.action.fee : undefined,
|
1442
|
+
},
|
1443
|
+
}
|
1444
|
+
} : undefined,
|
1375
1445
|
},
|
1376
1446
|
}))
|
1377
1447
|
} : undefined,
|
@@ -1474,20 +1544,25 @@ exports.Asset = {
|
|
1474
1544
|
lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
|
1475
1545
|
changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
|
1476
1546
|
assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
|
1477
|
-
alpacaAccount: item.alpacaAccount ?
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1547
|
+
alpacaAccount: item.alpacaAccount ?
|
1548
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
1549
|
+
? { connect: {
|
1550
|
+
id: item.alpacaAccount.id
|
1551
|
+
}
|
1552
|
+
}
|
1553
|
+
: { connectOrCreate: {
|
1554
|
+
where: {
|
1555
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1556
|
+
},
|
1557
|
+
create: {
|
1558
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
1559
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
1560
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
1561
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
1562
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
1563
|
+
},
|
1564
|
+
}
|
1565
|
+
} : undefined,
|
1491
1566
|
},
|
1492
1567
|
}))
|
1493
1568
|
} : undefined,
|
@@ -1593,32 +1668,37 @@ exports.Asset = {
|
|
1593
1668
|
relevancyScore: item.relevancyScore !== undefined ? item.relevancyScore : undefined,
|
1594
1669
|
sentimentScore: item.sentimentScore !== undefined ? item.sentimentScore : undefined,
|
1595
1670
|
sentimentLabel: item.sentimentLabel !== undefined ? item.sentimentLabel : undefined,
|
1596
|
-
news: item.news ?
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1671
|
+
news: item.news ?
|
1672
|
+
typeof item.news === 'object' && Object.keys(item.news).length === 1 && Object.keys(item.news)[0] === 'id'
|
1673
|
+
? { connect: {
|
1674
|
+
id: item.news.id
|
1675
|
+
}
|
1676
|
+
}
|
1677
|
+
: { connectOrCreate: {
|
1678
|
+
where: {
|
1679
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
1680
|
+
url: item.news.url !== undefined ? item.news.url : undefined,
|
1681
|
+
title: item.news.title !== undefined ? {
|
1682
|
+
equals: item.news.title
|
1683
|
+
} : undefined,
|
1684
|
+
},
|
1685
|
+
create: {
|
1686
|
+
title: item.news.title !== undefined ? item.news.title : undefined,
|
1687
|
+
content: item.news.content !== undefined ? item.news.content : undefined,
|
1688
|
+
source: item.news.source !== undefined ? item.news.source : undefined,
|
1689
|
+
sourceDomain: item.news.sourceDomain !== undefined ? item.news.sourceDomain : undefined,
|
1690
|
+
url: item.news.url !== undefined ? item.news.url : undefined,
|
1691
|
+
sentiment: item.news.sentiment !== undefined ? item.news.sentiment : undefined,
|
1692
|
+
authors: item.news.authors !== undefined ? item.news.authors : undefined,
|
1693
|
+
summary: item.news.summary !== undefined ? item.news.summary : undefined,
|
1694
|
+
bannerImage: item.news.bannerImage !== undefined ? item.news.bannerImage : undefined,
|
1695
|
+
timePublished: item.news.timePublished !== undefined ? item.news.timePublished : undefined,
|
1696
|
+
category: item.news.category !== undefined ? item.news.category : undefined,
|
1697
|
+
topics: item.news.topics !== undefined ? item.news.topics : undefined,
|
1698
|
+
logo: item.news.logo !== undefined ? item.news.logo : undefined,
|
1699
|
+
},
|
1700
|
+
}
|
1701
|
+
} : undefined,
|
1622
1702
|
},
|
1623
1703
|
}))
|
1624
1704
|
} : undefined,
|
@@ -1956,34 +2036,44 @@ exports.Asset = {
|
|
1956
2036
|
timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
|
1957
2037
|
status: item.status !== undefined ? item.status : undefined,
|
1958
2038
|
optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
|
1959
|
-
alpacaAccount: item.alpacaAccount ?
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
|
1970
|
-
|
1971
|
-
|
1972
|
-
|
1973
|
-
|
1974
|
-
|
1975
|
-
|
1976
|
-
|
1977
|
-
},
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
2039
|
+
alpacaAccount: item.alpacaAccount ?
|
2040
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
2041
|
+
? { connect: {
|
2042
|
+
id: item.alpacaAccount.id
|
2043
|
+
}
|
2044
|
+
}
|
2045
|
+
: { connectOrCreate: {
|
2046
|
+
where: {
|
2047
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2048
|
+
},
|
2049
|
+
create: {
|
2050
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2051
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2052
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2053
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2054
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2055
|
+
},
|
2056
|
+
}
|
2057
|
+
} : undefined,
|
2058
|
+
actions: item.actions ?
|
2059
|
+
typeof item.actions[0] === 'object' && Object.keys(item.actions).length === 1 && Object.keys(item.actions)[0] === 'id'
|
2060
|
+
? { connect: item.actions.map((item) => ({
|
2061
|
+
id: item.id
|
2062
|
+
}))
|
2063
|
+
}
|
2064
|
+
: { connectOrCreate: item.actions.map((item) => ({
|
2065
|
+
where: {
|
2066
|
+
id: item.id !== undefined ? item.id : undefined,
|
2067
|
+
},
|
2068
|
+
create: {
|
2069
|
+
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
2070
|
+
type: item.type !== undefined ? item.type : undefined,
|
2071
|
+
note: item.note !== undefined ? item.note : undefined,
|
2072
|
+
status: item.status !== undefined ? item.status : undefined,
|
2073
|
+
fee: item.fee !== undefined ? item.fee : undefined,
|
2074
|
+
},
|
2075
|
+
}))
|
2076
|
+
} : undefined,
|
1987
2077
|
},
|
1988
2078
|
}))
|
1989
2079
|
} : undefined,
|
@@ -2134,34 +2224,44 @@ exports.Asset = {
|
|
2134
2224
|
filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
|
2135
2225
|
filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
|
2136
2226
|
fee: item.fee !== undefined ? item.fee : undefined,
|
2137
|
-
alpacaAccount: item.alpacaAccount ?
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
2141
|
-
|
2142
|
-
|
2143
|
-
|
2144
|
-
|
2145
|
-
|
2146
|
-
|
2147
|
-
|
2148
|
-
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
2153
|
-
|
2154
|
-
|
2155
|
-
},
|
2156
|
-
|
2157
|
-
|
2158
|
-
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
2162
|
-
|
2163
|
-
|
2164
|
-
|
2227
|
+
alpacaAccount: item.alpacaAccount ?
|
2228
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
2229
|
+
? { connect: {
|
2230
|
+
id: item.alpacaAccount.id
|
2231
|
+
}
|
2232
|
+
}
|
2233
|
+
: { connectOrCreate: {
|
2234
|
+
where: {
|
2235
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2236
|
+
},
|
2237
|
+
create: {
|
2238
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2239
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2240
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2241
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2242
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2243
|
+
},
|
2244
|
+
}
|
2245
|
+
} : undefined,
|
2246
|
+
action: item.action ?
|
2247
|
+
typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
|
2248
|
+
? { connect: {
|
2249
|
+
id: item.action.id
|
2250
|
+
}
|
2251
|
+
}
|
2252
|
+
: { connectOrCreate: {
|
2253
|
+
where: {
|
2254
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
2255
|
+
},
|
2256
|
+
create: {
|
2257
|
+
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
2258
|
+
type: item.action.type !== undefined ? item.action.type : undefined,
|
2259
|
+
note: item.action.note !== undefined ? item.action.note : undefined,
|
2260
|
+
status: item.action.status !== undefined ? item.action.status : undefined,
|
2261
|
+
fee: item.action.fee !== undefined ? item.action.fee : undefined,
|
2262
|
+
},
|
2263
|
+
}
|
2264
|
+
} : undefined,
|
2165
2265
|
},
|
2166
2266
|
}))
|
2167
2267
|
} : undefined,
|
@@ -2264,20 +2364,25 @@ exports.Asset = {
|
|
2264
2364
|
lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
|
2265
2365
|
changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
|
2266
2366
|
assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
|
2267
|
-
alpacaAccount: item.alpacaAccount ?
|
2268
|
-
|
2269
|
-
|
2270
|
-
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2367
|
+
alpacaAccount: item.alpacaAccount ?
|
2368
|
+
typeof item.alpacaAccount === 'object' && Object.keys(item.alpacaAccount).length === 1 && Object.keys(item.alpacaAccount)[0] === 'id'
|
2369
|
+
? { connect: {
|
2370
|
+
id: item.alpacaAccount.id
|
2371
|
+
}
|
2372
|
+
}
|
2373
|
+
: { connectOrCreate: {
|
2374
|
+
where: {
|
2375
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2376
|
+
},
|
2377
|
+
create: {
|
2378
|
+
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
2379
|
+
APIKey: item.alpacaAccount.APIKey !== undefined ? item.alpacaAccount.APIKey : undefined,
|
2380
|
+
APISecret: item.alpacaAccount.APISecret !== undefined ? item.alpacaAccount.APISecret : undefined,
|
2381
|
+
configuration: item.alpacaAccount.configuration !== undefined ? item.alpacaAccount.configuration : undefined,
|
2382
|
+
marketOpen: item.alpacaAccount.marketOpen !== undefined ? item.alpacaAccount.marketOpen : undefined,
|
2383
|
+
},
|
2384
|
+
}
|
2385
|
+
} : undefined,
|
2281
2386
|
},
|
2282
2387
|
}))
|
2283
2388
|
} : undefined,
|
@@ -2383,32 +2488,37 @@ exports.Asset = {
|
|
2383
2488
|
relevancyScore: item.relevancyScore !== undefined ? item.relevancyScore : undefined,
|
2384
2489
|
sentimentScore: item.sentimentScore !== undefined ? item.sentimentScore : undefined,
|
2385
2490
|
sentimentLabel: item.sentimentLabel !== undefined ? item.sentimentLabel : undefined,
|
2386
|
-
news: item.news ?
|
2387
|
-
|
2388
|
-
|
2389
|
-
|
2390
|
-
|
2391
|
-
|
2392
|
-
|
2393
|
-
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2397
|
-
|
2398
|
-
|
2399
|
-
|
2400
|
-
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
2406
|
-
|
2407
|
-
|
2408
|
-
|
2409
|
-
|
2410
|
-
|
2411
|
-
|
2491
|
+
news: item.news ?
|
2492
|
+
typeof item.news === 'object' && Object.keys(item.news).length === 1 && Object.keys(item.news)[0] === 'id'
|
2493
|
+
? { connect: {
|
2494
|
+
id: item.news.id
|
2495
|
+
}
|
2496
|
+
}
|
2497
|
+
: { connectOrCreate: {
|
2498
|
+
where: {
|
2499
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
2500
|
+
url: item.news.url !== undefined ? item.news.url : undefined,
|
2501
|
+
title: item.news.title !== undefined ? {
|
2502
|
+
equals: item.news.title
|
2503
|
+
} : undefined,
|
2504
|
+
},
|
2505
|
+
create: {
|
2506
|
+
title: item.news.title !== undefined ? item.news.title : undefined,
|
2507
|
+
content: item.news.content !== undefined ? item.news.content : undefined,
|
2508
|
+
source: item.news.source !== undefined ? item.news.source : undefined,
|
2509
|
+
sourceDomain: item.news.sourceDomain !== undefined ? item.news.sourceDomain : undefined,
|
2510
|
+
url: item.news.url !== undefined ? item.news.url : undefined,
|
2511
|
+
sentiment: item.news.sentiment !== undefined ? item.news.sentiment : undefined,
|
2512
|
+
authors: item.news.authors !== undefined ? item.news.authors : undefined,
|
2513
|
+
summary: item.news.summary !== undefined ? item.news.summary : undefined,
|
2514
|
+
bannerImage: item.news.bannerImage !== undefined ? item.news.bannerImage : undefined,
|
2515
|
+
timePublished: item.news.timePublished !== undefined ? item.news.timePublished : undefined,
|
2516
|
+
category: item.news.category !== undefined ? item.news.category : undefined,
|
2517
|
+
topics: item.news.topics !== undefined ? item.news.topics : undefined,
|
2518
|
+
logo: item.news.logo !== undefined ? item.news.logo : undefined,
|
2519
|
+
},
|
2520
|
+
}
|
2521
|
+
} : undefined,
|
2412
2522
|
},
|
2413
2523
|
}))
|
2414
2524
|
} : undefined,
|