From 2e424fe2498188e3349edc3f9d99655745593680 Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Fri, 3 Nov 2023 21:33:15 -0400 Subject: [PATCH] feat(server): better api error messages (for unhandled exceptions) (#4817) * feat(server): better error messages * chore: open api * chore: remove debug log * fix: syntax error * fix: e2e test --- cli/src/api/open-api/api.ts | 1146 ++++++++--------- .../modules/login/services/oauth.service.dart | 4 +- mobile/lib/modules/login/ui/login_form.dart | 2 +- mobile/openapi/README.md | Bin 22728 -> 22877 bytes mobile/openapi/doc/APIKeyApi.md | Bin 10142 -> 10232 bytes mobile/openapi/doc/AssetApi.md | Bin 66617 -> 66635 bytes mobile/openapi/doc/AuthenticationApi.md | Bin 13976 -> 13976 bytes mobile/openapi/doc/LibraryApi.md | Bin 16472 -> 16466 bytes mobile/openapi/doc/OAuthApi.md | Bin 8044 -> 8254 bytes mobile/openapi/doc/ServerInfoApi.md | Bin 9157 -> 9228 bytes mobile/openapi/doc/SystemConfigApi.md | Bin 8056 -> 8092 bytes mobile/openapi/lib/api/api_key_api.dart | Bin 7816 -> 7861 bytes mobile/openapi/lib/api/asset_api.dart | Bin 58765 -> 58774 bytes .../openapi/lib/api/authentication_api.dart | Bin 11607 -> 11607 bytes mobile/openapi/lib/api/library_api.dart | Bin 11878 -> 11875 bytes mobile/openapi/lib/api/o_auth_api.dart | Bin 9354 -> 9459 bytes mobile/openapi/lib/api/server_info_api.dart | Bin 11576 -> 11619 bytes mobile/openapi/lib/api/system_config_api.dart | Bin 6323 -> 6341 bytes mobile/openapi/test/api_key_api_test.dart | Bin 1084 -> 1114 bytes mobile/openapi/test/asset_api_test.dart | Bin 5890 -> 5896 bytes .../openapi/test/authentication_api_test.dart | Bin 1514 -> 1514 bytes mobile/openapi/test/library_api_test.dart | Bin 1544 -> 1542 bytes mobile/openapi/test/o_auth_api_test.dart | Bin 1308 -> 1378 bytes mobile/openapi/test/server_info_api_test.dart | Bin 1451 -> 1473 bytes .../openapi/test/system_config_api_test.dart | Bin 1003 -> 1015 bytes server/immich-openapi-specs.json | 38 +- server/src/domain/asset/asset.service.spec.ts | 20 +- server/src/domain/asset/asset.service.ts | 4 +- server/src/domain/auth/auth.service.ts | 9 +- .../domain/repositories/asset.repository.ts | 2 +- .../server-info/server-info.service.spec.ts | 2 +- .../domain/server-info/server-info.service.ts | 2 +- server/src/domain/user/user.core.ts | 78 +- .../immich/api-v1/asset/asset.controller.ts | 4 +- server/src/immich/app.module.ts | 9 +- server/src/immich/app.utils.ts | 7 + .../immich/controllers/api-key.controller.ts | 10 +- .../immich/controllers/asset.controller.ts | 9 +- .../src/immich/controllers/auth.controller.ts | 2 +- .../immich/controllers/library.controller.ts | 2 +- .../immich/controllers/oauth.controller.ts | 12 +- .../controllers/server-info.controller.ts | 6 +- .../controllers/system-config.controller.ts | 2 +- .../src/immich/controllers/user.controller.ts | 2 +- .../immich/interceptors/error.interceptor.ts | 32 + .../file.interceptor.ts} | 2 +- server/src/immich/interceptors/index.ts | 2 + .../infra/repositories/asset.repository.ts | 2 +- server/test/e2e/server-info.e2e-spec.ts | 8 +- .../repositories/asset.repository.mock.ts | 2 +- web/src/api/open-api/api.ts | 1146 ++++++++--------- web/src/api/utils.ts | 12 +- .../settings/ffmpeg/ffmpeg-settings.svelte | 4 +- .../settings/job-settings/job-settings.svelte | 4 +- .../library-settings/library-settings.svelte | 4 +- .../machine-learning-settings.svelte | 2 +- .../settings/map-settings/map-settings.svelte | 4 +- .../new-version-check-settings.svelte | 4 +- .../settings/oauth/oauth-settings.svelte | 4 +- .../password-login-settings.svelte | 4 +- .../storage-template-settings.svelte | 4 +- .../settings/theme/theme-settings.svelte | 4 +- .../thumbnail/thumbnail-settings.svelte | 4 +- .../trash-settings/trash-settings.svelte | 4 +- .../forms/admin-registration-form.svelte | 2 +- .../side-bar/side-bar.svelte | 6 +- .../user-settings-page/library-list.svelte | 2 +- .../user-api-key-list.svelte | 8 +- web/src/lib/stores/assets.store.ts | 4 +- .../(user)/user-settings/+page.server.ts | 2 +- .../admin/server-status/+page.server.ts | 2 +- .../routes/admin/server-status/+page.svelte | 2 +- 72 files changed, 1337 insertions(+), 1315 deletions(-) create mode 100644 server/src/immich/interceptors/error.interceptor.ts rename server/src/immich/{app.interceptor.ts => interceptors/file.interceptor.ts} (99%) create mode 100644 server/src/immich/interceptors/index.ts diff --git a/cli/src/api/open-api/api.ts b/cli/src/api/open-api/api.ts index b00b0deb5..9f4d765f2 100644 --- a/cli/src/api/open-api/api.ts +++ b/cli/src/api/open-api/api.ts @@ -4528,9 +4528,9 @@ export const APIKeyApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createKey: async (aPIKeyCreateDto: APIKeyCreateDto, options: AxiosRequestConfig = {}): Promise => { + createApiKey: async (aPIKeyCreateDto: APIKeyCreateDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'aPIKeyCreateDto' is not null or undefined - assertParamExists('createKey', 'aPIKeyCreateDto', aPIKeyCreateDto) + assertParamExists('createApiKey', 'aPIKeyCreateDto', aPIKeyCreateDto) const localVarPath = `/api-key`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -4572,9 +4572,9 @@ export const APIKeyApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteKey: async (id: string, options: AxiosRequestConfig = {}): Promise => { + deleteApiKey: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined - assertParamExists('deleteKey', 'id', id) + assertParamExists('deleteApiKey', 'id', id) const localVarPath = `/api-key/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. @@ -4614,9 +4614,9 @@ export const APIKeyApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKey: async (id: string, options: AxiosRequestConfig = {}): Promise => { + getApiKey: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined - assertParamExists('getKey', 'id', id) + assertParamExists('getApiKey', 'id', id) const localVarPath = `/api-key/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. @@ -4655,7 +4655,7 @@ export const APIKeyApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKeys: async (options: AxiosRequestConfig = {}): Promise => { + getApiKeys: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api-key`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -4695,11 +4695,11 @@ export const APIKeyApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateKey: async (id: string, aPIKeyUpdateDto: APIKeyUpdateDto, options: AxiosRequestConfig = {}): Promise => { + updateApiKey: async (id: string, aPIKeyUpdateDto: APIKeyUpdateDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined - assertParamExists('updateKey', 'id', id) + assertParamExists('updateApiKey', 'id', id) // verify required parameter 'aPIKeyUpdateDto' is not null or undefined - assertParamExists('updateKey', 'aPIKeyUpdateDto', aPIKeyUpdateDto) + assertParamExists('updateApiKey', 'aPIKeyUpdateDto', aPIKeyUpdateDto) const localVarPath = `/api-key/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. @@ -4752,8 +4752,8 @@ export const APIKeyApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async createKey(aPIKeyCreateDto: APIKeyCreateDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createKey(aPIKeyCreateDto, options); + async createApiKey(aPIKeyCreateDto: APIKeyCreateDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createApiKey(aPIKeyCreateDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -4762,8 +4762,8 @@ export const APIKeyApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deleteKey(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteKey(id, options); + async deleteApiKey(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteApiKey(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -4772,8 +4772,8 @@ export const APIKeyApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getKey(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getKey(id, options); + async getApiKey(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getApiKey(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -4781,8 +4781,8 @@ export const APIKeyApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getKeys(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getKeys(options); + async getApiKeys(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getApiKeys(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -4792,8 +4792,8 @@ export const APIKeyApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async updateKey(id: string, aPIKeyUpdateDto: APIKeyUpdateDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateKey(id, aPIKeyUpdateDto, options); + async updateApiKey(id: string, aPIKeyUpdateDto: APIKeyUpdateDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateApiKey(id, aPIKeyUpdateDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -4808,110 +4808,110 @@ export const APIKeyApiFactory = function (configuration?: Configuration, basePat return { /** * - * @param {APIKeyApiCreateKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiCreateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createKey(requestParameters: APIKeyApiCreateKeyRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.createKey(requestParameters.aPIKeyCreateDto, options).then((request) => request(axios, basePath)); + createApiKey(requestParameters: APIKeyApiCreateApiKeyRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.createApiKey(requestParameters.aPIKeyCreateDto, options).then((request) => request(axios, basePath)); }, /** * - * @param {APIKeyApiDeleteKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiDeleteApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteKey(requestParameters: APIKeyApiDeleteKeyRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.deleteKey(requestParameters.id, options).then((request) => request(axios, basePath)); + deleteApiKey(requestParameters: APIKeyApiDeleteApiKeyRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.deleteApiKey(requestParameters.id, options).then((request) => request(axios, basePath)); }, /** * - * @param {APIKeyApiGetKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiGetApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKey(requestParameters: APIKeyApiGetKeyRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getKey(requestParameters.id, options).then((request) => request(axios, basePath)); + getApiKey(requestParameters: APIKeyApiGetApiKeyRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getApiKey(requestParameters.id, options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKeys(options?: AxiosRequestConfig): AxiosPromise> { - return localVarFp.getKeys(options).then((request) => request(axios, basePath)); + getApiKeys(options?: AxiosRequestConfig): AxiosPromise> { + return localVarFp.getApiKeys(options).then((request) => request(axios, basePath)); }, /** * - * @param {APIKeyApiUpdateKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiUpdateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateKey(requestParameters: APIKeyApiUpdateKeyRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.updateKey(requestParameters.id, requestParameters.aPIKeyUpdateDto, options).then((request) => request(axios, basePath)); + updateApiKey(requestParameters: APIKeyApiUpdateApiKeyRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.updateApiKey(requestParameters.id, requestParameters.aPIKeyUpdateDto, options).then((request) => request(axios, basePath)); }, }; }; /** - * Request parameters for createKey operation in APIKeyApi. + * Request parameters for createApiKey operation in APIKeyApi. * @export - * @interface APIKeyApiCreateKeyRequest + * @interface APIKeyApiCreateApiKeyRequest */ -export interface APIKeyApiCreateKeyRequest { +export interface APIKeyApiCreateApiKeyRequest { /** * * @type {APIKeyCreateDto} - * @memberof APIKeyApiCreateKey + * @memberof APIKeyApiCreateApiKey */ readonly aPIKeyCreateDto: APIKeyCreateDto } /** - * Request parameters for deleteKey operation in APIKeyApi. + * Request parameters for deleteApiKey operation in APIKeyApi. * @export - * @interface APIKeyApiDeleteKeyRequest + * @interface APIKeyApiDeleteApiKeyRequest */ -export interface APIKeyApiDeleteKeyRequest { +export interface APIKeyApiDeleteApiKeyRequest { /** * * @type {string} - * @memberof APIKeyApiDeleteKey + * @memberof APIKeyApiDeleteApiKey */ readonly id: string } /** - * Request parameters for getKey operation in APIKeyApi. + * Request parameters for getApiKey operation in APIKeyApi. * @export - * @interface APIKeyApiGetKeyRequest + * @interface APIKeyApiGetApiKeyRequest */ -export interface APIKeyApiGetKeyRequest { +export interface APIKeyApiGetApiKeyRequest { /** * * @type {string} - * @memberof APIKeyApiGetKey + * @memberof APIKeyApiGetApiKey */ readonly id: string } /** - * Request parameters for updateKey operation in APIKeyApi. + * Request parameters for updateApiKey operation in APIKeyApi. * @export - * @interface APIKeyApiUpdateKeyRequest + * @interface APIKeyApiUpdateApiKeyRequest */ -export interface APIKeyApiUpdateKeyRequest { +export interface APIKeyApiUpdateApiKeyRequest { /** * * @type {string} - * @memberof APIKeyApiUpdateKey + * @memberof APIKeyApiUpdateApiKey */ readonly id: string /** * * @type {APIKeyUpdateDto} - * @memberof APIKeyApiUpdateKey + * @memberof APIKeyApiUpdateApiKey */ readonly aPIKeyUpdateDto: APIKeyUpdateDto } @@ -4925,35 +4925,35 @@ export interface APIKeyApiUpdateKeyRequest { export class APIKeyApi extends BaseAPI { /** * - * @param {APIKeyApiCreateKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiCreateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof APIKeyApi */ - public createKey(requestParameters: APIKeyApiCreateKeyRequest, options?: AxiosRequestConfig) { - return APIKeyApiFp(this.configuration).createKey(requestParameters.aPIKeyCreateDto, options).then((request) => request(this.axios, this.basePath)); + public createApiKey(requestParameters: APIKeyApiCreateApiKeyRequest, options?: AxiosRequestConfig) { + return APIKeyApiFp(this.configuration).createApiKey(requestParameters.aPIKeyCreateDto, options).then((request) => request(this.axios, this.basePath)); } /** * - * @param {APIKeyApiDeleteKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiDeleteApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof APIKeyApi */ - public deleteKey(requestParameters: APIKeyApiDeleteKeyRequest, options?: AxiosRequestConfig) { - return APIKeyApiFp(this.configuration).deleteKey(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); + public deleteApiKey(requestParameters: APIKeyApiDeleteApiKeyRequest, options?: AxiosRequestConfig) { + return APIKeyApiFp(this.configuration).deleteApiKey(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); } /** * - * @param {APIKeyApiGetKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiGetApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof APIKeyApi */ - public getKey(requestParameters: APIKeyApiGetKeyRequest, options?: AxiosRequestConfig) { - return APIKeyApiFp(this.configuration).getKey(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); + public getApiKey(requestParameters: APIKeyApiGetApiKeyRequest, options?: AxiosRequestConfig) { + return APIKeyApiFp(this.configuration).getApiKey(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); } /** @@ -4962,19 +4962,19 @@ export class APIKeyApi extends BaseAPI { * @throws {RequiredError} * @memberof APIKeyApi */ - public getKeys(options?: AxiosRequestConfig) { - return APIKeyApiFp(this.configuration).getKeys(options).then((request) => request(this.axios, this.basePath)); + public getApiKeys(options?: AxiosRequestConfig) { + return APIKeyApiFp(this.configuration).getApiKeys(options).then((request) => request(this.axios, this.basePath)); } /** * - * @param {APIKeyApiUpdateKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiUpdateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof APIKeyApi */ - public updateKey(requestParameters: APIKeyApiUpdateKeyRequest, options?: AxiosRequestConfig) { - return APIKeyApiFp(this.configuration).updateKey(requestParameters.id, requestParameters.aPIKeyUpdateDto, options).then((request) => request(this.axios, this.basePath)); + public updateApiKey(requestParameters: APIKeyApiUpdateApiKeyRequest, options?: AxiosRequestConfig) { + return APIKeyApiFp(this.configuration).updateApiKey(requestParameters.id, requestParameters.aPIKeyUpdateDto, options).then((request) => request(this.axios, this.basePath)); } } @@ -6433,9 +6433,9 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - bulkUploadCheck: async (assetBulkUploadCheckDto: AssetBulkUploadCheckDto, options: AxiosRequestConfig = {}): Promise => { + checkBulkUpload: async (assetBulkUploadCheckDto: AssetBulkUploadCheckDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'assetBulkUploadCheckDto' is not null or undefined - assertParamExists('bulkUploadCheck', 'assetBulkUploadCheckDto', assetBulkUploadCheckDto) + assertParamExists('checkBulkUpload', 'assetBulkUploadCheckDto', assetBulkUploadCheckDto) const localVarPath = `/asset/bulk-upload-check`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -6856,7 +6856,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAssetStats: async (isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, options: AxiosRequestConfig = {}): Promise => { + getAssetStatistics: async (isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/asset/statistics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -6944,98 +6944,6 @@ export const AssetApiAxiosParamCreator = 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 {TimeBucketSize} size - * @param {string} timeBucket - * @param {string} [userId] - * @param {string} [albumId] - * @param {string} [personId] - * @param {boolean} [isArchived] - * @param {boolean} [isFavorite] - * @param {boolean} [isTrashed] - * @param {boolean} [withStacked] - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getByTimeBucket: async (size: TimeBucketSize, timeBucket: string, userId?: string, albumId?: string, personId?: string, isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, withStacked?: boolean, key?: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'size' is not null or undefined - assertParamExists('getByTimeBucket', 'size', size) - // verify required parameter 'timeBucket' is not null or undefined - assertParamExists('getByTimeBucket', 'timeBucket', timeBucket) - const localVarPath = `/asset/time-bucket`; - // 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 cookie required - - // authentication api_key required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (size !== undefined) { - localVarQueryParameter['size'] = size; - } - - if (userId !== undefined) { - localVarQueryParameter['userId'] = userId; - } - - if (albumId !== undefined) { - localVarQueryParameter['albumId'] = albumId; - } - - if (personId !== undefined) { - localVarQueryParameter['personId'] = personId; - } - - if (isArchived !== undefined) { - localVarQueryParameter['isArchived'] = isArchived; - } - - if (isFavorite !== undefined) { - localVarQueryParameter['isFavorite'] = isFavorite; - } - - if (isTrashed !== undefined) { - localVarQueryParameter['isTrashed'] = isTrashed; - } - - if (withStacked !== undefined) { - localVarQueryParameter['withStacked'] = withStacked; - } - - if (timeBucket !== undefined) { - localVarQueryParameter['timeBucket'] = timeBucket; - } - - if (key !== undefined) { - localVarQueryParameter['key'] = key; - } - - - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -7318,6 +7226,98 @@ export const AssetApiAxiosParamCreator = 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 {TimeBucketSize} size + * @param {string} timeBucket + * @param {string} [userId] + * @param {string} [albumId] + * @param {string} [personId] + * @param {boolean} [isArchived] + * @param {boolean} [isFavorite] + * @param {boolean} [isTrashed] + * @param {boolean} [withStacked] + * @param {string} [key] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTimeBucket: async (size: TimeBucketSize, timeBucket: string, userId?: string, albumId?: string, personId?: string, isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, withStacked?: boolean, key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'size' is not null or undefined + assertParamExists('getTimeBucket', 'size', size) + // verify required parameter 'timeBucket' is not null or undefined + assertParamExists('getTimeBucket', 'timeBucket', timeBucket) + const localVarPath = `/asset/time-bucket`; + // 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 cookie required + + // authentication api_key required + await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + + // authentication bearer required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (size !== undefined) { + localVarQueryParameter['size'] = size; + } + + if (userId !== undefined) { + localVarQueryParameter['userId'] = userId; + } + + if (albumId !== undefined) { + localVarQueryParameter['albumId'] = albumId; + } + + if (personId !== undefined) { + localVarQueryParameter['personId'] = personId; + } + + if (isArchived !== undefined) { + localVarQueryParameter['isArchived'] = isArchived; + } + + if (isFavorite !== undefined) { + localVarQueryParameter['isFavorite'] = isFavorite; + } + + if (isTrashed !== undefined) { + localVarQueryParameter['isTrashed'] = isTrashed; + } + + if (withStacked !== undefined) { + localVarQueryParameter['withStacked'] = withStacked; + } + + if (timeBucket !== undefined) { + localVarQueryParameter['timeBucket'] = timeBucket; + } + + if (key !== undefined) { + localVarQueryParameter['key'] = key; + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -8011,8 +8011,8 @@ export const AssetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async bulkUploadCheck(assetBulkUploadCheckDto: AssetBulkUploadCheckDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.bulkUploadCheck(assetBulkUploadCheckDto, options); + async checkBulkUpload(assetBulkUploadCheckDto: AssetBulkUploadCheckDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.checkBulkUpload(assetBulkUploadCheckDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -8109,8 +8109,8 @@ export const AssetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getAssetStats(isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAssetStats(isArchived, isFavorite, isTrashed, options); + async getAssetStatistics(isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAssetStatistics(isArchived, isFavorite, isTrashed, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -8125,25 +8125,6 @@ export const AssetApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getAssetThumbnail(id, format, key, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, - /** - * - * @param {TimeBucketSize} size - * @param {string} timeBucket - * @param {string} [userId] - * @param {string} [albumId] - * @param {string} [personId] - * @param {boolean} [isArchived] - * @param {boolean} [isFavorite] - * @param {boolean} [isTrashed] - * @param {boolean} [withStacked] - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getByTimeBucket(size: TimeBucketSize, timeBucket: string, userId?: string, albumId?: string, personId?: string, isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, withStacked?: boolean, key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getByTimeBucket(size, timeBucket, userId, albumId, personId, isArchived, isFavorite, isTrashed, withStacked, key, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * * @param {*} [options] Override http request option. @@ -8207,6 +8188,25 @@ export const AssetApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getRandom(count, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {TimeBucketSize} size + * @param {string} timeBucket + * @param {string} [userId] + * @param {string} [albumId] + * @param {string} [personId] + * @param {boolean} [isArchived] + * @param {boolean} [isFavorite] + * @param {boolean} [isTrashed] + * @param {boolean} [withStacked] + * @param {string} [key] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getTimeBucket(size: TimeBucketSize, timeBucket: string, userId?: string, albumId?: string, personId?: string, isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, withStacked?: boolean, key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTimeBucket(size, timeBucket, userId, albumId, personId, isArchived, isFavorite, isTrashed, withStacked, key, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {TimeBucketSize} size @@ -8365,12 +8365,12 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath return { /** * Checks if assets exist by checksums - * @param {AssetApiBulkUploadCheckRequest} requestParameters Request parameters. + * @param {AssetApiCheckBulkUploadRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - bulkUploadCheck(requestParameters: AssetApiBulkUploadCheckRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.bulkUploadCheck(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(axios, basePath)); + checkBulkUpload(requestParameters: AssetApiCheckBulkUploadRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.checkBulkUpload(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(axios, basePath)); }, /** * Checks if multiple assets exist on the server and returns all existing - used by background backup @@ -8444,12 +8444,12 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath }, /** * - * @param {AssetApiGetAssetStatsRequest} requestParameters Request parameters. + * @param {AssetApiGetAssetStatisticsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAssetStats(requestParameters: AssetApiGetAssetStatsRequest = {}, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getAssetStats(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, options).then((request) => request(axios, basePath)); + getAssetStatistics(requestParameters: AssetApiGetAssetStatisticsRequest = {}, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getAssetStatistics(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, options).then((request) => request(axios, basePath)); }, /** * @@ -8460,15 +8460,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath getAssetThumbnail(requestParameters: AssetApiGetAssetThumbnailRequest, options?: AxiosRequestConfig): AxiosPromise { return localVarFp.getAssetThumbnail(requestParameters.id, requestParameters.format, requestParameters.key, options).then((request) => request(axios, basePath)); }, - /** - * - * @param {AssetApiGetByTimeBucketRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getByTimeBucket(requestParameters: AssetApiGetByTimeBucketRequest, options?: AxiosRequestConfig): AxiosPromise> { - return localVarFp.getByTimeBucket(requestParameters.size, requestParameters.timeBucket, requestParameters.userId, requestParameters.albumId, requestParameters.personId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.withStacked, requestParameters.key, options).then((request) => request(axios, basePath)); - }, /** * * @param {*} [options] Override http request option. @@ -8521,6 +8512,15 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath getRandom(requestParameters: AssetApiGetRandomRequest = {}, options?: AxiosRequestConfig): AxiosPromise> { return localVarFp.getRandom(requestParameters.count, options).then((request) => request(axios, basePath)); }, + /** + * + * @param {AssetApiGetTimeBucketRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTimeBucket(requestParameters: AssetApiGetTimeBucketRequest, options?: AxiosRequestConfig): AxiosPromise> { + return localVarFp.getTimeBucket(requestParameters.size, requestParameters.timeBucket, requestParameters.userId, requestParameters.albumId, requestParameters.personId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.withStacked, requestParameters.key, options).then((request) => request(axios, basePath)); + }, /** * * @param {AssetApiGetTimeBucketsRequest} requestParameters Request parameters. @@ -8632,15 +8632,15 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath }; /** - * Request parameters for bulkUploadCheck operation in AssetApi. + * Request parameters for checkBulkUpload operation in AssetApi. * @export - * @interface AssetApiBulkUploadCheckRequest + * @interface AssetApiCheckBulkUploadRequest */ -export interface AssetApiBulkUploadCheckRequest { +export interface AssetApiCheckBulkUploadRequest { /** * * @type {AssetBulkUploadCheckDto} - * @memberof AssetApiBulkUploadCheck + * @memberof AssetApiCheckBulkUpload */ readonly assetBulkUploadCheckDto: AssetBulkUploadCheckDto } @@ -8786,29 +8786,29 @@ export interface AssetApiGetAssetByIdRequest { } /** - * Request parameters for getAssetStats operation in AssetApi. + * Request parameters for getAssetStatistics operation in AssetApi. * @export - * @interface AssetApiGetAssetStatsRequest + * @interface AssetApiGetAssetStatisticsRequest */ -export interface AssetApiGetAssetStatsRequest { +export interface AssetApiGetAssetStatisticsRequest { /** * * @type {boolean} - * @memberof AssetApiGetAssetStats + * @memberof AssetApiGetAssetStatistics */ readonly isArchived?: boolean /** * * @type {boolean} - * @memberof AssetApiGetAssetStats + * @memberof AssetApiGetAssetStatistics */ readonly isFavorite?: boolean /** * * @type {boolean} - * @memberof AssetApiGetAssetStats + * @memberof AssetApiGetAssetStatistics */ readonly isTrashed?: boolean } @@ -8841,83 +8841,6 @@ export interface AssetApiGetAssetThumbnailRequest { readonly key?: string } -/** - * Request parameters for getByTimeBucket operation in AssetApi. - * @export - * @interface AssetApiGetByTimeBucketRequest - */ -export interface AssetApiGetByTimeBucketRequest { - /** - * - * @type {TimeBucketSize} - * @memberof AssetApiGetByTimeBucket - */ - readonly size: TimeBucketSize - - /** - * - * @type {string} - * @memberof AssetApiGetByTimeBucket - */ - readonly timeBucket: string - - /** - * - * @type {string} - * @memberof AssetApiGetByTimeBucket - */ - readonly userId?: string - - /** - * - * @type {string} - * @memberof AssetApiGetByTimeBucket - */ - readonly albumId?: string - - /** - * - * @type {string} - * @memberof AssetApiGetByTimeBucket - */ - readonly personId?: string - - /** - * - * @type {boolean} - * @memberof AssetApiGetByTimeBucket - */ - readonly isArchived?: boolean - - /** - * - * @type {boolean} - * @memberof AssetApiGetByTimeBucket - */ - readonly isFavorite?: boolean - - /** - * - * @type {boolean} - * @memberof AssetApiGetByTimeBucket - */ - readonly isTrashed?: boolean - - /** - * - * @type {boolean} - * @memberof AssetApiGetByTimeBucket - */ - readonly withStacked?: boolean - - /** - * - * @type {string} - * @memberof AssetApiGetByTimeBucket - */ - readonly key?: string -} - /** * Request parameters for getDownloadInfo operation in AssetApi. * @export @@ -9009,6 +8932,83 @@ export interface AssetApiGetRandomRequest { readonly count?: number } +/** + * Request parameters for getTimeBucket operation in AssetApi. + * @export + * @interface AssetApiGetTimeBucketRequest + */ +export interface AssetApiGetTimeBucketRequest { + /** + * + * @type {TimeBucketSize} + * @memberof AssetApiGetTimeBucket + */ + readonly size: TimeBucketSize + + /** + * + * @type {string} + * @memberof AssetApiGetTimeBucket + */ + readonly timeBucket: string + + /** + * + * @type {string} + * @memberof AssetApiGetTimeBucket + */ + readonly userId?: string + + /** + * + * @type {string} + * @memberof AssetApiGetTimeBucket + */ + readonly albumId?: string + + /** + * + * @type {string} + * @memberof AssetApiGetTimeBucket + */ + readonly personId?: string + + /** + * + * @type {boolean} + * @memberof AssetApiGetTimeBucket + */ + readonly isArchived?: boolean + + /** + * + * @type {boolean} + * @memberof AssetApiGetTimeBucket + */ + readonly isFavorite?: boolean + + /** + * + * @type {boolean} + * @memberof AssetApiGetTimeBucket + */ + readonly isTrashed?: boolean + + /** + * + * @type {boolean} + * @memberof AssetApiGetTimeBucket + */ + readonly withStacked?: boolean + + /** + * + * @type {string} + * @memberof AssetApiGetTimeBucket + */ + readonly key?: string +} + /** * Request parameters for getTimeBuckets operation in AssetApi. * @export @@ -9361,13 +9361,13 @@ export interface AssetApiUploadFileRequest { export class AssetApi extends BaseAPI { /** * Checks if assets exist by checksums - * @param {AssetApiBulkUploadCheckRequest} requestParameters Request parameters. + * @param {AssetApiCheckBulkUploadRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AssetApi */ - public bulkUploadCheck(requestParameters: AssetApiBulkUploadCheckRequest, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).bulkUploadCheck(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(this.axios, this.basePath)); + public checkBulkUpload(requestParameters: AssetApiCheckBulkUploadRequest, options?: AxiosRequestConfig) { + return AssetApiFp(this.configuration).checkBulkUpload(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(this.axios, this.basePath)); } /** @@ -9458,13 +9458,13 @@ export class AssetApi extends BaseAPI { /** * - * @param {AssetApiGetAssetStatsRequest} requestParameters Request parameters. + * @param {AssetApiGetAssetStatisticsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AssetApi */ - public getAssetStats(requestParameters: AssetApiGetAssetStatsRequest = {}, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).getAssetStats(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, options).then((request) => request(this.axios, this.basePath)); + public getAssetStatistics(requestParameters: AssetApiGetAssetStatisticsRequest = {}, options?: AxiosRequestConfig) { + return AssetApiFp(this.configuration).getAssetStatistics(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, options).then((request) => request(this.axios, this.basePath)); } /** @@ -9478,17 +9478,6 @@ export class AssetApi extends BaseAPI { return AssetApiFp(this.configuration).getAssetThumbnail(requestParameters.id, requestParameters.format, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); } - /** - * - * @param {AssetApiGetByTimeBucketRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AssetApi - */ - public getByTimeBucket(requestParameters: AssetApiGetByTimeBucketRequest, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).getByTimeBucket(requestParameters.size, requestParameters.timeBucket, requestParameters.userId, requestParameters.albumId, requestParameters.personId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.withStacked, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); - } - /** * * @param {*} [options] Override http request option. @@ -9553,6 +9542,17 @@ export class AssetApi extends BaseAPI { return AssetApiFp(this.configuration).getRandom(requestParameters.count, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {AssetApiGetTimeBucketRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AssetApi + */ + public getTimeBucket(requestParameters: AssetApiGetTimeBucketRequest, options?: AxiosRequestConfig) { + return AssetApiFp(this.configuration).getTimeBucket(requestParameters.size, requestParameters.timeBucket, requestParameters.userId, requestParameters.albumId, requestParameters.personId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.withStacked, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {AssetApiGetTimeBucketsRequest} requestParameters Request parameters. @@ -10090,41 +10090,6 @@ export class AuditApi extends BaseAPI { */ export const AuthenticationApiAxiosParamCreator = function (configuration?: Configuration) { return { - /** - * - * @param {SignUpDto} signUpDto - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - adminSignUp: async (signUpDto: SignUpDto, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'signUpDto' is not null or undefined - assertParamExists('adminSignUp', 'signUpDto', signUpDto) - const localVarPath = `/auth/admin-sign-up`; - // 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: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(signUpDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * * @param {ChangePasswordDto} changePasswordDto @@ -10360,6 +10325,41 @@ export const AuthenticationApiAxiosParamCreator = function (configuration?: Conf options: localVarRequestOptions, }; }, + /** + * + * @param {SignUpDto} signUpDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signUpAdmin: async (signUpDto: SignUpDto, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'signUpDto' is not null or undefined + assertParamExists('signUpAdmin', 'signUpDto', signUpDto) + const localVarPath = `/auth/admin-sign-up`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(signUpDto, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @param {*} [options] Override http request option. @@ -10408,16 +10408,6 @@ export const AuthenticationApiAxiosParamCreator = function (configuration?: Conf export const AuthenticationApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AuthenticationApiAxiosParamCreator(configuration) return { - /** - * - * @param {SignUpDto} signUpDto - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async adminSignUp(signUpDto: SignUpDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.adminSignUp(signUpDto, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * * @param {ChangePasswordDto} changePasswordDto @@ -10475,6 +10465,16 @@ export const AuthenticationApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.logoutAuthDevices(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {SignUpDto} signUpDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async signUpAdmin(signUpDto: SignUpDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.signUpAdmin(signUpDto, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {*} [options] Override http request option. @@ -10494,15 +10494,6 @@ export const AuthenticationApiFp = function(configuration?: Configuration) { export const AuthenticationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AuthenticationApiFp(configuration) return { - /** - * - * @param {AuthenticationApiAdminSignUpRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - adminSignUp(requestParameters: AuthenticationApiAdminSignUpRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.adminSignUp(requestParameters.signUpDto, options).then((request) => request(axios, basePath)); - }, /** * * @param {AuthenticationApiChangePasswordRequest} requestParameters Request parameters. @@ -10554,6 +10545,15 @@ export const AuthenticationApiFactory = function (configuration?: Configuration, logoutAuthDevices(options?: AxiosRequestConfig): AxiosPromise { return localVarFp.logoutAuthDevices(options).then((request) => request(axios, basePath)); }, + /** + * + * @param {AuthenticationApiSignUpAdminRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signUpAdmin(requestParameters: AuthenticationApiSignUpAdminRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.signUpAdmin(requestParameters.signUpDto, options).then((request) => request(axios, basePath)); + }, /** * * @param {*} [options] Override http request option. @@ -10565,20 +10565,6 @@ export const AuthenticationApiFactory = function (configuration?: Configuration, }; }; -/** - * Request parameters for adminSignUp operation in AuthenticationApi. - * @export - * @interface AuthenticationApiAdminSignUpRequest - */ -export interface AuthenticationApiAdminSignUpRequest { - /** - * - * @type {SignUpDto} - * @memberof AuthenticationApiAdminSignUp - */ - readonly signUpDto: SignUpDto -} - /** * Request parameters for changePassword operation in AuthenticationApi. * @export @@ -10621,6 +10607,20 @@ export interface AuthenticationApiLogoutAuthDeviceRequest { readonly id: string } +/** + * Request parameters for signUpAdmin operation in AuthenticationApi. + * @export + * @interface AuthenticationApiSignUpAdminRequest + */ +export interface AuthenticationApiSignUpAdminRequest { + /** + * + * @type {SignUpDto} + * @memberof AuthenticationApiSignUpAdmin + */ + readonly signUpDto: SignUpDto +} + /** * AuthenticationApi - object-oriented interface * @export @@ -10628,17 +10628,6 @@ export interface AuthenticationApiLogoutAuthDeviceRequest { * @extends {BaseAPI} */ export class AuthenticationApi extends BaseAPI { - /** - * - * @param {AuthenticationApiAdminSignUpRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AuthenticationApi - */ - public adminSignUp(requestParameters: AuthenticationApiAdminSignUpRequest, options?: AxiosRequestConfig) { - return AuthenticationApiFp(this.configuration).adminSignUp(requestParameters.signUpDto, options).then((request) => request(this.axios, this.basePath)); - } - /** * * @param {AuthenticationApiChangePasswordRequest} requestParameters Request parameters. @@ -10702,6 +10691,17 @@ export class AuthenticationApi extends BaseAPI { return AuthenticationApiFp(this.configuration).logoutAuthDevices(options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {AuthenticationApiSignUpAdminRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthenticationApi + */ + public signUpAdmin(requestParameters: AuthenticationApiSignUpAdminRequest, options?: AxiosRequestConfig) { + return AuthenticationApiFp(this.configuration).signUpAdmin(requestParameters.signUpDto, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {*} [options] Override http request option. @@ -11014,7 +11014,7 @@ export const LibraryApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAllForUser: async (options: AxiosRequestConfig = {}): Promise => { + getLibraries: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/library`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11304,8 +11304,8 @@ export const LibraryApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getAllForUser(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAllForUser(options); + async getLibraries(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLibraries(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -11393,8 +11393,8 @@ export const LibraryApiFactory = function (configuration?: Configuration, basePa * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAllForUser(options?: AxiosRequestConfig): AxiosPromise> { - return localVarFp.getAllForUser(options).then((request) => request(axios, basePath)); + getLibraries(options?: AxiosRequestConfig): AxiosPromise> { + return localVarFp.getLibraries(options).then((request) => request(axios, basePath)); }, /** * @@ -11591,8 +11591,8 @@ export class LibraryApi extends BaseAPI { * @throws {RequiredError} * @memberof LibraryApi */ - public getAllForUser(options?: AxiosRequestConfig) { - return LibraryApiFp(this.configuration).getAllForUser(options).then((request) => request(this.axios, this.basePath)); + public getLibraries(options?: AxiosRequestConfig) { + return LibraryApiFp(this.configuration).getLibraries(options).then((request) => request(this.axios, this.basePath)); } /** @@ -11658,50 +11658,15 @@ export class LibraryApi extends BaseAPI { */ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration) { return { - /** - * - * @param {OAuthConfigDto} oAuthConfigDto - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - authorizeOAuth: async (oAuthConfigDto: OAuthConfigDto, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'oAuthConfigDto' is not null or undefined - assertParamExists('authorizeOAuth', 'oAuthConfigDto', oAuthConfigDto) - const localVarPath = `/oauth/authorize`; - // 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: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(oAuthConfigDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * * @param {OAuthCallbackDto} oAuthCallbackDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ - callback: async (oAuthCallbackDto: OAuthCallbackDto, options: AxiosRequestConfig = {}): Promise => { + finishOAuth: async (oAuthCallbackDto: OAuthCallbackDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'oAuthCallbackDto' is not null or undefined - assertParamExists('callback', 'oAuthCallbackDto', oAuthCallbackDto) + assertParamExists('finishOAuth', 'oAuthCallbackDto', oAuthCallbackDto) const localVarPath = `/oauth/callback`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11735,9 +11700,9 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration * @deprecated * @throws {RequiredError} */ - generateConfig: async (oAuthConfigDto: OAuthConfigDto, options: AxiosRequestConfig = {}): Promise => { + generateOAuthConfig: async (oAuthConfigDto: OAuthConfigDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'oAuthConfigDto' is not null or undefined - assertParamExists('generateConfig', 'oAuthConfigDto', oAuthConfigDto) + assertParamExists('generateOAuthConfig', 'oAuthConfigDto', oAuthConfigDto) const localVarPath = `/oauth/config`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11770,9 +11735,9 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - link: async (oAuthCallbackDto: OAuthCallbackDto, options: AxiosRequestConfig = {}): Promise => { + linkOAuthAccount: async (oAuthCallbackDto: OAuthCallbackDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'oAuthCallbackDto' is not null or undefined - assertParamExists('link', 'oAuthCallbackDto', oAuthCallbackDto) + assertParamExists('linkOAuthAccount', 'oAuthCallbackDto', oAuthCallbackDto) const localVarPath = `/oauth/link`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11813,7 +11778,7 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mobileRedirect: async (options: AxiosRequestConfig = {}): Promise => { + redirectOAuthToMobile: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/oauth/mobile-redirect`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11839,10 +11804,45 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration }, /** * + * @param {OAuthConfigDto} oAuthConfigDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ - unlink: async (options: AxiosRequestConfig = {}): Promise => { + startOAuth: async (oAuthConfigDto: OAuthConfigDto, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'oAuthConfigDto' is not null or undefined + assertParamExists('startOAuth', 'oAuthConfigDto', oAuthConfigDto) + const localVarPath = `/oauth/authorize`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(oAuthConfigDto, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unlinkOAuthAccount: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/oauth/unlink`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11885,24 +11885,14 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration export const OAuthApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = OAuthApiAxiosParamCreator(configuration) return { - /** - * - * @param {OAuthConfigDto} oAuthConfigDto - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async authorizeOAuth(oAuthConfigDto: OAuthConfigDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.authorizeOAuth(oAuthConfigDto, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * * @param {OAuthCallbackDto} oAuthCallbackDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async callback(oAuthCallbackDto: OAuthCallbackDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.callback(oAuthCallbackDto, options); + async finishOAuth(oAuthCallbackDto: OAuthCallbackDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.finishOAuth(oAuthCallbackDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -11912,8 +11902,8 @@ export const OAuthApiFp = function(configuration?: Configuration) { * @deprecated * @throws {RequiredError} */ - async generateConfig(oAuthConfigDto: OAuthConfigDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.generateConfig(oAuthConfigDto, options); + async generateOAuthConfig(oAuthConfigDto: OAuthConfigDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.generateOAuthConfig(oAuthConfigDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -11922,8 +11912,8 @@ export const OAuthApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async link(oAuthCallbackDto: OAuthCallbackDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.link(oAuthCallbackDto, options); + async linkOAuthAccount(oAuthCallbackDto: OAuthCallbackDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.linkOAuthAccount(oAuthCallbackDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -11931,8 +11921,18 @@ export const OAuthApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async mobileRedirect(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.mobileRedirect(options); + async redirectOAuthToMobile(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.redirectOAuthToMobile(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {OAuthConfigDto} oAuthConfigDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async startOAuth(oAuthConfigDto: OAuthConfigDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.startOAuth(oAuthConfigDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -11940,8 +11940,8 @@ export const OAuthApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async unlink(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.unlink(options); + async unlinkOAuthAccount(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.unlinkOAuthAccount(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -11956,116 +11956,116 @@ export const OAuthApiFactory = function (configuration?: Configuration, basePath return { /** * - * @param {OAuthApiAuthorizeOAuthRequest} requestParameters Request parameters. + * @param {OAuthApiFinishOAuthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - authorizeOAuth(requestParameters: OAuthApiAuthorizeOAuthRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.authorizeOAuth(requestParameters.oAuthConfigDto, options).then((request) => request(axios, basePath)); - }, - /** - * - * @param {OAuthApiCallbackRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - callback(requestParameters: OAuthApiCallbackRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.callback(requestParameters.oAuthCallbackDto, options).then((request) => request(axios, basePath)); + finishOAuth(requestParameters: OAuthApiFinishOAuthRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.finishOAuth(requestParameters.oAuthCallbackDto, options).then((request) => request(axios, basePath)); }, /** * @deprecated use feature flags and /oauth/authorize - * @param {OAuthApiGenerateConfigRequest} requestParameters Request parameters. + * @param {OAuthApiGenerateOAuthConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ - generateConfig(requestParameters: OAuthApiGenerateConfigRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.generateConfig(requestParameters.oAuthConfigDto, options).then((request) => request(axios, basePath)); + generateOAuthConfig(requestParameters: OAuthApiGenerateOAuthConfigRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.generateOAuthConfig(requestParameters.oAuthConfigDto, options).then((request) => request(axios, basePath)); }, /** * - * @param {OAuthApiLinkRequest} requestParameters Request parameters. + * @param {OAuthApiLinkOAuthAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - link(requestParameters: OAuthApiLinkRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.link(requestParameters.oAuthCallbackDto, options).then((request) => request(axios, basePath)); + linkOAuthAccount(requestParameters: OAuthApiLinkOAuthAccountRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.linkOAuthAccount(requestParameters.oAuthCallbackDto, options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mobileRedirect(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.mobileRedirect(options).then((request) => request(axios, basePath)); + redirectOAuthToMobile(options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.redirectOAuthToMobile(options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {OAuthApiStartOAuthRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + startOAuth(requestParameters: OAuthApiStartOAuthRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.startOAuth(requestParameters.oAuthConfigDto, options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - unlink(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.unlink(options).then((request) => request(axios, basePath)); + unlinkOAuthAccount(options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.unlinkOAuthAccount(options).then((request) => request(axios, basePath)); }, }; }; /** - * Request parameters for authorizeOAuth operation in OAuthApi. + * Request parameters for finishOAuth operation in OAuthApi. * @export - * @interface OAuthApiAuthorizeOAuthRequest + * @interface OAuthApiFinishOAuthRequest */ -export interface OAuthApiAuthorizeOAuthRequest { - /** - * - * @type {OAuthConfigDto} - * @memberof OAuthApiAuthorizeOAuth - */ - readonly oAuthConfigDto: OAuthConfigDto -} - -/** - * Request parameters for callback operation in OAuthApi. - * @export - * @interface OAuthApiCallbackRequest - */ -export interface OAuthApiCallbackRequest { +export interface OAuthApiFinishOAuthRequest { /** * * @type {OAuthCallbackDto} - * @memberof OAuthApiCallback + * @memberof OAuthApiFinishOAuth */ readonly oAuthCallbackDto: OAuthCallbackDto } /** - * Request parameters for generateConfig operation in OAuthApi. + * Request parameters for generateOAuthConfig operation in OAuthApi. * @export - * @interface OAuthApiGenerateConfigRequest + * @interface OAuthApiGenerateOAuthConfigRequest */ -export interface OAuthApiGenerateConfigRequest { +export interface OAuthApiGenerateOAuthConfigRequest { /** * * @type {OAuthConfigDto} - * @memberof OAuthApiGenerateConfig + * @memberof OAuthApiGenerateOAuthConfig */ readonly oAuthConfigDto: OAuthConfigDto } /** - * Request parameters for link operation in OAuthApi. + * Request parameters for linkOAuthAccount operation in OAuthApi. * @export - * @interface OAuthApiLinkRequest + * @interface OAuthApiLinkOAuthAccountRequest */ -export interface OAuthApiLinkRequest { +export interface OAuthApiLinkOAuthAccountRequest { /** * * @type {OAuthCallbackDto} - * @memberof OAuthApiLink + * @memberof OAuthApiLinkOAuthAccount */ readonly oAuthCallbackDto: OAuthCallbackDto } +/** + * Request parameters for startOAuth operation in OAuthApi. + * @export + * @interface OAuthApiStartOAuthRequest + */ +export interface OAuthApiStartOAuthRequest { + /** + * + * @type {OAuthConfigDto} + * @memberof OAuthApiStartOAuth + */ + readonly oAuthConfigDto: OAuthConfigDto +} + /** * OAuthApi - object-oriented interface * @export @@ -12075,47 +12075,36 @@ export interface OAuthApiLinkRequest { export class OAuthApi extends BaseAPI { /** * - * @param {OAuthApiAuthorizeOAuthRequest} requestParameters Request parameters. + * @param {OAuthApiFinishOAuthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OAuthApi */ - public authorizeOAuth(requestParameters: OAuthApiAuthorizeOAuthRequest, options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).authorizeOAuth(requestParameters.oAuthConfigDto, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @param {OAuthApiCallbackRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof OAuthApi - */ - public callback(requestParameters: OAuthApiCallbackRequest, options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).callback(requestParameters.oAuthCallbackDto, options).then((request) => request(this.axios, this.basePath)); + public finishOAuth(requestParameters: OAuthApiFinishOAuthRequest, options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).finishOAuth(requestParameters.oAuthCallbackDto, options).then((request) => request(this.axios, this.basePath)); } /** * @deprecated use feature flags and /oauth/authorize - * @param {OAuthApiGenerateConfigRequest} requestParameters Request parameters. + * @param {OAuthApiGenerateOAuthConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof OAuthApi */ - public generateConfig(requestParameters: OAuthApiGenerateConfigRequest, options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).generateConfig(requestParameters.oAuthConfigDto, options).then((request) => request(this.axios, this.basePath)); + public generateOAuthConfig(requestParameters: OAuthApiGenerateOAuthConfigRequest, options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).generateOAuthConfig(requestParameters.oAuthConfigDto, options).then((request) => request(this.axios, this.basePath)); } /** * - * @param {OAuthApiLinkRequest} requestParameters Request parameters. + * @param {OAuthApiLinkOAuthAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OAuthApi */ - public link(requestParameters: OAuthApiLinkRequest, options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).link(requestParameters.oAuthCallbackDto, options).then((request) => request(this.axios, this.basePath)); + public linkOAuthAccount(requestParameters: OAuthApiLinkOAuthAccountRequest, options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).linkOAuthAccount(requestParameters.oAuthCallbackDto, options).then((request) => request(this.axios, this.basePath)); } /** @@ -12124,8 +12113,19 @@ export class OAuthApi extends BaseAPI { * @throws {RequiredError} * @memberof OAuthApi */ - public mobileRedirect(options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).mobileRedirect(options).then((request) => request(this.axios, this.basePath)); + public redirectOAuthToMobile(options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).redirectOAuthToMobile(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {OAuthApiStartOAuthRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OAuthApi + */ + public startOAuth(requestParameters: OAuthApiStartOAuthRequest, options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).startOAuth(requestParameters.oAuthConfigDto, options).then((request) => request(this.axios, this.basePath)); } /** @@ -12134,8 +12134,8 @@ export class OAuthApi extends BaseAPI { * @throws {RequiredError} * @memberof OAuthApi */ - public unlink(options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).unlink(options).then((request) => request(this.axios, this.basePath)); + public unlinkOAuthAccount(options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).unlinkOAuthAccount(options).then((request) => request(this.axios, this.basePath)); } } @@ -13790,37 +13790,8 @@ export const ServerInfoApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getServerVersion: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/server-info/version`; - // 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; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getStats: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/server-info/stats`; + getServerStatistics: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/server-info/statistics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -13843,6 +13814,35 @@ export const ServerInfoApiAxiosParamCreator = function (configuration?: Configur + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getServerVersion: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/server-info/version`; + // 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; + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -13981,8 +13981,8 @@ export const ServerInfoApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getServerVersion(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getServerVersion(options); + async getServerStatistics(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getServerStatistics(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -13990,8 +13990,8 @@ export const ServerInfoApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getStats(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getStats(options); + async getServerVersion(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getServerVersion(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -14060,16 +14060,16 @@ export const ServerInfoApiFactory = function (configuration?: Configuration, bas * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getServerVersion(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getServerVersion(options).then((request) => request(axios, basePath)); + getServerStatistics(options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getServerStatistics(options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getStats(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getStats(options).then((request) => request(axios, basePath)); + getServerVersion(options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getServerVersion(options).then((request) => request(axios, basePath)); }, /** * @@ -14141,8 +14141,8 @@ export class ServerInfoApi extends BaseAPI { * @throws {RequiredError} * @memberof ServerInfoApi */ - public getServerVersion(options?: AxiosRequestConfig) { - return ServerInfoApiFp(this.configuration).getServerVersion(options).then((request) => request(this.axios, this.basePath)); + public getServerStatistics(options?: AxiosRequestConfig) { + return ServerInfoApiFp(this.configuration).getServerStatistics(options).then((request) => request(this.axios, this.basePath)); } /** @@ -14151,8 +14151,8 @@ export class ServerInfoApi extends BaseAPI { * @throws {RequiredError} * @memberof ServerInfoApi */ - public getStats(options?: AxiosRequestConfig) { - return ServerInfoApiFp(this.configuration).getStats(options).then((request) => request(this.axios, this.basePath)); + public getServerVersion(options?: AxiosRequestConfig) { + return ServerInfoApiFp(this.configuration).getServerVersion(options).then((request) => request(this.axios, this.basePath)); } /** @@ -15038,7 +15038,7 @@ export const SystemConfigApiAxiosParamCreator = function (configuration?: Config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getDefaults: async (options: AxiosRequestConfig = {}): Promise => { + getConfigDefaults: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/system-config/defaults`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -15177,8 +15177,8 @@ export const SystemConfigApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getDefaults(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDefaults(options); + async getConfigDefaults(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getConfigDefaults(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -15223,8 +15223,8 @@ export const SystemConfigApiFactory = function (configuration?: Configuration, b * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getDefaults(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getDefaults(options).then((request) => request(axios, basePath)); + getConfigDefaults(options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getConfigDefaults(options).then((request) => request(axios, basePath)); }, /** * @@ -15283,8 +15283,8 @@ export class SystemConfigApi extends BaseAPI { * @throws {RequiredError} * @memberof SystemConfigApi */ - public getDefaults(options?: AxiosRequestConfig) { - return SystemConfigApiFp(this.configuration).getDefaults(options).then((request) => request(this.axios, this.basePath)); + public getConfigDefaults(options?: AxiosRequestConfig) { + return SystemConfigApiFp(this.configuration).getConfigDefaults(options).then((request) => request(this.axios, this.basePath)); } /** diff --git a/mobile/lib/modules/login/services/oauth.service.dart b/mobile/lib/modules/login/services/oauth.service.dart index e8b516d35..e7fd43344 100644 --- a/mobile/lib/modules/login/services/oauth.service.dart +++ b/mobile/lib/modules/login/services/oauth.service.dart @@ -17,7 +17,7 @@ class OAuthService { // Resolve API server endpoint from user provided serverUrl await _apiService.resolveAndSetEndpoint(serverUrl); - return await _apiService.oAuthApi.generateConfig( + return await _apiService.oAuthApi.generateOAuthConfig( OAuthConfigDto(redirectUri: '$callbackUrlScheme:/'), ); } @@ -29,7 +29,7 @@ class OAuthService { callbackUrlScheme: callbackUrlScheme, ); - return await _apiService.oAuthApi.callback( + return await _apiService.oAuthApi.finishOAuth( OAuthCallbackDto( url: result, ), diff --git a/mobile/lib/modules/login/ui/login_form.dart b/mobile/lib/modules/login/ui/login_form.dart index 7622b0b53..58c7feec2 100644 --- a/mobile/lib/modules/login/ui/login_form.dart +++ b/mobile/lib/modules/login/ui/login_form.dart @@ -65,7 +65,7 @@ class LoginForm extends HookConsumerWidget { isLoadingServer.value = true; final endpoint = await apiService.resolveAndSetEndpoint(serverUrl); - final loginConfig = await apiService.oAuthApi.generateConfig( + final loginConfig = await apiService.oAuthApi.generateOAuthConfig( OAuthConfigDto(redirectUri: serverUrl), ); diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index f4d32ac30fb5acba6a25ca0b4b16f739412f320c..70ef217a50c61fc997e19615ca7cb8d70cdae470 100644 GIT binary patch delta 663 zcmX@Hk@4;(#tm)k%#H<_liS#{!1M?9TVPs-Q<5{eC^fMpH4!NLlEWA(D$fk!TXUMj zRI#O}mVku%I8E4r26?Ae7EhMv6oU!h=Y;8$nfta`1kZUR{e{x1@a<)@xPIhQP zPJUv_eMT#dEiVIJ! z6YkwyAd=2BSzJV7@&_@l$<`vKo6m|dvTe4Poz28uoSB{%THu(Ho0&J+S5^+pFD*y} z^O{lw?U>ZkGV?NvGyEM(OER>yVl`6ollAq% zJfKJQa#NHc@{^-gBqyIzQDFs3O@61M%$lDF)G}F6)xr>>JUKbPG_M4!89AAG*N%}>hANyTaeOeNTulKfn-%E|jx%~XKlR0J^q zt46Ri(D`OUrFkHCAUk&QZ&hg?bcb!$Qd_{r6^sb|i#p1j@W_~~s3V0OH3@o>lVfx^ wC!f;E+dNa(n^nL$KQApa-6b_Gu{5WoSW9biVSw=DdSfoOWU$0$ZsWbG0N{G+xc~qF delta 484 zcmYk0NlU{(6vs)rrh--)D=l^*CI!U`Qcy%(s^Uci7kc!NCes=_CN&FEQM?HrM9KpZ zyz~Qju#N{o#G`%&!GlLXfXhX28rQ?{=J%Wbd-EPInENJkz8`>tz&gAJ9z64?22Whn zub4=-5xfL*ze+_IQMJI0e5;tJLeor$hZ`;dkMw+Szwu6|s?rHG(U;yy_xCRrpviTU zt&rvGC_1=OsA5A_XV#EXfkw2;b&l&4*VV&3848biU^5~x7BGAS&LW5GbPbN90$Z%X zRdkY!@@1AV-EY1&S>4d|6|Jlns<4+xez8T_slr`qoV@p(vc#KyWABtcvk}v@6D7Fp~%>w4o@|rR!4HA1q2d9E&2{ioJft z&`VkwT8fd9tsG2AUdjXQ8%9yXXc?)Ri4?o_^sUSvbuA719UW`B`@zqZ&LSt7h954o oy2qAn$Y)b-JsOC6t(K@~lSCMt_XTHBNp`SpK{%Hpjogj&38km2L;wH) diff --git a/mobile/openapi/doc/APIKeyApi.md b/mobile/openapi/doc/APIKeyApi.md index 807cb5317ebe35546fb9fb476364c9fa9b34ed87..69b0917bb2e6129dde631fd6aeecb3c00e5fb959 100644 GIT binary patch delta 373 zcmbQ||HFU6U1rCE%!zlUm=l52cU2H?vJ4}bJK2m;6U>ii6bDI9E@M;!^XD*1fcaY( zRkeZYy;Cc-v|=?J13ZB&AYU&xMY*&fC9xzGs3|+OQd6NuK}#zjbaEr3C_fjMGLVy8 zlnRsvs+}y)1U7TCE7N=yu;EYGvcU93zK+e;*p-XwqsZj>jQo=~GD=K7 z!w6PaT9A?mR42%!GueSjZF45me3r@F>{-m-K;`RX6(;wHrEcO-X5s_#wY0eG6d>kq zt`*E>nY@Hgm<=edk(n~tklk+bKRz}jZGD?}@GoMVd{JJC8E89DLl4Vj9xAC*jL7*-tid^D0>tCZKwS&0pjnvP{0Ak_T6tquRp+0HvEzt^fc4 diff --git a/mobile/openapi/doc/AssetApi.md b/mobile/openapi/doc/AssetApi.md index d606e540f7eb119376c5bfba7e34efe05832e8b2..cf50f659df667ea15bf63a2e70f7fbb58bd386e8 100644 GIT binary patch delta 339 zcmdnl!E(BTWx_SRe%TYi4mtX7c0&W+{%6#1aVSAe+eK=gfJVSFrqMoSeuk%vF+^o0?RboSj-S`5~+D z)IyYRp6Zbl8vy!qnXj5Gi`p@r=L delta 291 zcmX@z!LqZ1Wx_SRq|%)1(1M)!X@)Z}a}tym4m;^Nd2$AV0~+!SSybSYRm86>@# zg>e(pr*p rO#Y}V#-o5FI{A$DaTL?$=_I4@4MkcvPt-lixOqA=v&QByeJ6GR*wirS diff --git a/mobile/openapi/doc/LibraryApi.md b/mobile/openapi/doc/LibraryApi.md index 2362dfaeaccae5bd29465863e462160d44e9885c..5ecd46503a64870f41528359a7e2d967bc06f220 100644 GIT binary patch delta 110 zcmcc7z<8;FaYGTKx=&_OQDRYMYO$79tOkTr=~$4dmz$!To?4OvlifU<@rS@QgNQKe%+re1D}a(Ze>Vopw4eo-k< vdh<-i9|Bwm<&$R#DRLvY8k-Xh`~G+B#q{$K>Sv z(!3Hatym2RzaUdDH$^!oGcOygG7%y_`5dFXRZ(h6W>IQ#30PrBzHfd~W=<-)PM9LF z?vngmu%gM5Oq#64C5c5PK&L?&e>F`?^Fa3Ca|c8Pic8{{RJbAD1Z$jJ$R>uu?`OM( z!Y^b`MByjMDom~uKCpQgM>QifTuiyNAgs;tTp}>RcrLNYYnlCd(^KM<7c}D^>%{a4g8w%S};+%T9J@(o{%J%*jbgOwLAE z1rwk6M|-jkqugYFMr{#vH947i*^`$s%IoCjCuQcO2BoHC7NsVapeuvO7C~hv|7X;c zDa`}vMOO$BoxFreg%jb(Tv24+G|}rwaz$b(NIVCY36no?glyg~-oU5^bHA1rmz{!7 zetKqJP-<~OeqM2^OG!T5*OR|6-Qs{Lojiv>5y5#N*1h=x%LT^COWCwGUttqrocxwO zcXK>PGSlQhNl_NC-@h>VZg$`fU;*k(oeb14`2tJm=C=Y{85Pk(1n3Asf!v+ns^RnTSHwedW J?w4E72mq`Zz+3zaH_Sdl-qs4TSzE>t}E0JH68PA)MPBxUjJ3CLDG6inO9D7lAmaz7jE=G6ic L%$xU0ac}|vAo?}Z delta 98 zcmeD2IO@LP72{-orf`;$#FFC43m7FKj7DZj)?$#*=Gjcze4F2hOE5D7xs%TeC_)q{ kO4x3;5fo&B@a*`az|s%d(>H62?O~j}j7em(g!C5<0Kxwv2mk;8 diff --git a/mobile/openapi/doc/SystemConfigApi.md b/mobile/openapi/doc/SystemConfigApi.md index 5767f7bb5c16a4a3c0cd25c77285436774527d44..9377b6e0bb8c3a459fbe1527ef8a829480ec84b1 100644 GIT binary patch delta 81 zcmexiH^+X179*Q;eqLH;`eZFerAdrzn|&C6u=7ELTvF2#OLIz!C&x0$u|qkVCkh0x Rz_je-ojml8aIkOHwzNvAQvDzR0tLadI-(W3Yk; zJd$7qDXBTBC8?9=@GqaN!?OserXOMeL|$t19R62Kn>&RJnI`WQ(cS!3WC!!)i#$@3 b&q(V}{>d|MbHAhx)8u{9QJbY@W-$Q(_T@4q diff --git a/mobile/openapi/lib/api/asset_api.dart b/mobile/openapi/lib/api/asset_api.dart index 866d11a37378b22f6c981cacbb0c2da26e40ade0..b0e9c822d2f686239fc81c3993ac0966618d66c0 100644 GIT binary patch delta 156 zcmeA@%{=Wi^M*Pm{^X3*mgFtb>rdU8OZ*byaz``;4am2I9 b*^{^?KM&yD{3voR^JIx`-px}we#QU*;eI^n delta 167 zcmbPsnz{Eh^M*Pm{-n~J?9hUo{KORJjMU`p&Am*z%mQeF8k6;y#3w&wwL@1u+5V)& zWJ@NV&0iMiGi`3g2O9j#^T8z?cFDDcql$O&xL1my~`%9$rC!b tH@j4=V`Orw-2ADUg#$=W{?_~q#J$t9g?X}WD92_?e{Su~vpasr007e~L6`sl diff --git a/mobile/openapi/lib/api/authentication_api.dart b/mobile/openapi/lib/api/authentication_api.dart index 5035d51558e5d476e3b3e174db29ad82f87707d1..3b986d34d2b1ea54df6a9dcceb80497a48ddec3d 100644 GIT binary patch delta 71 zcmcZ}bv!I|lKp#_^&lvXk!3rsdpQl8w$Dvm6+Sypu?)8^}p MJLETCQ*UGi0Cj8~CjbBd diff --git a/mobile/openapi/lib/api/library_api.dart b/mobile/openapi/lib/api/library_api.dart index ec08a646de3a0b81b66fd5c465addb690e15da4e..a5273dbb0bb00307fc3cea9e3495deac2e863a51 100644 GIT binary patch delta 53 zcmaDB^EhV16rRZqLTt>Lsl}V;@#rye`D7*)B^Cj>8j~B&9knR%JT8I$9gBsTx#SkJ@_;rlz5mSjve6f>N>PDmW4rjb=* zv#X>D(`I)*ZAMnGlFdc@oXimB z%@@eY%*#erzKO@3X>z6XR?(u=l+2>k!%Q%j)y$^0zpljkz4fYlykhUlHZq{UXNY0Xv31pr>?D5L-Y delta 87 zcmcb`v4>;BYsSg%7#$`XGFeZ~XVL=FCX+8Pi38ax%;~8mV7>>lEUR~FWwFL&K_+o_ hpeTqlc|MaXTWLW`VoB=cJIvldg<5R2n$}#kTmb!98=3$B diff --git a/mobile/openapi/test/asset_api_test.dart b/mobile/openapi/test/asset_api_test.dart index c2a07323c51b61947d8f17cbb08e5366fc8b68a0..453982cf1e7bab2347de8326b98bd14cc2f8d14d 100644 GIT binary patch delta 109 zcmZqD>(JXE!^EGQk(!+CRGO0=T9A{Um@-+L$sJv6b0gD3R*uZ#lFZ~{jq1rC`3xsd y<4|P<3rya~Z9MrM$HvVkxpp&8p3f;Zc|IT4dE(b4JXg$P@Q~< pO=q$J7yINN92+NVu!%7_RZgzrJrANh`5ZT|EPM$iHX}WC&w+nD6}}WNMmw6lQ?gBY6(JUvpn;2CICR_4)Op1 diff --git a/mobile/openapi/test/o_auth_api_test.dart b/mobile/openapi/test/o_auth_api_test.dart index 7a3ee0a9fbdd804d971212f5a157e05f5c6a1603..52326d423f6a4f98ad3a22a1c43529fa05f8a06c 100644 GIT binary patch delta 248 zcmbQk^@wZ3Nyf?POhVjgnR%JT8UBu?B^i?&nJn2L{K*DP29w`1Ww1gdLYbYp!7S(e zytK^p$?sXzC$DFb5y;8R%La=(CMV~Y=9PdhA zNu7L=MM4z23`8UMgXMJ1EpGFm}d22AFYFE9%Vmgb>3Vsavjq!5N^3DC{D E0PFKxC;$Ke delta 179 zcmaFFHHT}%Nyf=REYf_5r6n2pMVVEp{*FM_7lri}blk;RQW?zsbOHO89_GAHOLsNy^{G`mB)S%Rq%%arf5)Dm- r#Nx`lWG)3DC`m0Y(NG7GXsUoZo!LtBz=m+M$^p6RY_*!!T(w*PaoRk2 diff --git a/mobile/openapi/test/server_info_api_test.dart b/mobile/openapi/test/server_info_api_test.dart index f431f521b06c68b708e57d1b25579aaeef95295d..dac465116eb42c185c525ec1eee5ca4a399c6078 100644 GIT binary patch delta 57 zcmZ3@eUN)YAoJv_%wl}0MP;c)!6k_$nZ+fU$&=qP%T5+xX5~bPEM&2q9LU_V*_|bY F5ddJA6g~g| delta 37 scmX@ey_$PNAoJv#%q^1xnZ;O25=)9F|7Dh81~MiuV7A;G%aXzf00rX>8UO$Q diff --git a/mobile/openapi/test/system_config_api_test.dart b/mobile/openapi/test/system_config_api_test.dart index 6cb7aa79d1d26c710984e02ec9a34c1f138337a2..b8e57aaaee0719caae28173b50f3180efb579cb3 100644 GIT binary patch delta 46 ycmaFO{+)e8JQJI9eqLH;`s8>fWj+YgB{eOvG^eC^@;+wu$qr27n@=z)GXemM`Vbia delta 16 Xcmey){+fM5Jk#V { }); }); - describe('getByTimeBucket', () => { + describe('getTimeBucket', () => { it('should return the assets for a album time bucket if user has album.read', async () => { accessMock.album.hasOwnerAccess.mockResolvedValue(true); - assetMock.getByTimeBucket.mockResolvedValue([assetStub.image]); + assetMock.getTimeBucket.mockResolvedValue([assetStub.image]); await expect( - sut.getByTimeBucket(authStub.admin, { size: TimeBucketSize.DAY, timeBucket: 'bucket', albumId: 'album-id' }), + sut.getTimeBucket(authStub.admin, { size: TimeBucketSize.DAY, timeBucket: 'bucket', albumId: 'album-id' }), ).resolves.toEqual(expect.arrayContaining([expect.objectContaining({ id: 'asset-id' })])); expect(accessMock.album.hasOwnerAccess).toHaveBeenCalledWith(authStub.admin.id, 'album-id'); - expect(assetMock.getByTimeBucket).toBeCalledWith('bucket', { + expect(assetMock.getTimeBucket).toBeCalledWith('bucket', { size: TimeBucketSize.DAY, timeBucket: 'bucket', albumId: 'album-id', @@ -349,17 +349,17 @@ describe(AssetService.name, () => { }); it('should return the assets for a archive time bucket if user has archive.read', async () => { - assetMock.getByTimeBucket.mockResolvedValue([assetStub.image]); + assetMock.getTimeBucket.mockResolvedValue([assetStub.image]); await expect( - sut.getByTimeBucket(authStub.admin, { + sut.getTimeBucket(authStub.admin, { size: TimeBucketSize.DAY, timeBucket: 'bucket', isArchived: true, userId: authStub.admin.id, }), ).resolves.toEqual(expect.arrayContaining([expect.objectContaining({ id: 'asset-id' })])); - expect(assetMock.getByTimeBucket).toBeCalledWith('bucket', { + expect(assetMock.getTimeBucket).toBeCalledWith('bucket', { size: TimeBucketSize.DAY, timeBucket: 'bucket', isArchived: true, @@ -368,16 +368,16 @@ describe(AssetService.name, () => { }); it('should return the assets for a library time bucket if user has library.read', async () => { - assetMock.getByTimeBucket.mockResolvedValue([assetStub.image]); + assetMock.getTimeBucket.mockResolvedValue([assetStub.image]); await expect( - sut.getByTimeBucket(authStub.admin, { + sut.getTimeBucket(authStub.admin, { size: TimeBucketSize.DAY, timeBucket: 'bucket', userId: authStub.admin.id, }), ).resolves.toEqual(expect.arrayContaining([expect.objectContaining({ id: 'asset-id' })])); - expect(assetMock.getByTimeBucket).toBeCalledWith('bucket', { + expect(assetMock.getTimeBucket).toBeCalledWith('bucket', { size: TimeBucketSize.DAY, timeBucket: 'bucket', userId: authStub.admin.id, diff --git a/server/src/domain/asset/asset.service.ts b/server/src/domain/asset/asset.service.ts index 9b6322dac..34da78680 100644 --- a/server/src/domain/asset/asset.service.ts +++ b/server/src/domain/asset/asset.service.ts @@ -194,12 +194,12 @@ export class AssetService { return this.assetRepository.getTimeBuckets(dto); } - async getByTimeBucket( + async getTimeBucket( authUser: AuthUserDto, dto: TimeBucketAssetDto, ): Promise { await this.timeBucketChecks(authUser, dto); - const assets = await this.assetRepository.getByTimeBucket(dto.timeBucket, dto); + const assets = await this.assetRepository.getTimeBucket(dto.timeBucket, dto); if (authUser.isShowMetadata) { return assets.map((asset) => mapAsset(asset, { withStack: true })); } else { diff --git a/server/src/domain/auth/auth.service.ts b/server/src/domain/auth/auth.service.ts index 5b65909fa..289f50bfb 100644 --- a/server/src/domain/auth/auth.service.ts +++ b/server/src/domain/auth/auth.service.ts @@ -315,13 +315,8 @@ export class AuthService { const redirectUri = this.normalize(config, url.split('?')[0]); const client = await this.getOAuthClient(config); const params = client.callbackParams(url); - try { - const tokens = await client.callback(redirectUri, params, { state: params.state }); - return client.userinfo(tokens.access_token || ''); - } catch (error: Error | any) { - this.logger.error(`Unable to complete OAuth login: ${error}`, error?.stack); - throw new InternalServerErrorException(`Unable to complete OAuth login: ${error}`, { cause: error }); - } + const tokens = await client.callback(redirectUri, params, { state: params.state }); + return client.userinfo(tokens.access_token || ''); } private async getOAuthClient(config: SystemConfig) { diff --git a/server/src/domain/repositories/asset.repository.ts b/server/src/domain/repositories/asset.repository.ts index 086b9ba1a..bdbdd78f2 100644 --- a/server/src/domain/repositories/asset.repository.ts +++ b/server/src/domain/repositories/asset.repository.ts @@ -123,6 +123,6 @@ export interface IAssetRepository { getMapMarkers(ownerId: string, options?: MapMarkerSearchOptions): Promise; getStatistics(ownerId: string, options: AssetStatsOptions): Promise; getTimeBuckets(options: TimeBucketOptions): Promise; - getByTimeBucket(timeBucket: string, options: TimeBucketOptions): Promise; + getTimeBucket(timeBucket: string, options: TimeBucketOptions): Promise; upsertExif(exif: Partial): Promise; } diff --git a/server/src/domain/server-info/server-info.service.spec.ts b/server/src/domain/server-info/server-info.service.spec.ts index 4f6b24680..f4025a331 100644 --- a/server/src/domain/server-info/server-info.service.spec.ts +++ b/server/src/domain/server-info/server-info.service.spec.ts @@ -220,7 +220,7 @@ describe(ServerInfoService.name, () => { }, ]); - await expect(sut.getStats()).resolves.toEqual({ + await expect(sut.getStatistics()).resolves.toEqual({ photos: 120, videos: 31, usage: 1123455, diff --git a/server/src/domain/server-info/server-info.service.ts b/server/src/domain/server-info/server-info.service.ts index f2d312343..dc2efd416 100644 --- a/server/src/domain/server-info/server-info.service.ts +++ b/server/src/domain/server-info/server-info.service.ts @@ -92,7 +92,7 @@ export class ServerInfoService { }; } - async getStats(): Promise { + async getStatistics(): Promise { const userStats: UserStatsQueryResponse[] = await this.userRepository.getUserStats(); const serverStats = new ServerStatsResponseDto(); diff --git a/server/src/domain/user/user.core.ts b/server/src/domain/user/user.core.ts index 2d1d46838..431caa8e1 100644 --- a/server/src/domain/user/user.core.ts +++ b/server/src/domain/user/user.core.ts @@ -1,5 +1,5 @@ import { LibraryType, UserEntity } from '@app/infra/entities'; -import { BadRequestException, ForbiddenException, InternalServerErrorException, Logger } from '@nestjs/common'; +import { BadRequestException, ForbiddenException } from '@nestjs/common'; import path from 'path'; import sanitize from 'sanitize-filename'; import { AuthUserDto } from '../auth'; @@ -61,26 +61,21 @@ export class UserCore { } } - try { - if (dto.password) { - dto.password = await this.cryptoRepository.hashBcrypt(dto.password, SALT_ROUNDS); - } - - if (dto.storageLabel === '') { - dto.storageLabel = null; - } - - if (dto.externalPath === '') { - dto.externalPath = null; - } else if (dto.externalPath) { - dto.externalPath = path.normalize(dto.externalPath); - } - - return this.userRepository.update(id, dto); - } catch (e) { - Logger.error(e, 'Failed to update user info'); - throw new InternalServerErrorException('Failed to update user info'); + if (dto.password) { + dto.password = await this.cryptoRepository.hashBcrypt(dto.password, SALT_ROUNDS); } + + if (dto.storageLabel === '') { + dto.storageLabel = null; + } + + if (dto.externalPath === '') { + dto.externalPath = null; + } else if (dto.externalPath) { + dto.externalPath = path.normalize(dto.externalPath); + } + + return this.userRepository.update(id, dto); } async createUser(dto: Partial & { email: string }): Promise { @@ -96,30 +91,25 @@ export class UserCore { } } - try { - const payload: Partial = { ...dto }; - if (payload.password) { - payload.password = await this.cryptoRepository.hashBcrypt(payload.password, SALT_ROUNDS); - } - if (payload.storageLabel) { - payload.storageLabel = sanitize(payload.storageLabel); - } - - const userEntity = await this.userRepository.create(payload); - await this.libraryRepository.create({ - owner: { id: userEntity.id } as UserEntity, - name: 'Default Library', - assets: [], - type: LibraryType.UPLOAD, - importPaths: [], - exclusionPatterns: [], - isVisible: true, - }); - - return userEntity; - } catch (e) { - Logger.error(e, 'Create new user'); - throw new InternalServerErrorException('Failed to register new user'); + const payload: Partial = { ...dto }; + if (payload.password) { + payload.password = await this.cryptoRepository.hashBcrypt(payload.password, SALT_ROUNDS); } + if (payload.storageLabel) { + payload.storageLabel = sanitize(payload.storageLabel); + } + + const userEntity = await this.userRepository.create(payload); + await this.libraryRepository.create({ + owner: { id: userEntity.id } as UserEntity, + name: 'Default Library', + assets: [], + type: LibraryType.UPLOAD, + importPaths: [], + exclusionPatterns: [], + isVisible: true, + }); + + return userEntity; } } diff --git a/server/src/immich/api-v1/asset/asset.controller.ts b/server/src/immich/api-v1/asset/asset.controller.ts index ed50e3bec..24127e873 100644 --- a/server/src/immich/api-v1/asset/asset.controller.ts +++ b/server/src/immich/api-v1/asset/asset.controller.ts @@ -17,8 +17,8 @@ import { import { ApiBody, ApiConsumes, ApiHeader, ApiOkResponse, ApiTags } from '@nestjs/swagger'; import { Response as Res } from 'express'; import { AuthUser, Authenticated, SharedLinkRoute } from '../../app.guard'; -import { FileUploadInterceptor, ImmichFile, Route, mapToUploadFile } from '../../app.interceptor'; import { UUIDParamDto } from '../../controllers/dto/uuid-param.dto'; +import { FileUploadInterceptor, ImmichFile, Route, mapToUploadFile } from '../../interceptors'; import FileNotEmptyValidator from '../validation/file-not-empty-validator'; import { AssetService } from './asset.service'; import { AssetBulkUploadCheckDto } from './dto/asset-check.dto'; @@ -204,7 +204,7 @@ export class AssetController { */ @Post('/bulk-upload-check') @HttpCode(HttpStatus.OK) - bulkUploadCheck( + checkBulkUpload( @AuthUser() authUser: AuthUserDto, @Body(ValidationPipe) dto: AssetBulkUploadCheckDto, ): Promise { diff --git a/server/src/immich/app.module.ts b/server/src/immich/app.module.ts index cf537c6b9..cf95eb236 100644 --- a/server/src/immich/app.module.ts +++ b/server/src/immich/app.module.ts @@ -2,14 +2,13 @@ import { DomainModule } from '@app/domain'; import { InfraModule } from '@app/infra'; import { AssetEntity } from '@app/infra/entities'; import { Module, OnModuleDestroy, OnModuleInit } from '@nestjs/common'; -import { APP_GUARD } from '@nestjs/core'; +import { APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core'; import { ScheduleModule } from '@nestjs/schedule'; import { TypeOrmModule } from '@nestjs/typeorm'; import { AssetRepository, IAssetRepository } from './api-v1/asset/asset-repository'; import { AssetController as AssetControllerV1 } from './api-v1/asset/asset.controller'; import { AssetService } from './api-v1/asset/asset.service'; import { AppGuard } from './app.guard'; -import { FileUploadInterceptor } from './app.interceptor'; import { AppService } from './app.service'; import { APIKeyController, @@ -31,6 +30,7 @@ import { TagController, UserController, } from './controllers'; +import { ErrorInterceptor, FileUploadInterceptor } from './interceptors'; @Module({ imports: [ @@ -61,10 +61,9 @@ import { PersonController, ], providers: [ - // - { provide: APP_GUARD, useExisting: AppGuard }, + { provide: APP_INTERCEPTOR, useClass: ErrorInterceptor }, + { provide: APP_GUARD, useClass: AppGuard }, { provide: IAssetRepository, useClass: AssetRepository }, - AppGuard, AppService, AssetService, FileUploadInterceptor, diff --git a/server/src/immich/app.utils.ts b/server/src/immich/app.utils.ts index 1a27b6f30..a7584cb1a 100644 --- a/server/src/immich/app.utils.ts +++ b/server/src/immich/app.utils.ts @@ -47,6 +47,9 @@ function sortKeys(obj: T): T { return result as T; } +export const routeToErrorMessage = (methodName: string) => + 'Failed to ' + methodName.replace(/[A-Z]+/g, (letter) => ` ${letter.toLowerCase()}`); + const patchOpenAPI = (document: OpenAPIObject) => { document.paths = sortKeys(document.paths); if (document.components?.schemas) { @@ -78,6 +81,10 @@ const patchOpenAPI = (document: OpenAPIObject) => { delete operation.summary; } + if (operation.operationId) { + // console.log(`${routeToErrorMessage(operation.operationId).padEnd(40)} (${operation.operationId})`); + } + if (operation.description === '') { delete operation.description; } diff --git a/server/src/immich/controllers/api-key.controller.ts b/server/src/immich/controllers/api-key.controller.ts index dc995ddf7..10e0394cf 100644 --- a/server/src/immich/controllers/api-key.controller.ts +++ b/server/src/immich/controllers/api-key.controller.ts @@ -20,22 +20,22 @@ export class APIKeyController { constructor(private service: APIKeyService) {} @Post() - createKey(@AuthUser() authUser: AuthUserDto, @Body() dto: APIKeyCreateDto): Promise { + createApiKey(@AuthUser() authUser: AuthUserDto, @Body() dto: APIKeyCreateDto): Promise { return this.service.create(authUser, dto); } @Get() - getKeys(@AuthUser() authUser: AuthUserDto): Promise { + getApiKeys(@AuthUser() authUser: AuthUserDto): Promise { return this.service.getAll(authUser); } @Get(':id') - getKey(@AuthUser() authUser: AuthUserDto, @Param() { id }: UUIDParamDto): Promise { + getApiKey(@AuthUser() authUser: AuthUserDto, @Param() { id }: UUIDParamDto): Promise { return this.service.getById(authUser, id); } @Put(':id') - updateKey( + updateApiKey( @AuthUser() authUser: AuthUserDto, @Param() { id }: UUIDParamDto, @Body() dto: APIKeyUpdateDto, @@ -44,7 +44,7 @@ export class APIKeyController { } @Delete(':id') - deleteKey(@AuthUser() authUser: AuthUserDto, @Param() { id }: UUIDParamDto): Promise { + deleteApiKey(@AuthUser() authUser: AuthUserDto, @Param() { id }: UUIDParamDto): Promise { return this.service.delete(authUser, id); } } diff --git a/server/src/immich/controllers/asset.controller.ts b/server/src/immich/controllers/asset.controller.ts index 6a91bad30..d0f294d1e 100644 --- a/server/src/immich/controllers/asset.controller.ts +++ b/server/src/immich/controllers/asset.controller.ts @@ -39,10 +39,11 @@ import { import { ApiOkResponse, ApiTags } from '@nestjs/swagger'; import { AuthUser, Authenticated, SharedLinkRoute } from '../app.guard'; import { UseValidation, asStreamableFile } from '../app.utils'; +import { Route } from '../interceptors'; import { UUIDParamDto } from './dto/uuid-param.dto'; @ApiTags('Asset') -@Controller('asset') +@Controller(Route.ASSET) @Authenticated() @UseValidation() export class AssetController { @@ -86,7 +87,7 @@ export class AssetController { } @Get('statistics') - getAssetStats(@AuthUser() authUser: AuthUserDto, @Query() dto: AssetStatsDto): Promise { + getAssetStatistics(@AuthUser() authUser: AuthUserDto, @Query() dto: AssetStatsDto): Promise { return this.service.getStatistics(authUser, dto); } @@ -98,8 +99,8 @@ export class AssetController { @Authenticated({ isShared: true }) @Get('time-bucket') - getByTimeBucket(@AuthUser() authUser: AuthUserDto, @Query() dto: TimeBucketAssetDto): Promise { - return this.service.getByTimeBucket(authUser, dto) as Promise; + getTimeBucket(@AuthUser() authUser: AuthUserDto, @Query() dto: TimeBucketAssetDto): Promise { + return this.service.getTimeBucket(authUser, dto) as Promise; } @Post('jobs') diff --git a/server/src/immich/controllers/auth.controller.ts b/server/src/immich/controllers/auth.controller.ts index 2124cc8b8..83e4b5145 100644 --- a/server/src/immich/controllers/auth.controller.ts +++ b/server/src/immich/controllers/auth.controller.ts @@ -43,7 +43,7 @@ export class AuthController { @PublicRoute() @Post('admin-sign-up') @ApiBadRequestResponse({ description: 'The server already has an admin' }) - adminSignUp(@Body() signUpCredential: SignUpDto): Promise { + signUpAdmin(@Body() signUpCredential: SignUpDto): Promise { return this.service.adminSignUp(signUpCredential); } diff --git a/server/src/immich/controllers/library.controller.ts b/server/src/immich/controllers/library.controller.ts index 23b1ec7fc..ad1676ee0 100644 --- a/server/src/immich/controllers/library.controller.ts +++ b/server/src/immich/controllers/library.controller.ts @@ -21,7 +21,7 @@ export class LibraryController { constructor(private service: LibraryService) {} @Get() - getAllForUser(@AuthUser() authUser: AuthUserDto): Promise { + getLibraries(@AuthUser() authUser: AuthUserDto): Promise { return this.service.getAllForUser(authUser); } diff --git a/server/src/immich/controllers/oauth.controller.ts b/server/src/immich/controllers/oauth.controller.ts index 176ce62bc..a55cc03ce 100644 --- a/server/src/immich/controllers/oauth.controller.ts +++ b/server/src/immich/controllers/oauth.controller.ts @@ -25,7 +25,7 @@ export class OAuthController { @PublicRoute() @Get('mobile-redirect') @Redirect() - mobileRedirect(@Req() req: Request) { + redirectOAuthToMobile(@Req() req: Request) { return { url: this.service.getMobileRedirect(req.url), statusCode: HttpStatus.TEMPORARY_REDIRECT, @@ -35,19 +35,19 @@ export class OAuthController { /** @deprecated use feature flags and /oauth/authorize */ @PublicRoute() @Post('config') - generateConfig(@Body() dto: OAuthConfigDto): Promise { + generateOAuthConfig(@Body() dto: OAuthConfigDto): Promise { return this.service.generateConfig(dto); } @PublicRoute() @Post('authorize') - authorizeOAuth(@Body() dto: OAuthConfigDto): Promise { + startOAuth(@Body() dto: OAuthConfigDto): Promise { return this.service.authorize(dto); } @PublicRoute() @Post('callback') - async callback( + async finishOAuth( @Res({ passthrough: true }) res: Response, @Body() dto: OAuthCallbackDto, @GetLoginDetails() loginDetails: LoginDetails, @@ -58,12 +58,12 @@ export class OAuthController { } @Post('link') - link(@AuthUser() authUser: AuthUserDto, @Body() dto: OAuthCallbackDto): Promise { + linkOAuthAccount(@AuthUser() authUser: AuthUserDto, @Body() dto: OAuthCallbackDto): Promise { return this.service.link(authUser, dto); } @Post('unlink') - unlink(@AuthUser() authUser: AuthUserDto): Promise { + unlinkOAuthAccount(@AuthUser() authUser: AuthUserDto): Promise { return this.service.unlink(authUser); } } diff --git a/server/src/immich/controllers/server-info.controller.ts b/server/src/immich/controllers/server-info.controller.ts index 7355583ac..52e9ea8d2 100644 --- a/server/src/immich/controllers/server-info.controller.ts +++ b/server/src/immich/controllers/server-info.controller.ts @@ -57,9 +57,9 @@ export class ServerInfoController { } @AdminRoute() - @Get('stats') - getStats(): Promise { - return this.service.getStats(); + @Get('statistics') + getServerStatistics(): Promise { + return this.service.getStatistics(); } @PublicRoute() diff --git a/server/src/immich/controllers/system-config.controller.ts b/server/src/immich/controllers/system-config.controller.ts index 646c9a629..aa44c7acd 100644 --- a/server/src/immich/controllers/system-config.controller.ts +++ b/server/src/immich/controllers/system-config.controller.ts @@ -17,7 +17,7 @@ export class SystemConfigController { } @Get('defaults') - getDefaults(): SystemConfigDto { + getConfigDefaults(): SystemConfigDto { return this.service.getDefaults(); } diff --git a/server/src/immich/controllers/user.controller.ts b/server/src/immich/controllers/user.controller.ts index 7ca8b1c6e..92b3fdcc0 100644 --- a/server/src/immich/controllers/user.controller.ts +++ b/server/src/immich/controllers/user.controller.ts @@ -22,8 +22,8 @@ import { } from '@nestjs/common'; import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger'; import { AdminRoute, AuthUser, Authenticated } from '../app.guard'; -import { FileUploadInterceptor, Route } from '../app.interceptor'; import { UseValidation, asStreamableFile } from '../app.utils'; +import { FileUploadInterceptor, Route } from '../interceptors'; import { UUIDParamDto } from './dto/uuid-param.dto'; @ApiTags('User') diff --git a/server/src/immich/interceptors/error.interceptor.ts b/server/src/immich/interceptors/error.interceptor.ts new file mode 100644 index 000000000..5e18684fd --- /dev/null +++ b/server/src/immich/interceptors/error.interceptor.ts @@ -0,0 +1,32 @@ +import { + CallHandler, + ExecutionContext, + HttpException, + Injectable, + InternalServerErrorException, + Logger, + NestInterceptor, +} from '@nestjs/common'; +import { Observable, catchError, throwError } from 'rxjs'; +import { routeToErrorMessage } from '../app.utils'; + +@Injectable() +export class ErrorInterceptor implements NestInterceptor { + private logger = new Logger(ErrorInterceptor.name); + + async intercept(context: ExecutionContext, next: CallHandler): Promise> { + return next.handle().pipe( + catchError((error) => + throwError(() => { + if (error instanceof HttpException === false) { + const errorMessage = routeToErrorMessage(context.getHandler().name); + this.logger.error(errorMessage, error, error?.errors); + return new InternalServerErrorException(errorMessage); + } else { + return error; + } + }), + ), + ); + } +} diff --git a/server/src/immich/app.interceptor.ts b/server/src/immich/interceptors/file.interceptor.ts similarity index 99% rename from server/src/immich/app.interceptor.ts rename to server/src/immich/interceptors/file.interceptor.ts index 67a09ca73..7388df457 100644 --- a/server/src/immich/app.interceptor.ts +++ b/server/src/immich/interceptors/file.interceptor.ts @@ -7,7 +7,7 @@ import { createHash } from 'crypto'; import { NextFunction, RequestHandler } from 'express'; import multer, { StorageEngine, diskStorage } from 'multer'; import { Observable } from 'rxjs'; -import { AuthRequest } from './app.guard'; +import { AuthRequest } from '../app.guard'; export enum Route { ASSET = 'asset', diff --git a/server/src/immich/interceptors/index.ts b/server/src/immich/interceptors/index.ts new file mode 100644 index 000000000..27c858aba --- /dev/null +++ b/server/src/immich/interceptors/index.ts @@ -0,0 +1,2 @@ +export * from './error.interceptor'; +export * from './file.interceptor'; diff --git a/server/src/infra/repositories/asset.repository.ts b/server/src/infra/repositories/asset.repository.ts index 4947c0d76..c237a3604 100644 --- a/server/src/infra/repositories/asset.repository.ts +++ b/server/src/infra/repositories/asset.repository.ts @@ -493,7 +493,7 @@ export class AssetRepository implements IAssetRepository { .getRawMany(); } - getByTimeBucket(timeBucket: string, options: TimeBucketOptions): Promise { + getTimeBucket(timeBucket: string, options: TimeBucketOptions): Promise { const truncated = dateTrunc(options); return ( this.getBuilder(options) diff --git a/server/test/e2e/server-info.e2e-spec.ts b/server/test/e2e/server-info.e2e-spec.ts index a19c6235e..33b7c5693 100644 --- a/server/test/e2e/server-info.e2e-spec.ts +++ b/server/test/e2e/server-info.e2e-spec.ts @@ -103,9 +103,9 @@ describe(`${ServerInfoController.name} (e2e)`, () => { }); }); - describe('GET /server-info/stats', () => { + describe('GET /server-info/statistics', () => { it('should require authentication', async () => { - const { status, body } = await request(server).get('/server-info/stats'); + const { status, body } = await request(server).get('/server-info/statistics'); expect(status).toBe(401); expect(body).toEqual(errorStub.unauthorized); }); @@ -115,7 +115,7 @@ describe(`${ServerInfoController.name} (e2e)`, () => { await api.userApi.create(server, accessToken, { ...loginDto, firstName: 'test', lastName: 'test' }); const { accessToken: userAccessToken } = await api.authApi.login(server, loginDto); const { status, body } = await request(server) - .get('/server-info/stats') + .get('/server-info/statistics') .set('Authorization', `Bearer ${userAccessToken}`); expect(status).toBe(403); expect(body).toEqual(errorStub.forbidden); @@ -123,7 +123,7 @@ describe(`${ServerInfoController.name} (e2e)`, () => { it('should return the server stats', async () => { const { status, body } = await request(server) - .get('/server-info/stats') + .get('/server-info/statistics') .set('Authorization', `Bearer ${accessToken}`); expect(status).toBe(200); expect(body).toEqual({ diff --git a/server/test/repositories/asset.repository.mock.ts b/server/test/repositories/asset.repository.mock.ts index 57020001c..c185d3983 100644 --- a/server/test/repositories/asset.repository.mock.ts +++ b/server/test/repositories/asset.repository.mock.ts @@ -26,7 +26,7 @@ export const newAssetRepositoryMock = (): jest.Mocked => { findLivePhotoMatch: jest.fn(), getMapMarkers: jest.fn(), getStatistics: jest.fn(), - getByTimeBucket: jest.fn(), + getTimeBucket: jest.fn(), getTimeBuckets: jest.fn(), restoreAll: jest.fn(), softDeleteAll: jest.fn(), diff --git a/web/src/api/open-api/api.ts b/web/src/api/open-api/api.ts index b00b0deb5..9f4d765f2 100644 --- a/web/src/api/open-api/api.ts +++ b/web/src/api/open-api/api.ts @@ -4528,9 +4528,9 @@ export const APIKeyApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createKey: async (aPIKeyCreateDto: APIKeyCreateDto, options: AxiosRequestConfig = {}): Promise => { + createApiKey: async (aPIKeyCreateDto: APIKeyCreateDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'aPIKeyCreateDto' is not null or undefined - assertParamExists('createKey', 'aPIKeyCreateDto', aPIKeyCreateDto) + assertParamExists('createApiKey', 'aPIKeyCreateDto', aPIKeyCreateDto) const localVarPath = `/api-key`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -4572,9 +4572,9 @@ export const APIKeyApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteKey: async (id: string, options: AxiosRequestConfig = {}): Promise => { + deleteApiKey: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined - assertParamExists('deleteKey', 'id', id) + assertParamExists('deleteApiKey', 'id', id) const localVarPath = `/api-key/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. @@ -4614,9 +4614,9 @@ export const APIKeyApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKey: async (id: string, options: AxiosRequestConfig = {}): Promise => { + getApiKey: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined - assertParamExists('getKey', 'id', id) + assertParamExists('getApiKey', 'id', id) const localVarPath = `/api-key/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. @@ -4655,7 +4655,7 @@ export const APIKeyApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKeys: async (options: AxiosRequestConfig = {}): Promise => { + getApiKeys: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api-key`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -4695,11 +4695,11 @@ export const APIKeyApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateKey: async (id: string, aPIKeyUpdateDto: APIKeyUpdateDto, options: AxiosRequestConfig = {}): Promise => { + updateApiKey: async (id: string, aPIKeyUpdateDto: APIKeyUpdateDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined - assertParamExists('updateKey', 'id', id) + assertParamExists('updateApiKey', 'id', id) // verify required parameter 'aPIKeyUpdateDto' is not null or undefined - assertParamExists('updateKey', 'aPIKeyUpdateDto', aPIKeyUpdateDto) + assertParamExists('updateApiKey', 'aPIKeyUpdateDto', aPIKeyUpdateDto) const localVarPath = `/api-key/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // use dummy base URL string because the URL constructor only accepts absolute URLs. @@ -4752,8 +4752,8 @@ export const APIKeyApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async createKey(aPIKeyCreateDto: APIKeyCreateDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createKey(aPIKeyCreateDto, options); + async createApiKey(aPIKeyCreateDto: APIKeyCreateDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createApiKey(aPIKeyCreateDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -4762,8 +4762,8 @@ export const APIKeyApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deleteKey(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteKey(id, options); + async deleteApiKey(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteApiKey(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -4772,8 +4772,8 @@ export const APIKeyApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getKey(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getKey(id, options); + async getApiKey(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getApiKey(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -4781,8 +4781,8 @@ export const APIKeyApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getKeys(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getKeys(options); + async getApiKeys(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getApiKeys(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -4792,8 +4792,8 @@ export const APIKeyApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async updateKey(id: string, aPIKeyUpdateDto: APIKeyUpdateDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateKey(id, aPIKeyUpdateDto, options); + async updateApiKey(id: string, aPIKeyUpdateDto: APIKeyUpdateDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateApiKey(id, aPIKeyUpdateDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -4808,110 +4808,110 @@ export const APIKeyApiFactory = function (configuration?: Configuration, basePat return { /** * - * @param {APIKeyApiCreateKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiCreateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createKey(requestParameters: APIKeyApiCreateKeyRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.createKey(requestParameters.aPIKeyCreateDto, options).then((request) => request(axios, basePath)); + createApiKey(requestParameters: APIKeyApiCreateApiKeyRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.createApiKey(requestParameters.aPIKeyCreateDto, options).then((request) => request(axios, basePath)); }, /** * - * @param {APIKeyApiDeleteKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiDeleteApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteKey(requestParameters: APIKeyApiDeleteKeyRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.deleteKey(requestParameters.id, options).then((request) => request(axios, basePath)); + deleteApiKey(requestParameters: APIKeyApiDeleteApiKeyRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.deleteApiKey(requestParameters.id, options).then((request) => request(axios, basePath)); }, /** * - * @param {APIKeyApiGetKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiGetApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKey(requestParameters: APIKeyApiGetKeyRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getKey(requestParameters.id, options).then((request) => request(axios, basePath)); + getApiKey(requestParameters: APIKeyApiGetApiKeyRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getApiKey(requestParameters.id, options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKeys(options?: AxiosRequestConfig): AxiosPromise> { - return localVarFp.getKeys(options).then((request) => request(axios, basePath)); + getApiKeys(options?: AxiosRequestConfig): AxiosPromise> { + return localVarFp.getApiKeys(options).then((request) => request(axios, basePath)); }, /** * - * @param {APIKeyApiUpdateKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiUpdateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateKey(requestParameters: APIKeyApiUpdateKeyRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.updateKey(requestParameters.id, requestParameters.aPIKeyUpdateDto, options).then((request) => request(axios, basePath)); + updateApiKey(requestParameters: APIKeyApiUpdateApiKeyRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.updateApiKey(requestParameters.id, requestParameters.aPIKeyUpdateDto, options).then((request) => request(axios, basePath)); }, }; }; /** - * Request parameters for createKey operation in APIKeyApi. + * Request parameters for createApiKey operation in APIKeyApi. * @export - * @interface APIKeyApiCreateKeyRequest + * @interface APIKeyApiCreateApiKeyRequest */ -export interface APIKeyApiCreateKeyRequest { +export interface APIKeyApiCreateApiKeyRequest { /** * * @type {APIKeyCreateDto} - * @memberof APIKeyApiCreateKey + * @memberof APIKeyApiCreateApiKey */ readonly aPIKeyCreateDto: APIKeyCreateDto } /** - * Request parameters for deleteKey operation in APIKeyApi. + * Request parameters for deleteApiKey operation in APIKeyApi. * @export - * @interface APIKeyApiDeleteKeyRequest + * @interface APIKeyApiDeleteApiKeyRequest */ -export interface APIKeyApiDeleteKeyRequest { +export interface APIKeyApiDeleteApiKeyRequest { /** * * @type {string} - * @memberof APIKeyApiDeleteKey + * @memberof APIKeyApiDeleteApiKey */ readonly id: string } /** - * Request parameters for getKey operation in APIKeyApi. + * Request parameters for getApiKey operation in APIKeyApi. * @export - * @interface APIKeyApiGetKeyRequest + * @interface APIKeyApiGetApiKeyRequest */ -export interface APIKeyApiGetKeyRequest { +export interface APIKeyApiGetApiKeyRequest { /** * * @type {string} - * @memberof APIKeyApiGetKey + * @memberof APIKeyApiGetApiKey */ readonly id: string } /** - * Request parameters for updateKey operation in APIKeyApi. + * Request parameters for updateApiKey operation in APIKeyApi. * @export - * @interface APIKeyApiUpdateKeyRequest + * @interface APIKeyApiUpdateApiKeyRequest */ -export interface APIKeyApiUpdateKeyRequest { +export interface APIKeyApiUpdateApiKeyRequest { /** * * @type {string} - * @memberof APIKeyApiUpdateKey + * @memberof APIKeyApiUpdateApiKey */ readonly id: string /** * * @type {APIKeyUpdateDto} - * @memberof APIKeyApiUpdateKey + * @memberof APIKeyApiUpdateApiKey */ readonly aPIKeyUpdateDto: APIKeyUpdateDto } @@ -4925,35 +4925,35 @@ export interface APIKeyApiUpdateKeyRequest { export class APIKeyApi extends BaseAPI { /** * - * @param {APIKeyApiCreateKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiCreateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof APIKeyApi */ - public createKey(requestParameters: APIKeyApiCreateKeyRequest, options?: AxiosRequestConfig) { - return APIKeyApiFp(this.configuration).createKey(requestParameters.aPIKeyCreateDto, options).then((request) => request(this.axios, this.basePath)); + public createApiKey(requestParameters: APIKeyApiCreateApiKeyRequest, options?: AxiosRequestConfig) { + return APIKeyApiFp(this.configuration).createApiKey(requestParameters.aPIKeyCreateDto, options).then((request) => request(this.axios, this.basePath)); } /** * - * @param {APIKeyApiDeleteKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiDeleteApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof APIKeyApi */ - public deleteKey(requestParameters: APIKeyApiDeleteKeyRequest, options?: AxiosRequestConfig) { - return APIKeyApiFp(this.configuration).deleteKey(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); + public deleteApiKey(requestParameters: APIKeyApiDeleteApiKeyRequest, options?: AxiosRequestConfig) { + return APIKeyApiFp(this.configuration).deleteApiKey(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); } /** * - * @param {APIKeyApiGetKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiGetApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof APIKeyApi */ - public getKey(requestParameters: APIKeyApiGetKeyRequest, options?: AxiosRequestConfig) { - return APIKeyApiFp(this.configuration).getKey(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); + public getApiKey(requestParameters: APIKeyApiGetApiKeyRequest, options?: AxiosRequestConfig) { + return APIKeyApiFp(this.configuration).getApiKey(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); } /** @@ -4962,19 +4962,19 @@ export class APIKeyApi extends BaseAPI { * @throws {RequiredError} * @memberof APIKeyApi */ - public getKeys(options?: AxiosRequestConfig) { - return APIKeyApiFp(this.configuration).getKeys(options).then((request) => request(this.axios, this.basePath)); + public getApiKeys(options?: AxiosRequestConfig) { + return APIKeyApiFp(this.configuration).getApiKeys(options).then((request) => request(this.axios, this.basePath)); } /** * - * @param {APIKeyApiUpdateKeyRequest} requestParameters Request parameters. + * @param {APIKeyApiUpdateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof APIKeyApi */ - public updateKey(requestParameters: APIKeyApiUpdateKeyRequest, options?: AxiosRequestConfig) { - return APIKeyApiFp(this.configuration).updateKey(requestParameters.id, requestParameters.aPIKeyUpdateDto, options).then((request) => request(this.axios, this.basePath)); + public updateApiKey(requestParameters: APIKeyApiUpdateApiKeyRequest, options?: AxiosRequestConfig) { + return APIKeyApiFp(this.configuration).updateApiKey(requestParameters.id, requestParameters.aPIKeyUpdateDto, options).then((request) => request(this.axios, this.basePath)); } } @@ -6433,9 +6433,9 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - bulkUploadCheck: async (assetBulkUploadCheckDto: AssetBulkUploadCheckDto, options: AxiosRequestConfig = {}): Promise => { + checkBulkUpload: async (assetBulkUploadCheckDto: AssetBulkUploadCheckDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'assetBulkUploadCheckDto' is not null or undefined - assertParamExists('bulkUploadCheck', 'assetBulkUploadCheckDto', assetBulkUploadCheckDto) + assertParamExists('checkBulkUpload', 'assetBulkUploadCheckDto', assetBulkUploadCheckDto) const localVarPath = `/asset/bulk-upload-check`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -6856,7 +6856,7 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAssetStats: async (isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, options: AxiosRequestConfig = {}): Promise => { + getAssetStatistics: async (isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/asset/statistics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -6944,98 +6944,6 @@ export const AssetApiAxiosParamCreator = 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 {TimeBucketSize} size - * @param {string} timeBucket - * @param {string} [userId] - * @param {string} [albumId] - * @param {string} [personId] - * @param {boolean} [isArchived] - * @param {boolean} [isFavorite] - * @param {boolean} [isTrashed] - * @param {boolean} [withStacked] - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getByTimeBucket: async (size: TimeBucketSize, timeBucket: string, userId?: string, albumId?: string, personId?: string, isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, withStacked?: boolean, key?: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'size' is not null or undefined - assertParamExists('getByTimeBucket', 'size', size) - // verify required parameter 'timeBucket' is not null or undefined - assertParamExists('getByTimeBucket', 'timeBucket', timeBucket) - const localVarPath = `/asset/time-bucket`; - // 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 cookie required - - // authentication api_key required - await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) - - // authentication bearer required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (size !== undefined) { - localVarQueryParameter['size'] = size; - } - - if (userId !== undefined) { - localVarQueryParameter['userId'] = userId; - } - - if (albumId !== undefined) { - localVarQueryParameter['albumId'] = albumId; - } - - if (personId !== undefined) { - localVarQueryParameter['personId'] = personId; - } - - if (isArchived !== undefined) { - localVarQueryParameter['isArchived'] = isArchived; - } - - if (isFavorite !== undefined) { - localVarQueryParameter['isFavorite'] = isFavorite; - } - - if (isTrashed !== undefined) { - localVarQueryParameter['isTrashed'] = isTrashed; - } - - if (withStacked !== undefined) { - localVarQueryParameter['withStacked'] = withStacked; - } - - if (timeBucket !== undefined) { - localVarQueryParameter['timeBucket'] = timeBucket; - } - - if (key !== undefined) { - localVarQueryParameter['key'] = key; - } - - - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -7318,6 +7226,98 @@ export const AssetApiAxiosParamCreator = 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 {TimeBucketSize} size + * @param {string} timeBucket + * @param {string} [userId] + * @param {string} [albumId] + * @param {string} [personId] + * @param {boolean} [isArchived] + * @param {boolean} [isFavorite] + * @param {boolean} [isTrashed] + * @param {boolean} [withStacked] + * @param {string} [key] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTimeBucket: async (size: TimeBucketSize, timeBucket: string, userId?: string, albumId?: string, personId?: string, isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, withStacked?: boolean, key?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'size' is not null or undefined + assertParamExists('getTimeBucket', 'size', size) + // verify required parameter 'timeBucket' is not null or undefined + assertParamExists('getTimeBucket', 'timeBucket', timeBucket) + const localVarPath = `/asset/time-bucket`; + // 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 cookie required + + // authentication api_key required + await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration) + + // authentication bearer required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (size !== undefined) { + localVarQueryParameter['size'] = size; + } + + if (userId !== undefined) { + localVarQueryParameter['userId'] = userId; + } + + if (albumId !== undefined) { + localVarQueryParameter['albumId'] = albumId; + } + + if (personId !== undefined) { + localVarQueryParameter['personId'] = personId; + } + + if (isArchived !== undefined) { + localVarQueryParameter['isArchived'] = isArchived; + } + + if (isFavorite !== undefined) { + localVarQueryParameter['isFavorite'] = isFavorite; + } + + if (isTrashed !== undefined) { + localVarQueryParameter['isTrashed'] = isTrashed; + } + + if (withStacked !== undefined) { + localVarQueryParameter['withStacked'] = withStacked; + } + + if (timeBucket !== undefined) { + localVarQueryParameter['timeBucket'] = timeBucket; + } + + if (key !== undefined) { + localVarQueryParameter['key'] = key; + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -8011,8 +8011,8 @@ export const AssetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async bulkUploadCheck(assetBulkUploadCheckDto: AssetBulkUploadCheckDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.bulkUploadCheck(assetBulkUploadCheckDto, options); + async checkBulkUpload(assetBulkUploadCheckDto: AssetBulkUploadCheckDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.checkBulkUpload(assetBulkUploadCheckDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -8109,8 +8109,8 @@ export const AssetApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getAssetStats(isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAssetStats(isArchived, isFavorite, isTrashed, options); + async getAssetStatistics(isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAssetStatistics(isArchived, isFavorite, isTrashed, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -8125,25 +8125,6 @@ export const AssetApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getAssetThumbnail(id, format, key, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, - /** - * - * @param {TimeBucketSize} size - * @param {string} timeBucket - * @param {string} [userId] - * @param {string} [albumId] - * @param {string} [personId] - * @param {boolean} [isArchived] - * @param {boolean} [isFavorite] - * @param {boolean} [isTrashed] - * @param {boolean} [withStacked] - * @param {string} [key] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getByTimeBucket(size: TimeBucketSize, timeBucket: string, userId?: string, albumId?: string, personId?: string, isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, withStacked?: boolean, key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getByTimeBucket(size, timeBucket, userId, albumId, personId, isArchived, isFavorite, isTrashed, withStacked, key, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * * @param {*} [options] Override http request option. @@ -8207,6 +8188,25 @@ export const AssetApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getRandom(count, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {TimeBucketSize} size + * @param {string} timeBucket + * @param {string} [userId] + * @param {string} [albumId] + * @param {string} [personId] + * @param {boolean} [isArchived] + * @param {boolean} [isFavorite] + * @param {boolean} [isTrashed] + * @param {boolean} [withStacked] + * @param {string} [key] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getTimeBucket(size: TimeBucketSize, timeBucket: string, userId?: string, albumId?: string, personId?: string, isArchived?: boolean, isFavorite?: boolean, isTrashed?: boolean, withStacked?: boolean, key?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTimeBucket(size, timeBucket, userId, albumId, personId, isArchived, isFavorite, isTrashed, withStacked, key, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {TimeBucketSize} size @@ -8365,12 +8365,12 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath return { /** * Checks if assets exist by checksums - * @param {AssetApiBulkUploadCheckRequest} requestParameters Request parameters. + * @param {AssetApiCheckBulkUploadRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - bulkUploadCheck(requestParameters: AssetApiBulkUploadCheckRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.bulkUploadCheck(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(axios, basePath)); + checkBulkUpload(requestParameters: AssetApiCheckBulkUploadRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.checkBulkUpload(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(axios, basePath)); }, /** * Checks if multiple assets exist on the server and returns all existing - used by background backup @@ -8444,12 +8444,12 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath }, /** * - * @param {AssetApiGetAssetStatsRequest} requestParameters Request parameters. + * @param {AssetApiGetAssetStatisticsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAssetStats(requestParameters: AssetApiGetAssetStatsRequest = {}, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getAssetStats(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, options).then((request) => request(axios, basePath)); + getAssetStatistics(requestParameters: AssetApiGetAssetStatisticsRequest = {}, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getAssetStatistics(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, options).then((request) => request(axios, basePath)); }, /** * @@ -8460,15 +8460,6 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath getAssetThumbnail(requestParameters: AssetApiGetAssetThumbnailRequest, options?: AxiosRequestConfig): AxiosPromise { return localVarFp.getAssetThumbnail(requestParameters.id, requestParameters.format, requestParameters.key, options).then((request) => request(axios, basePath)); }, - /** - * - * @param {AssetApiGetByTimeBucketRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getByTimeBucket(requestParameters: AssetApiGetByTimeBucketRequest, options?: AxiosRequestConfig): AxiosPromise> { - return localVarFp.getByTimeBucket(requestParameters.size, requestParameters.timeBucket, requestParameters.userId, requestParameters.albumId, requestParameters.personId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.withStacked, requestParameters.key, options).then((request) => request(axios, basePath)); - }, /** * * @param {*} [options] Override http request option. @@ -8521,6 +8512,15 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath getRandom(requestParameters: AssetApiGetRandomRequest = {}, options?: AxiosRequestConfig): AxiosPromise> { return localVarFp.getRandom(requestParameters.count, options).then((request) => request(axios, basePath)); }, + /** + * + * @param {AssetApiGetTimeBucketRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTimeBucket(requestParameters: AssetApiGetTimeBucketRequest, options?: AxiosRequestConfig): AxiosPromise> { + return localVarFp.getTimeBucket(requestParameters.size, requestParameters.timeBucket, requestParameters.userId, requestParameters.albumId, requestParameters.personId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.withStacked, requestParameters.key, options).then((request) => request(axios, basePath)); + }, /** * * @param {AssetApiGetTimeBucketsRequest} requestParameters Request parameters. @@ -8632,15 +8632,15 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath }; /** - * Request parameters for bulkUploadCheck operation in AssetApi. + * Request parameters for checkBulkUpload operation in AssetApi. * @export - * @interface AssetApiBulkUploadCheckRequest + * @interface AssetApiCheckBulkUploadRequest */ -export interface AssetApiBulkUploadCheckRequest { +export interface AssetApiCheckBulkUploadRequest { /** * * @type {AssetBulkUploadCheckDto} - * @memberof AssetApiBulkUploadCheck + * @memberof AssetApiCheckBulkUpload */ readonly assetBulkUploadCheckDto: AssetBulkUploadCheckDto } @@ -8786,29 +8786,29 @@ export interface AssetApiGetAssetByIdRequest { } /** - * Request parameters for getAssetStats operation in AssetApi. + * Request parameters for getAssetStatistics operation in AssetApi. * @export - * @interface AssetApiGetAssetStatsRequest + * @interface AssetApiGetAssetStatisticsRequest */ -export interface AssetApiGetAssetStatsRequest { +export interface AssetApiGetAssetStatisticsRequest { /** * * @type {boolean} - * @memberof AssetApiGetAssetStats + * @memberof AssetApiGetAssetStatistics */ readonly isArchived?: boolean /** * * @type {boolean} - * @memberof AssetApiGetAssetStats + * @memberof AssetApiGetAssetStatistics */ readonly isFavorite?: boolean /** * * @type {boolean} - * @memberof AssetApiGetAssetStats + * @memberof AssetApiGetAssetStatistics */ readonly isTrashed?: boolean } @@ -8841,83 +8841,6 @@ export interface AssetApiGetAssetThumbnailRequest { readonly key?: string } -/** - * Request parameters for getByTimeBucket operation in AssetApi. - * @export - * @interface AssetApiGetByTimeBucketRequest - */ -export interface AssetApiGetByTimeBucketRequest { - /** - * - * @type {TimeBucketSize} - * @memberof AssetApiGetByTimeBucket - */ - readonly size: TimeBucketSize - - /** - * - * @type {string} - * @memberof AssetApiGetByTimeBucket - */ - readonly timeBucket: string - - /** - * - * @type {string} - * @memberof AssetApiGetByTimeBucket - */ - readonly userId?: string - - /** - * - * @type {string} - * @memberof AssetApiGetByTimeBucket - */ - readonly albumId?: string - - /** - * - * @type {string} - * @memberof AssetApiGetByTimeBucket - */ - readonly personId?: string - - /** - * - * @type {boolean} - * @memberof AssetApiGetByTimeBucket - */ - readonly isArchived?: boolean - - /** - * - * @type {boolean} - * @memberof AssetApiGetByTimeBucket - */ - readonly isFavorite?: boolean - - /** - * - * @type {boolean} - * @memberof AssetApiGetByTimeBucket - */ - readonly isTrashed?: boolean - - /** - * - * @type {boolean} - * @memberof AssetApiGetByTimeBucket - */ - readonly withStacked?: boolean - - /** - * - * @type {string} - * @memberof AssetApiGetByTimeBucket - */ - readonly key?: string -} - /** * Request parameters for getDownloadInfo operation in AssetApi. * @export @@ -9009,6 +8932,83 @@ export interface AssetApiGetRandomRequest { readonly count?: number } +/** + * Request parameters for getTimeBucket operation in AssetApi. + * @export + * @interface AssetApiGetTimeBucketRequest + */ +export interface AssetApiGetTimeBucketRequest { + /** + * + * @type {TimeBucketSize} + * @memberof AssetApiGetTimeBucket + */ + readonly size: TimeBucketSize + + /** + * + * @type {string} + * @memberof AssetApiGetTimeBucket + */ + readonly timeBucket: string + + /** + * + * @type {string} + * @memberof AssetApiGetTimeBucket + */ + readonly userId?: string + + /** + * + * @type {string} + * @memberof AssetApiGetTimeBucket + */ + readonly albumId?: string + + /** + * + * @type {string} + * @memberof AssetApiGetTimeBucket + */ + readonly personId?: string + + /** + * + * @type {boolean} + * @memberof AssetApiGetTimeBucket + */ + readonly isArchived?: boolean + + /** + * + * @type {boolean} + * @memberof AssetApiGetTimeBucket + */ + readonly isFavorite?: boolean + + /** + * + * @type {boolean} + * @memberof AssetApiGetTimeBucket + */ + readonly isTrashed?: boolean + + /** + * + * @type {boolean} + * @memberof AssetApiGetTimeBucket + */ + readonly withStacked?: boolean + + /** + * + * @type {string} + * @memberof AssetApiGetTimeBucket + */ + readonly key?: string +} + /** * Request parameters for getTimeBuckets operation in AssetApi. * @export @@ -9361,13 +9361,13 @@ export interface AssetApiUploadFileRequest { export class AssetApi extends BaseAPI { /** * Checks if assets exist by checksums - * @param {AssetApiBulkUploadCheckRequest} requestParameters Request parameters. + * @param {AssetApiCheckBulkUploadRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AssetApi */ - public bulkUploadCheck(requestParameters: AssetApiBulkUploadCheckRequest, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).bulkUploadCheck(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(this.axios, this.basePath)); + public checkBulkUpload(requestParameters: AssetApiCheckBulkUploadRequest, options?: AxiosRequestConfig) { + return AssetApiFp(this.configuration).checkBulkUpload(requestParameters.assetBulkUploadCheckDto, options).then((request) => request(this.axios, this.basePath)); } /** @@ -9458,13 +9458,13 @@ export class AssetApi extends BaseAPI { /** * - * @param {AssetApiGetAssetStatsRequest} requestParameters Request parameters. + * @param {AssetApiGetAssetStatisticsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AssetApi */ - public getAssetStats(requestParameters: AssetApiGetAssetStatsRequest = {}, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).getAssetStats(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, options).then((request) => request(this.axios, this.basePath)); + public getAssetStatistics(requestParameters: AssetApiGetAssetStatisticsRequest = {}, options?: AxiosRequestConfig) { + return AssetApiFp(this.configuration).getAssetStatistics(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, options).then((request) => request(this.axios, this.basePath)); } /** @@ -9478,17 +9478,6 @@ export class AssetApi extends BaseAPI { return AssetApiFp(this.configuration).getAssetThumbnail(requestParameters.id, requestParameters.format, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); } - /** - * - * @param {AssetApiGetByTimeBucketRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AssetApi - */ - public getByTimeBucket(requestParameters: AssetApiGetByTimeBucketRequest, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).getByTimeBucket(requestParameters.size, requestParameters.timeBucket, requestParameters.userId, requestParameters.albumId, requestParameters.personId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.withStacked, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); - } - /** * * @param {*} [options] Override http request option. @@ -9553,6 +9542,17 @@ export class AssetApi extends BaseAPI { return AssetApiFp(this.configuration).getRandom(requestParameters.count, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {AssetApiGetTimeBucketRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AssetApi + */ + public getTimeBucket(requestParameters: AssetApiGetTimeBucketRequest, options?: AxiosRequestConfig) { + return AssetApiFp(this.configuration).getTimeBucket(requestParameters.size, requestParameters.timeBucket, requestParameters.userId, requestParameters.albumId, requestParameters.personId, requestParameters.isArchived, requestParameters.isFavorite, requestParameters.isTrashed, requestParameters.withStacked, requestParameters.key, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {AssetApiGetTimeBucketsRequest} requestParameters Request parameters. @@ -10090,41 +10090,6 @@ export class AuditApi extends BaseAPI { */ export const AuthenticationApiAxiosParamCreator = function (configuration?: Configuration) { return { - /** - * - * @param {SignUpDto} signUpDto - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - adminSignUp: async (signUpDto: SignUpDto, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'signUpDto' is not null or undefined - assertParamExists('adminSignUp', 'signUpDto', signUpDto) - const localVarPath = `/auth/admin-sign-up`; - // 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: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(signUpDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * * @param {ChangePasswordDto} changePasswordDto @@ -10360,6 +10325,41 @@ export const AuthenticationApiAxiosParamCreator = function (configuration?: Conf options: localVarRequestOptions, }; }, + /** + * + * @param {SignUpDto} signUpDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signUpAdmin: async (signUpDto: SignUpDto, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'signUpDto' is not null or undefined + assertParamExists('signUpAdmin', 'signUpDto', signUpDto) + const localVarPath = `/auth/admin-sign-up`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(signUpDto, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @param {*} [options] Override http request option. @@ -10408,16 +10408,6 @@ export const AuthenticationApiAxiosParamCreator = function (configuration?: Conf export const AuthenticationApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AuthenticationApiAxiosParamCreator(configuration) return { - /** - * - * @param {SignUpDto} signUpDto - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async adminSignUp(signUpDto: SignUpDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.adminSignUp(signUpDto, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * * @param {ChangePasswordDto} changePasswordDto @@ -10475,6 +10465,16 @@ export const AuthenticationApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.logoutAuthDevices(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {SignUpDto} signUpDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async signUpAdmin(signUpDto: SignUpDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.signUpAdmin(signUpDto, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {*} [options] Override http request option. @@ -10494,15 +10494,6 @@ export const AuthenticationApiFp = function(configuration?: Configuration) { export const AuthenticationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AuthenticationApiFp(configuration) return { - /** - * - * @param {AuthenticationApiAdminSignUpRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - adminSignUp(requestParameters: AuthenticationApiAdminSignUpRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.adminSignUp(requestParameters.signUpDto, options).then((request) => request(axios, basePath)); - }, /** * * @param {AuthenticationApiChangePasswordRequest} requestParameters Request parameters. @@ -10554,6 +10545,15 @@ export const AuthenticationApiFactory = function (configuration?: Configuration, logoutAuthDevices(options?: AxiosRequestConfig): AxiosPromise { return localVarFp.logoutAuthDevices(options).then((request) => request(axios, basePath)); }, + /** + * + * @param {AuthenticationApiSignUpAdminRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signUpAdmin(requestParameters: AuthenticationApiSignUpAdminRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.signUpAdmin(requestParameters.signUpDto, options).then((request) => request(axios, basePath)); + }, /** * * @param {*} [options] Override http request option. @@ -10565,20 +10565,6 @@ export const AuthenticationApiFactory = function (configuration?: Configuration, }; }; -/** - * Request parameters for adminSignUp operation in AuthenticationApi. - * @export - * @interface AuthenticationApiAdminSignUpRequest - */ -export interface AuthenticationApiAdminSignUpRequest { - /** - * - * @type {SignUpDto} - * @memberof AuthenticationApiAdminSignUp - */ - readonly signUpDto: SignUpDto -} - /** * Request parameters for changePassword operation in AuthenticationApi. * @export @@ -10621,6 +10607,20 @@ export interface AuthenticationApiLogoutAuthDeviceRequest { readonly id: string } +/** + * Request parameters for signUpAdmin operation in AuthenticationApi. + * @export + * @interface AuthenticationApiSignUpAdminRequest + */ +export interface AuthenticationApiSignUpAdminRequest { + /** + * + * @type {SignUpDto} + * @memberof AuthenticationApiSignUpAdmin + */ + readonly signUpDto: SignUpDto +} + /** * AuthenticationApi - object-oriented interface * @export @@ -10628,17 +10628,6 @@ export interface AuthenticationApiLogoutAuthDeviceRequest { * @extends {BaseAPI} */ export class AuthenticationApi extends BaseAPI { - /** - * - * @param {AuthenticationApiAdminSignUpRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AuthenticationApi - */ - public adminSignUp(requestParameters: AuthenticationApiAdminSignUpRequest, options?: AxiosRequestConfig) { - return AuthenticationApiFp(this.configuration).adminSignUp(requestParameters.signUpDto, options).then((request) => request(this.axios, this.basePath)); - } - /** * * @param {AuthenticationApiChangePasswordRequest} requestParameters Request parameters. @@ -10702,6 +10691,17 @@ export class AuthenticationApi extends BaseAPI { return AuthenticationApiFp(this.configuration).logoutAuthDevices(options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {AuthenticationApiSignUpAdminRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AuthenticationApi + */ + public signUpAdmin(requestParameters: AuthenticationApiSignUpAdminRequest, options?: AxiosRequestConfig) { + return AuthenticationApiFp(this.configuration).signUpAdmin(requestParameters.signUpDto, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {*} [options] Override http request option. @@ -11014,7 +11014,7 @@ export const LibraryApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAllForUser: async (options: AxiosRequestConfig = {}): Promise => { + getLibraries: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/library`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11304,8 +11304,8 @@ export const LibraryApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getAllForUser(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAllForUser(options); + async getLibraries(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLibraries(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -11393,8 +11393,8 @@ export const LibraryApiFactory = function (configuration?: Configuration, basePa * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAllForUser(options?: AxiosRequestConfig): AxiosPromise> { - return localVarFp.getAllForUser(options).then((request) => request(axios, basePath)); + getLibraries(options?: AxiosRequestConfig): AxiosPromise> { + return localVarFp.getLibraries(options).then((request) => request(axios, basePath)); }, /** * @@ -11591,8 +11591,8 @@ export class LibraryApi extends BaseAPI { * @throws {RequiredError} * @memberof LibraryApi */ - public getAllForUser(options?: AxiosRequestConfig) { - return LibraryApiFp(this.configuration).getAllForUser(options).then((request) => request(this.axios, this.basePath)); + public getLibraries(options?: AxiosRequestConfig) { + return LibraryApiFp(this.configuration).getLibraries(options).then((request) => request(this.axios, this.basePath)); } /** @@ -11658,50 +11658,15 @@ export class LibraryApi extends BaseAPI { */ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration) { return { - /** - * - * @param {OAuthConfigDto} oAuthConfigDto - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - authorizeOAuth: async (oAuthConfigDto: OAuthConfigDto, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'oAuthConfigDto' is not null or undefined - assertParamExists('authorizeOAuth', 'oAuthConfigDto', oAuthConfigDto) - const localVarPath = `/oauth/authorize`; - // 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: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(oAuthConfigDto, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * * @param {OAuthCallbackDto} oAuthCallbackDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ - callback: async (oAuthCallbackDto: OAuthCallbackDto, options: AxiosRequestConfig = {}): Promise => { + finishOAuth: async (oAuthCallbackDto: OAuthCallbackDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'oAuthCallbackDto' is not null or undefined - assertParamExists('callback', 'oAuthCallbackDto', oAuthCallbackDto) + assertParamExists('finishOAuth', 'oAuthCallbackDto', oAuthCallbackDto) const localVarPath = `/oauth/callback`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11735,9 +11700,9 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration * @deprecated * @throws {RequiredError} */ - generateConfig: async (oAuthConfigDto: OAuthConfigDto, options: AxiosRequestConfig = {}): Promise => { + generateOAuthConfig: async (oAuthConfigDto: OAuthConfigDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'oAuthConfigDto' is not null or undefined - assertParamExists('generateConfig', 'oAuthConfigDto', oAuthConfigDto) + assertParamExists('generateOAuthConfig', 'oAuthConfigDto', oAuthConfigDto) const localVarPath = `/oauth/config`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11770,9 +11735,9 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - link: async (oAuthCallbackDto: OAuthCallbackDto, options: AxiosRequestConfig = {}): Promise => { + linkOAuthAccount: async (oAuthCallbackDto: OAuthCallbackDto, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'oAuthCallbackDto' is not null or undefined - assertParamExists('link', 'oAuthCallbackDto', oAuthCallbackDto) + assertParamExists('linkOAuthAccount', 'oAuthCallbackDto', oAuthCallbackDto) const localVarPath = `/oauth/link`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11813,7 +11778,7 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mobileRedirect: async (options: AxiosRequestConfig = {}): Promise => { + redirectOAuthToMobile: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/oauth/mobile-redirect`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11839,10 +11804,45 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration }, /** * + * @param {OAuthConfigDto} oAuthConfigDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ - unlink: async (options: AxiosRequestConfig = {}): Promise => { + startOAuth: async (oAuthConfigDto: OAuthConfigDto, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'oAuthConfigDto' is not null or undefined + assertParamExists('startOAuth', 'oAuthConfigDto', oAuthConfigDto) + const localVarPath = `/oauth/authorize`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(oAuthConfigDto, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unlinkOAuthAccount: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/oauth/unlink`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -11885,24 +11885,14 @@ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration export const OAuthApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = OAuthApiAxiosParamCreator(configuration) return { - /** - * - * @param {OAuthConfigDto} oAuthConfigDto - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async authorizeOAuth(oAuthConfigDto: OAuthConfigDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.authorizeOAuth(oAuthConfigDto, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * * @param {OAuthCallbackDto} oAuthCallbackDto * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async callback(oAuthCallbackDto: OAuthCallbackDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.callback(oAuthCallbackDto, options); + async finishOAuth(oAuthCallbackDto: OAuthCallbackDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.finishOAuth(oAuthCallbackDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -11912,8 +11902,8 @@ export const OAuthApiFp = function(configuration?: Configuration) { * @deprecated * @throws {RequiredError} */ - async generateConfig(oAuthConfigDto: OAuthConfigDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.generateConfig(oAuthConfigDto, options); + async generateOAuthConfig(oAuthConfigDto: OAuthConfigDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.generateOAuthConfig(oAuthConfigDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -11922,8 +11912,8 @@ export const OAuthApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async link(oAuthCallbackDto: OAuthCallbackDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.link(oAuthCallbackDto, options); + async linkOAuthAccount(oAuthCallbackDto: OAuthCallbackDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.linkOAuthAccount(oAuthCallbackDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -11931,8 +11921,18 @@ export const OAuthApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async mobileRedirect(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.mobileRedirect(options); + async redirectOAuthToMobile(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.redirectOAuthToMobile(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @param {OAuthConfigDto} oAuthConfigDto + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async startOAuth(oAuthConfigDto: OAuthConfigDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.startOAuth(oAuthConfigDto, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -11940,8 +11940,8 @@ export const OAuthApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async unlink(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.unlink(options); + async unlinkOAuthAccount(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.unlinkOAuthAccount(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -11956,116 +11956,116 @@ export const OAuthApiFactory = function (configuration?: Configuration, basePath return { /** * - * @param {OAuthApiAuthorizeOAuthRequest} requestParameters Request parameters. + * @param {OAuthApiFinishOAuthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - authorizeOAuth(requestParameters: OAuthApiAuthorizeOAuthRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.authorizeOAuth(requestParameters.oAuthConfigDto, options).then((request) => request(axios, basePath)); - }, - /** - * - * @param {OAuthApiCallbackRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - callback(requestParameters: OAuthApiCallbackRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.callback(requestParameters.oAuthCallbackDto, options).then((request) => request(axios, basePath)); + finishOAuth(requestParameters: OAuthApiFinishOAuthRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.finishOAuth(requestParameters.oAuthCallbackDto, options).then((request) => request(axios, basePath)); }, /** * @deprecated use feature flags and /oauth/authorize - * @param {OAuthApiGenerateConfigRequest} requestParameters Request parameters. + * @param {OAuthApiGenerateOAuthConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ - generateConfig(requestParameters: OAuthApiGenerateConfigRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.generateConfig(requestParameters.oAuthConfigDto, options).then((request) => request(axios, basePath)); + generateOAuthConfig(requestParameters: OAuthApiGenerateOAuthConfigRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.generateOAuthConfig(requestParameters.oAuthConfigDto, options).then((request) => request(axios, basePath)); }, /** * - * @param {OAuthApiLinkRequest} requestParameters Request parameters. + * @param {OAuthApiLinkOAuthAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - link(requestParameters: OAuthApiLinkRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.link(requestParameters.oAuthCallbackDto, options).then((request) => request(axios, basePath)); + linkOAuthAccount(requestParameters: OAuthApiLinkOAuthAccountRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.linkOAuthAccount(requestParameters.oAuthCallbackDto, options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - mobileRedirect(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.mobileRedirect(options).then((request) => request(axios, basePath)); + redirectOAuthToMobile(options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.redirectOAuthToMobile(options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {OAuthApiStartOAuthRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + startOAuth(requestParameters: OAuthApiStartOAuthRequest, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.startOAuth(requestParameters.oAuthConfigDto, options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - unlink(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.unlink(options).then((request) => request(axios, basePath)); + unlinkOAuthAccount(options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.unlinkOAuthAccount(options).then((request) => request(axios, basePath)); }, }; }; /** - * Request parameters for authorizeOAuth operation in OAuthApi. + * Request parameters for finishOAuth operation in OAuthApi. * @export - * @interface OAuthApiAuthorizeOAuthRequest + * @interface OAuthApiFinishOAuthRequest */ -export interface OAuthApiAuthorizeOAuthRequest { - /** - * - * @type {OAuthConfigDto} - * @memberof OAuthApiAuthorizeOAuth - */ - readonly oAuthConfigDto: OAuthConfigDto -} - -/** - * Request parameters for callback operation in OAuthApi. - * @export - * @interface OAuthApiCallbackRequest - */ -export interface OAuthApiCallbackRequest { +export interface OAuthApiFinishOAuthRequest { /** * * @type {OAuthCallbackDto} - * @memberof OAuthApiCallback + * @memberof OAuthApiFinishOAuth */ readonly oAuthCallbackDto: OAuthCallbackDto } /** - * Request parameters for generateConfig operation in OAuthApi. + * Request parameters for generateOAuthConfig operation in OAuthApi. * @export - * @interface OAuthApiGenerateConfigRequest + * @interface OAuthApiGenerateOAuthConfigRequest */ -export interface OAuthApiGenerateConfigRequest { +export interface OAuthApiGenerateOAuthConfigRequest { /** * * @type {OAuthConfigDto} - * @memberof OAuthApiGenerateConfig + * @memberof OAuthApiGenerateOAuthConfig */ readonly oAuthConfigDto: OAuthConfigDto } /** - * Request parameters for link operation in OAuthApi. + * Request parameters for linkOAuthAccount operation in OAuthApi. * @export - * @interface OAuthApiLinkRequest + * @interface OAuthApiLinkOAuthAccountRequest */ -export interface OAuthApiLinkRequest { +export interface OAuthApiLinkOAuthAccountRequest { /** * * @type {OAuthCallbackDto} - * @memberof OAuthApiLink + * @memberof OAuthApiLinkOAuthAccount */ readonly oAuthCallbackDto: OAuthCallbackDto } +/** + * Request parameters for startOAuth operation in OAuthApi. + * @export + * @interface OAuthApiStartOAuthRequest + */ +export interface OAuthApiStartOAuthRequest { + /** + * + * @type {OAuthConfigDto} + * @memberof OAuthApiStartOAuth + */ + readonly oAuthConfigDto: OAuthConfigDto +} + /** * OAuthApi - object-oriented interface * @export @@ -12075,47 +12075,36 @@ export interface OAuthApiLinkRequest { export class OAuthApi extends BaseAPI { /** * - * @param {OAuthApiAuthorizeOAuthRequest} requestParameters Request parameters. + * @param {OAuthApiFinishOAuthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OAuthApi */ - public authorizeOAuth(requestParameters: OAuthApiAuthorizeOAuthRequest, options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).authorizeOAuth(requestParameters.oAuthConfigDto, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @param {OAuthApiCallbackRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof OAuthApi - */ - public callback(requestParameters: OAuthApiCallbackRequest, options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).callback(requestParameters.oAuthCallbackDto, options).then((request) => request(this.axios, this.basePath)); + public finishOAuth(requestParameters: OAuthApiFinishOAuthRequest, options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).finishOAuth(requestParameters.oAuthCallbackDto, options).then((request) => request(this.axios, this.basePath)); } /** * @deprecated use feature flags and /oauth/authorize - * @param {OAuthApiGenerateConfigRequest} requestParameters Request parameters. + * @param {OAuthApiGenerateOAuthConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof OAuthApi */ - public generateConfig(requestParameters: OAuthApiGenerateConfigRequest, options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).generateConfig(requestParameters.oAuthConfigDto, options).then((request) => request(this.axios, this.basePath)); + public generateOAuthConfig(requestParameters: OAuthApiGenerateOAuthConfigRequest, options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).generateOAuthConfig(requestParameters.oAuthConfigDto, options).then((request) => request(this.axios, this.basePath)); } /** * - * @param {OAuthApiLinkRequest} requestParameters Request parameters. + * @param {OAuthApiLinkOAuthAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OAuthApi */ - public link(requestParameters: OAuthApiLinkRequest, options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).link(requestParameters.oAuthCallbackDto, options).then((request) => request(this.axios, this.basePath)); + public linkOAuthAccount(requestParameters: OAuthApiLinkOAuthAccountRequest, options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).linkOAuthAccount(requestParameters.oAuthCallbackDto, options).then((request) => request(this.axios, this.basePath)); } /** @@ -12124,8 +12113,19 @@ export class OAuthApi extends BaseAPI { * @throws {RequiredError} * @memberof OAuthApi */ - public mobileRedirect(options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).mobileRedirect(options).then((request) => request(this.axios, this.basePath)); + public redirectOAuthToMobile(options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).redirectOAuthToMobile(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {OAuthApiStartOAuthRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OAuthApi + */ + public startOAuth(requestParameters: OAuthApiStartOAuthRequest, options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).startOAuth(requestParameters.oAuthConfigDto, options).then((request) => request(this.axios, this.basePath)); } /** @@ -12134,8 +12134,8 @@ export class OAuthApi extends BaseAPI { * @throws {RequiredError} * @memberof OAuthApi */ - public unlink(options?: AxiosRequestConfig) { - return OAuthApiFp(this.configuration).unlink(options).then((request) => request(this.axios, this.basePath)); + public unlinkOAuthAccount(options?: AxiosRequestConfig) { + return OAuthApiFp(this.configuration).unlinkOAuthAccount(options).then((request) => request(this.axios, this.basePath)); } } @@ -13790,37 +13790,8 @@ export const ServerInfoApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getServerVersion: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/server-info/version`; - // 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; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getStats: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/server-info/stats`; + getServerStatistics: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/server-info/statistics`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -13843,6 +13814,35 @@ export const ServerInfoApiAxiosParamCreator = function (configuration?: Configur + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getServerVersion: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/server-info/version`; + // 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; + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -13981,8 +13981,8 @@ export const ServerInfoApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getServerVersion(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getServerVersion(options); + async getServerStatistics(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getServerStatistics(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -13990,8 +13990,8 @@ export const ServerInfoApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getStats(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getStats(options); + async getServerVersion(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getServerVersion(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -14060,16 +14060,16 @@ export const ServerInfoApiFactory = function (configuration?: Configuration, bas * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getServerVersion(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getServerVersion(options).then((request) => request(axios, basePath)); + getServerStatistics(options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getServerStatistics(options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getStats(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getStats(options).then((request) => request(axios, basePath)); + getServerVersion(options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getServerVersion(options).then((request) => request(axios, basePath)); }, /** * @@ -14141,8 +14141,8 @@ export class ServerInfoApi extends BaseAPI { * @throws {RequiredError} * @memberof ServerInfoApi */ - public getServerVersion(options?: AxiosRequestConfig) { - return ServerInfoApiFp(this.configuration).getServerVersion(options).then((request) => request(this.axios, this.basePath)); + public getServerStatistics(options?: AxiosRequestConfig) { + return ServerInfoApiFp(this.configuration).getServerStatistics(options).then((request) => request(this.axios, this.basePath)); } /** @@ -14151,8 +14151,8 @@ export class ServerInfoApi extends BaseAPI { * @throws {RequiredError} * @memberof ServerInfoApi */ - public getStats(options?: AxiosRequestConfig) { - return ServerInfoApiFp(this.configuration).getStats(options).then((request) => request(this.axios, this.basePath)); + public getServerVersion(options?: AxiosRequestConfig) { + return ServerInfoApiFp(this.configuration).getServerVersion(options).then((request) => request(this.axios, this.basePath)); } /** @@ -15038,7 +15038,7 @@ export const SystemConfigApiAxiosParamCreator = function (configuration?: Config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getDefaults: async (options: AxiosRequestConfig = {}): Promise => { + getConfigDefaults: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/system-config/defaults`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -15177,8 +15177,8 @@ export const SystemConfigApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getDefaults(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDefaults(options); + async getConfigDefaults(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getConfigDefaults(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -15223,8 +15223,8 @@ export const SystemConfigApiFactory = function (configuration?: Configuration, b * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getDefaults(options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.getDefaults(options).then((request) => request(axios, basePath)); + getConfigDefaults(options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.getConfigDefaults(options).then((request) => request(axios, basePath)); }, /** * @@ -15283,8 +15283,8 @@ export class SystemConfigApi extends BaseAPI { * @throws {RequiredError} * @memberof SystemConfigApi */ - public getDefaults(options?: AxiosRequestConfig) { - return SystemConfigApiFp(this.configuration).getDefaults(options).then((request) => request(this.axios, this.basePath)); + public getConfigDefaults(options?: AxiosRequestConfig) { + return SystemConfigApiFp(this.configuration).getConfigDefaults(options).then((request) => request(this.axios, this.basePath)); } /** diff --git a/web/src/api/utils.ts b/web/src/api/utils.ts index f82596eef..8dd0fb4ca 100644 --- a/web/src/api/utils.ts +++ b/web/src/api/utils.ts @@ -36,23 +36,19 @@ export const oauth = { authorize: async (location: Location) => { try { const redirectUri = location.href.split('?')[0]; - const { data } = await api.oauthApi.authorizeOAuth({ oAuthConfigDto: { redirectUri } }); + const { data } = await api.oauthApi.startOAuth({ oAuthConfigDto: { redirectUri } }); goto(data.url); } catch (error) { handleError(error, 'Unable to login with OAuth'); } }, - getConfig: (location: Location) => { - const redirectUri = location.href.split('?')[0]; - return api.oauthApi.generateConfig({ oAuthConfigDto: { redirectUri } }); - }, login: (location: Location) => { - return api.oauthApi.callback({ oAuthCallbackDto: { url: location.href } }); + return api.oauthApi.finishOAuth({ oAuthCallbackDto: { url: location.href } }); }, link: (location: Location): AxiosPromise => { - return api.oauthApi.link({ oAuthCallbackDto: { url: location.href } }); + return api.oauthApi.linkOAuthAccount({ oAuthCallbackDto: { url: location.href } }); }, unlink: () => { - return api.oauthApi.unlink(); + return api.oauthApi.unlinkOAuthAccount(); }, }; diff --git a/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte b/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte index 96fceb61e..f22538d94 100644 --- a/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte +++ b/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte @@ -32,7 +32,7 @@ async function getConfigs() { [savedConfig, defaultConfig] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data.ffmpeg), - api.systemConfigApi.getDefaults().then((res) => res.data.ffmpeg), + api.systemConfigApi.getConfigDefaults().then((res) => res.data.ffmpeg), ]); } @@ -76,7 +76,7 @@ } async function resetToDefault() { - const { data: configs } = await api.systemConfigApi.getDefaults(); + const { data: configs } = await api.systemConfigApi.getConfigDefaults(); ffmpegConfig = { ...configs.ffmpeg }; defaultConfig = { ...configs.ffmpeg }; diff --git a/web/src/lib/components/admin-page/settings/job-settings/job-settings.svelte b/web/src/lib/components/admin-page/settings/job-settings/job-settings.svelte index b795db7d3..9098bc33c 100644 --- a/web/src/lib/components/admin-page/settings/job-settings/job-settings.svelte +++ b/web/src/lib/components/admin-page/settings/job-settings/job-settings.svelte @@ -22,7 +22,7 @@ async function getConfigs() { [savedConfig, defaultConfig] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data.job), - api.systemConfigApi.getDefaults().then((res) => res.data.job), + api.systemConfigApi.getConfigDefaults().then((res) => res.data.job), ]); } @@ -59,7 +59,7 @@ } async function resetToDefault() { - const { data: configs } = await api.systemConfigApi.getDefaults(); + const { data: configs } = await api.systemConfigApi.getConfigDefaults(); jobConfig = { ...configs.job }; defaultConfig = { ...configs.job }; diff --git a/web/src/lib/components/admin-page/settings/library-settings/library-settings.svelte b/web/src/lib/components/admin-page/settings/library-settings/library-settings.svelte index 2330507e0..698f2fc35 100644 --- a/web/src/lib/components/admin-page/settings/library-settings/library-settings.svelte +++ b/web/src/lib/components/admin-page/settings/library-settings/library-settings.svelte @@ -28,7 +28,7 @@ async function getConfigs() { [savedConfig, defaultConfig] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data.library), - api.systemConfigApi.getDefaults().then((res) => res.data.library), + api.systemConfigApi.getConfigDefaults().then((res) => res.data.library), ]); } @@ -68,7 +68,7 @@ } async function resetToDefault() { - const { data: configs } = await api.systemConfigApi.getDefaults(); + const { data: configs } = await api.systemConfigApi.getConfigDefaults(); libraryConfig = { ...configs.library }; defaultConfig = { ...configs.library }; diff --git a/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte b/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte index 78c37977d..e09157746 100644 --- a/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte +++ b/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte @@ -22,7 +22,7 @@ async function refreshConfig() { [savedConfig, defaultConfig] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data.machineLearning), - api.systemConfigApi.getDefaults().then((res) => res.data.machineLearning), + api.systemConfigApi.getConfigDefaults().then((res) => res.data.machineLearning), ]); } diff --git a/web/src/lib/components/admin-page/settings/map-settings/map-settings.svelte b/web/src/lib/components/admin-page/settings/map-settings/map-settings.svelte index df9059fce..0efc839ad 100644 --- a/web/src/lib/components/admin-page/settings/map-settings/map-settings.svelte +++ b/web/src/lib/components/admin-page/settings/map-settings/map-settings.svelte @@ -22,7 +22,7 @@ async function refreshConfig() { [savedConfig, defaultConfig] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data), - api.systemConfigApi.getDefaults().then((res) => res.data), + api.systemConfigApi.getConfigDefaults().then((res) => res.data), ]); } @@ -65,7 +65,7 @@ } async function resetToDefault() { - const { data: configs } = await api.systemConfigApi.getDefaults(); + const { data: configs } = await api.systemConfigApi.getConfigDefaults(); config = cloneDeep(configs); defaultConfig = cloneDeep(configs); diff --git a/web/src/lib/components/admin-page/settings/new-version-check-settings/new-version-check-settings.svelte b/web/src/lib/components/admin-page/settings/new-version-check-settings/new-version-check-settings.svelte index acb83f0ca..7568ef60a 100644 --- a/web/src/lib/components/admin-page/settings/new-version-check-settings/new-version-check-settings.svelte +++ b/web/src/lib/components/admin-page/settings/new-version-check-settings/new-version-check-settings.svelte @@ -18,7 +18,7 @@ async function getConfigs() { [savedConfig, defaultConfig] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data.newVersionCheck), - api.systemConfigApi.getDefaults().then((res) => res.data.newVersionCheck), + api.systemConfigApi.getConfigDefaults().then((res) => res.data.newVersionCheck), ]); } @@ -55,7 +55,7 @@ } async function resetToDefault() { - const { data: configs } = await api.systemConfigApi.getDefaults(); + const { data: configs } = await api.systemConfigApi.getConfigDefaults(); newVersionCheckConfig = { ...configs.newVersionCheck }; defaultConfig = { ...configs.newVersionCheck }; diff --git a/web/src/lib/components/admin-page/settings/oauth/oauth-settings.svelte b/web/src/lib/components/admin-page/settings/oauth/oauth-settings.svelte index 9e16b44f2..a9f2c2713 100644 --- a/web/src/lib/components/admin-page/settings/oauth/oauth-settings.svelte +++ b/web/src/lib/components/admin-page/settings/oauth/oauth-settings.svelte @@ -29,7 +29,7 @@ async function getConfigs() { [savedConfig, defaultConfig] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data.oauth), - api.systemConfigApi.getDefaults().then((res) => res.data.oauth), + api.systemConfigApi.getConfigDefaults().then((res) => res.data.oauth), ]); } @@ -90,7 +90,7 @@ } async function resetToDefault() { - const { data: defaultConfig } = await api.systemConfigApi.getDefaults(); + const { data: defaultConfig } = await api.systemConfigApi.getConfigDefaults(); oauthConfig = { ...defaultConfig.oauth }; diff --git a/web/src/lib/components/admin-page/settings/password-login/password-login-settings.svelte b/web/src/lib/components/admin-page/settings/password-login/password-login-settings.svelte index 2c11512f5..0b5f7a16c 100644 --- a/web/src/lib/components/admin-page/settings/password-login/password-login-settings.svelte +++ b/web/src/lib/components/admin-page/settings/password-login/password-login-settings.svelte @@ -20,7 +20,7 @@ async function getConfigs() { [savedConfig, defaultConfig] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data.passwordLogin), - api.systemConfigApi.getDefaults().then((res) => res.data.passwordLogin), + api.systemConfigApi.getConfigDefaults().then((res) => res.data.passwordLogin), ]); } @@ -77,7 +77,7 @@ } async function resetToDefault() { - const { data: configs } = await api.systemConfigApi.getDefaults(); + const { data: configs } = await api.systemConfigApi.getConfigDefaults(); passwordLoginConfig = { ...configs.passwordLogin }; defaultConfig = { ...configs.passwordLogin }; diff --git a/web/src/lib/components/admin-page/settings/storage-template/storage-template-settings.svelte b/web/src/lib/components/admin-page/settings/storage-template/storage-template-settings.svelte index fc95e6d7b..5bdef1f5e 100644 --- a/web/src/lib/components/admin-page/settings/storage-template/storage-template-settings.svelte +++ b/web/src/lib/components/admin-page/settings/storage-template/storage-template-settings.svelte @@ -26,7 +26,7 @@ async function getConfigs() { [savedConfig, defaultConfig, templateOptions] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data.storageTemplate), - api.systemConfigApi.getDefaults().then((res) => res.data.storageTemplate), + api.systemConfigApi.getConfigDefaults().then((res) => res.data.storageTemplate), api.systemConfigApi.getStorageTemplateOptions().then((res) => res.data), ]); @@ -119,7 +119,7 @@ } async function resetToDefault() { - const { data: defaultConfig } = await api.systemConfigApi.getDefaults(); + const { data: defaultConfig } = await api.systemConfigApi.getConfigDefaults(); storageConfig.template = defaultConfig.storageTemplate.template; diff --git a/web/src/lib/components/admin-page/settings/theme/theme-settings.svelte b/web/src/lib/components/admin-page/settings/theme/theme-settings.svelte index b28d0106d..7d67c3d95 100644 --- a/web/src/lib/components/admin-page/settings/theme/theme-settings.svelte +++ b/web/src/lib/components/admin-page/settings/theme/theme-settings.svelte @@ -19,7 +19,7 @@ async function getConfigs() { [savedConfig, defaultConfig] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data.theme), - api.systemConfigApi.getDefaults().then((res) => res.data.theme), + api.systemConfigApi.getConfigDefaults().then((res) => res.data.theme), ]); } @@ -56,7 +56,7 @@ } async function resetToDefault() { - const { data: configs } = await api.systemConfigApi.getDefaults(); + const { data: configs } = await api.systemConfigApi.getConfigDefaults(); themeConfig = { ...configs.theme }; defaultConfig = { ...configs.theme }; diff --git a/web/src/lib/components/admin-page/settings/thumbnail/thumbnail-settings.svelte b/web/src/lib/components/admin-page/settings/thumbnail/thumbnail-settings.svelte index d57d7ccff..e1f4f89bf 100644 --- a/web/src/lib/components/admin-page/settings/thumbnail/thumbnail-settings.svelte +++ b/web/src/lib/components/admin-page/settings/thumbnail/thumbnail-settings.svelte @@ -20,7 +20,7 @@ async function getConfigs() { [savedConfig, defaultConfig] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data.thumbnail), - api.systemConfigApi.getDefaults().then((res) => res.data.thumbnail), + api.systemConfigApi.getConfigDefaults().then((res) => res.data.thumbnail), ]); } @@ -37,7 +37,7 @@ } async function resetToDefault() { - const { data: configs } = await api.systemConfigApi.getDefaults(); + const { data: configs } = await api.systemConfigApi.getConfigDefaults(); thumbnailConfig = { ...configs.thumbnail }; defaultConfig = { ...configs.thumbnail }; diff --git a/web/src/lib/components/admin-page/settings/trash-settings/trash-settings.svelte b/web/src/lib/components/admin-page/settings/trash-settings/trash-settings.svelte index 5ebc21a6d..da9e0d779 100644 --- a/web/src/lib/components/admin-page/settings/trash-settings/trash-settings.svelte +++ b/web/src/lib/components/admin-page/settings/trash-settings/trash-settings.svelte @@ -20,7 +20,7 @@ async function getConfigs() { [savedConfig, defaultConfig] = await Promise.all([ api.systemConfigApi.getConfig().then((res) => res.data.trash), - api.systemConfigApi.getDefaults().then((res) => res.data.trash), + api.systemConfigApi.getConfigDefaults().then((res) => res.data.trash), ]); } @@ -53,7 +53,7 @@ } async function resetToDefault() { - const { data: configs } = await api.systemConfigApi.getDefaults(); + const { data: configs } = await api.systemConfigApi.getConfigDefaults(); trashConfig = { ...configs.trash }; defaultConfig = { ...configs.trash }; diff --git a/web/src/lib/components/forms/admin-registration-form.svelte b/web/src/lib/components/forms/admin-registration-form.svelte index 6d3902a46..9223f54e0 100644 --- a/web/src/lib/components/forms/admin-registration-form.svelte +++ b/web/src/lib/components/forms/admin-registration-form.svelte @@ -30,7 +30,7 @@ const firstName = form.get('firstName'); const lastName = form.get('lastName'); - const { status } = await api.authenticationApi.adminSignUp({ + const { status } = await api.authenticationApi.signUpAdmin({ signUpDto: { email: String(email), password: String(password), diff --git a/web/src/lib/components/shared-components/side-bar/side-bar.svelte b/web/src/lib/components/shared-components/side-bar/side-bar.svelte index 464eba299..9f5103a76 100644 --- a/web/src/lib/components/shared-components/side-bar/side-bar.svelte +++ b/web/src/lib/components/shared-components/side-bar/side-bar.svelte @@ -2,7 +2,7 @@ import { page } from '$app/stores'; import { locale, sidebarSettings } from '$lib/stores/preferences.store'; import { featureFlags } from '$lib/stores/server-config.store'; - import { AssetApiGetAssetStatsRequest, api } from '@api'; + import { AssetApiGetAssetStatisticsRequest, api } from '@api'; import { mdiAccount, mdiAccountMultiple, @@ -23,8 +23,8 @@ import SideBarButton from './side-bar-button.svelte'; import SideBarSection from './side-bar-section.svelte'; - const getStats = async (dto: AssetApiGetAssetStatsRequest) => { - const { data: stats } = await api.assetApi.getAssetStats(dto); + const getStats = async (dto: AssetApiGetAssetStatisticsRequest) => { + const { data: stats } = await api.assetApi.getAssetStatistics(dto); return stats; }; diff --git a/web/src/lib/components/user-settings-page/library-list.svelte b/web/src/lib/components/user-settings-page/library-list.svelte index e69e22279..fd96129eb 100644 --- a/web/src/lib/components/user-settings-page/library-list.svelte +++ b/web/src/lib/components/user-settings-page/library-list.svelte @@ -82,7 +82,7 @@ }; async function readLibraryList() { - const { data } = await api.libraryApi.getAllForUser(); + const { data } = await api.libraryApi.getLibraries(); libraries = data; dropdownOpen.length = libraries.length; diff --git a/web/src/lib/components/user-settings-page/user-api-key-list.svelte b/web/src/lib/components/user-settings-page/user-api-key-list.svelte index d9f2008b9..d1f5d927f 100644 --- a/web/src/lib/components/user-settings-page/user-api-key-list.svelte +++ b/web/src/lib/components/user-settings-page/user-api-key-list.svelte @@ -25,14 +25,14 @@ }; async function refreshKeys() { - const { data } = await api.keyApi.getKeys(); + const { data } = await api.keyApi.getApiKeys(); keys = data; } const handleCreate = async (event: CustomEvent) => { try { const dto = event.detail; - const { data } = await api.keyApi.createKey({ aPIKeyCreateDto: dto }); + const { data } = await api.keyApi.createApiKey({ aPIKeyCreateDto: dto }); secret = data.secret; } catch (error) { handleError(error, 'Unable to create a new API Key'); @@ -50,7 +50,7 @@ const dto = event.detail; try { - await api.keyApi.updateKey({ id: editKey.id, aPIKeyUpdateDto: { name: dto.name } }); + await api.keyApi.updateApiKey({ id: editKey.id, aPIKeyUpdateDto: { name: dto.name } }); notificationController.show({ message: `Saved API Key`, type: NotificationType.Info, @@ -69,7 +69,7 @@ } try { - await api.keyApi.deleteKey({ id: deleteKey.id }); + await api.keyApi.deleteApiKey({ id: deleteKey.id }); notificationController.show({ message: `Removed API Key: ${deleteKey.name}`, type: NotificationType.Info, diff --git a/web/src/lib/stores/assets.store.ts b/web/src/lib/stores/assets.store.ts index 7488ddf6a..83123f7fd 100644 --- a/web/src/lib/stores/assets.store.ts +++ b/web/src/lib/stores/assets.store.ts @@ -196,7 +196,7 @@ export class AssetStore { bucket.cancelToken = new AbortController(); - const { data: assets } = await api.assetApi.getByTimeBucket( + const { data: assets } = await api.assetApi.getTimeBucket( { ...this.options, timeBucket: bucketDate, @@ -206,7 +206,7 @@ export class AssetStore { ); if (this.albumId) { - const { data: albumAssets } = await api.assetApi.getByTimeBucket( + const { data: albumAssets } = await api.assetApi.getTimeBucket( { albumId: this.albumId, timeBucket: bucketDate, diff --git a/web/src/routes/(user)/user-settings/+page.server.ts b/web/src/routes/(user)/user-settings/+page.server.ts index 7d35d5fde..a6aa5e15a 100644 --- a/web/src/routes/(user)/user-settings/+page.server.ts +++ b/web/src/routes/(user)/user-settings/+page.server.ts @@ -8,7 +8,7 @@ export const load = (async ({ parent, locals }) => { throw redirect(302, AppRoute.AUTH_LOGIN); } - const { data: keys } = await locals.api.keyApi.getKeys(); + const { data: keys } = await locals.api.keyApi.getApiKeys(); const { data: devices } = await locals.api.authenticationApi.getAuthDevices(); const { data: partners } = await locals.api.partnerApi.getPartners({ direction: 'shared-by' }); diff --git a/web/src/routes/admin/server-status/+page.server.ts b/web/src/routes/admin/server-status/+page.server.ts index 00c5e48bf..a9b08e2a1 100644 --- a/web/src/routes/admin/server-status/+page.server.ts +++ b/web/src/routes/admin/server-status/+page.server.ts @@ -11,7 +11,7 @@ export const load = (async ({ parent, locals: { api } }) => { throw redirect(302, AppRoute.PHOTOS); } - const { data: stats } = await api.serverInfoApi.getStats(); + const { data: stats } = await api.serverInfoApi.getServerStatistics(); return { user, diff --git a/web/src/routes/admin/server-status/+page.svelte b/web/src/routes/admin/server-status/+page.svelte index d5fd31f31..ea8344723 100644 --- a/web/src/routes/admin/server-status/+page.svelte +++ b/web/src/routes/admin/server-status/+page.svelte @@ -11,7 +11,7 @@ onMount(async () => { setIntervalHandler = setInterval(async () => { - const { data: stats } = await api.serverInfoApi.getStats(); + const { data: stats } = await api.serverInfoApi.getServerStatistics(); data.stats = stats; }, 5000); });