diff --git a/.gitignore b/.gitignore index b55d0d3..e32cdbd 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,4 @@ dist_*/ # custom test/output .serena -assets/schematron +assets_downloaded/ diff --git a/ts/formats/validation/schematron.downloader.ts b/ts/formats/validation/schematron.downloader.ts index 4f75b07..f020dd6 100644 --- a/ts/formats/validation/schematron.downloader.ts +++ b/ts/formats/validation/schematron.downloader.ts @@ -81,7 +81,7 @@ export class SchematronDownloader { private cacheDir: string; private smartfile: any; - constructor(cacheDir: string = 'assets/schematron') { + constructor(cacheDir: string = 'assets_downloaded/schematron') { this.cacheDir = cacheDir; } @@ -278,7 +278,7 @@ export const ISO_SCHEMATRON_SKELETONS = { /** * Download ISO Schematron skeleton files */ -export async function downloadISOSkeletons(targetDir: string = 'assets/schematron/iso'): Promise { +export async function downloadISOSkeletons(targetDir: string = 'assets_downloaded/schematron/iso'): Promise { await fs.mkdir(targetDir, { recursive: true }); console.log('Downloading ISO Schematron skeleton files...'); diff --git a/ts/formats/validation/schematron.integration.ts b/ts/formats/validation/schematron.integration.ts index 358702e..6512f80 100644 --- a/ts/formats/validation/schematron.integration.ts +++ b/ts/formats/validation/schematron.integration.ts @@ -75,7 +75,7 @@ export class IntegratedValidator { standard: 'EN16931' | 'PEPPOL' | 'XRECHNUNG', format: 'UBL' | 'CII' ): Promise { - const basePath = 'assets/schematron'; + const basePath = 'assets_downloaded/schematron'; // Map standard and format to file pattern const patterns: Record> = { diff --git a/ts/formats/validation/schematron.validator.ts b/ts/formats/validation/schematron.validator.ts index 96fdf66..9ac67de 100644 --- a/ts/formats/validation/schematron.validator.ts +++ b/ts/formats/validation/schematron.validator.ts @@ -272,19 +272,19 @@ export async function createStandardValidator( switch (standard) { case 'EN16931': // Would load from ConnectingEurope/eInvoicing-EN16931 - await validator.loadSchematron('assets/schematron/en16931/EN16931-UBL-validation.sch'); + await validator.loadSchematron('assets_downloaded/schematron/en16931/EN16931-UBL-validation.sch'); break; case 'XRECHNUNG': // Would load from itplr-kosit/xrechnung-schematron - await validator.loadSchematron('assets/schematron/xrechnung/XRechnung-UBL-validation.sch'); + await validator.loadSchematron('assets_downloaded/schematron/xrechnung/XRechnung-UBL-validation.sch'); break; case 'PEPPOL': // Would load from OpenPEPPOL/peppol-bis-invoice-3 - await validator.loadSchematron('assets/schematron/peppol/PEPPOL-EN16931-UBL.sch'); + await validator.loadSchematron('assets_downloaded/schematron/peppol/PEPPOL-EN16931-UBL.sch'); break; case 'FACTURX': // Would load from Factur-X specific Schematron - await validator.loadSchematron('assets/schematron/facturx/Factur-X-EN16931-validation.sch'); + await validator.loadSchematron('assets_downloaded/schematron/facturx/Factur-X-EN16931-validation.sch'); break; } diff --git a/ts_install/download-schematron.ts b/ts_install/download-schematron.ts index 3f21354..80b9aeb 100644 --- a/ts_install/download-schematron.ts +++ b/ts_install/download-schematron.ts @@ -9,7 +9,7 @@ import { SchematronDownloader } from '../dist_ts/formats/validation/schematron.d async function main() { console.log('📥 Starting Schematron download...\n'); - const downloader = new SchematronDownloader('assets/schematron'); + const downloader = new SchematronDownloader('assets_downloaded/schematron'); await downloader.initialize(); // Download EN16931 Schematron files diff --git a/ts_install/index.ts b/ts_install/index.ts index 79ef3e7..9822a9a 100644 --- a/ts_install/index.ts +++ b/ts_install/index.ts @@ -49,7 +49,7 @@ function getFileChecksum(filePath: string): string | null { * Check if resources are already downloaded and valid */ function checkExistingResources(): boolean { - const versionFile = path.join('assets', 'schematron', '.version'); + const versionFile = path.join('assets_downloaded', 'schematron', '.version'); try { if (!fs.existsSync(versionFile)) return false; @@ -62,9 +62,9 @@ function checkExistingResources(): boolean { // Check if key files exist const keyFiles = [ - 'assets/schematron/EN16931-UBL-v1.3.14.sch', - 'assets/schematron/EN16931-CII-v1.3.14.sch', - 'assets/schematron/PEPPOL-EN16931-UBL-v3.0.17.sch' + 'assets_downloaded/schematron/EN16931-UBL-v1.3.14.sch', + 'assets_downloaded/schematron/EN16931-CII-v1.3.14.sch', + 'assets_downloaded/schematron/PEPPOL-EN16931-UBL-v3.0.17.sch' ]; for (const file of keyFiles) { @@ -84,7 +84,7 @@ function checkExistingResources(): boolean { * Save version file after successful download */ function saveVersionFile(): void { - const versionFile = path.join('assets', 'schematron', '.version'); + const versionFile = path.join('assets_downloaded', 'schematron', '.version'); try { fs.mkdirSync(path.dirname(versionFile), { recursive: true }); fs.writeFileSync(versionFile, RESOURCES_VERSION); @@ -96,7 +96,7 @@ function saveVersionFile(): void { async function downloadSchematron() { console.log('📥 Downloading Schematron validation files...\n'); - const downloader = new SchematronDownloader('assets/schematron'); + const downloader = new SchematronDownloader('assets_downloaded/schematron'); await downloader.initialize(); let successCount = 0;