@platform-mesh/portal-ui-lib 0.73.0 → 0.74.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.
@@ -1,47 +1,42 @@
1
- import { TableFieldDefinition, FormFieldDefinition, ButtonSettings, FieldFilterDefinition, GenericResource } from '@openmfp/ngx';
2
- export { ButtonSettings, CssRule, GenericResource, ModalSettings, PropertyField, ResourceFieldButtonClickEvent, TransformType, UiSettings } from '@openmfp/ngx';
3
- import { ObjectMeta, Condition } from 'kubernetes-types/meta/v1';
4
-
5
- declare const ALL_NAMESPACE = "-all-";
6
- declare const kcpRootOrgsPath = "root:orgs";
7
-
8
- interface AccountInfo {
9
- metadata: ObjectMeta;
10
- spec: {
11
- account: {
12
- originClusterId: string;
13
- };
14
- clusterInfo: {
15
- ca: string;
16
- };
17
- organization: {
18
- originClusterId: string;
19
- name: string;
20
- };
21
- /** Absent until an identity provider is set up for the organization. */
22
- oidc?: {
23
- issuerUrl: string;
24
- clients: {
25
- kubectl?: {
26
- clientId: string;
27
- /** Secret of a client that is not public; absent for a public client. */
28
- clientSecret?: string | null;
29
- };
30
- };
31
- /** Scopes to request besides openid; empty leaves the choice to the client. */
32
- scopes?: string[] | null;
33
- /** PEM bundle to verify the issuer with; empty for a publicly trusted certificate. */
34
- ca?: string | null;
1
+ import { ButtonSettings, ButtonSettings as ButtonSettings$1, CssRule, FieldFilterDefinition, FormFieldDefinition, GenericResource, GenericResource as GenericResource$2, ModalSettings, PropertyField, ResourceFieldButtonClickEvent, TableFieldDefinition, TransformType, UiSettings } from "@openmfp/ngx";
2
+ import { Condition, ObjectMeta } from "kubernetes-types/meta/v1";
3
+ export declare const ALL_NAMESPACE = "-all-";
4
+ export declare const kcpRootOrgsPath = "root:orgs";
5
+ export interface AccountInfo {
6
+ metadata: ObjectMeta;
7
+ spec: {
8
+ account: {
9
+ originClusterId: string;
10
+ };
11
+ clusterInfo: {
12
+ ca: string;
13
+ };
14
+ organization: {
15
+ originClusterId: string;
16
+ name: string;
17
+ };
18
+ /** Absent until an identity provider is set up for the organization. */
19
+ oidc?: {
20
+ issuerUrl: string;
21
+ clients: {
22
+ kubectl?: {
23
+ clientId: string;
24
+ /** Secret of a client that is not public; absent for a public client. */
25
+ clientSecret?: string | null;
35
26
  };
27
+ };
28
+ /** Scopes to request besides openid; empty leaves the choice to the client. */
29
+ scopes?: string[] | null;
30
+ /** PEM bundle to verify the issuer with; empty for a publicly trusted certificate. */
31
+ ca?: string | null;
36
32
  };
33
+ };
37
34
  }
38
-
39
- interface LogicalCluster {
40
- status: {
41
- phase: string;
42
- };
35
+ export interface LogicalCluster {
36
+ status: {
37
+ phase: string;
38
+ };
43
39
  }
44
-
45
40
  /**
46
41
  * Action performed inside a modal, reported back on close.
47
42
  *
@@ -49,14 +44,14 @@ interface LogicalCluster {
49
44
  * `'delete'`). Consumers pass the action through `goBackContext` so the host
50
45
  * (e.g. a table) can react accordingly.
51
46
  */
52
- type ModalResultAction = 'create' | 'navigate' | 'loadTableData';
47
+ export type ModalResultAction = 'create' | 'navigate' | 'loadTableData';
53
48
  /**
54
49
  * How the modal was closed.
55
50
  *
56
51
  * - `'submit'` — the user completed the modal; `action`/`resource` are honored.
57
52
  * - `'cancelled'` — the modal was dismissed; the host performs no action.
58
53
  */
59
- type ModalResultStatus = 'submit' | 'cancelled';
54
+ export type ModalResultStatus = 'submit' | 'cancelled';
60
55
  /**
61
56
  * Context passed to `LuigiClient.linkManager().goBack(context)` when a modal
62
57
  * opened via `openAsModal` (button action `'openInModal'`) is closed. The
@@ -75,13 +70,13 @@ type ModalResultStatus = 'submit' | 'cancelled';
75
70
  *
76
71
  * @typeParam T - Type of the affected resource.
77
72
  */
78
- interface ModalResultContext<T = unknown> {
79
- /** How the modal was closed. Treated as `'cancelled'` when omitted. */
80
- status?: ModalResultStatus;
81
- /** Action performed inside the modal (applied only when `status` is `'submit'`). */
82
- action?: ModalResultAction;
83
- /** Resource affected by the action (e.g. the created resource). May be undefined. */
84
- resource?: T;
73
+ export interface ModalResultContext<T = unknown> {
74
+ /** How the modal was closed. Treated as `'cancelled'` when omitted. */
75
+ status?: ModalResultStatus;
76
+ /** Action performed inside the modal (applied only when `status` is `'submit'`). */
77
+ action?: ModalResultAction;
78
+ /** Resource affected by the action (e.g. the created resource). May be undefined. */
79
+ resource?: T;
85
80
  }
86
81
  /**
87
82
  * Value the `openAsModal` promise resolves with. Luigi wraps the
@@ -93,147 +88,142 @@ interface ModalResultContext<T = unknown> {
93
88
  *
94
89
  * @typeParam T - Type of the affected resource.
95
90
  */
96
- interface ModalResult<T = unknown> {
97
- /** The `goBackContext` provided when closing the modal. */
98
- data?: ModalResultContext<T>;
99
- }
100
-
101
- interface Permission {
102
- actions: string[];
103
- resource: string;
104
- }
105
- interface InstancePermission extends Permission {
106
- namespace?: string;
107
- name?: string;
108
- }
109
-
110
- type PlatformMeshFieldDefinition = TableFieldDefinition & Omit<FormFieldDefinition, 'name' | 'label'> & {
111
- label?: string;
112
- dynamicValuesDefinition?: {
113
- operation: string;
114
- gqlQuery: string;
115
- gqlQueryVariables?: Record<string, string>;
116
- value: string;
117
- key: string;
118
- };
91
+ export interface ModalResult<T = unknown> {
92
+ /** The `goBackContext` provided when closing the modal. */
93
+ data?: ModalResultContext<T>;
94
+ }
95
+ export interface Permission {
96
+ actions: string[];
97
+ resource: string;
98
+ }
99
+ export interface InstancePermission extends Permission {
100
+ namespace?: string;
101
+ name?: string;
102
+ }
103
+ export type PlatformMeshFieldDefinition = TableFieldDefinition & Omit<FormFieldDefinition, 'name' | 'label'> & {
104
+ label?: string;
105
+ dynamicValuesDefinition?: {
106
+ operation: string;
107
+ gqlQuery: string;
108
+ gqlQueryVariables?: Record<string, string>;
109
+ value: string;
110
+ key: string;
111
+ };
119
112
  };
120
- declare const DOWNLOAD_KUBECONFIG_FROM_SECRET_REF_ACTION = "download-kubeconfig-from-secret-ref";
113
+ export declare const DOWNLOAD_KUBECONFIG_FROM_SECRET_REF_ACTION = "download-kubeconfig-from-secret-ref";
121
114
  /**
122
115
  * `ButtonSettings` plus the extra data the kubeconfig download needs. Used
123
116
  * inside `UiView.actions[].uiSettings.buttonSettings`.
124
117
  */
125
- interface DownloadKubeconfigFromSecretRefButtonSettings extends ButtonSettings {
126
- action: typeof DOWNLOAD_KUBECONFIG_FROM_SECRET_REF_ACTION;
127
- /** Resource property holding the referenced Secret name. */
128
- resourceProperty: string;
129
- /** Secret `data` key to download; defaults to `kubeconfig`. */
130
- dataKey?: string;
131
- /** Download filename; defaults to `kubeconfig.yaml`. */
132
- filename?: string;
133
- /**
134
- * Resource property holding the Secret namespace; falls back to the
135
- * resource's own namespace, then the node context namespace.
136
- */
137
- namespaceProperty?: string;
138
- }
139
- interface UiView {
140
- actions?: PlatformMeshFieldDefinition[];
141
- fields?: PlatformMeshFieldDefinition[];
142
- resourceDescription?: PlatformMeshFieldDefinition;
143
- resourceTitle?: PlatformMeshFieldDefinition;
144
- backgroundImageUrl?: string;
145
- }
146
- interface UIDefinition {
147
- logoUrl?: string;
148
- listView?: ListView;
149
- createView?: UiView;
150
- detailView?: DetailView;
151
- }
152
- interface ListView extends UiView {
153
- /** Horizontal overflow behavior for list and search tables. Defaults to Scroll. */
154
- overflowMode?: 'Scroll' | 'Popin';
155
- filters?: FieldFilterDefinition[];
156
- baselineFilters?: FieldFilterDefinition[];
157
- /**
158
- * Absolute path a row click navigates to, with `{resource.<dot.path>}` and
159
- * `{context.<dot.path>}` placeholders resolved against the clicked row and the
160
- * current Luigi context respectively — e.g.
161
- * `"/workspaces/{context.org}/components/{resource.metadata.name}"`.
162
- * When set, overrides the default relative navigation to the row's detail
163
- * view, so a flat list can link into an entity-scoped path.
164
- */
165
- resourceURL?: string;
166
- }
167
- interface DetailView extends UiView {
168
- showDownloadKubeconfig?: boolean;
169
- }
170
-
171
- interface ResourceStatus {
172
- conditions: Condition[];
173
- }
174
- interface ResourceSpec extends Record<string, any> {
175
- type: string;
176
- description?: string;
177
- displayName?: string;
178
- }
179
- interface ResourceMeta extends ObjectMeta {
180
- name: string;
181
- }
182
- interface Resource extends GenericResource {
183
- metadata: ResourceMeta;
184
- spec?: ResourceSpec;
185
- status?: ResourceStatus;
186
- __typename?: string;
187
- data?: Record<string, any>;
188
- ready?: boolean;
189
- isAvailable?: boolean;
190
- accessibleName?: string;
191
- }
192
- interface PermissionsDefinition {
193
- group: string;
194
- resource: string;
195
- entityActions: string[];
196
- resourceActions: string[];
197
- entityContextKey: string;
198
- }
199
- interface ResourceDefinition {
200
- apiGroup?: string;
201
- version: string;
202
- entityCollection: string;
203
- entity: string;
204
- name?: string;
205
- scope?: KubernetesScope;
206
- namespace?: string;
207
- readyCondition?: PlatformMeshFieldDefinition;
208
- /**
209
- * Keep resources usable while their ready condition is false. Resources that
210
- * are pending deletion remain unavailable.
211
- */
212
- availableWhenNotReady?: boolean;
213
- ui?: UIDefinition;
214
- permissionsDefinition?: PermissionsDefinition;
215
- }
216
- declare const ResourceOperationTypeMap: {
217
- readonly ADDED: "ADDED";
218
- readonly MODIFIED: "MODIFIED";
219
- readonly DELETED: "DELETED";
118
+ export interface DownloadKubeconfigFromSecretRefButtonSettings extends ButtonSettings$1 {
119
+ action: typeof DOWNLOAD_KUBECONFIG_FROM_SECRET_REF_ACTION;
120
+ /** Resource property holding the referenced Secret name. */
121
+ resourceProperty: string;
122
+ /** Secret `data` key to download; defaults to `kubeconfig`. */
123
+ dataKey?: string;
124
+ /** Download filename; defaults to `kubeconfig.yaml`. */
125
+ filename?: string;
126
+ /**
127
+ * Resource property holding the Secret namespace; falls back to the
128
+ * resource's own namespace, then the node context namespace.
129
+ */
130
+ namespaceProperty?: string;
131
+ }
132
+ export interface UiView {
133
+ actions?: PlatformMeshFieldDefinition[];
134
+ fields?: PlatformMeshFieldDefinition[];
135
+ resourceDescription?: PlatformMeshFieldDefinition;
136
+ resourceTitle?: PlatformMeshFieldDefinition;
137
+ backgroundImageUrl?: string;
138
+ }
139
+ export interface UIDefinition {
140
+ logoUrl?: string;
141
+ listView?: ListView;
142
+ createView?: UiView;
143
+ detailView?: DetailView;
144
+ }
145
+ export interface ListView extends UiView {
146
+ /** Horizontal overflow behavior for list and search tables. Defaults to Scroll. */
147
+ overflowMode?: 'Scroll' | 'Popin';
148
+ filters?: FieldFilterDefinition[];
149
+ baselineFilters?: FieldFilterDefinition[];
150
+ /**
151
+ * Absolute path a row click navigates to, with `{resource.<dot.path>}` and
152
+ * `{context.<dot.path>}` placeholders resolved against the clicked row and the
153
+ * current Luigi context respectively — e.g.
154
+ * `"/workspaces/{context.org}/components/{resource.metadata.name}"`.
155
+ * When set, overrides the default relative navigation to the row's detail
156
+ * view, so a flat list can link into an entity-scoped path.
157
+ */
158
+ resourceURL?: string;
159
+ }
160
+ export interface DetailView extends UiView {
161
+ showDownloadKubeconfig?: boolean;
162
+ }
163
+ export interface ResourceStatus {
164
+ conditions: Condition[];
165
+ }
166
+ export interface ResourceSpec extends Record<string, any> {
167
+ type: string;
168
+ description?: string;
169
+ displayName?: string;
170
+ }
171
+ export interface ResourceMeta extends ObjectMeta {
172
+ name: string;
173
+ }
174
+ export interface Resource extends GenericResource$2 {
175
+ metadata: ResourceMeta;
176
+ spec?: ResourceSpec;
177
+ status?: ResourceStatus;
178
+ __typename?: string;
179
+ data?: Record<string, any>;
180
+ ready?: boolean;
181
+ isAvailable?: boolean;
182
+ accessibleName?: string;
183
+ }
184
+ export interface PermissionsDefinition {
185
+ group: string;
186
+ resource: string;
187
+ entityActions: string[];
188
+ resourceActions: string[];
189
+ entityContextKey: string;
190
+ }
191
+ export interface ResourceDefinition {
192
+ apiGroup?: string;
193
+ version: string;
194
+ entityCollection: string;
195
+ entity: string;
196
+ name?: string;
197
+ scope?: KubernetesScope;
198
+ namespace?: string;
199
+ readyCondition?: PlatformMeshFieldDefinition;
200
+ /**
201
+ * Keep resources usable while their ready condition is false. Resources that
202
+ * are pending deletion remain unavailable.
203
+ */
204
+ availableWhenNotReady?: boolean;
205
+ ui?: UIDefinition;
206
+ permissionsDefinition?: PermissionsDefinition;
207
+ }
208
+ export declare const ResourceOperationTypeMap: {
209
+ readonly ADDED: "ADDED";
210
+ readonly MODIFIED: "MODIFIED";
211
+ readonly DELETED: "DELETED";
220
212
  };
221
- type ResourceOperationType = (typeof ResourceOperationTypeMap)[keyof typeof ResourceOperationTypeMap];
222
- interface ResourceSubscriptionResult {
223
- type: ResourceOperationType;
224
- object: Resource;
225
- }
226
- interface ResourcePagination {
227
- limit: number | undefined;
228
- continue: string | undefined;
229
- }
230
- interface ResourceListResult {
231
- resourceVersion: string;
232
- items: Resource[];
233
- continue: string | undefined;
234
- remainingItemCount?: number;
235
- }
236
- type KubernetesScope = 'Cluster' | 'Namespaced';
237
-
238
- export { ALL_NAMESPACE, DOWNLOAD_KUBECONFIG_FROM_SECRET_REF_ACTION, ResourceOperationTypeMap, kcpRootOrgsPath };
239
- export type { AccountInfo, DetailView, DownloadKubeconfigFromSecretRefButtonSettings, InstancePermission, KubernetesScope, ListView, LogicalCluster, ModalResult, ModalResultAction, ModalResultContext, ModalResultStatus, Permission, PermissionsDefinition, PlatformMeshFieldDefinition, Resource, ResourceDefinition, ResourceListResult, ResourceMeta, ResourceOperationType, ResourcePagination, ResourceSpec, ResourceStatus, ResourceSubscriptionResult, UIDefinition, UiView };
213
+ export type ResourceOperationType = (typeof ResourceOperationTypeMap)[keyof typeof ResourceOperationTypeMap];
214
+ export interface ResourceSubscriptionResult {
215
+ type: ResourceOperationType;
216
+ object: Resource;
217
+ }
218
+ export interface ResourcePagination {
219
+ limit: number | undefined;
220
+ continue: string | undefined;
221
+ }
222
+ export interface ResourceListResult {
223
+ resourceVersion: string;
224
+ items: Resource[];
225
+ continue: string | undefined;
226
+ remainingItemCount?: number;
227
+ }
228
+ export type KubernetesScope = 'Cluster' | 'Namespaced';
229
+ export { type ButtonSettings, type CssRule, GenericResource, type ModalSettings, type PropertyField, type ResourceFieldButtonClickEvent, type TransformType, type UiSettings };