{"_id":"@aifind/mustangjs","_rev":"3-077470941449426ff2805d7ebd836658","name":"@aifind/mustangjs","dist-tags":{"latest":"0.4.0"},"versions":{"0.2.0":{"name":"@aifind/mustangjs","version":"0.2.0","keywords":["zugferd","factur-x","xrechnung","en16931","e-invoice","einvoicing","cii","ubl","mustangproject"],"author":{"name":"Panagiotis Kapros","email":"kapros@gmail.com"},"license":"Apache-2.0","_id":"@aifind/mustangjs@0.2.0","maintainers":[{"name":"kapros","email":"kapros@gmail.com"}],"homepage":"https://github.com/loremaps/mustangjs#readme","bugs":{"url":"https://github.com/loremaps/mustangjs/issues"},"dist":{"shasum":"466d8aa0d0da06c3384e7754dcba408f3f320251","tarball":"https://registry.npmjs.org/@aifind/mustangjs/-/mustangjs-0.2.0.tgz","fileCount":76,"integrity":"sha512-Zl7Pl4P3tNfiJ2/OD0EHxj34SRvEzmI24EgXjlXNv/Jw1tyi/mkBYt0cY/lhlGegxOqTjOvZbu0yNvfha4YbYQ==","signatures":[{"sig":"MEQCIE9ToajLmEok76T1GYbHKdYw8Z1VD35LiiwDheEzDLH8AiB8PBcFmOu6IkX/t5ZM8e1rlB1/xBAhsynNrBzNGhR0Pw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14172126},"main":"dist/src/index.js","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"493a6d0d178bc79e0fe1683de9053d42e0811d1e","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepare":"npm run build","test:watch":"vitest","prepublishOnly":"npm test"},"_npmUser":{"name":"kapros","email":"kapros@gmail.com"},"repository":{"url":"git+https://github.com/loremaps/mustangjs.git","type":"git"},"_npmVersion":"11.16.0","description":"TypeScript port of mustangproject - ZUGFeRD, Factur-X, XRechnung e-invoicing library","directories":{},"_nodeVersion":"24.15.0","dependencies":{"xpath":"^0.0.34","big.js":"^6.2.2","saxon-js":"^2.7.0","@xmldom/xmldom":"^0.9.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","typescript":"^5.4.0","@types/node":"^25.5.0","@types/big.js":"^6.2.2"},"_npmOperationalInternal":{"tmp":"tmp/mustangjs_0.2.0_1780912789500_0.07494315673190988","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@aifind/mustangjs","version":"0.3.0","keywords":["zugferd","factur-x","xrechnung","en16931","e-invoice","einvoicing","cii","ubl","mustangproject"],"author":{"name":"Panagiotis Kapros","email":"kapros@gmail.com"},"license":"Apache-2.0","_id":"@aifind/mustangjs@0.3.0","maintainers":[{"name":"kapros","email":"kapros@gmail.com"}],"homepage":"https://github.com/loremaps/mustangjs#readme","bugs":{"url":"https://github.com/loremaps/mustangjs/issues"},"dist":{"shasum":"1e6c65086d8eba410a5a86d6cad32c9f4e2b2a05","tarball":"https://registry.npmjs.org/@aifind/mustangjs/-/mustangjs-0.3.0.tgz","fileCount":80,"integrity":"sha512-APANZvqDHhls7seNe+4LVE4rq7is/JKu2f0UoedXbtaT7ix6ett4OdPO+Jvp33AK9OHMDyajNnteqqDVY8f5Sw==","signatures":[{"sig":"MEUCIBQoC3lQn40CnYbOmQlshoRi+Fh37NhQ4QK/Ld3+QsDcAiEA6UWrH1qZaacSQ+taUabLhpkBNWds5i6489ebOXCEsVw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14185087},"main":"dist/src/index.js","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"37190085f9b7d9693c69871f2287ac3ae291afd8","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepare":"npm run build","test:watch":"vitest","prepublishOnly":"npm test"},"_npmUser":{"name":"kapros","email":"kapros@gmail.com"},"repository":{"url":"git+https://github.com/loremaps/mustangjs.git","type":"git"},"_npmVersion":"11.16.0","description":"TypeScript port of mustangproject - ZUGFeRD, Factur-X, XRechnung e-invoicing library","directories":{},"_nodeVersion":"24.15.0","dependencies":{"xpath":"^0.0.34","big.js":"^6.2.2","saxon-js":"^2.7.0","@xmldom/xmldom":"^0.9.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.9","typescript":"^5.4.0","@types/node":"^25.5.0","@types/big.js":"^6.2.2"},"_npmOperationalInternal":{"tmp":"tmp/mustangjs_0.3.0_1782393177306_0.13454293165494446","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@aifind/mustangjs","version":"0.4.0","description":"TypeScript port of mustangproject - ZUGFeRD, Factur-X, XRechnung e-invoicing library","type":"module","main":"dist/src/index.js","types":"dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"keywords":["zugferd","factur-x","xrechnung","en16931","e-invoice","einvoicing","cii","ubl","mustangproject"],"repository":{"type":"git","url":"git+https://github.com/loremaps/mustangjs.git"},"homepage":"https://github.com/loremaps/mustangjs#readme","bugs":{"url":"https://github.com/loremaps/mustangjs/issues"},"author":{"name":"Panagiotis Kapros","email":"kapros@gmail.com"},"scripts":{"build":"tsc -p tsconfig.build.json","test":"vitest run","test:watch":"vitest","prepare":"npm run build","prepublishOnly":"npm test"},"dependencies":{"@xmldom/xmldom":"^0.9.10","big.js":"^6.2.2","saxon-js":"^2.7.0","xpath":"^0.0.34"},"devDependencies":{"@types/big.js":"^6.2.2","@types/node":"^25.5.0","typescript":"^5.4.0","vitest":"^2.1.9"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"license":"Apache-2.0","gitHead":"3d633de373cb85da9872a811eb711bd9d88ae8b5","_id":"@aifind/mustangjs@0.4.0","_nodeVersion":"24.15.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-L0/6hQ8nY5nOg1V36VxowegTVebATykErkKP1JG8B7mFCaR5dE54RolzCSnk7wUy18yIEbNYij8CXgANNvCfzg==","shasum":"fc6b3b78e0b7866b7fb14b72f8d3f3c887d0101d","tarball":"https://registry.npmjs.org/@aifind/mustangjs/-/mustangjs-0.4.0.tgz","fileCount":86,"unpackedSize":14204620,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDapM32Y0+aM/MwzzMvfaep7kUSnLE6JKvLt1rQc25XDAiEAnv3s3UDHQrIkSrYgGM75dh71i0JjEqhBEDKOpoGHqQI="}]},"_npmUser":{"name":"kapros","email":"kapros@gmail.com"},"directories":{},"maintainers":[{"name":"kapros","email":"kapros@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mustangjs_0.4.0_1783409740085_0.635481628803269"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-08T09:59:49.314Z","modified":"2026-07-07T07:35:40.355Z","0.2.0":"2026-06-08T09:59:49.669Z","0.3.0":"2026-06-25T13:12:57.491Z","0.4.0":"2026-07-07T07:35:40.232Z"},"bugs":{"url":"https://github.com/loremaps/mustangjs/issues"},"author":{"name":"Panagiotis Kapros","email":"kapros@gmail.com"},"license":"Apache-2.0","homepage":"https://github.com/loremaps/mustangjs#readme","keywords":["zugferd","factur-x","xrechnung","en16931","e-invoice","einvoicing","cii","ubl","mustangproject"],"repository":{"type":"git","url":"git+https://github.com/loremaps/mustangjs.git"},"description":"TypeScript port of mustangproject - ZUGFeRD, Factur-X, XRechnung e-invoicing library","maintainers":[{"name":"kapros","email":"kapros@gmail.com"}],"readme":"# mustangjs\n\nTypeScript port of [mustangproject](https://www.mustangproject.org/) — a library for creating, parsing, and validating EN16931 e-invoices (ZUGFeRD, Factur-X, XRechnung).\n\n## Install\n\n```bash\nnpm install @aifind/mustangjs\n```\n\n## Usage\n\n```typescript\nimport { Invoice, Item, Product, TradeParty, Big } from '@aifind/mustangjs';\nimport { ZUGFeRD2PullProvider, Profiles } from '@aifind/mustangjs';\n\nconst invoice = new Invoice()\n  .setNumber('INV-001')\n  .setIssueDate(new Date())\n  .setSender(new TradeParty('Seller GmbH', 'Str. 1', '10115', 'Berlin', 'DE').addVATID('DE123'))\n  .setRecipient(new TradeParty('Buyer AG', 'Str. 2', '80331', 'Munich', 'DE'))\n  .addItem(new Item(new Product('Service', '', 'C62', new Big(19)), new Big(100), new Big(1)));\n\nconst provider = new ZUGFeRD2PullProvider();\nprovider.setProfile(Profiles.getByName('EN16931'));\nprovider.generateXML(invoice);\nconst xml = provider.getXML(); // CII XML string\n```\n\n### Parse\n\n```typescript\nimport { ZUGFeRDInvoiceImporter, CalculatedInvoice } from '@aifind/mustangjs';\n\nconst importer = new ZUGFeRDInvoiceImporter(xmlString);\nconst ci = new CalculatedInvoice();\nimporter.extractInto(ci);\nconsole.log(ci.getGrandTotal().toString());\n```\n\n### Validate\n\nValidate invoice XML against official EN16931 and XRechnung Schematron rules using `XMLValidator`.\n\n```typescript\nimport { XMLValidator } from '@aifind/mustangjs';\n\nconst validator = new XMLValidator();\nconst result = await validator.validate(xmlString);\n\nresult.isValid();          // true if no errors\nresult.getErrors();        // ValidationResultItem[]\nresult.getWarnings();      // warnings (non-blocking)\nresult.hasRule('BR-02');   // check specific rule\n```\n\nFormat (CII/UBL) and profile are auto-detected from the XML. You can override:\n\n```typescript\nimport { XMLValidator, Profiles } from '@aifind/mustangjs';\n\nconst result = await validator.validate(xmlString, {\n  profile: Profiles.getByName('XRECHNUNG'),  // override auto-detected profile\n  skipProgrammatic: true,                     // Schematron only (recommended)\n});\n```\n\nThere is also a lower-level `InvoiceValidator` for programmatic rule checks on `Invoice` objects (without XML/Schematron):\n\n```typescript\nimport { InvoiceValidator, Profiles } from '@aifind/mustangjs';\n\nconst validator = new InvoiceValidator(Profiles.getByName('EN16931'));\nconst result = validator.validate(invoice);\n```\n\n### Schematron rules\n\nValidation is powered by pre-compiled Schematron XSLT stylesheets (via [saxon-js](https://www.saxonica.com/saxon-js/)):\n\n| Ruleset | Format | Covers |\n|---------|--------|--------|\n| EN16931-CII | CII | Core EN16931 business rules for ZUGFeRD/Factur-X |\n| EN16931-UBL | UBL | Core EN16931 business rules (incl. PEPPOL BIS) |\n| XRechnung-CII | CII | German XRechnung-specific rules (v3.0) |\n| XRechnung-UBL | UBL | German XRechnung-specific rules (v3.0) |\n\nThe SEF files live in `src/validation/schematron/`. See [SCHEMATRON.md](SCHEMATRON.md) for how to update them when new rule versions are released.\n\n## Supported formats\n\n- **CII** (Cross-Industry Invoice): ZUGFeRD 2.x, Factur-X\n- **UBL** (Universal Business Language): XRechnung\n\n## Profiles\n\n`MINIMUM`, `BASICWL`, `BASIC`, `EN16931`, `EXTENDED`, `XRECHNUNG`\n\n## Build & test\n\n```bash\nnpm run build\nnpm test\n```\n\n## License\n\nThis project is licensed under the [Apache License 2.0](LICENSE). Third-party runtime dependencies and bundled validation artifacts are under their own licenses. See [NOTICE](NOTICE).\n","readmeFilename":"README.md"}