UNPKG

contentful-management

Version:
46 lines (43 loc) 1.57 kB
import { freezeSys, toPlainObject } from 'contentful-sdk-core'; import copy from 'fast-copy'; import { wrapCollection } from '../common-utils'; export let InvocationStatus = /*#__PURE__*/function (InvocationStatus) { InvocationStatus["Scheduled"] = "SCHEDULED"; InvocationStatus["InProgress"] = "IN_PROGRESS"; InvocationStatus["Failed"] = "FAILED"; InvocationStatus["Completed"] = "COMPLETED"; InvocationStatus["Cancelled"] = "CANCELLED"; return InvocationStatus; }({}); export let InvocationResultType = /*#__PURE__*/function (InvocationResultType) { InvocationResultType["Text"] = "text"; return InvocationResultType; }({}); 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);