@dovetail-v2/refine 0.2.0-alpha.0 → 0.2.0
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/dist/{MonacoYamlDiffEditor-b8952aa0.js → MonacoYamlDiffEditor-c33773fc.js} +1 -1
- package/dist/{index-fd721293.js → index-0acc32c8.js} +492 -476
- package/dist/refine.js +1 -1
- package/dist/refine.umd.cjs +491 -475
- package/lib/Dovetail.d.ts +4 -8
- package/lib/components/Form/useYamlForm.d.ts +0 -3
- package/lib/contexts/global-store.d.ts +3 -4
- package/lib/hooks/useGlobalStore.d.ts +1 -3
- package/lib/models/ingress-model.d.ts +2 -2
- package/lib/types/globalStore.d.ts +25 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/resource.d.ts +2 -0
- package/package.json +3 -3
package/lib/Dovetail.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RefineProps } from '@refinedev/core';
|
|
2
2
|
import { History } from 'history';
|
|
3
|
-
import { GlobalStore } from 'k8s-api-provider';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { ResourceConfig } from './types';
|
|
6
5
|
import './styles.css';
|
|
6
|
+
import { IGlobalStore } from './types/globalStore';
|
|
7
7
|
type Props = {
|
|
8
8
|
resourcesConfig: ResourceConfig[];
|
|
9
9
|
schemaUrlPrefix: string;
|
|
@@ -11,12 +11,8 @@ type Props = {
|
|
|
11
11
|
urlPrefix?: string;
|
|
12
12
|
Layout?: React.FC<unknown>;
|
|
13
13
|
history: History;
|
|
14
|
-
|
|
15
|
-
accessControlProvider?: AccessControlProvider;
|
|
16
|
-
routerProvider?: any;
|
|
17
|
-
dataProvider?: DataProvider;
|
|
18
|
-
liveProvider?: LiveProvider;
|
|
14
|
+
globalStoreMap: Record<string, IGlobalStore<unknown>>;
|
|
19
15
|
antdGetPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement;
|
|
20
|
-
}
|
|
16
|
+
} & Partial<RefineProps>;
|
|
21
17
|
export declare const Dovetail: React.FC<Props>;
|
|
22
18
|
export {};
|
|
@@ -42,10 +42,7 @@ export type UseFormReturnType<TQueryFnData extends BaseRecord = BaseRecord, TErr
|
|
|
42
42
|
isLoadingSchema: boolean;
|
|
43
43
|
loadSchemaError: Error | null;
|
|
44
44
|
fetchSchema: () => void;
|
|
45
|
-
enableEditor: boolean;
|
|
46
45
|
errorResponseBody?: Record<string, unknown> | null;
|
|
47
|
-
switchEditor: () => void;
|
|
48
|
-
onFinish: (values?: TVariables) => Promise<CreateResponse<TResponse> | UpdateResponse<TResponse> | void>;
|
|
49
46
|
};
|
|
50
47
|
declare const useYamlForm: <TQueryFnData extends Unstructured = Unstructured & {
|
|
51
48
|
id: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}>;
|
|
2
|
+
import { WatchEvent } from 'k8s-api-provider';
|
|
3
|
+
import { IGlobalStore } from 'src/types/globalStore';
|
|
4
|
+
declare const GlobalStoreContext: import("react").Context<Record<string, IGlobalStore<WatchEvent>>>;
|
|
6
5
|
export default GlobalStoreContext;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GlobalStore, Unstructured } from 'k8s-api-provider';
|
|
2
|
+
import { Service } from 'kubernetes-types/core/v1';
|
|
2
3
|
import type { Ingress } from 'kubernetes-types/networking/v1';
|
|
3
4
|
import { ResourceModel } from './resource-model';
|
|
4
5
|
type IngressTypes = Required<Ingress> & Unstructured;
|
|
@@ -12,9 +13,8 @@ export type RuleItem = {
|
|
|
12
13
|
};
|
|
13
14
|
export declare class IngressModel extends ResourceModel<IngressTypes> {
|
|
14
15
|
_rawYaml: IngressTypes;
|
|
15
|
-
flattenedRules: RuleItem[];
|
|
16
16
|
constructor(_rawYaml: IngressTypes, _globalStore: GlobalStore);
|
|
17
|
-
init(): Promise<void>;
|
|
18
17
|
private getFullPath;
|
|
18
|
+
getFlattenedRules(services: Service[]): RuleItem[];
|
|
19
19
|
}
|
|
20
20
|
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MetaQuery } from '@refinedev/core';
|
|
2
|
+
import { CancelQueriesParams, IProviderPlugin, Unstructured, UnstructuredList } from 'k8s-api-provider';
|
|
3
|
+
interface GlobalStoreInitParams {
|
|
4
|
+
apiUrl: string;
|
|
5
|
+
fieldManager?: string;
|
|
6
|
+
kubeApiTimeout?: false | number;
|
|
7
|
+
}
|
|
8
|
+
export interface IGlobalStore<TWatchEvent> {
|
|
9
|
+
plugins: IProviderPlugin[];
|
|
10
|
+
prefix?: string;
|
|
11
|
+
fieldManager?: string;
|
|
12
|
+
apiUrl: string;
|
|
13
|
+
kubeApiTimeout: number | false | undefined;
|
|
14
|
+
get<T = UnstructuredList>(resource: string, meta?: MetaQuery): Promise<T>;
|
|
15
|
+
subscribe(resource: string, onEvent: (event: TWatchEvent) => void): () => void;
|
|
16
|
+
publish(resource: string, event: TWatchEvent): void;
|
|
17
|
+
init(params: GlobalStoreInitParams): void;
|
|
18
|
+
loadPlugins(plugins?: IProviderPlugin[]): void;
|
|
19
|
+
restoreItem(item: Unstructured): Unstructured;
|
|
20
|
+
restoreData(list: UnstructuredList): UnstructuredList;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
cancelQueries(params?: CancelQueriesParams): void;
|
|
23
|
+
refreshList?(resource: string): void;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
package/lib/types/index.d.ts
CHANGED
package/lib/types/resource.d.ts
CHANGED
|
@@ -151,6 +151,8 @@ export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
|
|
|
151
151
|
* 实际效果为:{apiUrl}{basePath}{apiVersion}{name}
|
|
152
152
|
*/
|
|
153
153
|
apiVersion: string;
|
|
154
|
+
/** 资源使用的 DataProvider 的名称 */
|
|
155
|
+
dataProviderName?: string;
|
|
154
156
|
/** 资源在界面上显示的名称 */
|
|
155
157
|
displayName?: string;
|
|
156
158
|
/** 是否隐藏列表页的工具栏。会连标题和描述一起去掉 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dovetail-v2/refine",
|
|
3
|
-
"version": "0.2.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"module": "./dist/refine.js",
|
|
11
11
|
"types": "./lib/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@cloudtower/eagle": "^0.
|
|
14
|
-
"@cloudtower/icons-react": "^0.
|
|
13
|
+
"@cloudtower/eagle": "^0.32.46",
|
|
14
|
+
"@cloudtower/icons-react": "^0.32.46",
|
|
15
15
|
"@patternfly/react-core": "^5.1.1",
|
|
16
16
|
"@patternfly/react-log-viewer": "^5.0.0",
|
|
17
17
|
"@refinedev/core": "^4.47.2",
|