Skip to content

GenerateMapping

Source: src/AWS/B2BI/GenerateMapping.ts

Runtime binding for b2bi:GenerateMapping.

Generates a mapping template (JSONATA or XSLT) from a sample input and desired output document using AI-assisted mapping — useful for building self-service EDI onboarding flows where trading partners supply sample documents. mappingAccuracy reports the model’s confidence. Provide the implementation with Effect.provide(AWS.B2BI.GenerateMappingHttp).

// init — account-level, no resource argument
const generateMapping = yield* AWS.B2BI.GenerateMapping();
// runtime
const result = yield* generateMapping({
inputFileContent: JSON.stringify({ customer: "acme" }),
outputFileContent: JSON.stringify({ name: "acme" }),
mappingType: "JSONATA",
});
// result.mappingTemplate, result.mappingAccuracy