mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	refactor(server): job repository (#1382)
* refactor(server): job repository * refactor: job repository * chore: generate open-api * fix: job panel * Remove incorrect subtitle Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
		
							
								
								
									
										145
									
								
								web/src/api/open-api/api.ts
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										145
									
								
								web/src/api/open-api/api.ts
									
									
									
										generated
									
									
									
								
							@@ -13,24 +13,13 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import {Configuration} from './configuration';
 | 
			
		||||
import globalAxios, {AxiosInstance, AxiosPromise, AxiosRequestConfig} from 'axios';
 | 
			
		||||
import { Configuration } from './configuration';
 | 
			
		||||
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
 | 
			
		||||
// Some imports not used depending on template conditions
 | 
			
		||||
// @ts-ignore
 | 
			
		||||
import {
 | 
			
		||||
    assertParamExists,
 | 
			
		||||
    createRequestFunction,
 | 
			
		||||
    DUMMY_BASE_URL,
 | 
			
		||||
    serializeDataIfNeeded,
 | 
			
		||||
    setApiKeyToObject,
 | 
			
		||||
    setBasicAuthToObject,
 | 
			
		||||
    setBearerAuthToObject,
 | 
			
		||||
    setOAuthToObject,
 | 
			
		||||
    setSearchParams,
 | 
			
		||||
    toPathString
 | 
			
		||||
} from './common';
 | 
			
		||||
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
 | 
			
		||||
// @ts-ignore
 | 
			
		||||
import {BASE_PATH, BaseAPI, COLLECTION_FORMATS, RequestArgs, RequiredError} from './base';
 | 
			
		||||
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 
 | 
			
		||||
@@ -293,61 +282,31 @@ export interface AllJobStatusResponseDto {
 | 
			
		||||
     * @type {JobCounts}
 | 
			
		||||
     * @memberof AllJobStatusResponseDto
 | 
			
		||||
     */
 | 
			
		||||
    'thumbnailGenerationQueueCount': JobCounts;
 | 
			
		||||
    'thumbnail-generation': JobCounts;
 | 
			
		||||
    /**
 | 
			
		||||
     * 
 | 
			
		||||
     * @type {JobCounts}
 | 
			
		||||
     * @memberof AllJobStatusResponseDto
 | 
			
		||||
     */
 | 
			
		||||
    'metadataExtractionQueueCount': JobCounts;
 | 
			
		||||
    'metadata-extraction': JobCounts;
 | 
			
		||||
    /**
 | 
			
		||||
     * 
 | 
			
		||||
     * @type {JobCounts}
 | 
			
		||||
     * @memberof AllJobStatusResponseDto
 | 
			
		||||
     */
 | 
			
		||||
    'videoConversionQueueCount': JobCounts;
 | 
			
		||||
    'video-conversion': JobCounts;
 | 
			
		||||
    /**
 | 
			
		||||
     * 
 | 
			
		||||
     * @type {JobCounts}
 | 
			
		||||
     * @memberof AllJobStatusResponseDto
 | 
			
		||||
     */
 | 
			
		||||
    'machineLearningQueueCount': JobCounts;
 | 
			
		||||
    'machine-learning': JobCounts;
 | 
			
		||||
    /**
 | 
			
		||||
     * 
 | 
			
		||||
     * @type {JobCounts}
 | 
			
		||||
     * @memberof AllJobStatusResponseDto
 | 
			
		||||
     */
 | 
			
		||||
    'storageMigrationQueueCount': 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;
 | 
			
		||||
    /**
 | 
			
		||||
     * 
 | 
			
		||||
     * @type {boolean}
 | 
			
		||||
     * @memberof AllJobStatusResponseDto
 | 
			
		||||
     */
 | 
			
		||||
    'isStorageMigrationActive': boolean;
 | 
			
		||||
    'storage-template-migration': JobCounts;
 | 
			
		||||
}
 | 
			
		||||
/**
 | 
			
		||||
 * 
 | 
			
		||||
@@ -1269,25 +1228,6 @@ export const JobId = {
 | 
			
		||||
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
 | 
			
		||||
@@ -5772,43 +5712,6 @@ export const JobApiAxiosParamCreator = function (configuration?: 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};
 | 
			
		||||
@@ -5880,16 +5783,6 @@ export const JobApiFp = function(configuration?: Configuration) {
 | 
			
		||||
            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 
 | 
			
		||||
@@ -5919,15 +5812,6 @@ export const JobApiFactory = function (configuration?: Configuration, basePath?:
 | 
			
		||||
        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 
 | 
			
		||||
@@ -5958,17 +5842,6 @@ export class JobApi extends BaseAPI {
 | 
			
		||||
        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 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user