-
-
Save lobot/355d8427de567d9b2c5b083bcf9f6073 to your computer and use it in GitHub Desktop.
Rich_old_code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To do its job, the PDFer only needs - | |
* 1. resource_id/order_id | |
* 2. picasso.use_preflight feature flag | |
* However, UpdateOrder and Thumbnailer need more and therefore it gets passed | |
* more than what it needs. We'll have to refactor the flow to get past this | |
* undesirable situation. To minimize the spillover of larger than needed objects | |
* within this code, we use this method to return only whats needed. | |
* This should also help in refactoring later. | |
*/ | |
function getWhatsRequired(msg) { | |
const id = msg.resource.id; | |
const required = { | |
id, | |
resource_type: msg.resource_type, | |
receiptHandle: msg.receiptHandle, | |
rawUri: '/' + id.substring(id.indexOf('_') + 1) + '/' + id + '_raw.pdf', | |
rawX1a: '/' + id.substring(id.indexOf('_') + 1) + '/' + id + '_raw.pdfx', | |
rawNonX1a: | |
'/' + id.substring(id.indexOf('_') + 1) + '/' + id + '_raw_non_x1a.pdf', | |
proofUri: '/' + id.substring(id.indexOf('_') + 1) + '/' + id + '.pdf', | |
proofX1a: '/' + id.substring(id.indexOf('_') + 1) + '/' + id + '.pdfx', | |
proofNonX1a: | |
'/' + id.substring(id.indexOf('_') + 1) + '/' + id + '_non_x1a.pdf', | |
usePreflight: | |
msg.launch_darkly_flags['picasso.use_preflight'] === 1 ? true : false, | |
strictPreflight: | |
msg.launch_darkly_flags['picasso.strict_preflight'] === 1 ? true : false, | |
}; | |
return required; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment