|
|
@ -4,20 +4,25 @@ import NODE_AND_DR_RESERVED_MEMORY_SIZE from '../../consts/NODE_AND_DR_RESERVED_ |
|
|
|
import SERVER_PATHS from '../../consts/SERVER_PATHS'; |
|
|
|
import SERVER_PATHS from '../../consts/SERVER_PATHS'; |
|
|
|
|
|
|
|
|
|
|
|
import join from '../../join'; |
|
|
|
import join from '../../join'; |
|
|
|
|
|
|
|
import { sanitizeSQLParam } from '../../sanitizeSQLParam'; |
|
|
|
|
|
|
|
|
|
|
|
const buildQueryAnvilDetail = ({ |
|
|
|
const buildQueryAnvilDetail = ({ |
|
|
|
anvilUUIDs, |
|
|
|
anvilUUIDs = ['*'], |
|
|
|
isForProvisionServer, |
|
|
|
isForProvisionServer, |
|
|
|
}: { |
|
|
|
}: { |
|
|
|
anvilUUIDs?: string[] | '*'; |
|
|
|
anvilUUIDs?: string[] | '*'; |
|
|
|
isForProvisionServer?: boolean; |
|
|
|
isForProvisionServer?: boolean; |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const condAnvilsUUID = join(anvilUUIDs, { |
|
|
|
const condAnvilsUUID = ['all', '*'].includes(anvilUUIDs[0]) |
|
|
|
beforeReturn: (toReturn) => |
|
|
|
? '' |
|
|
|
toReturn ? `WHERE anv.anvil_uuid IN (${toReturn})` : '', |
|
|
|
: join(anvilUUIDs, { |
|
|
|
elementWrapper: "'", |
|
|
|
beforeReturn: (toReturn) => |
|
|
|
separator: ', ', |
|
|
|
toReturn |
|
|
|
}); |
|
|
|
? `WHERE anv.anvil_uuid IN (${sanitizeSQLParam(toReturn)})` |
|
|
|
|
|
|
|
: '', |
|
|
|
|
|
|
|
elementWrapper: "'", |
|
|
|
|
|
|
|
separator: ', ', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
console.log(`condAnvilsUUID=[${condAnvilsUUID}]`); |
|
|
|
console.log(`condAnvilsUUID=[${condAnvilsUUID}]`); |
|
|
|
|
|
|
|
|
|
|
|