Skip to content

TestMapping

Source: src/AWS/B2BI/TestMapping.ts

Runtime binding for b2bi:TestMapping.

Synchronously maps sample content with a mapping template (JSONATA or XSLT) — the inline counterpart of a transformer’s mapping step, useful for validating templates or transforming small documents on the fly without a deployed transformer. Provide the implementation with Effect.provide(AWS.B2BI.TestMappingHttp).

// init — account-level, no resource argument
const testMapping = yield* AWS.B2BI.TestMapping();
// runtime
const result = yield* testMapping({
inputFileContent: JSON.stringify({ customer: "acme" }),
mappingTemplate: '{ "name": customer }',
fileFormat: "JSON",
});
// result.mappedFileContent === '{"name":"acme"}'