@prorobotech/openapi-k8s-toolkit 1.5.0-alpha.2 → 1.5.0-alpha.4

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 (28) hide show
  1. package/dist/{index-BYGA57EJ.mjs → index-D8riHM_k.mjs} +1101 -268
  2. package/dist/{index-BYGA57EJ.mjs.map → index-D8riHM_k.mjs.map} +1 -1
  3. package/dist/{index-DoND5hQh.mjs → index-DHTFNSby.mjs} +2 -2
  4. package/dist/{index-DoND5hQh.mjs.map → index-DHTFNSby.mjs.map} +1 -1
  5. package/dist/openapi-k8s-toolkit.es.js +1 -1
  6. package/dist/openapi-k8s-toolkit.umd.js +1099 -266
  7. package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
  8. package/dist/types/components/molecules/BlackholeForm/molecules/FormListInput/FormListInput.d.ts +2 -0
  9. package/dist/types/components/molecules/BlackholeForm/molecules/FormNamespaceInput/FormNamespaceInput.d.ts +9 -2
  10. package/dist/types/components/molecules/BlackholeForm/molecules/FormNamespaceInput/FormNamespaceInput.test.d.ts +1 -0
  11. package/dist/types/components/molecules/BlackholeForm/molecules/FormNumberInput/FormNumberInput.d.ts +3 -0
  12. package/dist/types/components/molecules/BlackholeForm/molecules/FormObjectFromSwagger/FormObjectFromSwagger.d.ts +2 -1
  13. package/dist/types/components/molecules/BlackholeForm/molecules/FormStringInput/FormStringInput.d.ts +4 -0
  14. package/dist/types/components/molecules/BlackholeForm/molecules/FormStringMultilineInput/FormStringMultilineInput.d.ts +4 -0
  15. package/dist/types/components/molecules/BlackholeForm/molecules/helpers/oneOfBranch.d.ts +9 -0
  16. package/dist/types/components/molecules/BlackholeForm/molecules/helpers/oneOfBranch.test.d.ts +1 -0
  17. package/dist/types/components/molecules/BlackholeForm/molecules/helpers/validation.d.ts +18 -0
  18. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/oneOfBranchCleanup.d.ts +7 -0
  19. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/oneOfBranchCleanup.test.d.ts +1 -0
  20. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/oneOfBranchVisibility.d.ts +6 -0
  21. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/oneOfBranchVisibility.test.d.ts +1 -0
  22. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/utils.d.ts +20 -5
  23. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormProvider/styled.d.ts +8 -0
  24. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/EnrichedTable.d.ts +1 -0
  25. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTableProvider/EnrichedTableProvider.d.ts +1 -0
  26. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTableProvider/styled.d.ts +8 -0
  27. package/dist/types/localTypes/formSchema.d.ts +15 -0
  28. package/package.json +1 -1
@@ -18,6 +18,8 @@ type TFormListInputProps = {
18
18
  urlParams: TUrlParams;
19
19
  onRemoveByMinus?: () => void;
20
20
  defaultValue?: string | string[];
21
+ minItems?: number;
22
+ maxItems?: number;
21
23
  };
22
24
  export declare const FormListInput: FC<TFormListInputProps>;
23
25
  export {};
@@ -8,10 +8,17 @@ type TFormNamespaceInputProps = {
8
8
  path: TFormName;
9
9
  }) => void;
10
10
  /**
11
- * OpenAPI schema `default` value for this field.
12
- * Drives placeholder hint and Apply Default / Clear button.
11
+ * YAML / OpenAPI default for the namespace field. Drives placeholder hint and the
12
+ * Apply Default / Clear button, and has priority over contextNamespace in the
13
+ * one-shot mount cascade because it's an explicit declarative choice from the
14
+ * schema author.
13
15
  */
14
16
  defaultValue?: string;
17
+ /**
18
+ * Current namespace from the URL route context. Used as a fallback when defaultValue
19
+ * is absent or refers to a namespace that doesn't exist in the cluster.
20
+ */
21
+ contextNamespace?: string;
15
22
  };
16
23
  export declare const FormNamespaceInput: FC<TFormNamespaceInputProps>;
17
24
  export {};
@@ -18,6 +18,9 @@ type TFormNumberItemProps = {
18
18
  defaultValue?: number;
19
19
  example?: number;
20
20
  nullable?: boolean;
21
+ format?: string;
22
+ minimum?: number;
23
+ maximum?: number;
21
24
  };
22
25
  export declare const FormNumberInput: FC<TFormNumberItemProps>;
23
26
  export {};
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { TFormName, TExpandedControls, TPersistedControls } from '../../../../../localTypes/form';
3
- import { TFormSchemaNode, TFormSchemaProperties } from '../../../../../localTypes/formSchema';
3
+ import { TFormSchemaNode, TFormSchemaOneOfBranch, TFormSchemaProperties } from '../../../../../localTypes/formSchema';
4
4
  type TFormObjectFromSwaggerProps = {
5
5
  name: TFormName;
6
6
  persistName?: TFormName;
@@ -16,6 +16,7 @@ type TFormObjectFromSwaggerProps = {
16
16
  collapseTitle: TFormName;
17
17
  collapseFormName: TFormName;
18
18
  oneOfRequiredGroups?: string[][];
19
+ oneOfBranches?: TFormSchemaOneOfBranch[];
19
20
  validationErrors?: string[];
20
21
  data?: JSX.Element;
21
22
  inputProps?: {
@@ -17,6 +17,10 @@ type TFormStringInputProps = {
17
17
  defaultValue?: string;
18
18
  example?: string;
19
19
  nullable?: boolean;
20
+ format?: string;
21
+ pattern?: string;
22
+ minLength?: number;
23
+ maxLength?: number;
20
24
  };
21
25
  export declare const FormStringInput: FC<TFormStringInputProps>;
22
26
  export {};
@@ -18,6 +18,10 @@ type TFormStringMultilineInputProps = {
18
18
  defaultValue?: string;
19
19
  example?: string;
20
20
  nullable?: boolean;
21
+ format?: string;
22
+ pattern?: string;
23
+ minLength?: number;
24
+ maxLength?: number;
21
25
  };
22
26
  export declare const FormStringMultilineInput: FC<TFormStringMultilineInputProps>;
23
27
  export {};
@@ -0,0 +1,9 @@
1
+ import { TFormSchemaOneOfBranch } from '../../../../../localTypes/formSchema';
2
+ export declare const toOneOfBranchPath: (path: string) => (string | number)[];
3
+ export declare const getOneOfBranchPathKey: (path: (string | number)[]) => string;
4
+ export declare const matchesOneOfBranch: (value: unknown, branch: TFormSchemaOneOfBranch) => boolean;
5
+ export declare const collectOneOfBranchMatchKeys: (branches: TFormSchemaOneOfBranch[]) => string[];
6
+ export declare const collectInactiveOneOfBranchPaths: ({ branches, activeBranch, }: {
7
+ branches: TFormSchemaOneOfBranch[];
8
+ activeBranch: TFormSchemaOneOfBranch;
9
+ }) => (string | number)[][];
@@ -17,3 +17,21 @@ export declare const collectOneOfRequiredGroupStates: ({ properties, values, cur
17
17
  * treated as empty, same as undefined/''/[].
18
18
  */
19
19
  export declare const getRequiredRule: (isRequired: boolean, name: TFormName, nullable?: boolean) => Rule;
20
+ export declare const getPatternRule: (pattern: string | undefined, name: TFormName) => Rule | undefined;
21
+ export declare const getStringLengthRule: ({ minLength, maxLength, name, }: {
22
+ minLength?: number | undefined;
23
+ maxLength?: number | undefined;
24
+ name: TFormName;
25
+ }) => Rule | undefined;
26
+ export declare const getStringFormatRule: (format: string | undefined, name: TFormName) => Rule | undefined;
27
+ export declare const getArrayItemsRule: ({ minItems, maxItems, name, }: {
28
+ minItems?: number | undefined;
29
+ maxItems?: number | undefined;
30
+ name: TFormName;
31
+ }) => Rule | undefined;
32
+ export declare const getNumberFormatRule: (format: string | undefined, name: TFormName) => Rule | undefined;
33
+ export declare const getNumberRangeRule: ({ minimum, maximum, name, }: {
34
+ minimum?: number | undefined;
35
+ maximum?: number | undefined;
36
+ name: TFormName;
37
+ }) => Rule | undefined;
@@ -0,0 +1,7 @@
1
+ import { TFormSchemaProperties } from '../../../../../../localTypes/formSchema';
2
+ export declare const collectInactiveBranchCleanupPaths: ({ properties, values, changedValues, currentPath, }: {
3
+ properties: TFormSchemaProperties;
4
+ values: Record<string, unknown>;
5
+ changedValues: Record<string, unknown> | undefined;
6
+ currentPath?: (string | number)[] | undefined;
7
+ }) => (string | number)[][];
@@ -0,0 +1,6 @@
1
+ import { TFormSchemaProperties } from '../../../../../../localTypes/formSchema';
2
+ export declare const collectOneOfBranchHiddenPaths: ({ properties, values, currentPath, }: {
3
+ properties: TFormSchemaProperties;
4
+ values: Record<string, unknown>;
5
+ currentPath?: (string | number)[] | undefined;
6
+ }) => (string | number)[][];
@@ -1,7 +1,7 @@
1
1
  import { TListInputCustomProps, TRangeInputCustomProps } from '../../../../../localTypes/formExtensions';
2
2
  import { TFormName, TExpandedControls, TNamespaceData, TPersistedControls, TUrlParams } from '../../../../../localTypes/form';
3
3
  import { TFormSchemaNode, TFormSchemaProperties } from '../../../../../localTypes/formSchema';
4
- export declare const getStringFormItemFromSwagger: ({ name, arrKey, arrName, persistName, required, forceNonRequired, description, namespaceData, isAdditionalProperties, removeField, persistedControls, onRemoveByMinus, defaultValue, example, nullable, }: {
4
+ export declare const getStringFormItemFromSwagger: ({ name, arrKey, arrName, persistName, required, forceNonRequired, description, namespaceData, isAdditionalProperties, removeField, persistedControls, onRemoveByMinus, defaultValue, example, nullable, format, pattern, minLength, maxLength, urlParams, }: {
5
5
  name: TFormName;
6
6
  arrKey?: number | undefined;
7
7
  arrName?: TFormName | undefined;
@@ -19,6 +19,11 @@ export declare const getStringFormItemFromSwagger: ({ name, arrKey, arrName, per
19
19
  defaultValue?: string | undefined;
20
20
  example?: string | undefined;
21
21
  nullable?: boolean | undefined;
22
+ format?: string | undefined;
23
+ pattern?: string | undefined;
24
+ minLength?: number | undefined;
25
+ maxLength?: number | undefined;
26
+ urlParams?: TUrlParams | undefined;
22
27
  }) => import("react/jsx-runtime").JSX.Element;
23
28
  export declare const getEnumStringFormItemFromSwagger: ({ name, arrKey, arrName, persistName, required, forceNonRequired, description, isAdditionalProperties, removeField, options, persistedControls, onRemoveByMinus, defaultValue, example, nullable, }: {
24
29
  name: TFormName;
@@ -39,7 +44,7 @@ export declare const getEnumStringFormItemFromSwagger: ({ name, arrKey, arrName,
39
44
  example?: string | undefined;
40
45
  nullable?: boolean | undefined;
41
46
  }) => import("react/jsx-runtime").JSX.Element;
42
- export declare const getNumberFormItemFromSwagger: ({ isNumber, name, arrKey, arrName, persistName, required, forceNonRequired, description, isAdditionalProperties, removeField, persistedControls, onRemoveByMinus, defaultValue, example, nullable, }: {
47
+ export declare const getNumberFormItemFromSwagger: ({ isNumber, name, arrKey, arrName, persistName, required, forceNonRequired, description, isAdditionalProperties, removeField, persistedControls, onRemoveByMinus, defaultValue, example, nullable, format, minimum, maximum, }: {
43
48
  isNumber?: boolean | undefined;
44
49
  name: TFormName;
45
50
  arrKey?: number | undefined;
@@ -57,6 +62,9 @@ export declare const getNumberFormItemFromSwagger: ({ isNumber, name, arrKey, ar
57
62
  defaultValue?: number | undefined;
58
63
  example?: number | undefined;
59
64
  nullable?: boolean | undefined;
65
+ format?: string | undefined;
66
+ minimum?: number | undefined;
67
+ maximum?: number | undefined;
60
68
  }) => import("react/jsx-runtime").JSX.Element;
61
69
  export declare const getRangeInputFormItemFromSwagger: ({ name, arrKey, arrName, persistName, required, forceNonRequired, description, isEdit, persistedControls, customProps, urlParams, onRemoveByMinus, }: {
62
70
  name: TFormName;
@@ -72,7 +80,7 @@ export declare const getRangeInputFormItemFromSwagger: ({ name, arrKey, arrName,
72
80
  urlParams: TUrlParams;
73
81
  onRemoveByMinus?: (() => void) | undefined;
74
82
  }) => import("react/jsx-runtime").JSX.Element;
75
- export declare const getStringMultilineFormItemFromSwagger: ({ name, arrKey, arrName, persistName, required, forceNonRequired, description, isAdditionalProperties, removeField, persistedControls, onRemoveByMinus, isBase64, defaultValue, example, nullable, }: {
83
+ export declare const getStringMultilineFormItemFromSwagger: ({ name, arrKey, arrName, persistName, required, forceNonRequired, description, isAdditionalProperties, removeField, persistedControls, onRemoveByMinus, isBase64, defaultValue, example, nullable, format, pattern, minLength, maxLength, }: {
76
84
  name: TFormName;
77
85
  arrKey?: number | undefined;
78
86
  arrName?: TFormName | undefined;
@@ -90,8 +98,12 @@ export declare const getStringMultilineFormItemFromSwagger: ({ name, arrKey, arr
90
98
  defaultValue?: string | undefined;
91
99
  example?: string | undefined;
92
100
  nullable?: boolean | undefined;
101
+ format?: string | undefined;
102
+ pattern?: string | undefined;
103
+ minLength?: number | undefined;
104
+ maxLength?: number | undefined;
93
105
  }) => import("react/jsx-runtime").JSX.Element;
94
- export declare const getListInputFormItemFromSwagger: ({ name, arrKey, arrName, persistName, required, forceNonRequired, description, isAdditionalProperties, removeField, persistedControls, customProps, urlParams, onRemoveByMinus, defaultValue, }: {
106
+ export declare const getListInputFormItemFromSwagger: ({ name, arrKey, arrName, persistName, required, forceNonRequired, description, isAdditionalProperties, removeField, persistedControls, customProps, urlParams, onRemoveByMinus, defaultValue, minItems, maxItems, }: {
95
107
  name: TFormName;
96
108
  arrKey?: number | undefined;
97
109
  arrName?: TFormName | undefined;
@@ -108,6 +120,8 @@ export declare const getListInputFormItemFromSwagger: ({ name, arrKey, arrName,
108
120
  urlParams: TUrlParams;
109
121
  onRemoveByMinus?: (() => void) | undefined;
110
122
  defaultValue?: string | string[] | undefined;
123
+ minItems?: number | undefined;
124
+ maxItems?: number | undefined;
111
125
  }) => import("react/jsx-runtime").JSX.Element;
112
126
  export declare const getBooleanFormItemFromSwagger: ({ name, arrKey, arrName, description, makeValueUndefined, isAdditionalProperties, removeField, onRemoveByMinus, defaultValue, }: {
113
127
  name: TFormName;
@@ -183,9 +197,10 @@ export declare const getObjectFormItemsDraft: ({ properties, name, arrKey, arrNa
183
197
  sortPaths?: string[][] | undefined;
184
198
  urlParams: TUrlParams;
185
199
  }) => import("react/jsx-runtime").JSX.Element;
186
- export declare const getObjectFormItemFromSwagger: ({ properties, oneOfRequiredGroups, objectValidationErrors, name, arrKey, arrName, expandName, persistName, selfRequired, required, forceNonRequired, description, namespaceData, makeValueUndefined, addField, isAdditionalProperties, removeField, isEdit, expandedControls, persistedControls, sortPaths, urlParams, onRemoveByMinus, }: {
200
+ export declare const getObjectFormItemFromSwagger: ({ properties, oneOfRequiredGroups, oneOfBranches, objectValidationErrors, name, arrKey, arrName, expandName, persistName, selfRequired, required, forceNonRequired, description, namespaceData, makeValueUndefined, addField, isAdditionalProperties, removeField, isEdit, expandedControls, persistedControls, sortPaths, urlParams, onRemoveByMinus, }: {
187
201
  properties: TFormSchemaProperties;
188
202
  oneOfRequiredGroups?: string[][] | undefined;
203
+ oneOfBranches?: TFormSchemaNode['oneOfBranches'];
189
204
  objectValidationErrors?: Record<string, string[]> | undefined;
190
205
  name: TFormName;
191
206
  arrKey?: number | undefined;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ type TLoadingContainerProps = {
3
+ $minHeight?: number;
4
+ };
5
+ export declare const Styled: {
6
+ LoadingContainer: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, TLoadingContainerProps>>;
7
+ };
8
+ export {};
@@ -37,6 +37,7 @@ export type TEnrichedTableProps<T extends AnyObject = AnyObject> = {
37
37
  maxHeight?: number;
38
38
  virtual?: boolean;
39
39
  disablePagination?: boolean;
40
+ loadingMinHeight?: number | string;
40
41
  };
41
42
  };
42
43
  export declare const EnrichedTable: <T extends AnyObject = AnyObject>({ theme, baseprefix, dataSource, columns, pathToNavigate, recordKeysForNavigation, recordKeysForNavigationSecond, recordKeysForNavigationThird, additionalPrinterColumnsUndefinedValues, additionalPrinterColumnsTrimLengths, additionalPrinterColumnsColWidths, additionalPrinterColumnsTooltips, additionalPrinterColumnsKeyTypeProps, additionalPrinterColumnsCustomSortersAndFilters, selectData, withoutControls, rowClassName, onRow, rowClickable, tableProps, }: TEnrichedTableProps<T>) => import("react/jsx-runtime").JSX.Element | null;
@@ -43,6 +43,7 @@ export type TEnrichedTableProviderProps = {
43
43
  maxHeight?: number;
44
44
  virtual?: boolean;
45
45
  disablePagination?: boolean;
46
+ loadingMinHeight?: number | string;
46
47
  };
47
48
  withoutControls?: boolean;
48
49
  pathToKey?: string;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ type TLoadingContainerProps = {
3
+ $minHeight?: number | string;
4
+ };
5
+ export declare const Styled: {
6
+ LoadingContainer: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, TLoadingContainerProps>>;
7
+ };
8
+ export {};
@@ -1,5 +1,11 @@
1
1
  export type TFormSchemaKnownType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'listInput' | 'multilineString' | 'multilineStringBase64' | 'rangeInputCpu' | 'rangeInputMemory';
2
2
  type TFormSchemaLooseType = TFormSchemaKnownType | (string & {});
3
+ export type TFormSchemaOneOfMatchValue = string | number | boolean;
4
+ export interface TFormSchemaOneOfBranch {
5
+ match?: Record<string, TFormSchemaOneOfMatchValue>;
6
+ required?: string[];
7
+ forbidden?: string[];
8
+ }
3
9
  /**
4
10
  * Mirror of the normalized form-schema contract returned by the BFF.
5
11
  * Toolkit components should consume this type instead of raw OpenAPI v2 types.
@@ -12,9 +18,18 @@ export interface TFormSchemaNode {
12
18
  required?: string[];
13
19
  enum?: string[];
14
20
  oneOfRequiredGroups?: string[][];
21
+ oneOfBranches?: TFormSchemaOneOfBranch[];
15
22
  default?: unknown;
16
23
  example?: unknown;
17
24
  nullable?: boolean;
25
+ format?: string;
26
+ pattern?: string;
27
+ minLength?: number;
28
+ maxLength?: number;
29
+ minItems?: number;
30
+ maxItems?: number;
31
+ minimum?: number;
32
+ maximum?: number;
18
33
  description?: string;
19
34
  customProps?: unknown;
20
35
  isAdditionalProperties?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prorobotech/openapi-k8s-toolkit",
3
- "version": "1.5.0-alpha.2",
3
+ "version": "1.5.0-alpha.4",
4
4
  "description": "ProRobotech OpenAPI k8s tools",
5
5
  "main": "dist/openapi-k8s-toolkit.cjs.js",
6
6
  "module": "dist/openapi-k8s-toolkit.es.js",