UNPKG

contentful-management

Version:
34 lines (31 loc) 1.07 kB
import { freezeSys, toPlainObject } from 'contentful-sdk-core'; import copy from 'fast-copy'; import { wrapCollection } from '../common-utils'; export const AiActionOutputFormat = { RichText: 'RichText', Markdown: 'Markdown', PlainText: 'PlainText' }; /** * The AI Action Invocation entity. * This entity is read-only and primarily used to inspect the result of an AI action invocation. */ /** * Wraps raw AI Action Invocation data with SDK helper methods. * * @param makeRequest - Function to make API requests. * @param data - Raw AI Action Invocation data. * @returns The AI Action Invocation entity. */ export function wrapAiActionInvocation(makeRequest, data) { const invocation = toPlainObject(copy(data)); return freezeSys(invocation); } /** * Wraps a collection of raw AI Action Invocation data. * * @param makeRequest - Function to make API requests. * @param data - Raw collection data. * @returns A collection of AI Action Invocation entities. */ export const wrapAiActionInvocationCollection = wrapCollection(wrapAiActionInvocation);