Merge branch 'master' into upstream/develop
This commit is contained in:
commit
e6f03e8f79
4 files changed
+12
-14
No files matched your search
@@ -1,11 +1,11 @@
|
||||
export const Trading = 'Trading'
|
||||
export const Indicator = 'Indicator'
|
||||
export const Sensor = 'Extraction'
|
||||
export const Extraction = 'Extraction'
|
||||
|
||||
export const BotTypesEnum = [
|
||||
Trading,
|
||||
Indicator,
|
||||
Sensor
|
||||
Extraction
|
||||
]
|
||||
|
||||
export default BotTypesEnum
|
||||
@@ -4,7 +4,7 @@ import { KubernateError } from '../errors'
|
||||
import { Client, config } from 'kubernetes-client'
|
||||
import deploymentManifest from '../config/clone-deployment.json'
|
||||
import { BACKTEST, COMPETITION, LIVE, NO_TIME } from '../enums/CloneMode'
|
||||
import { Trading, Indicator, Sensor } from '../enums/BotTypes'
|
||||
import { Trading, Indicator, Extraction } from '../enums/BotTypes'
|
||||
|
||||
const createClone = async (clone) => {
|
||||
try {
|
||||
@@ -130,7 +130,7 @@ const createClone = async (clone) => {
|
||||
'value': clone.keyId
|
||||
})
|
||||
}
|
||||
} else if (clone.botType === Indicator || clone.botType === Sensor) {
|
||||
} else if (clone.botType === Indicator || clone.botType === Extraction) {
|
||||
if (clone.mode === NO_TIME) {
|
||||
if (!clone.resumeExecution) {
|
||||
env.push({
|
||||
|
||||
@@ -10,7 +10,6 @@ const cloneDetails = (selectedBot, clone) => {
|
||||
clone.teamSlug = selectedBot.team.slug
|
||||
clone.teamAvatar = selectedBot.team.profile.avatar
|
||||
clone.userLoggedIn = selectedBot.team.members[0].member.alias
|
||||
clone.botType = selectedBot.kind
|
||||
}
|
||||
return clone
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ import {
|
||||
import { OperationsError } from '../../errors'
|
||||
import { Clone } from '../../models'
|
||||
import logger from '../../config/logger'
|
||||
import teamQuery from '../../graphQLCalls/teamQuery'
|
||||
import cloneDetails from '../cloneDetails'
|
||||
import { isDefined } from '../../config/utils'
|
||||
|
||||
const args = {
|
||||
@@ -25,15 +23,20 @@ const args = {
|
||||
}
|
||||
|
||||
const resolve = async (parent,
|
||||
{ id, summaryDate, buyAverage, sellAverage, marketRate, combinedProfitsA,
|
||||
combinedProfitsB, assetA, assetB
|
||||
}, context) => {
|
||||
{ id, summaryDate, buyAverage, sellAverage, marketRate, combinedProfitsA,
|
||||
combinedProfitsB, assetA, assetB
|
||||
}, context) => {
|
||||
logger.debug('UpdateExecutionSummary -> Entering Function.')
|
||||
|
||||
if (!context.userId) {
|
||||
throw new AuthentificationError()
|
||||
}
|
||||
|
||||
if (!(context.userId === process.env.AACLOUD_ID)) {
|
||||
logger.debug('User %s is not authorized to manage team %s.', authId, team.slug)
|
||||
throw new AutorizationError()
|
||||
}
|
||||
|
||||
try {
|
||||
let clone = await Clone.findOne({
|
||||
_id: id,
|
||||
@@ -44,10 +47,6 @@ const resolve = async (parent,
|
||||
return 'Clone not found.'
|
||||
}
|
||||
|
||||
let allUserBotsResponse = await teamQuery(context.authorization, clone.botId)
|
||||
let bot = allUserBotsResponse.data.data.teams_FbByOwner.edges[0].node
|
||||
clone = cloneDetails(bot, clone)
|
||||
|
||||
const query = { _id: id }
|
||||
const options = { new: true }
|
||||
const update = {
|
||||
|
||||
Reference in new issue
Block a user