Skip to content

TestConversion

Source: src/AWS/B2BI/TestConversion.ts

Runtime binding for b2bi:TestConversion.

Synchronously converts an inline JSON or XML document into an outbound X12 EDI document — the inline counterpart of an outbound transformer’s conversion step. Provide the implementation with Effect.provide(AWS.B2BI.TestConversionHttp).

// init — account-level, no resource argument
const testConversion = yield* AWS.B2BI.TestConversion();
// runtime
const result = yield* testConversion({
source: { fileFormat: "JSON", inputFile: { fileContent } },
target: {
fileFormat: "X12",
formatDetails: {
x12: { transactionSet: "X12_850", version: "VERSION_4010" },
},
},
});
// result.convertedFileContent — the generated X12 document