Skip to content

Instantly share code, notes, and snippets.

@lobot

lobot/new_code Secret

Created August 1, 2022 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lobot/f8b5eb6d1f470eaa5571150e541ddfcf to your computer and use it in GitHub Desktop.
Save lobot/f8b5eb6d1f470eaa5571150e541ddfcf to your computer and use it in GitHub Desktop.
rich_new_code
/*
* Returns the expected file locations for each of the raws and proofs before and after preflighting.
*/
function getPathsAndInstructions(msg) {
const id = msg.resource.id;
const orderIdWithoutPrefix = id.substring(id.indexOf('_') + 1);
const baseURL = '/' + orderIdWithoutPrefix + '/' + id;
return {
id,
resource_type: msg.resource_type,
receiptHandle: msg.receiptHandle,
rawUri: baseURL + '_raw.pdf',
rawX1a: baseURL + '_raw.pdfx',
rawNonX1a: baseURL + '_raw_non_x1a.pdf',
proofUri: baseURL + '.pdf',
proofX1a: baseURL + '.pdfx',
proofNonX1a: baseURL + '_non_x1a.pdf',
usePreflight: msg.launch_darkly_flags['picasso.use_preflight'] === '1',
strictPreflight: msg.launch_darkly_flags['picasso.strict_preflight'] === '1'
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment