import { CreateJobFn , CreateJobFnFactory } from '../../../types' ; import { validateUrls } from '../../common' ; import { JobParamsPDF , TaskPayloadPDF } from '../types' ; export const createJobFnFactory = function createJobFactoryFn ( ) { return async function createJobFn ( { relativeUrls , ... jobParams } ) { validateUrls ( relativeUrls ) ; return { ... jobParams , forceNow : new Date ( ) . toISOString ( ) , objects : relativeUrls . map ( ( u ) => ( { relativeUrl : u } ) ) , } ; } ; } ;