import {readFileSync} from 'node:fs'; export function buildAppointmentDeletionGateway(company,windows=[]){ const code=readFileSync(new URL('../cloud/legacy-appointment-deletions.js',import.meta.url),'utf8').replaceAll('__COMPANY_ID__',JSON.stringify(company)).replaceAll('__WINDOWS__',JSON.stringify(windows)); new Function(code);return code; } export function patchAppointmentDeletionCapability(code){ if(code.includes("appointmentDeletionVersion:'confirmed-ids-v1'"))return code; const handler=code.indexOf('async function handler(request,response)'),at=code.indexOf(" if(p.action===",handler); if(handler<0||at