import Base, { MaybeRaw } from "../../../../Base"; import { PaginatedResponse, SearchParams } from "../../../../interfaces/global"; import { CronjobType, Job, JobCreate } from "../../../../interfaces/high5/space/job"; import { High5JobLogInternal } from "../../internal/space/job/log"; import { High5JobLog } from "./log"; export declare class High5Job extends Base { get jobLog(): High5JobLog; private _jobLog?; get jobLogInternal(): High5JobLogInternal; private _jobLogInternal?; /** * Retrieves a cronjob by it's ID. * @param orgName Name of the organization * @param spaceName Name of the High5 space * @param jobId ID of the cronjob * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object * @returns The requested cronjob */ getJob(orgName: string, spaceName: string, jobId: string, exposeNextExecution?: boolean, raw?: { raw: R; }): Promise>; /** * Retrieves the next n cronjob executions as Unix timestamps (in milliseconds). * @param orgName Name of the organization * @param spaceName Name of the space * @param jobId ID of the cronjob * @returns Array of Unix timestamps */ getNextCronjobExecutions(orgName: string, spaceName: string, jobId: string, raw?: { raw: R; }): Promise>; /** * Creates a new cronjob in the specified High5 space. * @param orgName Name of the organisation * @param spaceName Name of the High5 space * @param createJob Cronjob to be created * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object * @returns Created cronjob */ createJob(orgName: string, spaceName: string, createJob: JobCreate, exposeNextExecution?: boolean, raw?: { raw: R; }): Promise>; /** * Updates an existing cronjob. * @param orgName Name of the organization * @param spaceName Name of the space * @param jobId ID of the cronjob * @param createJob Cronjob to be updated * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object * @returns Updated cronjob */ updateJob(orgName: string, spaceName: string, jobId: string, createJob: JobCreate, exposeNextExecution?: boolean, raw?: { raw: R; }): Promise>; /** * Change the cron expression of an existing cronjob * @param orgName Name of the organization * @param spaceName Name of the space * @param jobId ID of the cronjob * @param expression New cron expression * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object * @param time (optional) Schedule selection preset used on frontend * @returns The patched cronjob */ patchCronjobExpression(orgName: string, spaceName: string, jobId: string, expression: string, exposeNextExecution?: boolean, time?: CronjobType, raw?: { raw: R; }): Promise>; /** * Change the enabled flag of an existing cronjob * @param orgName Name of the organization * @param spaceName Name of the space * @param jobId ID of the cronjob * @param enabled Boolean flag to set * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object * @returns The patched cronjob */ patchCronjobEnabled(orgName: string, spaceName: string, jobId: string, enabled: boolean, exposeNextExecution?: boolean, raw?: { raw: R; }): Promise>; /** * Enable a cronjob. * * This is a wrapper around patchCronjobEnabled. * * @param orgName Name of the organization * @param spaceName Name of the space * @param jobId ID of the cronjob * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object * @returns The patched cronjob */ enableCronjob(orgName: string, spaceName: string, jobId: string, exposeNextExecution?: boolean, raw?: { raw: R; }): Promise>; /** * Disable a cronjob. * * This is a wrapper around patchCronjobEnabled. * * @param orgName Name of the organization * @param spaceName Name of the space * @param jobId ID of the cronjob * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object * @returns The patched cronjob */ disableCronjob(orgName: string, spaceName: string, jobId: string, exposeNextExecution?: boolean, raw?: { raw: R; }): Promise>; /** * Deletes a cronjob by its ID * @param orgName Name of the organization * @param spaceName Name of the space * @param jobId ID of the cronjob */ deleteJob(orgName: string, spaceName: string, jobId: string, raw?: { raw: R; }): Promise>; /** * Retrieves all cronjobs of a High5 space which match the provided search filter(s). Will return all cronjobs if no filter is provided. * @param orgName Name of the organization * @param spaceName Name of the space * @param filters (optional) Array of search filters * @param sorting (optional) Sorting object * @param limit (optional) Max number of results (1-100; defaults to 25) * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0) * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the returned cronjob objects * @returns Object containing an array of filtered cronjobs as well as the total number of results found in the database (independent of limit and page) */ searchJobs({ orgName, spaceName, filters, sorting, limit, page, exposeNextExecution, }: SearchParams & { orgName: string; spaceName: string; exposeNextExecution?: boolean; }, raw?: { raw: R; }): Promise>>; /** * Resolve a cron pattern along with a timezone to get the next executions in mili-seconds. * @param expression The cron expression * @param timezone The target IANA timezone * @param amount The amount of returned execution-dates (limited between 1 and 10, default is 3) * @returns Array of Unix timestamps */ resolveCronPatternWithTimezone(expression: string, timezone: string, amount?: number, raw?: { raw: R; }): Promise>; protected getEndpoint(endpoint: string): string; }