@dovetail-v2/refine 0.0.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.
Files changed (134) hide show
  1. package/README.MD +49 -0
  2. package/dist/MonacoYamlDiffEditor.15cce01f.js +54 -0
  3. package/dist/assets/yaml.worker.bb17811d.js +39447 -0
  4. package/dist/favicon.ico +0 -0
  5. package/dist/images/flags/de.svg +1 -0
  6. package/dist/images/flags/en.svg +1 -0
  7. package/dist/index.cbb145c9.js +9820 -0
  8. package/dist/locales/de/common.json +167 -0
  9. package/dist/locales/en/common.json +167 -0
  10. package/dist/refine.js +30 -0
  11. package/dist/refine.umd.cjs +9874 -0
  12. package/dist/style.css +32634 -0
  13. package/lib/src/App.d.ts +6 -0
  14. package/lib/src/Dovetail.d.ts +10 -0
  15. package/lib/src/components/Breadcrumb/index.d.ts +6 -0
  16. package/lib/src/components/ConditionsTable/ConditionsTable.d.ts +7 -0
  17. package/lib/src/components/ConditionsTable/index.d.ts +1 -0
  18. package/lib/src/components/CreateButton/index.d.ts +2 -0
  19. package/lib/src/components/CronJobDropdown/index.d.ts +7 -0
  20. package/lib/src/components/CronjobJobsTable/index.d.ts +7 -0
  21. package/lib/src/components/DeleteButton/index.d.ts +2 -0
  22. package/lib/src/components/DeleteManyButton/index.d.ts +4 -0
  23. package/lib/src/components/DrawerShow/DrawerShow.d.ts +10 -0
  24. package/lib/src/components/DrawerShow/index.d.ts +1 -0
  25. package/lib/src/components/EditButton/index.d.ts +2 -0
  26. package/lib/src/components/Form/KeyValueListWidget.d.ts +6 -0
  27. package/lib/src/components/Form/MetadataForm.d.ts +2 -0
  28. package/lib/src/components/Form/NameInputWidget.d.ts +51 -0
  29. package/lib/src/components/Form/NamespaceSelectWidget.d.ts +9 -0
  30. package/lib/src/components/Form/index.d.ts +4 -0
  31. package/lib/src/components/Form/widget.d.ts +5 -0
  32. package/lib/src/components/FormLayout/index.d.ts +3 -0
  33. package/lib/src/components/ImageNames/index.d.ts +4 -0
  34. package/lib/src/components/K8sDropdown/index.d.ts +7 -0
  35. package/lib/src/components/KeyValue/KeyValue.d.ts +6 -0
  36. package/lib/src/components/KeyValue/index.d.ts +1 -0
  37. package/lib/src/components/Layout/index.d.ts +3 -0
  38. package/lib/src/components/ListPage/index.d.ts +10 -0
  39. package/lib/src/components/Menu/index.d.ts +2 -0
  40. package/lib/src/components/NamespacesFilter/index.d.ts +7 -0
  41. package/lib/src/components/PageShow/PageShow.d.ts +13 -0
  42. package/lib/src/components/PageShow/index.d.ts +1 -0
  43. package/lib/src/components/PodContainersTable/PodContainersTable.d.ts +8 -0
  44. package/lib/src/components/PodContainersTable/index.d.ts +1 -0
  45. package/lib/src/components/ResourceCRUD/ResourceCRUD.d.ts +8 -0
  46. package/lib/src/components/ResourceCRUD/create/index.d.ts +8 -0
  47. package/lib/src/components/ResourceCRUD/index.d.ts +1 -0
  48. package/lib/src/components/ResourceCRUD/list/index.d.ts +14 -0
  49. package/lib/src/components/ResourceCRUD/show/index.d.ts +14 -0
  50. package/lib/src/components/Separator/index.d.ts +2 -0
  51. package/lib/src/components/ShowContent/ShowContent.d.ts +13 -0
  52. package/lib/src/components/ShowContent/fields.d.ts +16 -0
  53. package/lib/src/components/ShowContent/index.d.ts +2 -0
  54. package/lib/src/components/StateTag/StateTag.d.ts +6 -0
  55. package/lib/src/components/StateTag/index.d.ts +1 -0
  56. package/lib/src/components/Table/ErrorContent.d.ts +10 -0
  57. package/lib/src/components/Table/TableToolBar.d.ts +8 -0
  58. package/lib/src/components/Table/TableWidgets.d.ts +6 -0
  59. package/lib/src/components/Table/index.d.ts +28 -0
  60. package/lib/src/components/Tags/index.d.ts +6 -0
  61. package/lib/src/components/Time/index.d.ts +9 -0
  62. package/lib/src/components/WorkloadDropdown/index.d.ts +7 -0
  63. package/lib/src/components/WorkloadPodsTable/WorkloadPodsTable.d.ts +5 -0
  64. package/lib/src/components/WorkloadPodsTable/index.d.ts +1 -0
  65. package/lib/src/components/WorkloadReplicas/index.d.ts +5 -0
  66. package/lib/src/components/YamlEditor/MonacoYamlDiffEditor.d.ts +9 -0
  67. package/lib/src/components/YamlEditor/MonacoYamlEditor.d.ts +19 -0
  68. package/lib/src/components/YamlEditor/YamlEditorComponent.d.ts +26 -0
  69. package/lib/src/components/YamlEditor/index.d.ts +1 -0
  70. package/lib/src/components/YamlEditor/style.d.ts +11 -0
  71. package/lib/src/components/YamlEditor/yaml.worker.d.ts +1 -0
  72. package/lib/src/components/YamlForm/index.d.ts +6 -0
  73. package/lib/src/constants/k8s.d.ts +204 -0
  74. package/lib/src/hooks/index.d.ts +2 -0
  75. package/lib/src/hooks/useDeleteModal/index.d.ts +1 -0
  76. package/lib/src/hooks/useDeleteModal/useDeleteManyModal.d.ts +8 -0
  77. package/lib/src/hooks/useDeleteModal/useDeleteModal.d.ts +7 -0
  78. package/lib/src/hooks/useDownloadYAML.d.ts +7 -0
  79. package/lib/src/hooks/useEagleForm.d.ts +39 -0
  80. package/lib/src/hooks/useEagleTable/columns.d.ts +15 -0
  81. package/lib/src/hooks/useEagleTable/index.d.ts +52 -0
  82. package/lib/src/hooks/useEdit.d.ts +4 -0
  83. package/lib/src/hooks/useSchema.d.ts +7 -0
  84. package/lib/src/i18n.d.ts +72 -0
  85. package/lib/src/index.d.ts +6 -0
  86. package/lib/src/locales/en-US/index.d.ts +15 -0
  87. package/lib/src/locales/index.d.ts +2 -0
  88. package/lib/src/locales/zh-CN/index.d.ts +55 -0
  89. package/lib/src/main.d.ts +1 -0
  90. package/lib/src/model/cronjob-model.d.ts +9 -0
  91. package/lib/src/model/index.d.ts +5 -0
  92. package/lib/src/model/job-model.d.ts +10 -0
  93. package/lib/src/model/pod-model.d.ts +10 -0
  94. package/lib/src/model/resource-model.d.ts +17 -0
  95. package/lib/src/model/workload-model.d.ts +17 -0
  96. package/lib/src/pages/configmaps/index.d.ts +3 -0
  97. package/lib/src/pages/cronjobs/create/index.d.ts +3 -0
  98. package/lib/src/pages/cronjobs/index.d.ts +3 -0
  99. package/lib/src/pages/cronjobs/list/index.d.ts +3 -0
  100. package/lib/src/pages/cronjobs/show/index.d.ts +3 -0
  101. package/lib/src/pages/daemonsets/create/index.d.ts +3 -0
  102. package/lib/src/pages/daemonsets/index.d.ts +3 -0
  103. package/lib/src/pages/daemonsets/list/index.d.ts +3 -0
  104. package/lib/src/pages/daemonsets/show/index.d.ts +3 -0
  105. package/lib/src/pages/deployments/create/index.d.ts +3 -0
  106. package/lib/src/pages/deployments/index.d.ts +3 -0
  107. package/lib/src/pages/deployments/list/index.d.ts +3 -0
  108. package/lib/src/pages/deployments/show/index.d.ts +3 -0
  109. package/lib/src/pages/jobs/index.d.ts +4 -0
  110. package/lib/src/pages/pods/create/index.d.ts +3 -0
  111. package/lib/src/pages/pods/index.d.ts +3 -0
  112. package/lib/src/pages/pods/list/index.d.ts +3 -0
  113. package/lib/src/pages/pods/show/index.d.ts +3 -0
  114. package/lib/src/pages/secrets/index.d.ts +3 -0
  115. package/lib/src/pages/statefulsets/create/index.d.ts +3 -0
  116. package/lib/src/pages/statefulsets/index.d.ts +3 -0
  117. package/lib/src/pages/statefulsets/list/index.d.ts +3 -0
  118. package/lib/src/pages/statefulsets/show/index.d.ts +3 -0
  119. package/lib/src/providers/index.d.ts +1 -0
  120. package/lib/src/providers/router-provider/index.d.ts +21 -0
  121. package/lib/src/types/index.d.ts +1 -0
  122. package/lib/src/types/resource.d.ts +39 -0
  123. package/lib/src/utils/addId.d.ts +3 -0
  124. package/lib/src/utils/download.d.ts +1 -0
  125. package/lib/src/utils/error.d.ts +20 -0
  126. package/lib/src/utils/k8s.d.ts +3 -0
  127. package/lib/src/utils/labels.d.ts +9 -0
  128. package/lib/src/utils/openapi.d.ts +45 -0
  129. package/lib/src/utils/schema.d.ts +17 -0
  130. package/lib/src/utils/string.d.ts +1 -0
  131. package/lib/src/utils/time.d.ts +8 -0
  132. package/lib/src/utils/yaml.d.ts +2 -0
  133. package/lib/vite.config.d.ts +2 -0
  134. package/package.json +90 -0
@@ -0,0 +1,3 @@
1
+ import { IResourceComponentsProps } from '@refinedev/core';
2
+ import React from 'react';
3
+ export declare const DeploymentShow: React.FC<IResourceComponentsProps>;
@@ -0,0 +1,4 @@
1
+ import { Job } from 'kubernetes-types/batch/v1';
2
+ import { JobModel } from '../../model';
3
+ import { ResourceConfig, WithId } from '../../types';
4
+ export declare const JobConfig: ResourceConfig<WithId<Job>, JobModel>;
@@ -0,0 +1,3 @@
1
+ import { FormProps } from 'antd/lib/form';
2
+ import React from 'react';
3
+ export declare const PodForm: React.FC<FormProps>;
@@ -0,0 +1,3 @@
1
+ export * from './create';
2
+ export * from './list';
3
+ export * from './show';
@@ -0,0 +1,3 @@
1
+ import { IResourceComponentsProps } from '@refinedev/core';
2
+ import React from 'react';
3
+ export declare const PodList: React.FC<IResourceComponentsProps>;
@@ -0,0 +1,3 @@
1
+ import { IResourceComponentsProps } from '@refinedev/core';
2
+ import React from 'react';
3
+ export declare const PodShow: React.FC<IResourceComponentsProps>;
@@ -0,0 +1,3 @@
1
+ import { ResourceModel } from '../../model';
2
+ import { Resource, ResourceConfig } from '../../types';
3
+ export declare const SecretsConfig: ResourceConfig<Resource, ResourceModel>;
@@ -0,0 +1,3 @@
1
+ import { FormProps } from 'antd/lib/form';
2
+ import React from 'react';
3
+ export declare const StatefulSetForm: React.FC<FormProps>;
@@ -0,0 +1,3 @@
1
+ export * from './create';
2
+ export * from './list';
3
+ export * from './show';
@@ -0,0 +1,3 @@
1
+ import { IResourceComponentsProps } from '@refinedev/core';
2
+ import React from 'react';
3
+ export declare const StatefulSetList: React.FC<IResourceComponentsProps>;
@@ -0,0 +1,3 @@
1
+ import { IResourceComponentsProps } from '@refinedev/core';
2
+ import React from 'react';
3
+ export declare const StatefulSetShow: React.FC<IResourceComponentsProps>;
@@ -0,0 +1 @@
1
+ export { routerProvider } from './router-provider';
@@ -0,0 +1,21 @@
1
+ import { GoConfig, ParseResponse } from '@refinedev/core';
2
+ import React from 'react';
3
+ export declare const stringifyConfig: {
4
+ addQueryPrefix: boolean;
5
+ skipNulls: boolean;
6
+ arrayFormat: "indices";
7
+ encode: boolean;
8
+ encodeValuesOnly: boolean;
9
+ };
10
+ export declare const convertToNumberIfPossible: (value: string | undefined) => string | number | undefined;
11
+ export declare const routerProvider: {
12
+ go: () => ({ to, type, query, hash, options: { keepQuery, keepHash } }: GoConfig) => string | void;
13
+ back: () => () => void;
14
+ parse: () => () => ParseResponse<Record<string, any>>;
15
+ Link: React.ForwardRefExoticComponent<Pick<{
16
+ [prop: string]: any;
17
+ to: string;
18
+ } & {
19
+ children?: React.ReactNode;
20
+ }, string | number> & React.RefAttributes<HTMLAnchorElement>>;
21
+ };
@@ -0,0 +1 @@
1
+ export * from './resource';
@@ -0,0 +1,39 @@
1
+ /// <reference types="react" />
2
+ import { i18n } from 'i18next';
3
+ import { ObjectMeta } from 'kubernetes-types/meta/v1';
4
+ import { ShowField } from '../components/ShowContent';
5
+ import { Column } from '../components/Table';
6
+ import { ResourceModel } from '../model';
7
+ export declare enum RESOURCE_GROUP {
8
+ WORKLOAD = "WORKLOAD",
9
+ CORE = "CORE"
10
+ }
11
+ export type WithId<T> = T & {
12
+ id: string;
13
+ };
14
+ export interface Resource {
15
+ id: string;
16
+ apiVersion?: string;
17
+ /**
18
+ * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
19
+ */
20
+ kind?: string;
21
+ /**
22
+ * Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
23
+ */
24
+ metadata?: ObjectMeta;
25
+ }
26
+ export type ResourceConfig<Raw extends Resource = Resource, Model extends ResourceModel = ResourceModel> = {
27
+ name: string;
28
+ kind: string;
29
+ basePath: string;
30
+ apiVersion: string;
31
+ parent?: RESOURCE_GROUP;
32
+ formatter?: (v: Raw) => Model;
33
+ initValue?: Record<string, unknown>;
34
+ columns?: (i18n: i18n) => Column<Model>[];
35
+ showFields?: (i18n: i18n) => ShowField<Model>[][];
36
+ Dropdown?: React.FC<{
37
+ data: Model;
38
+ }>;
39
+ };
@@ -0,0 +1,3 @@
1
+ export declare function addId<T extends object>(arr: T[], idKey: keyof T): ({
2
+ id: string;
3
+ } & T)[];
@@ -0,0 +1 @@
1
+ export declare function download(filename: string, content: string): void;
@@ -0,0 +1,20 @@
1
+ import { i18n as I18n } from 'i18next';
2
+ type Cause = {
3
+ code?: string;
4
+ reason?: string;
5
+ message: string;
6
+ field?: string;
7
+ };
8
+ type ErrorResponse = {
9
+ message?: string;
10
+ code?: number;
11
+ reason?: string;
12
+ details?: {
13
+ causes?: Cause[];
14
+ };
15
+ graphQLErrors?: Cause[];
16
+ };
17
+ export declare function isNetworkError(errors?: Cause[]): boolean;
18
+ export declare function getSubmitError(errorResponse: ErrorResponse | undefined, text: string, i18n: I18n): string;
19
+ export declare function getCommonErrors(response: ErrorResponse, i18n: I18n): string[];
20
+ export {};
@@ -0,0 +1,3 @@
1
+ import { BaseRecord } from '@refinedev/core';
2
+ export declare function getApiVersion(resourceBasePath: string): string;
3
+ export declare function pruneBeforeEdit(v: BaseRecord): void;
@@ -0,0 +1,9 @@
1
+ type Labels = Record<string, string>;
2
+ type LabelsArray = {
3
+ key: string;
4
+ value: string;
5
+ }[];
6
+ export declare function toLabelStrings(labels?: Labels): string[];
7
+ export declare function toLabelsArray(labels?: Labels): LabelsArray;
8
+ export declare function toLabelsRecord(labels: LabelsArray): Labels;
9
+ export {};
@@ -0,0 +1,45 @@
1
+ import { JSONSchema7 } from 'json-schema';
2
+ interface OpenAPIResponse {
3
+ openapi: string;
4
+ paths: {
5
+ [prop: string]: {
6
+ get: {
7
+ responses: {
8
+ 200: {
9
+ content: {
10
+ 'application/json': {
11
+ schema: JSONSchema7;
12
+ };
13
+ };
14
+ };
15
+ };
16
+ };
17
+ };
18
+ };
19
+ components: {
20
+ schemas: {
21
+ [prop: string]: JSONSchema7 & {
22
+ 'x-kubernetes-group-version-kind': {
23
+ group: string;
24
+ kind: string;
25
+ version: string;
26
+ }[];
27
+ };
28
+ };
29
+ };
30
+ }
31
+ declare class K8sOpenAPI {
32
+ resourceBasePath: string;
33
+ response: OpenAPIResponse | null;
34
+ apiVersion: string;
35
+ constructor(resourceBasePath: string);
36
+ fetch(): Promise<OpenAPIResponse>;
37
+ findSchema(kind: string): Promise<(JSONSchema7 & {
38
+ 'x-kubernetes-group-version-kind': {
39
+ group: string;
40
+ kind: string;
41
+ version: string;
42
+ }[];
43
+ }) | undefined>;
44
+ }
45
+ export default K8sOpenAPI;
@@ -0,0 +1,17 @@
1
+ import { JSONSchema7, JSONSchema7Type } from 'json-schema';
2
+ type TransformOptions = {
3
+ generateValue?: (schema: JSONSchema7) => JSONSchema7Type | undefined | null | Record<string, unknown>;
4
+ };
5
+ export declare function generateValueFromSchema(schema: JSONSchema7, options: TransformOptions): JSONSchema7Type | undefined | Record<string, unknown>;
6
+ export declare function generateSchemaTypeValue(schema: JSONSchema7): JSONSchema7Type | undefined | Record<string, unknown>;
7
+ type ResolveOptions = {
8
+ prune: {
9
+ description: boolean;
10
+ optional: boolean;
11
+ metadata: boolean;
12
+ fields: string[];
13
+ xProperty: boolean;
14
+ };
15
+ };
16
+ export declare function resolveRef(schema: JSONSchema7, schemas: Record<string, JSONSchema7>, options: ResolveOptions): JSONSchema7;
17
+ export {};
@@ -0,0 +1 @@
1
+ export declare function shortenedImage(image: string): string;
@@ -0,0 +1,8 @@
1
+ export declare function getSecondsDiff(startDate: string, endDate: string): number;
2
+ export declare function elapsedTime(seconds: number): {
3
+ diff?: undefined;
4
+ label?: undefined;
5
+ } | {
6
+ diff: number;
7
+ label: string;
8
+ };
@@ -0,0 +1,2 @@
1
+ import { JSONSchema7 } from 'json-schema';
2
+ export declare function generateYamlBySchema(defaultValue: Record<string, unknown>, schema: JSONSchema7): string;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfigExport;
2
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "@dovetail-v2/refine",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "files": [
6
+ "dist",
7
+ "lib"
8
+ ],
9
+ "main": "./dist/refine.umd.js",
10
+ "module": "./dist/refine.js",
11
+ "types": "./lib/src/index.d.ts",
12
+ "dependencies": {
13
+ "@cloudtower/eagle": "^0.26.11",
14
+ "@cloudtower/icons-react": "^0.26.11",
15
+ "@refinedev/core": "^4.38.0",
16
+ "@refinedev/inferencer": "^4.5.4",
17
+ "antd": "4.5.0",
18
+ "dayjs": "^1.11.10",
19
+ "i18next": "^20.1.0",
20
+ "js-yaml": "^4.1.0",
21
+ "k8s-api-provider": "^0.0.6",
22
+ "ky": "^0.33.3",
23
+ "lodash-es": "^4.17.21",
24
+ "mitt": "^3.0.1",
25
+ "monaco-editor": "^0.33.0",
26
+ "monaco-yaml": "^4.0.4",
27
+ "qs": "6.11.2",
28
+ "react": "^16.12.0",
29
+ "react-dom": "^16.12.0",
30
+ "react-router-dom": "^5.1.2",
31
+ "sunflower-antd": "^1.0.0-beta.3",
32
+ "usehooks-ts": "^2.9.1"
33
+ },
34
+ "devDependencies": {
35
+ "@babel/core": "^7.4.0",
36
+ "@babel/preset-env": "^7.1.6",
37
+ "@linaria/core": "^4.5.4",
38
+ "@linaria/react": "^4.5.4",
39
+ "@linaria/vite": "^4.5.4",
40
+ "@refinedev/cli": "^2.9.0",
41
+ "@types/js-yaml": "^4.0.6",
42
+ "@types/json-schema": "^7.0.13",
43
+ "@types/lodash-es": "^4.17.9",
44
+ "@types/node": "^18.16.2",
45
+ "@types/qs": "^6.9.8",
46
+ "@types/react": "^16.9.0",
47
+ "@types/react-dom": "^16.9.0",
48
+ "@types/react-router-dom": "^5.1.2",
49
+ "@typescript-eslint/eslint-plugin": "^6.7.5",
50
+ "@typescript-eslint/parser": "^6.7.5",
51
+ "@vitejs/plugin-react": "^4.0.0",
52
+ "eslint": "^8.38.0",
53
+ "eslint-plugin-react-hooks": "^4.6.0",
54
+ "eslint-plugin-react-refresh": "^0.3.4",
55
+ "kubernetes-types": "^1.26.0",
56
+ "vite": "^3.2.7"
57
+ },
58
+ "peerDependencies": {
59
+ "@cloudtower/eagle": "^0.26.9",
60
+ "@cloudtower/icons-react": "^0.26.9",
61
+ "@refinedev/core": "^4.38.0",
62
+ "antd": "4.5.0",
63
+ "i18next": "^20.1.0",
64
+ "react": "^16.12.0",
65
+ "react-dom": "^16.12.0",
66
+ "react-router-dom": "^5.1.2"
67
+ },
68
+ "scripts": {
69
+ "dev": "refine dev",
70
+ "build": "tsc --emitDeclarationOnly && vite build",
71
+ "preview": "refine start",
72
+ "refine": "refine",
73
+ "lint": "eslint src --ext .ts,.tsx"
74
+ },
75
+ "browserslist": {
76
+ "production": [
77
+ ">0.2%",
78
+ "not dead",
79
+ "not op_mini all"
80
+ ],
81
+ "development": [
82
+ "last 1 chrome version",
83
+ "last 1 firefox version",
84
+ "last 1 safari version"
85
+ ]
86
+ },
87
+ "refine": {
88
+ "projectId": "cY4Pl6-jiYxMm-ipjKjr"
89
+ }
90
+ }