import { IntegrationActionResult, IntegrationDefinition, IntegrationInstance } from './../../jupiter-types/integration'; import { PersisterOperationsResult } from '../../persister/types'; import { IntegrationClientProvider } from './clients'; import IntegrationLogger from './IntegrationLogger'; import { IntegrationInvocationContext } from './invocation'; /** * Provides a minimal reference to a subset of `IntegrationJob` properties, used * throughout calls to the integration job system API to identify the intended * job. */ export interface IntegrationJobKey { id: string; integrationInstanceId: string; } /** * A function that serves as the entry point of implementing an integration. */ export interface IntegrationExecutionHandler { (context: IntegrationExecutionContext): Promise; } interface IntegrationContext { /** * The IntegrationDefinition represents information about this integration. * There is one definition no matter the number of configured instances. */ readonly definition: IntegrationDefinition; /** * The IntegrationInstance represents information about a particular * configuration of the integration, allowing the integration to operate on * behalf of the tenant/account holder represented by the * IntegrationInstance. */ readonly instance: IntegrationInstance; /** * A logger configured to include information about the current run of the * integration, allowing for tracing the run across steps in the process. */ readonly logger: IntegrationLogger; /** * Maintains references to J1 integration clients (db/API clients, etc). */ readonly clients: IntegrationClientProvider; } /** * The complete context necessary for executing the work of the integration, * provided to integration handler functions. */ export declare type IntegrationExecutionContext = IntegrationInvocationContext & IntegrationContext; /** * The complete context necessary for processing a provider event. */ export declare type IntegrationEventExecutionContext = Omit; /** * The result returned from the execution of an integration process. */ export interface IntegrationExecutionResult { /** * A summary of operations generated by the execution. */ operations?: PersisterOperationsResult; /** * Result data, determined by the action performed. Not all * `IntegrationAction`s will return a result, so this is an optional value. */ actionResult?: IntegrationActionResult; /** * Execution failure information, never to be any sensitive information! */ error?: Error; } export {};