import { Database } from '@journeyapps/db'; interface ScheduleTaskOptions { task: string; at?: Date; after?: number; queue?: string; parameters?: any; } import { EventSources } from './event_sources'; import { DatabaseAuth } from './DatabaseAuth'; import { GenericDatabase } from './api_db'; import { InternalTaskContext } from './InternalTaskContext'; export interface TaskEnvironment { readonly name: string; readonly env: string; readonly appId: string; } export interface DeployInfo { readonly revision?: string; readonly draftId?: string; readonly branch: string; readonly description: string; } export declare class CloudCodeEnvironment implements EventSources { readonly task: TaskEnvironment; readonly deployInfo: DeployInfo; APP: string; EDITOR_TEST: string; ENQUEUE: string; IDP: string; SCHEDULER: string; WEB: string; WEBHOOK: string; private currentTaskContext; constructor(task: TaskEnvironment); setTaskContext(context: InternalTaskContext): void; /** * Create a DB pointing to a different deployment of the same application. * * The local datamodel is used for the database. * * @param baseUrl Backend base baseUrl, e.g. "https://run-us.journeyapps.com" * @param instanceId Instance ID * @param auth Authentication options, null for default */ createDB(baseUrl: string, instanceId: string, auth?: DatabaseAuth): T; /** * * Create a DB pointing to a different deployment. * The datamodel is loaded from the remote deployment. * * @param baseUrl Backend base baseUrl, e.g. "https://run-us.journeyapps.com" * @param instanceId Instance ID * @param auth Authentication options */ createRemoteDB(baseUrl: string, instanceId: string, auth: DatabaseAuth): Promise; /** * Schedule a task for execution. * * @param {string} options.task - Name of task to schedule. * @param {Date} [options.at] - Time to run the task * @param {number} [options.after] - Milliseconds delay before executing the task * @param {string} [options.queue] - Name of a queue to run the task on. * @param {object} [options.parameters] - Parameters to pass to the function. */ scheduleTask(options: ScheduleTaskOptions): Promise; } export {};