import { RunnerOptions as SchedulerRunnerOptions } from "graphile-scheduler"; import { AddJobFunction, JobHelpers, Logger, RunnerOptions as WorkerRunnerOptions, Task as GraphileWorkerTask, TaskList as GraphileWorkerTaskList } from "graphile-worker"; import { Pool, PoolClient } from "pg"; import Cryptr = require("cryptr"); import { ModuleI } from "../objects/module/core"; declare type PoolOrPoolClient = Pool | PoolClient; declare type ComposeWorkerOptions = { encryptionSecret: string; pgPool: Pool; logger?: Logger; } & Omit; export interface PgComposeWorker { stop: () => Promise; setSecret: (secretRef: string, unencryptedSecret: string) => Promise; getSecret: (secretRef: string) => Promise; addJob: AddJobFunction; } export declare type Task = (payload: any, helpers: JobHelpers) => Promise; export interface TaskList { [name: string]: Task; } export declare const makeWrapTaskList: (pool: PoolOrPoolClient, cryptr: Cryptr) => (taskList: TaskList) => GraphileWorkerTaskList; export declare const run: (m: ModuleI, opts: ComposeWorkerOptions) => Promise; export declare const runTaskListOnce: (m: ModuleI, opts: ComposeWorkerOptions, client: PoolClient) => Promise; export declare const runMigrations: (opts: Pick) => Promise; export interface GraphileSecrets { ref: string; encrypted_secret: string; } export interface GraphileUnencryptedSecrets { ref: string; unencrypted_secret: string; } export declare const encryptSecret: (client: PoolClient, cryptr: Cryptr, secretRef: string) => Promise; export declare const getSecret: (client: PoolOrPoolClient, cryptr: Cryptr, secretRef: string) => Promise; export declare const setSecret: (client: PoolOrPoolClient, secretRef: string, unencryptedSecret: string) => Promise; export declare const deepCloneWithSecretReplacement: (client: PoolOrPoolClient, cryptr: Cryptr, v: any) => Promise; export declare const extractAfterFnAndContext: (payload: any) => { payload: any; afterFn: string | undefined; context: any; }; export declare const wrapTask: (client: PoolOrPoolClient, cryptr: Cryptr, task: Task) => GraphileWorkerTask; export {};