UNPKG

@crowdin/app-project-module

Version:

Module that generates for you all common endpoints for serving standalone Crowdin App

50 lines (49 loc) 1.43 kB
import { CrowdinContextInfo, ImagePath, ModuleKey, UiModule } from '../../types'; import Crowdin from '@crowdin/crowdin-api-client'; export interface AutomationActionModule extends ModuleKey, ImagePath { /** * module name */ name: string; /** * module description */ description?: string; /** * invocation wait mode, default is sync */ invocationWaitMode?: 'sync' | 'taskToken'; /** * JSON schema defining the structure of data returned by the automation action */ outputSchema?: any; /** * JSON schema defining the structure of input parameters expected by the automation action */ inputSchema?: any; validateSettings?: ({ client, settings, context, req, }: { client: Crowdin; settings: any; context: CrowdinContextInfo; req: any; }) => Promise<any>; /** * function to execute the automation action */ execute: ({ client, inputData, validationErrors, context, req, }: { client: Crowdin; inputData: any; validationErrors?: Record<string, string> | undefined; context: CrowdinContextInfo; req: any; }) => Promise<any>; /** * Settings UI module */ settingsUiModule?: UiModule; /** * validate output data, default: true * set to false to skip output validation */ validateOutputData?: boolean; }