@terreno/admin-frontend 0.3.2 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/AdminFieldRenderer.d.ts +36 -0
- package/dist/AdminFieldRenderer.js +41 -1
- package/dist/AdminFieldRenderer.js.map +1 -1
- package/dist/AdminModelForm.d.ts +51 -0
- package/dist/AdminModelForm.js +55 -4
- package/dist/AdminModelForm.js.map +1 -1
- package/dist/AdminModelList.d.ts +26 -0
- package/dist/AdminModelList.js +35 -5
- package/dist/AdminModelList.js.map +1 -1
- package/dist/AdminModelTable.d.ts +29 -0
- package/dist/AdminModelTable.js +45 -16
- package/dist/AdminModelTable.js.map +1 -1
- package/dist/AdminRefField.d.ts +35 -0
- package/dist/AdminRefField.js +36 -1
- package/dist/AdminRefField.js.map +1 -1
- package/dist/AdminScriptList.d.ts +10 -0
- package/dist/AdminScriptList.js +31 -0
- package/dist/AdminScriptList.js.map +1 -0
- package/dist/AdminScriptRunModal.d.ts +11 -0
- package/dist/AdminScriptRunModal.js +87 -0
- package/dist/AdminScriptRunModal.js.map +1 -0
- package/dist/ConfigurationScreen.d.ts +30 -0
- package/dist/ConfigurationScreen.js +128 -0
- package/dist/ConfigurationScreen.js.map +1 -0
- package/dist/DocumentStorageBrowser.d.ts +3 -0
- package/dist/DocumentStorageBrowser.js +317 -0
- package/dist/DocumentStorageBrowser.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +52 -0
- package/dist/types.js.map +1 -1
- package/dist/useAdminApi.d.ts +43 -0
- package/dist/useAdminApi.js +44 -1
- package/dist/useAdminApi.js.map +1 -1
- package/dist/useAdminConfig.d.ts +29 -0
- package/dist/useAdminConfig.js +30 -1
- package/dist/useAdminConfig.js.map +1 -1
- package/dist/useAdminScripts.d.ts +32 -0
- package/dist/useAdminScripts.js +36 -0
- package/dist/useAdminScripts.js.map +1 -0
- package/dist/useConfigurationApi.d.ts +34 -0
- package/dist/useConfigurationApi.js +53 -0
- package/dist/useConfigurationApi.js.map +1 -0
- package/dist/useDocumentStorageApi.d.ts +9 -0
- package/dist/useDocumentStorageApi.js +89 -0
- package/dist/useDocumentStorageApi.js.map +1 -0
- package/package.json +17 -3
- package/src/AdminFieldRenderer.tsx +57 -1
- package/src/AdminModelForm.tsx +69 -16
- package/src/AdminModelList.tsx +107 -21
- package/src/AdminModelTable.tsx +98 -68
- package/src/AdminRefField.tsx +36 -1
- package/src/AdminScriptList.test.tsx +124 -0
- package/src/AdminScriptList.tsx +96 -0
- package/src/AdminScriptRunModal.test.tsx +69 -0
- package/src/AdminScriptRunModal.tsx +188 -0
- package/src/ConfigurationScreen.tsx +319 -0
- package/src/DocumentStorageBrowser.tsx +641 -0
- package/src/index.tsx +12 -0
- package/src/types.ts +59 -0
- package/src/useAdminApi.ts +44 -1
- package/src/useAdminConfig.ts +30 -1
- package/src/useAdminScripts.ts +48 -0
- package/src/useConfigurationApi.ts +70 -0
- package/src/useDocumentStorageApi.ts +96 -0
package/src/types.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface AdminFieldConfig {
|
|
|
7
7
|
enum?: string[];
|
|
8
8
|
default?: any;
|
|
9
9
|
ref?: string;
|
|
10
|
+
widget?: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export interface AdminModelConfig {
|
|
@@ -18,8 +19,41 @@ export interface AdminModelConfig {
|
|
|
18
19
|
fields: Record<string, AdminFieldConfig>;
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
export interface AdminScriptConfig {
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
21
27
|
export interface AdminConfigResponse {
|
|
22
28
|
models: AdminModelConfig[];
|
|
29
|
+
scripts: AdminScriptConfig[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface BackgroundTaskProgress {
|
|
33
|
+
percentage: number;
|
|
34
|
+
stage?: string;
|
|
35
|
+
message?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface BackgroundTaskLog {
|
|
39
|
+
timestamp: string;
|
|
40
|
+
level: "info" | "warn" | "error";
|
|
41
|
+
message: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface BackgroundTask {
|
|
45
|
+
_id: string;
|
|
46
|
+
taskType: string;
|
|
47
|
+
status: "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
48
|
+
progress?: BackgroundTaskProgress;
|
|
49
|
+
isDryRun: boolean;
|
|
50
|
+
result?: string[];
|
|
51
|
+
error?: string;
|
|
52
|
+
logs: BackgroundTaskLog[];
|
|
53
|
+
startedAt?: string;
|
|
54
|
+
completedAt?: string;
|
|
55
|
+
created: string;
|
|
56
|
+
updated: string;
|
|
23
57
|
}
|
|
24
58
|
|
|
25
59
|
export interface AdminScreenProps {
|
|
@@ -29,3 +63,28 @@ export interface AdminScreenProps {
|
|
|
29
63
|
|
|
30
64
|
// System fields that should be skipped in forms
|
|
31
65
|
export const SYSTEM_FIELDS = new Set(["_id", "id", "__v", "created", "updated", "deleted"]);
|
|
66
|
+
|
|
67
|
+
export interface DocumentFile {
|
|
68
|
+
name: string;
|
|
69
|
+
fullPath: string;
|
|
70
|
+
size: number;
|
|
71
|
+
contentType: string | undefined;
|
|
72
|
+
updated: string;
|
|
73
|
+
isFolder: boolean;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface DocumentListResponse {
|
|
77
|
+
files: DocumentFile[];
|
|
78
|
+
folders: string[];
|
|
79
|
+
prefix: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface DocumentStorageBrowserProps {
|
|
83
|
+
api: Api<any, any, any, any>;
|
|
84
|
+
basePath: string;
|
|
85
|
+
title?: string;
|
|
86
|
+
allowDelete?: boolean;
|
|
87
|
+
allowUpload?: boolean;
|
|
88
|
+
onFileSelect?: (file: DocumentFile) => void;
|
|
89
|
+
onSettingsPress?: () => void;
|
|
90
|
+
}
|
package/src/useAdminApi.ts
CHANGED
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
import type {Api} from "@reduxjs/toolkit/query/react";
|
|
2
2
|
import {useMemo} from "react";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Hook that generates RTK Query CRUD hooks for a specific admin model.
|
|
6
|
+
*
|
|
7
|
+
* Dynamically injects endpoints for list, read, create, update, and delete operations
|
|
8
|
+
* into the provided RTK Query API. Returns typed hooks for each operation with automatic
|
|
9
|
+
* cache invalidation tags.
|
|
10
|
+
*
|
|
11
|
+
* @param api - RTK Query API instance to inject endpoints into
|
|
12
|
+
* @param routePath - Full route path to the model's endpoints (e.g., "/admin/users")
|
|
13
|
+
* @param modelName - Name of the model for cache tag generation (e.g., "User")
|
|
14
|
+
* @returns Object with hooks: `useListQuery`, `useReadQuery`, `useCreateMutation`, `useUpdateMutation`, `useDeleteMutation`
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import {useAdminApi} from "@terreno/admin-frontend";
|
|
19
|
+
* import {api} from "@/store/openApiSdk";
|
|
20
|
+
*
|
|
21
|
+
* function UserList() {
|
|
22
|
+
* const {useListQuery, useCreateMutation, useDeleteMutation} = useAdminApi(
|
|
23
|
+
* api,
|
|
24
|
+
* "/admin/users",
|
|
25
|
+
* "User"
|
|
26
|
+
* );
|
|
27
|
+
*
|
|
28
|
+
* const {data, isLoading} = useListQuery({limit: 20, page: 1});
|
|
29
|
+
* const [create, {isLoading: isCreating}] = useCreateMutation();
|
|
30
|
+
* const [deleteUser] = useDeleteMutation();
|
|
31
|
+
*
|
|
32
|
+
* const handleCreate = async () => {
|
|
33
|
+
* await create({email: "test@example.com", name: "Test"}).unwrap();
|
|
34
|
+
* };
|
|
35
|
+
*
|
|
36
|
+
* const handleDelete = async (id: string) => {
|
|
37
|
+
* await deleteUser(id).unwrap();
|
|
38
|
+
* };
|
|
39
|
+
*
|
|
40
|
+
* return <DataTable data={data?.data} />;
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see useAdminConfig for fetching model configurations
|
|
45
|
+
* @see AdminModelTable for usage in the table view
|
|
46
|
+
*/
|
|
4
47
|
export const useAdminApi = (api: Api<any, any, any, any>, routePath: string, modelName: string) => {
|
|
5
48
|
const enhancedApi = useMemo(() => {
|
|
6
49
|
const listKey = `adminList_${modelName}`;
|
|
@@ -55,7 +98,7 @@ export const useAdminApi = (api: Api<any, any, any, any>, routePath: string, mod
|
|
|
55
98
|
}),
|
|
56
99
|
}),
|
|
57
100
|
}),
|
|
58
|
-
overrideExisting:
|
|
101
|
+
overrideExisting: true,
|
|
59
102
|
});
|
|
60
103
|
}, [api, routePath, modelName]);
|
|
61
104
|
|
package/src/useAdminConfig.ts
CHANGED
|
@@ -4,6 +4,35 @@ import type {AdminConfigResponse} from "./types";
|
|
|
4
4
|
|
|
5
5
|
const ENDPOINT_NAME = "adminConfig";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Hook that fetches admin panel configuration from the backend.
|
|
9
|
+
*
|
|
10
|
+
* Dynamically injects a query endpoint into the provided RTK Query API to fetch
|
|
11
|
+
* model metadata from `{baseUrl}/config`. Returns model configurations including
|
|
12
|
+
* field types, required fields, references, and display settings.
|
|
13
|
+
*
|
|
14
|
+
* @param api - RTK Query API instance to inject the endpoint into
|
|
15
|
+
* @param baseUrl - Base URL for admin routes (e.g., "/admin")
|
|
16
|
+
* @returns Object with `config` (model metadata), `isLoading`, and `error`
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import {useAdminConfig} from "@terreno/admin-frontend";
|
|
21
|
+
* import {api} from "@/store/openApiSdk";
|
|
22
|
+
*
|
|
23
|
+
* function AdminScreen() {
|
|
24
|
+
* const {config, isLoading, error} = useAdminConfig(api, "/admin");
|
|
25
|
+
*
|
|
26
|
+
* if (isLoading) return <Spinner />;
|
|
27
|
+
* if (error || !config) return <Text>Error loading config</Text>;
|
|
28
|
+
*
|
|
29
|
+
* return <div>{config.models.map(m => <Card key={m.name}>{m.displayName}</Card>)}</div>;
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @see AdminConfigResponse for the returned configuration structure
|
|
34
|
+
* @see AdminModelList for usage in the model list screen
|
|
35
|
+
*/
|
|
7
36
|
export const useAdminConfig = (api: Api<any, any, any, any>, baseUrl: string) => {
|
|
8
37
|
const enhancedApi = useMemo(() => {
|
|
9
38
|
return api.injectEndpoints({
|
|
@@ -15,7 +44,7 @@ export const useAdminConfig = (api: Api<any, any, any, any>, baseUrl: string) =>
|
|
|
15
44
|
}),
|
|
16
45
|
}),
|
|
17
46
|
}),
|
|
18
|
-
overrideExisting:
|
|
47
|
+
overrideExisting: true,
|
|
19
48
|
});
|
|
20
49
|
}, [api, baseUrl]);
|
|
21
50
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type {Api} from "@reduxjs/toolkit/query/react";
|
|
2
|
+
import {useMemo} from "react";
|
|
3
|
+
import type {BackgroundTask} from "./types";
|
|
4
|
+
|
|
5
|
+
export const useAdminScripts = (api: Api<any, any, any, any>, baseUrl: string) => {
|
|
6
|
+
const enhancedApi = useMemo(() => {
|
|
7
|
+
return api.injectEndpoints({
|
|
8
|
+
endpoints: (build: any) => ({
|
|
9
|
+
adminCancelScriptTask: build.mutation({
|
|
10
|
+
invalidatesTags: ["admin_scriptTask"],
|
|
11
|
+
query: (taskId: string) => ({
|
|
12
|
+
method: "DELETE",
|
|
13
|
+
url: `${baseUrl}/scripts/tasks/${taskId}`,
|
|
14
|
+
}),
|
|
15
|
+
}),
|
|
16
|
+
adminGetScriptTask: build.query({
|
|
17
|
+
providesTags: ["admin_scriptTask"],
|
|
18
|
+
query: (taskId: string) => ({
|
|
19
|
+
method: "GET",
|
|
20
|
+
url: `${baseUrl}/scripts/tasks/${taskId}`,
|
|
21
|
+
}),
|
|
22
|
+
}),
|
|
23
|
+
adminRunScript: build.mutation({
|
|
24
|
+
query: ({name, wetRun}: {name: string; wetRun: boolean}) => ({
|
|
25
|
+
method: "POST",
|
|
26
|
+
url: `${baseUrl}/scripts/${name}/run?wetRun=${wetRun}`,
|
|
27
|
+
}),
|
|
28
|
+
}),
|
|
29
|
+
}),
|
|
30
|
+
overrideExisting: true,
|
|
31
|
+
});
|
|
32
|
+
}, [api, baseUrl]);
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
useCancelScriptTaskMutation: (enhancedApi as any).useAdminCancelScriptTaskMutation as () => [
|
|
36
|
+
(taskId: string) => {unwrap: () => Promise<{task: BackgroundTask; message: string}>},
|
|
37
|
+
{isLoading: boolean},
|
|
38
|
+
],
|
|
39
|
+
useGetScriptTaskQuery: (enhancedApi as any).useAdminGetScriptTaskQuery as (
|
|
40
|
+
taskId: string,
|
|
41
|
+
options?: {skip?: boolean; pollingInterval?: number}
|
|
42
|
+
) => {data: {task: BackgroundTask} | undefined; isLoading: boolean; error: unknown},
|
|
43
|
+
useRunScriptMutation: (enhancedApi as any).useAdminRunScriptMutation as () => [
|
|
44
|
+
(args: {name: string; wetRun: boolean}) => {unwrap: () => Promise<{taskId: string}>},
|
|
45
|
+
{isLoading: boolean},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type {Api} from "@reduxjs/toolkit/query/react";
|
|
2
|
+
import {useMemo} from "react";
|
|
3
|
+
|
|
4
|
+
interface UseConfigurationApiOptions {
|
|
5
|
+
api: Api<any, any, any, any>;
|
|
6
|
+
basePath: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface UseConfigurationApiResult {
|
|
10
|
+
useMetaQuery: () => {data: any; isLoading: boolean; error: any};
|
|
11
|
+
useRefreshSecretsMutation: () => [any, {isLoading: boolean}];
|
|
12
|
+
useUpdateMutation: () => [any, {isLoading: boolean}];
|
|
13
|
+
useValuesQuery: () => {data: any; isLoading: boolean; error: any};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Hook that generates RTK Query hooks for configuration management.
|
|
18
|
+
*
|
|
19
|
+
* Dynamically injects endpoints for:
|
|
20
|
+
* - `meta` — GET `{basePath}/meta` (schema metadata)
|
|
21
|
+
* - `values` — GET `{basePath}` (current configuration values)
|
|
22
|
+
* - `update` — PATCH `{basePath}` (update configuration)
|
|
23
|
+
* - `refreshSecrets` — POST `{basePath}/refresh-secrets` (trigger secret refresh)
|
|
24
|
+
*/
|
|
25
|
+
export const useConfigurationApi = ({
|
|
26
|
+
api,
|
|
27
|
+
basePath,
|
|
28
|
+
}: UseConfigurationApiOptions): UseConfigurationApiResult => {
|
|
29
|
+
const enhancedApi = useMemo(() => {
|
|
30
|
+
return api.enhanceEndpoints({addTagTypes: ["configuration"]}).injectEndpoints({
|
|
31
|
+
endpoints: (build: any) => ({
|
|
32
|
+
configMeta: build.query({
|
|
33
|
+
query: () => ({
|
|
34
|
+
method: "GET",
|
|
35
|
+
url: `${basePath}/meta`,
|
|
36
|
+
}),
|
|
37
|
+
}),
|
|
38
|
+
configRefreshSecrets: build.mutation({
|
|
39
|
+
query: () => ({
|
|
40
|
+
method: "POST",
|
|
41
|
+
url: `${basePath}/refresh-secrets`,
|
|
42
|
+
}),
|
|
43
|
+
}),
|
|
44
|
+
configUpdate: build.mutation({
|
|
45
|
+
invalidatesTags: ["configuration"],
|
|
46
|
+
query: (body: any) => ({
|
|
47
|
+
body,
|
|
48
|
+
method: "PATCH",
|
|
49
|
+
url: basePath,
|
|
50
|
+
}),
|
|
51
|
+
}),
|
|
52
|
+
configValues: build.query({
|
|
53
|
+
providesTags: ["configuration"],
|
|
54
|
+
query: () => ({
|
|
55
|
+
method: "GET",
|
|
56
|
+
url: basePath,
|
|
57
|
+
}),
|
|
58
|
+
}),
|
|
59
|
+
}),
|
|
60
|
+
overrideExisting: true,
|
|
61
|
+
});
|
|
62
|
+
}, [api, basePath]);
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
useMetaQuery: (enhancedApi as any).useConfigMetaQuery,
|
|
66
|
+
useRefreshSecretsMutation: (enhancedApi as any).useConfigRefreshSecretsMutation,
|
|
67
|
+
useUpdateMutation: (enhancedApi as any).useConfigUpdateMutation,
|
|
68
|
+
useValuesQuery: (enhancedApi as any).useConfigValuesQuery,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type {Api} from "@reduxjs/toolkit/query/react";
|
|
2
|
+
import {useMemo} from "react";
|
|
3
|
+
|
|
4
|
+
export const useDocumentStorageApi = (api: Api<any, any, any, any>, basePath: string) => {
|
|
5
|
+
const enhancedApi = useMemo(() => {
|
|
6
|
+
return api.injectEndpoints({
|
|
7
|
+
endpoints: (build: any) => ({
|
|
8
|
+
documentStorageCreateFolder: build.mutation({
|
|
9
|
+
invalidatesTags: ["documentStorage"],
|
|
10
|
+
query: ({folderName, prefix}: {folderName: string; prefix?: string}) => ({
|
|
11
|
+
body: {folderName, prefix},
|
|
12
|
+
method: "POST",
|
|
13
|
+
url: `${basePath}/folder`,
|
|
14
|
+
}),
|
|
15
|
+
}),
|
|
16
|
+
documentStorageDelete: build.mutation({
|
|
17
|
+
invalidatesTags: ["documentStorage"],
|
|
18
|
+
query: (filePath: string) => ({
|
|
19
|
+
method: "DELETE",
|
|
20
|
+
url: `${basePath}/${encodeURIComponent(filePath)}`,
|
|
21
|
+
}),
|
|
22
|
+
}),
|
|
23
|
+
documentStorageDeleteFolder: build.mutation({
|
|
24
|
+
invalidatesTags: ["documentStorage"],
|
|
25
|
+
query: (folderPath: string) => ({
|
|
26
|
+
method: "DELETE",
|
|
27
|
+
url: `${basePath}/folder/${encodeURIComponent(folderPath)}`,
|
|
28
|
+
}),
|
|
29
|
+
}),
|
|
30
|
+
documentStorageDownload: build.query({
|
|
31
|
+
extraOptions: {maxRetries: 0},
|
|
32
|
+
query: (filePath: string) => {
|
|
33
|
+
const url = `${basePath}/download/${encodeURIComponent(filePath)}`;
|
|
34
|
+
console.info("[documentStorage] download url:", url, "filePath:", filePath);
|
|
35
|
+
return {
|
|
36
|
+
method: "GET",
|
|
37
|
+
responseHandler: async (response: Response) => {
|
|
38
|
+
console.info(
|
|
39
|
+
"[documentStorage] download response:",
|
|
40
|
+
response.status,
|
|
41
|
+
response.statusText,
|
|
42
|
+
"content-type:",
|
|
43
|
+
response.headers.get("content-type")
|
|
44
|
+
);
|
|
45
|
+
if (response.ok) {
|
|
46
|
+
const blob = await response.blob();
|
|
47
|
+
console.info("[documentStorage] blob size:", blob.size, "type:", blob.type);
|
|
48
|
+
return blob;
|
|
49
|
+
}
|
|
50
|
+
const text = await response.text();
|
|
51
|
+
console.error("[documentStorage] error response body:", text);
|
|
52
|
+
try {
|
|
53
|
+
return JSON.parse(text);
|
|
54
|
+
} catch {
|
|
55
|
+
return {detail: text, status: response.status};
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
url,
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
documentStorageList: build.query({
|
|
63
|
+
providesTags: ["documentStorage"],
|
|
64
|
+
query: (prefix?: string) => ({
|
|
65
|
+
method: "GET",
|
|
66
|
+
params: prefix ? {prefix} : {},
|
|
67
|
+
url: `${basePath}/`,
|
|
68
|
+
}),
|
|
69
|
+
}),
|
|
70
|
+
documentStorageUpload: build.mutation({
|
|
71
|
+
invalidatesTags: ["documentStorage"],
|
|
72
|
+
query: ({formData, prefix}: {formData: FormData; prefix?: string}) => {
|
|
73
|
+
if (prefix) {
|
|
74
|
+
formData.append("prefix", prefix);
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
body: formData,
|
|
78
|
+
method: "POST",
|
|
79
|
+
url: `${basePath}/`,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
}),
|
|
84
|
+
overrideExisting: false,
|
|
85
|
+
});
|
|
86
|
+
}, [api, basePath]);
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
useCreateFolderMutation: (enhancedApi as any).useDocumentStorageCreateFolderMutation,
|
|
90
|
+
useDeleteFolderMutation: (enhancedApi as any).useDocumentStorageDeleteFolderMutation,
|
|
91
|
+
useDeleteMutation: (enhancedApi as any).useDocumentStorageDeleteMutation,
|
|
92
|
+
useLazyDownloadQuery: (enhancedApi as any).useLazyDocumentStorageDownloadQuery,
|
|
93
|
+
useListQuery: (enhancedApi as any).useDocumentStorageListQuery,
|
|
94
|
+
useUploadMutation: (enhancedApi as any).useDocumentStorageUploadMutation,
|
|
95
|
+
};
|
|
96
|
+
};
|