mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-14 02:55:11 -05:00
* build: prevent `opencv-python` from being installed Fixes this error: `AttributeError: module 'cv2.ximgproc' has no attribute 'thinning'` `opencv-contrib-python` supersedes `opencv-python`, providing the same API + additional features. The two packages should not be installed at the same time to avoid conflicts and/or errors. The `invisible-watermark` package requires `opencv-python`, but we require the contrib variant. This change updates `pyproject.toml` to prevent `opencv-python` from ever being installed using a `uv` features called dependency overrides. * feat(ui): data viewer supports disabling wrap * feat(api): list _all_ pkgs in app deps endpoint * chore(ui): typegen * feat(ui): update about modal to display new full deps list * chore: uv lock
105 lines
3.1 KiB
TypeScript
105 lines
3.1 KiB
TypeScript
import { $openAPISchemaUrl } from 'app/store/nanostores/openAPISchemaUrl';
|
|
import type { OpenAPIV3_1 } from 'openapi-types';
|
|
import type { paths } from 'services/api/schema';
|
|
import type { AppConfig, AppVersion } from 'services/api/types';
|
|
|
|
import { api, buildV1Url } from '..';
|
|
|
|
/**
|
|
* Builds an endpoint URL for the app router
|
|
* @example
|
|
* buildAppInfoUrl('some-path')
|
|
* // '/api/v1/app/some-path'
|
|
*/
|
|
const buildAppInfoUrl = (path: string = '') => buildV1Url(`app/${path}`);
|
|
|
|
export const appInfoApi = api.injectEndpoints({
|
|
endpoints: (build) => ({
|
|
getAppVersion: build.query<AppVersion, void>({
|
|
query: () => ({
|
|
url: buildAppInfoUrl('version'),
|
|
method: 'GET',
|
|
}),
|
|
providesTags: ['FetchOnReconnect'],
|
|
}),
|
|
getAppDeps: build.query<
|
|
paths['/api/v1/app/app_deps']['get']['responses']['200']['content']['application/json'],
|
|
void
|
|
>({
|
|
query: () => ({
|
|
url: buildAppInfoUrl('app_deps'),
|
|
method: 'GET',
|
|
}),
|
|
providesTags: ['FetchOnReconnect'],
|
|
}),
|
|
getAppConfig: build.query<AppConfig, void>({
|
|
query: () => ({
|
|
url: buildAppInfoUrl('config'),
|
|
method: 'GET',
|
|
}),
|
|
providesTags: ['FetchOnReconnect'],
|
|
}),
|
|
getRuntimeConfig: build.query<
|
|
paths['/api/v1/app/runtime_config']['get']['responses']['200']['content']['application/json'],
|
|
void
|
|
>({
|
|
query: () => ({
|
|
url: buildAppInfoUrl('runtime_config'),
|
|
method: 'GET',
|
|
}),
|
|
}),
|
|
getInvocationCacheStatus: build.query<
|
|
paths['/api/v1/app/invocation_cache/status']['get']['responses']['200']['content']['application/json'],
|
|
void
|
|
>({
|
|
query: () => ({
|
|
url: buildAppInfoUrl('invocation_cache/status'),
|
|
method: 'GET',
|
|
}),
|
|
providesTags: ['InvocationCacheStatus', 'FetchOnReconnect'],
|
|
}),
|
|
clearInvocationCache: build.mutation<void, void>({
|
|
query: () => ({
|
|
url: buildAppInfoUrl('invocation_cache'),
|
|
method: 'DELETE',
|
|
}),
|
|
invalidatesTags: ['InvocationCacheStatus'],
|
|
}),
|
|
enableInvocationCache: build.mutation<void, void>({
|
|
query: () => ({
|
|
url: buildAppInfoUrl('invocation_cache/enable'),
|
|
method: 'PUT',
|
|
}),
|
|
invalidatesTags: ['InvocationCacheStatus'],
|
|
}),
|
|
disableInvocationCache: build.mutation<void, void>({
|
|
query: () => ({
|
|
url: buildAppInfoUrl('invocation_cache/disable'),
|
|
method: 'PUT',
|
|
}),
|
|
invalidatesTags: ['InvocationCacheStatus'],
|
|
}),
|
|
getOpenAPISchema: build.query<OpenAPIV3_1.Document, void>({
|
|
query: () => {
|
|
const openAPISchemaUrl = $openAPISchemaUrl.get();
|
|
const url = openAPISchemaUrl ? openAPISchemaUrl : `${window.location.href.replace(/\/$/, '')}/openapi.json`;
|
|
return url;
|
|
},
|
|
providesTags: ['Schema'],
|
|
}),
|
|
}),
|
|
});
|
|
|
|
export const {
|
|
useGetAppVersionQuery,
|
|
useGetAppDepsQuery,
|
|
useGetAppConfigQuery,
|
|
useGetRuntimeConfigQuery,
|
|
useClearInvocationCacheMutation,
|
|
useDisableInvocationCacheMutation,
|
|
useEnableInvocationCacheMutation,
|
|
useGetInvocationCacheStatusQuery,
|
|
useGetOpenAPISchemaQuery,
|
|
useLazyGetOpenAPISchemaQuery,
|
|
} = appInfoApi;
|