CRITICAL FIX: - Added 'config' and 'type' fields to generation_jobs collection - Fixed JumpstartWizard to use 'url' field instead of non-existent 'domain' field - Tested via API: Job creation now works successfully Schema Changes (via Directus API): - generation_jobs.config (json) - stores WordPress URL, auth, mode - generation_jobs.type (string) - stores job type (Refactor, Import, etc.) Frontend Changes: - JumpstartWizard now looks up sites by 'url' field - Properly handles URL normalization (adds https:// if missing) Test Results: - ✅ API test: Job created successfully (ID: 7b97c4ae-bcb6-4c41-8883-83a0e742ccbd) - ✅ Site lookup works - ✅ Config field populated correctly Ready for frontend testing after deployment.
28 lines
887 B
TypeScript
28 lines
887 B
TypeScript
import { createDirectus, rest, authentication, readFieldsByCollection } from '@directus/sdk';
|
|
|
|
const DIRECTUS_URL = 'https://spark.jumpstartscaling.com';
|
|
const EMAIL = 'insanecorp@gmail.com';
|
|
const PASSWORD = 'Idk@ai2026yayhappy';
|
|
|
|
const client = createDirectus(DIRECTUS_URL).with(authentication()).with(rest());
|
|
|
|
async function checkSchema() {
|
|
try {
|
|
await client.login(EMAIL, PASSWORD);
|
|
console.log('✅ Authenticated\n');
|
|
|
|
// @ts-ignore
|
|
const fields = await client.request(readFieldsByCollection('generation_jobs'));
|
|
|
|
console.log('📋 generation_jobs fields:\n');
|
|
fields.forEach((field: any) => {
|
|
console.log(` ${field.field}: ${field.type} ${field.schema?.is_nullable ? '(nullable)' : '(required)'}`);
|
|
});
|
|
|
|
} catch (error: any) {
|
|
console.error('❌ Error:', error.message);
|
|
}
|
|
}
|
|
|
|
checkSchema();
|