lml-main
Version:
This is now a mono repository published into many standalone packages.
79 lines (78 loc) • 2.65 kB
TypeScript
import { RxHttpRequestAction, RxHttpActionTypes } from 'redux-rx-http';
import { JobStatusModel, JobStatusType } from '@lml/cosmo-ts-data';
export declare const FETCH_JOBS_BY_STATUS: RxHttpActionTypes;
export declare const SET_JOB_STATUS_BY_ID = "SET_JOB_STATUS_BY_ID";
export declare const SET_JOB_STATUSES_BY_ID_BATCH = "SET_JOB_STATUSES_BY_ID_BATCH";
export declare const SET_JOB_STATUS_SEARCH = "SET_JOB_STATUS_SEARCH";
export declare const CHANGE_JOB_STATUS = "CHANGE_JOB_STATUS";
export interface JobSearchParams {
statuses: string[];
labels: string[];
start: string;
end: string;
lastKeys: any;
order: string;
}
export interface SetJobStatusByIdAction {
type: 'SET_JOB_STATUS_BY_ID';
jobStatus: JobStatusModel;
}
export interface SetJobStatusesByIdBatchAction {
type: 'SET_JOB_STATUSES_BY_ID_BATCH';
jobStatuses: JobStatusModel[];
}
export interface SetJobStatusSearchAction {
type: 'SET_JOB_STATUS_SEARCH';
searchKey: string;
params: JobSearchParams;
jobs: JobStatusModel[];
}
export interface ChangeJobStatusAction {
type: 'CHANGE_JOB_STATUS';
job: JobStatusModel;
prevStatus: JobStatusType;
nextStatus: JobStatusType;
}
export declare type JobStatusAction = SetJobStatusByIdAction | SetJobStatusesByIdBatchAction | SetJobStatusSearchAction | ChangeJobStatusAction;
/**
* Retrieve a list of jobs by status
* Every search has a searchKey which allows you to save
* the query params in the state next to the results
*
* @param searchKey
* @param statuses
* @param labels
* @param start
* @param end
* @param lastKeys
* @param order
* @param showData
* @param args
*/
export declare const fetchJobsByStatus: (searchKey: string, params: JobSearchParams, showData?: string, args?: any) => RxHttpRequestAction;
/**
* Save an individual JobStatusModel in the state
*
* @param jobStatus
*/
export declare const setJobStatusById: (jobStatus: JobStatusModel) => SetJobStatusByIdAction;
/**
* Save an array of JobStatus models in the state
*
* @param jobStatuses
*/
export declare const setJobStatusesByIdBatch: (jobStatuses: JobStatusModel[]) => SetJobStatusesByIdBatchAction;
/**
* Save a list of JobStatus results
*
* @param jobs
*/
export declare const setJobStatusSearch: (jobs: JobStatusModel[], searchKey: string, params: JobSearchParams) => SetJobStatusSearchAction;
/**
* Pre-empt the api response by updating the status of a job directly
*
* @param job
* @param prevStatus
* @param nextStatus
*/
export declare const changeJobStatus: (job: JobStatusModel, prevStatus: JobStatusType, nextStatus: JobStatusType) => ChangeJobStatusAction;