import { Source, SimpleSourceOptions } from "./Source"; import { Property } from "./Property"; import { App, SimpleAppOptions } from "./App"; import { Run } from "./Run"; import { Option } from "./Option"; import { OptionHelper } from "./../modules/optionHelper"; import { FilterHelper } from "../modules/filterHelper"; import { Filter } from "./Filter"; import { ScheduleConfigurationObject } from "../classes/codeConfig"; import { CommonModel } from "../classes/commonModel"; /** * Metadata and methods to return the options a Schedule for this connection/app. * Options is a method which will poll the source for available options to select (ie: names of tables or columns) */ export interface PluginConnectionScheduleOption { key: string; required: boolean; description: string; type: "list" | "text" | "textarea"; options: (argument: { connection: any; app: App; appId: string; appOptions: SimpleAppOptions; source: Source; sourceId: string; sourceOptions: SimpleSourceOptions; sourceMapping: SimpleSourceOptions; properties: Property[]; }) => Promise<{ key: string; description?: string; examples?: any[]; }[]>; } export interface ScheduleFiltersWithKey extends FilterHelper.FiltersWithKey { } export interface SimpleScheduleOptions extends OptionHelper.SimpleOptions { } declare const STATES: readonly ["draft", "ready"]; export declare class Schedule extends CommonModel { idPrefix(): string; sourceId: string; name: string; state: typeof STATES[number]; locked: string; incremental: boolean; recurring: boolean; recurringFrequency: number; confirmRecords: boolean; refreshEnabled: boolean; __options: Option[]; filters: Filter[]; runs: Run[]; source: Source; getOptions(sourceFromEnvironment?: boolean): Promise; setOptions(options: SimpleScheduleOptions, externallyValidate?: boolean): Promise; afterSetOptions(hasChanges: boolean): Promise; validateOptions(options?: SimpleScheduleOptions, externallyValidate?: boolean): Promise; getPlugin(): Promise<{ plugin: import("..").GrouparooPlugin; pluginConnection: import("..").PluginConnection; pluginApp: import("..").PluginApp; }>; pluginOptions(): Promise<{ key: string; description: string; required: boolean; type: string; options: { key: string; description?: string; examples?: any[]; }[]; }[]>; getFilters(): Promise; setFilters(filters: ScheduleFiltersWithKey[], externallyValidate?: boolean): Promise; afterSetFilters(hasChanges: boolean): Promise; shouldRun(options?: { ignoreDeltas?: boolean; runIfNotRecurring?: boolean; }): Promise; runPercentComplete(run: Run): Promise; apiData(): Promise<{ id: string; name: string; state: "ready" | "draft"; sourceId: string; incremental: boolean; recurring: boolean; refreshEnabled: boolean; locked: string; confirmRecords: boolean; supportIncrementalSchedule: boolean; options: OptionHelper.SimpleOptions; filters: FilterHelper.FiltersWithKey[]; recurringFrequency: number; createdAt: number; updatedAt: number; }>; enqueueRun(): Promise; resetHighWatermarks(): Promise; run(run: Run): Promise<{ importsCount: number; highWaterMark: import("./Run").HighWaterMark; sourceOffset: string | number; }>; getConfigId(): string; getConfigObject(): Promise; static ensureSourceOptions(instance: Schedule): Promise; static noUpdateIfLocked(instance: Schedule): Promise; static checkRecurringFrequency(instance: Schedule): Promise; static ensureName(instance: Schedule): Promise; static ensureSetIncremental(instance: Schedule): Promise; static ensureSourceCanUseSchedule(instance: Schedule): Promise; static ensureOnePerSource(instance: Schedule): Promise; static checkIncremental(instance: Schedule): Promise; static updateState(instance: Schedule): Promise; static runAfterSave(instance: Schedule): Promise; static noDestroyIfLocked(instance: Schedule): Promise; static destroyAppOptions(instance: Schedule): Promise; static destroyFilters(instance: Property): Promise; static destroyRuns(instance: Schedule): Promise; } export {};