useFetchAiTransformations()
useFetchAiTransformations():
Generates Boomi-compatible transformation functions via OpenAI:
- Reads AI config (enabled, model, apiKey) from context.
- Sends a structured prompt to produce name, script, inputs, outputs.
- Validates the response against
AiTransformation(zod). - Shapes the result into Boomi
MapExtensionsFunctionformat.
Throws
When AI is enabled but model or apiKey is missing in context.
Returns
Hook API with the latest generated result, loading/error state, and an invoker.
fetchTransformation()
Requests an AI-generated transformation for a natural-language prompt and adapts it to Boomi’s map extension function structure.
fetchTransformation: (userPrompt: string, id: string) => Promise<undefined | { id: string; type: type; cacheType: cacheType; Inputs: { Input: { key: string; name: string; }[]; }; Outputs: { Output: { key: string; name: string; }[]; }; Configuration: { Scripting: { language: language; Script: string; Inputs: { Input: { index: string; name: string; dataType: dataType; }[]; }; Outputs: { Output: { index: string; name: string; }[]; }; }; }; }>
Parameters
Returns
Resolves with the structured Boomi transformation object on success.
Throws
If AI is enabled but not fully configured (missing model or apiKey).