- Installed @cantoo/pdf-lib for server-side PDF mutation - Created src/lib/pdf/prepare-document.ts with preparePdf function using atomic tmp->rename write pattern - form.flatten() called before drawing signature rectangles - Created GET/PUT /api/documents/[id]/fields routes for signature field storage - Created POST /api/documents/[id]/prepare route that calls preparePdf and transitions status to Sent - Fixed pre-existing null check error in scripts/debug-inspect2.ts (Rule 3: blocking build) - Build compiles successfully with 2 new API routes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import { chromium } from 'playwright';
|
|
import { config } from 'dotenv';
|
|
import path from 'path';
|
|
config({ path: path.resolve(process.cwd(), '.env.local') });
|
|
|
|
(async () => {
|
|
const browser = await chromium.launch({ headless: true });
|
|
const page = await browser.newPage();
|
|
|
|
// Try the direct forms app URL first
|
|
await page.goto('https://forms.skyslope.com', { waitUntil: 'domcontentloaded', timeout: 30_000 });
|
|
await page.waitForTimeout(3000);
|
|
|
|
console.log('URL after goto forms.skyslope.com:', page.url());
|
|
await page.screenshot({ path: 'scripts/debug-forms-home.png' });
|
|
|
|
// Look for any login/sign-in link
|
|
const loginLinks = await page.locator('a, button').all();
|
|
for (const el of loginLinks) {
|
|
const text = await el.textContent().catch(() => '');
|
|
const href = await el.getAttribute('href').catch(() => '');
|
|
if (/login|sign.?in|log.?in|get started|access/i.test((text ?? '') + (href ?? ''))) {
|
|
console.log('Found login element:', text?.trim().slice(0,60), href?.slice(0,80));
|
|
}
|
|
}
|
|
|
|
await browser.close();
|
|
})();
|