mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(server/web) Add manual job trigger mechanism to the web (#767)
This commit is contained in:
@@ -170,6 +170,61 @@ export interface AlbumResponseDto {
|
||||
*/
|
||||
'assets': Array<AssetResponseDto>;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface AllJobStatusResponseDto
|
||||
*/
|
||||
export interface AllJobStatusResponseDto {
|
||||
/**
|
||||
*
|
||||
* @type {JobCounts}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'thumbnailGenerationQueueCount': JobCounts;
|
||||
/**
|
||||
*
|
||||
* @type {JobCounts}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'metadataExtractionQueueCount': JobCounts;
|
||||
/**
|
||||
*
|
||||
* @type {JobCounts}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'videoConversionQueueCount': JobCounts;
|
||||
/**
|
||||
*
|
||||
* @type {JobCounts}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'machineLearningQueueCount': JobCounts;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'isThumbnailGenerationActive': boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'isMetadataExtractionActive': boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'isVideoConversionActive': boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'isMachineLearningActive': boolean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@@ -683,10 +738,16 @@ export type DeviceTypeEnum = typeof DeviceTypeEnum[keyof typeof DeviceTypeEnum];
|
||||
export interface ExifResponseDto {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @type {number}
|
||||
* @memberof ExifResponseDto
|
||||
*/
|
||||
'id'?: string | null;
|
||||
'id'?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof ExifResponseDto
|
||||
*/
|
||||
'fileSizeInByte'?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
@@ -717,12 +778,6 @@ export interface ExifResponseDto {
|
||||
* @memberof ExifResponseDto
|
||||
*/
|
||||
'exifImageHeight'?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof ExifResponseDto
|
||||
*/
|
||||
'fileSizeInByte'?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
@@ -828,6 +883,105 @@ export interface GetAssetCountByTimeBucketDto {
|
||||
*/
|
||||
'timeGroup': TimeGroupEnum;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
|
||||
export const JobCommand = {
|
||||
Start: 'start',
|
||||
Stop: 'stop'
|
||||
} as const;
|
||||
|
||||
export type JobCommand = typeof JobCommand[keyof typeof JobCommand];
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface JobCommandDto
|
||||
*/
|
||||
export interface JobCommandDto {
|
||||
/**
|
||||
*
|
||||
* @type {JobCommand}
|
||||
* @memberof JobCommandDto
|
||||
*/
|
||||
'command': JobCommand;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface JobCounts
|
||||
*/
|
||||
export interface JobCounts {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof JobCounts
|
||||
*/
|
||||
'active': number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof JobCounts
|
||||
*/
|
||||
'completed': number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof JobCounts
|
||||
*/
|
||||
'failed': number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof JobCounts
|
||||
*/
|
||||
'delayed': number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof JobCounts
|
||||
*/
|
||||
'waiting': number;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
|
||||
export const JobId = {
|
||||
ThumbnailGeneration: 'thumbnail-generation',
|
||||
MetadataExtraction: 'metadata-extraction',
|
||||
VideoConversion: 'video-conversion',
|
||||
MachineLearning: 'machine-learning'
|
||||
} as const;
|
||||
|
||||
export type JobId = typeof JobId[keyof typeof JobId];
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface JobStatusResponseDto
|
||||
*/
|
||||
export interface JobStatusResponseDto {
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof JobStatusResponseDto
|
||||
*/
|
||||
'isActive': boolean;
|
||||
/**
|
||||
*
|
||||
* @type {object}
|
||||
* @memberof JobStatusResponseDto
|
||||
*/
|
||||
'queueCount': object;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@@ -3682,6 +3836,247 @@ export class DeviceInfoApi extends BaseAPI {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* JobApi - axios parameter creator
|
||||
* @export
|
||||
*/
|
||||
export const JobApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getAllJobsStatus: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/jobs`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication bearer required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @param {JobId} jobId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getJobStatus: async (jobId: JobId, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'jobId' is not null or undefined
|
||||
assertParamExists('getJobStatus', 'jobId', jobId)
|
||||
const localVarPath = `/jobs/{jobId}`
|
||||
.replace(`{${"jobId"}}`, encodeURIComponent(String(jobId)));
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication bearer required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @param {JobId} jobId
|
||||
* @param {JobCommandDto} jobCommandDto
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
sendJobCommand: async (jobId: JobId, jobCommandDto: JobCommandDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'jobId' is not null or undefined
|
||||
assertParamExists('sendJobCommand', 'jobId', jobId)
|
||||
// verify required parameter 'jobCommandDto' is not null or undefined
|
||||
assertParamExists('sendJobCommand', 'jobCommandDto', jobCommandDto)
|
||||
const localVarPath = `/jobs/{jobId}`
|
||||
.replace(`{${"jobId"}}`, encodeURIComponent(String(jobId)));
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication bearer required
|
||||
// http bearer authentication required
|
||||
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||
|
||||
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(jobCommandDto, localVarRequestOptions, configuration)
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* JobApi - functional programming interface
|
||||
* @export
|
||||
*/
|
||||
export const JobApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = JobApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async getAllJobsStatus(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AllJobStatusResponseDto>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllJobsStatus(options);
|
||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @param {JobId} jobId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async getJobStatus(jobId: JobId, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<JobStatusResponseDto>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.getJobStatus(jobId, options);
|
||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @param {JobId} jobId
|
||||
* @param {JobCommandDto} jobCommandDto
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async sendJobCommand(jobId: JobId, jobCommandDto: JobCommandDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<number>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.sendJobCommand(jobId, jobCommandDto, options);
|
||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* JobApi - factory interface
|
||||
* @export
|
||||
*/
|
||||
export const JobApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = JobApiFp(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getAllJobsStatus(options?: any): AxiosPromise<AllJobStatusResponseDto> {
|
||||
return localVarFp.getAllJobsStatus(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @param {JobId} jobId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getJobStatus(jobId: JobId, options?: any): AxiosPromise<JobStatusResponseDto> {
|
||||
return localVarFp.getJobStatus(jobId, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @param {JobId} jobId
|
||||
* @param {JobCommandDto} jobCommandDto
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
sendJobCommand(jobId: JobId, jobCommandDto: JobCommandDto, options?: any): AxiosPromise<number> {
|
||||
return localVarFp.sendJobCommand(jobId, jobCommandDto, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* JobApi - object-oriented interface
|
||||
* @export
|
||||
* @class JobApi
|
||||
* @extends {BaseAPI}
|
||||
*/
|
||||
export class JobApi extends BaseAPI {
|
||||
/**
|
||||
*
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof JobApi
|
||||
*/
|
||||
public getAllJobsStatus(options?: AxiosRequestConfig) {
|
||||
return JobApiFp(this.configuration).getAllJobsStatus(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {JobId} jobId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof JobApi
|
||||
*/
|
||||
public getJobStatus(jobId: JobId, options?: AxiosRequestConfig) {
|
||||
return JobApiFp(this.configuration).getJobStatus(jobId, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {JobId} jobId
|
||||
* @param {JobCommandDto} jobCommandDto
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof JobApi
|
||||
*/
|
||||
public sendJobCommand(jobId: JobId, jobCommandDto: JobCommandDto, options?: AxiosRequestConfig) {
|
||||
return JobApiFp(this.configuration).sendJobCommand(jobId, jobCommandDto, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ServerInfoApi - axios parameter creator
|
||||
* @export
|
||||
|
||||
Reference in New Issue
Block a user