{"_id":"@ediflow/edifact","_rev":"3-f4d3d38438b8b3db1f1ecc64df0110d6","name":"@ediflow/edifact","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@ediflow/edifact","version":"0.2.0","keywords":["edi","edifact","un-edifact","parser","validator","typescript","edi-parser","edifact-parser","orders","invoic","desadv","logistics"],"author":{"name":"EdiFlow Contributors"},"license":"MIT","_id":"@ediflow/edifact@0.2.0","maintainers":[{"name":"ediflow","email":"hello.ediflow@gmail.com"}],"homepage":"https://github.com/ediflow-lib/core#readme","bugs":{"url":"https://github.com/ediflow-lib/core/issues"},"dist":{"shasum":"a7699db77efd9a7b95f4a7c06a400417fbdfffdc","tarball":"https://registry.npmjs.org/@ediflow/edifact/-/edifact-0.2.0.tgz","fileCount":8,"integrity":"sha512-utk+eHiQacdyvbOuya00G/vXhrjSmx6nN+FOqDXhvJtLJO8ktvlJN6y8V6z4LTeXgwVnruUqAX+OAv4LMESY/w==","signatures":[{"sig":"MEQCIFEphV7gemUgt3pRiPG4auYry7RLLuGFK5HF2rD/drfGAiALQ6EVbAwDa9YD4P1hZ4SFNvXRiBG288K8j/Utv8mwCg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":162068},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"f20a061f788bbba793c67be675c7019472ad906e","scripts":{"test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"ediflow","email":"hello.ediflow@gmail.com"},"repository":{"url":"git+https://github.com/ediflow-lib/core.git","type":"git","directory":"packages/edifact"},"_npmVersion":"10.9.3","description":"EDIFACT EDI Parser - Format-specific infrastructure for UN/EDIFACT standard","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@ediflow/core":"*","@ediflow/infrastructure-shared":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.7.3","@types/node":"^22.10.5","@vitest/coverage-v8":"^2.1.8"},"_npmOperationalInternal":{"tmp":"tmp/edifact_0.2.0_1770700231512_0.5531700061090372","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@ediflow/edifact","version":"0.2.1","keywords":["edi","edifact","un-edifact","parser","validator","builder","typescript","edi-parser","edifact-parser","edifact-builder","edifact-validator","orders","invoic","invoice","desadv","iftmin","iftsta","logistics","supply-chain","b2b","e-invoicing","modern-edifact","type-safe"],"author":{"name":"EdiFlow Contributors"},"license":"MIT","_id":"@ediflow/edifact@0.2.1","maintainers":[{"name":"ediflow","email":"hello.ediflow@gmail.com"}],"homepage":"https://github.com/ediflow-lib/core#readme","bugs":{"url":"https://github.com/ediflow-lib/core/issues"},"dist":{"shasum":"b93b1c780e0cc639ed9e1847c405233112dcf7a4","tarball":"https://registry.npmjs.org/@ediflow/edifact/-/edifact-0.2.1.tgz","fileCount":8,"integrity":"sha512-QYDvLlSR5YzMS5Wc+/3ypuyYAq1F+een84ypLc5TNH+3834ZQ1/wW+6qxFYq4dIZICyZ1I3diGEwW4yHyvel2A==","signatures":[{"sig":"MEUCIGgSrdFkVVeh6fb42GnewJ8QHUDvE68H3j2ZiVwdGW18AiEAxqrJFR+tfDERBn5cjjSR6ypithwZ1awhyR2ltewrMfQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":162816},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"9e0e399136f4523b97bd2e7af80075ba80a1e195","scripts":{"test":"vitest run","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"ediflow","email":"hello.ediflow@gmail.com"},"repository":{"url":"git+https://github.com/ediflow-lib/core.git","type":"git","directory":"packages/edifact"},"_npmVersion":"10.9.3","description":"EDIFACT EDI Parser - Format-specific infrastructure for UN/EDIFACT standard","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@ediflow/core":"*","@ediflow/infrastructure-shared":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.7.3","@types/node":"^22.10.5","@vitest/coverage-v8":"^2.1.8"},"_npmOperationalInternal":{"tmp":"tmp/edifact_0.2.1_1770724675386_0.8534513817411831","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@ediflow/edifact","version":"0.3.0","description":"EDIFACT EDI Parser - Format-specific infrastructure for UN/EDIFACT standard","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.js"}},"scripts":{"build":"tsup","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","typecheck":"tsc --noEmit","clean":"rm -rf dist","prepublishOnly":"npm run build"},"keywords":["edi","edifact","un-edifact","parser","validator","builder","typescript","edi-parser","edifact-parser","edifact-builder","edifact-validator","orders","invoic","invoice","desadv","iftmin","iftsta","logistics","supply-chain","b2b","e-invoicing","modern-edifact","type-safe"],"repository":{"type":"git","url":"git+https://github.com/ediflow-lib/core.git","directory":"packages/edifact"},"homepage":"https://github.com/ediflow-lib/core#readme","bugs":{"url":"https://github.com/ediflow-lib/core/issues"},"author":{"name":"EdiFlow Contributors"},"license":"MIT","dependencies":{"@ediflow/core":"*","@ediflow/infrastructure-shared":"*"},"devDependencies":{"@types/node":"^22.10.5","@vitest/coverage-v8":"^2.1.8","tsup":"^8.3.5","typescript":"^5.7.3","vitest":"^2.1.8"},"publishConfig":{"access":"public"},"_id":"@ediflow/edifact@0.3.0","gitHead":"a0b1155f0a2944828c45b6a375017d6fa01a6650","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-lHe5RYPOXPMZlZ6lJvkBvhIFG1L+Xwn1Y1BbXW7/9NfM4GbJskmpjie6HtrHgJDfS3m1Z90+zbSzItocyTi/2g==","shasum":"4bc5ef1ab6f46da2b9bab1c0bddebf0564962f43","tarball":"https://registry.npmjs.org/@ediflow/edifact/-/edifact-0.3.0.tgz","fileCount":8,"unpackedSize":165942,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCS/cpHw7VodQ1EWLKvrjNbuCEYYVhBLKdKL3fGzPVMpwIhAOoIn/gAITq8fc1IR4OwW+7x+usI8w8fZ6EhRUh4d1Bz"}]},"_npmUser":{"name":"ediflow","email":"hello.ediflow@gmail.com"},"directories":{},"maintainers":[{"name":"ediflow","email":"hello.ediflow@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/edifact_0.3.0_1777834306644_0.9879139943307145"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-10T05:10:31.459Z","modified":"2026-05-03T18:51:46.897Z","0.2.0":"2026-02-10T05:10:31.665Z","0.2.1":"2026-02-10T11:57:55.508Z","0.3.0":"2026-05-03T18:51:46.787Z"},"bugs":{"url":"https://github.com/ediflow-lib/core/issues"},"author":{"name":"EdiFlow Contributors"},"license":"MIT","homepage":"https://github.com/ediflow-lib/core#readme","keywords":["edi","edifact","un-edifact","parser","validator","builder","typescript","edi-parser","edifact-parser","edifact-builder","edifact-validator","orders","invoic","invoice","desadv","iftmin","iftsta","logistics","supply-chain","b2b","e-invoicing","modern-edifact","type-safe"],"repository":{"type":"git","url":"git+https://github.com/ediflow-lib/core.git","directory":"packages/edifact"},"description":"EDIFACT EDI Parser - Format-specific infrastructure for UN/EDIFACT standard","maintainers":[{"name":"ediflow","email":"hello.ediflow@gmail.com"}],"readme":"# @ediflow/edifact\n\n> EDIFACT EDI Parser - Format-specific infrastructure for UN/EDIFACT standard\n\nPart of the [EdiFlow](https://github.com/ediflow-lib/core) ecosystem - Modern, type-safe EDI parsing for TypeScript/JavaScript.\n\n---\n\n## 🆕 What's in v0.3.0\n\n- ✅ **Full EDIFACT parser** — UNB/UNH/UNT/UNZ envelope support\n- ✅ **Builder + EnvelopeBuilder** — Construct and wrap messages programmatically\n- ✅ **Validation** — `EdifactValidationServiceBuilder` with STRICT/LENIENT levels\n- ✅ **All data packages** — D.96A, D.01B, D.12A, D.20B, EANCOM 2002\n\n---\n\nThis package provides **EDIFACT-specific parsers, builders, and validators** for the UN/EDIFACT standard.\n\n```typescript\nimport {\n  EdifactMessageParser,\n  EdifactDelimiterDetector,\n  EdifactTokenizer,\n  EdifactSegmentParser,\n} from '@ediflow/edifact';\n\nconst parser  = new EdifactMessageParser(\n  new EdifactDelimiterDetector(), new EdifactTokenizer(), new EdifactSegmentParser(),\n);\nconst message = parser.parse(edifactString);\nconsole.log(message.messageType.value); // 'ORDERS'\n```\n\n## 🎯 Why a Separate Package?\n\n**Clean Architecture**:\n- `@ediflow/core` = Format-agnostic domain & application logic\n- `@ediflow/edifact` = EDIFACT-specific parsing infrastructure\n- `@ediflow/x12` = X12-specific parsing infrastructure\n\nThis allows you to:\n- ✅ Only install parsers you need (tree-shaking)\n- ✅ Keep core small and format-agnostic\n- ✅ Add new formats without bloating core\n\n## 📥 Installation\n\n```bash\nnpm install @ediflow/core @ediflow/edifact\n```\n\n## 🚀 Quick Start\n\n```typescript\nimport {\n  EdifactMessageParser,\n  EdifactDelimiterDetector,\n  EdifactTokenizer,\n  EdifactSegmentParser,\n  EdifactValidationServiceBuilder,\n} from '@ediflow/edifact';\n\nconst edifact = `UNB+UNOC:3+SENDER:14+RECEIVER:14+260503:0800+1'` +\n                `UNH+1+ORDERS:D:96A:UN'` +\n                `BGM+220+PO-001+9'` +\n                `DTM+137:20260503:102'` +\n                `UNT+4+1'` +\n                `UNZ+1+1'`;\n\n// 1. Parse\nconst parser = new EdifactMessageParser(\n  new EdifactDelimiterDetector(),\n  new EdifactTokenizer(),\n  new EdifactSegmentParser(),\n);\nconst message = parser.parse(edifact);\n\nconsole.log(message.standard);           // 'EDIFACT'\nconsole.log(message.version.value);      // 'D.96A'\nconsole.log(message.messageType.value);  // 'ORDERS'\nconsole.log(message.segments.length);    // 4 (BGM, DTM + envelope stripped)\n\n// 2. Validate\nconst validator = EdifactValidationServiceBuilder.forEDIFACT();\nconst result    = validator.validate(message);\nconsole.log(result.isValid);             // true\n```\n\n## 🏗️ Architecture\n\n```\n@ediflow/edifact/\n└── infrastructure/\n    └── parsers/\n        ├── EdifactTokenizer.ts           # Splits EDIFACT into tokens\n        ├── EdifactSegmentParser.ts       # Parses segments\n        ├── EdifactDelimiterDetector.ts   # Detects delimiters from UNA\n        └── EdifactMessageParser.ts       # Full message parsing\n```\n\n## 🎓 EDIFACT Delimiters\n\n| Delimiter | Default | Purpose | Example |\n|-----------|---------|---------|---------|\n| **Component** | `:` | Separates composite elements | `UNOC:3` |\n| **Data Element** | `+` | Separates data elements | `UNB+UNOC:3+...` |\n| **Decimal** | `.` | Decimal point | `123.45` |\n| **Escape** | `?` | Escapes special characters | `TEST?+DATA` |\n| **Segment** | `'` | Terminates segments | `UNH+1+ORDERS:D:96A:UN'` |\n\n**UNA Segment** (optional): `UNA:+.? '` - Defines custom delimiters\n\n## 📚 Supported Message Types\n\nWorks with all EDIFACT data packages (all MIT licensed):\n\n| Package | Messages | Description |\n|---------|----------|-------------|\n| **[@ediflow/edifact-d96a](https://www.npmjs.com/package/@ediflow/edifact-d96a)** | 126 | D.96A (1996) |\n| **[@ediflow/edifact-d01b](https://www.npmjs.com/package/@ediflow/edifact-d01b)** | 211 | D.01B (2001) — largest message count |\n| **[@ediflow/edifact-d12a](https://www.npmjs.com/package/@ediflow/edifact-d12a)** | 196 | D.12A (2012) |\n| **[@ediflow/edifact-d20b](https://www.npmjs.com/package/@ediflow/edifact-d20b)** | 195 | D.20B (2020) — latest |\n| **[@ediflow/eancom-2002](https://www.npmjs.com/package/@ediflow/eancom-2002)** | 49 | EANCOM 2002 — GS1 retail |\n\n**Total: 777 unique message types** across all EDIFACT versions.\n\n### Message Type Categories (D.12A — 196 types)\n\n**📦 Supply Chain & Logistics**\nDESADV, ORDERS, ORDRSP, ORDCHG, DELFOR, DELJIT, RECADV, COPARN, COREOR, COPRAR, COPINO, IFTMIN, IFTMAN, IFTMBC, IFTMCS, IFTSTA, IFTSAI, IFCSUM, COSTCO, COSTOR\n\n**💰 Finance & Payment**\nINVOIC, REMADV, PAYORD, PAYEXT, PAYMUL, PAYDUC, FINSTA, FINPAY, CREADV, CREEXT, CREMUL, DEBADV, DEBMUL, DEBREC, DIRDEB\n\n**📋 Catalog & Inventory**\nPRICAT, PRIHIS, INVRPT, SLSRPT, SLSFCT, QUOTES, REQOTE\n\n**🚢 Transport & Customs**\nCUSCAR, CUSDEC, CUSEXP, CUSRES, BAPLIE, COARRI, CODECO, VESDEP, MOVINS, BERMAN, HANMOV, IFTSTQ, IFTDGN, SAFHAZ, PAXLST\n\n**🏥 Healthcare**\nMEQPOS, MEDPID, MEDPRE, MEDREQ, MEDRPT, MEDRUC, INSDES, INSREQ, INSPRE, INSRPT\n\n**🏦 Banking & Trade Finance**\nBANSTA, DOCADV, DOCAPP, DOCARE, DOCAMA, DOCAMI, DOCAMR, DOCINF, BOPBNK, BOPCUS, BOPDIR, BOPINF\n\n**📊 Reporting & Statistics**\nSTATAC, STLRPT, TPFREP, INVRPT, RDRMES, ITRRPT, GENRAL, GESMES\n\n**Plus:** PARTIN, AUTHOR, APERAK, CONTRL, KEYMAN, and 100+ more\n\n## 🧪 Testing\n\n```bash\n# Run tests\nnpm test\n\n# Watch mode\nnpm run test:watch\n\n# Coverage\nnpm run test:coverage\n```\n\n## 🔗 Related Packages\n\n- **[@ediflow/core](https://www.npmjs.com/package/@ediflow/core)** - Core domain & application logic (required)\n- **[@ediflow/x12](https://www.npmjs.com/package/@ediflow/x12)** - X12 parser\n- **[@ediflow/edifact-d96a](https://www.npmjs.com/package/@ediflow/edifact-d96a)** - EDIFACT D96A definitions\n\n## 📖 Documentation\n\n- [Architecture Guide](https://github.com/ediflow-lib/core/blob/main/docs/ARCHITECTURE.md)\n- [Developer Guide](https://github.com/ediflow-lib/core/blob/main/docs/DEVELOPER_GUIDE.md)\n- [Quick Start](https://github.com/ediflow-lib/core/blob/main/docs/QUICK_START.md)\n- [EDIFACT Examples on GitHub](https://github.com/ediflow-lib/core/tree/main/examples/edifact)\n\n## 🤝 Contributing\n\nSee [CONTRIBUTING.md](https://github.com/ediflow-lib/core/blob/main/CONTRIBUTING.md)\n\n## 📄 License\n\nMIT - See [LICENSE](https://github.com/ediflow-lib/core/blob/main/LICENSE)\n\n---\n\n**Part of EdiFlow** - Modern, type-safe EDI parsing for TypeScript/JavaScript\n","readmeFilename":"README.md"}