TestParsing
Source:
src/AWS/B2BI/TestParsing.ts
Runtime binding for b2bi:TestParsing.
Synchronously parses an EDI document in S3 (e.g. an X12 file) into the
JSON or XML representation B2BI’s mapping step consumes. B2BI reads the
inputFile with its service principal, so the bucket needs a bucket
policy granting b2bi.amazonaws.com read access. Provide the
implementation with Effect.provide(AWS.B2BI.TestParsingHttp).
Parsing EDI Documents
Section titled “Parsing EDI Documents”// init — account-level, no resource argumentconst testParsing = yield* AWS.B2BI.TestParsing();
// runtimeconst result = yield* testParsing({ inputFile: { bucketName: "my-edi-bucket", key: "inbound/order.edi" }, fileFormat: "JSON", ediType: { x12Details: { transactionSet: "X12_850", version: "VERSION_4010" }, },});// result.parsedFileContent — the JSON representation of the EDI file