@omniviewdev/runtime 0.23.0 → 0.24.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/extensions/index.d.ts +1 -0
- package/dist/extensions/resource-editor.d.ts +22 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +1700 -1627
- package/dist/types/index.d.ts +1 -0
- package/dist/types/resource-editor.d.ts +195 -0
- package/package.json +3 -3
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
export declare const RESOURCE_EDITOR_EXTENSION_POINT: "kubernetes/resource/editor/v1";
|
|
3
|
+
export type ResourceEditorPath = readonly (string | number)[];
|
|
4
|
+
export type ResourceEditorIntent = 'create' | 'edit' | 'inspect' | 'action';
|
|
5
|
+
export type ResourceEditorAvailability = 'available' | 'denied' | 'unavailable' | 'absent' | 'unknown';
|
|
6
|
+
export interface ResourceEditorTarget {
|
|
7
|
+
group: string;
|
|
8
|
+
version: string;
|
|
9
|
+
kind: string;
|
|
10
|
+
resource: string;
|
|
11
|
+
scope: 'Namespaced' | 'Cluster';
|
|
12
|
+
}
|
|
13
|
+
export interface ResourceEditorCapabilities {
|
|
14
|
+
create: ResourceEditorAvailability;
|
|
15
|
+
update: ResourceEditorAvailability;
|
|
16
|
+
delete: ResourceEditorAvailability;
|
|
17
|
+
list: ResourceEditorAvailability;
|
|
18
|
+
get: ResourceEditorAvailability;
|
|
19
|
+
actions: Readonly<Record<string, ResourceEditorAvailability>>;
|
|
20
|
+
}
|
|
21
|
+
export interface ResourceEditorContext extends ResourceEditorTarget {
|
|
22
|
+
connectionID: string;
|
|
23
|
+
namespace?: string;
|
|
24
|
+
/** Trusted host policy only. Omission means unknown, never application-owned. */
|
|
25
|
+
ownership?: {
|
|
26
|
+
status: 'application' | 'controller' | 'system' | 'unknown';
|
|
27
|
+
};
|
|
28
|
+
name?: string;
|
|
29
|
+
uid?: string;
|
|
30
|
+
resourceVersion?: string;
|
|
31
|
+
intent: ResourceEditorIntent;
|
|
32
|
+
capabilities: ResourceEditorCapabilities;
|
|
33
|
+
discovery: {
|
|
34
|
+
status: ResourceEditorAvailability;
|
|
35
|
+
features: Readonly<Record<string, ResourceEditorAvailability>>;
|
|
36
|
+
};
|
|
37
|
+
schema: {
|
|
38
|
+
status: ResourceEditorAvailability;
|
|
39
|
+
identity?: string;
|
|
40
|
+
paths?: readonly ResourceEditorPath[];
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** Host-owned immutable, redacted projection. Never persist drafts or opaque values. */
|
|
44
|
+
export interface ResourceEditorDraft {
|
|
45
|
+
readonly sessionID: string;
|
|
46
|
+
readonly revision: number;
|
|
47
|
+
get(this: void, path: ResourceEditorPath): unknown;
|
|
48
|
+
has(this: void, path: ResourceEditorPath): boolean;
|
|
49
|
+
}
|
|
50
|
+
export type ResourceEditorPatch = {
|
|
51
|
+
op: 'set';
|
|
52
|
+
path: ResourceEditorPath;
|
|
53
|
+
value: unknown;
|
|
54
|
+
} | {
|
|
55
|
+
op: 'remove';
|
|
56
|
+
path: ResourceEditorPath;
|
|
57
|
+
} | {
|
|
58
|
+
op: 'insert';
|
|
59
|
+
path: ResourceEditorPath;
|
|
60
|
+
index: number;
|
|
61
|
+
value: unknown;
|
|
62
|
+
};
|
|
63
|
+
export interface ResourceEditorPatchRequest {
|
|
64
|
+
sessionID: string;
|
|
65
|
+
expectedRevision: number;
|
|
66
|
+
operations: readonly ResourceEditorPatch[];
|
|
67
|
+
}
|
|
68
|
+
export type ResourceEditorPatchResult = {
|
|
69
|
+
status: 'accepted';
|
|
70
|
+
revision: number;
|
|
71
|
+
} | {
|
|
72
|
+
status: 'stale' | 'forbidden' | 'immutable' | 'unsafe' | 'invalid';
|
|
73
|
+
message: string;
|
|
74
|
+
};
|
|
75
|
+
export interface ResourceEditorFieldIssue {
|
|
76
|
+
path: ResourceEditorPath;
|
|
77
|
+
message: string;
|
|
78
|
+
}
|
|
79
|
+
export type ResourceEditorReferenceProjection = 'metadata' | 'servicePorts' | 'storageClass' | 'ingressClass' | 'secretType';
|
|
80
|
+
export interface ResourceEditorServiceRequest {
|
|
81
|
+
sessionID: string;
|
|
82
|
+
generation: number;
|
|
83
|
+
signal: AbortSignal;
|
|
84
|
+
}
|
|
85
|
+
export interface ResourceEditorReferenceRequest extends ResourceEditorServiceRequest {
|
|
86
|
+
group: string;
|
|
87
|
+
version: string;
|
|
88
|
+
resource: string;
|
|
89
|
+
namespace?: string;
|
|
90
|
+
projection?: ResourceEditorReferenceProjection;
|
|
91
|
+
}
|
|
92
|
+
/** Sanitized reference only; secret data and arbitrary resource bodies are never returned. */
|
|
93
|
+
export interface ResourceEditorReference {
|
|
94
|
+
name: string;
|
|
95
|
+
namespace?: string;
|
|
96
|
+
uid?: string;
|
|
97
|
+
labels?: Readonly<Record<string, string>>;
|
|
98
|
+
servicePorts?: readonly {
|
|
99
|
+
name?: string;
|
|
100
|
+
port: number;
|
|
101
|
+
protocol?: string;
|
|
102
|
+
targetPort?: string | number;
|
|
103
|
+
}[];
|
|
104
|
+
/** Sanitized selector presence; omission must be treated as unknown. */
|
|
105
|
+
serviceSelector?: 'none' | 'present' | 'unknown';
|
|
106
|
+
storageClass?: {
|
|
107
|
+
provisioner: string;
|
|
108
|
+
volumeBindingMode?: string;
|
|
109
|
+
allowVolumeExpansion?: boolean;
|
|
110
|
+
};
|
|
111
|
+
ingressClass?: {
|
|
112
|
+
controller: string;
|
|
113
|
+
isDefault?: boolean;
|
|
114
|
+
};
|
|
115
|
+
secretType?: string;
|
|
116
|
+
}
|
|
117
|
+
export type ResourceEditorReferenceResult = {
|
|
118
|
+
status: 'ready';
|
|
119
|
+
items: readonly ResourceEditorReference[];
|
|
120
|
+
} | {
|
|
121
|
+
status: 'denied' | 'unavailable' | 'absent';
|
|
122
|
+
message: string;
|
|
123
|
+
};
|
|
124
|
+
export interface ResourceEditorReferenceService {
|
|
125
|
+
list(this: void, request: ResourceEditorReferenceRequest): Promise<ResourceEditorReferenceResult>;
|
|
126
|
+
}
|
|
127
|
+
export interface ResourceEditorActionRequest extends ResourceEditorServiceRequest {
|
|
128
|
+
protocol: string;
|
|
129
|
+
input: unknown;
|
|
130
|
+
}
|
|
131
|
+
export type ResourceEditorActionResult = {
|
|
132
|
+
status: 'ready';
|
|
133
|
+
output: unknown;
|
|
134
|
+
sensitive?: boolean;
|
|
135
|
+
} | {
|
|
136
|
+
status: 'denied' | 'unavailable' | 'absent' | 'invalid' | 'cancelled';
|
|
137
|
+
message: string;
|
|
138
|
+
};
|
|
139
|
+
export interface ResourceEditorActionService {
|
|
140
|
+
execute(this: void, request: ResourceEditorActionRequest): Promise<ResourceEditorActionResult>;
|
|
141
|
+
}
|
|
142
|
+
export interface ResourceEditorFormProps {
|
|
143
|
+
context: ResourceEditorContext;
|
|
144
|
+
draft: ResourceEditorDraft;
|
|
145
|
+
baseline?: ResourceEditorDraft;
|
|
146
|
+
section: string;
|
|
147
|
+
disabled: boolean;
|
|
148
|
+
patch(this: void, request: ResourceEditorPatchRequest): ResourceEditorPatchResult;
|
|
149
|
+
onValidityChange(this: void, error: string | null): void;
|
|
150
|
+
references: ResourceEditorReferenceService;
|
|
151
|
+
actions: ResourceEditorActionService;
|
|
152
|
+
requestResult?: ResourceEditorActionResult;
|
|
153
|
+
}
|
|
154
|
+
export interface ResourceEditorRequirements {
|
|
155
|
+
capabilities?: readonly (keyof Omit<ResourceEditorCapabilities, 'actions'>)[];
|
|
156
|
+
actions?: readonly string[];
|
|
157
|
+
features?: readonly string[];
|
|
158
|
+
schema?: {
|
|
159
|
+
identity?: string;
|
|
160
|
+
paths?: readonly ResourceEditorPath[];
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
export interface ResourceEditorContribution {
|
|
164
|
+
contractVersion: 1;
|
|
165
|
+
targets: readonly ResourceEditorTarget[];
|
|
166
|
+
intents: readonly ResourceEditorIntent[];
|
|
167
|
+
label: string;
|
|
168
|
+
sections: readonly {
|
|
169
|
+
id: string;
|
|
170
|
+
label: string;
|
|
171
|
+
}[];
|
|
172
|
+
ownedPaths: readonly ResourceEditorPath[];
|
|
173
|
+
sensitivePaths?: readonly ResourceEditorPath[];
|
|
174
|
+
requirements?: ResourceEditorRequirements;
|
|
175
|
+
/** Domain authoring policy, never RBAC authority; omission means unknown. */
|
|
176
|
+
ownershipPolicy?: 'declarative' | 'conditional' | 'controller' | 'system';
|
|
177
|
+
component: ComponentType<ResourceEditorFormProps>;
|
|
178
|
+
validate?: (draft: ResourceEditorDraft, context: ResourceEditorContext) => readonly ResourceEditorFieldIssue[];
|
|
179
|
+
/** Read-only admission at submit, never enumeration; draft remains redacted. */
|
|
180
|
+
validateSubmission?: (draft: ResourceEditorDraft, context: ResourceEditorContext, services: {
|
|
181
|
+
references: ResourceEditorReferenceService;
|
|
182
|
+
actions: ResourceEditorActionService;
|
|
183
|
+
}, signal: AbortSignal) => Promise<readonly ResourceEditorFieldIssue[]>;
|
|
184
|
+
formUnavailable?: (draft: ResourceEditorDraft, context: ResourceEditorContext) => string | null;
|
|
185
|
+
readOnly?: (draft: ResourceEditorDraft, context: ResourceEditorContext) => boolean;
|
|
186
|
+
request?: {
|
|
187
|
+
protocol: string;
|
|
188
|
+
source: 'canonical';
|
|
189
|
+
} | {
|
|
190
|
+
protocol: string;
|
|
191
|
+
source?: 'projection';
|
|
192
|
+
/** Always receives the redacted projection, never canonical sensitive source. */
|
|
193
|
+
buildInput: (draft: ResourceEditorDraft, context: ResourceEditorContext) => unknown;
|
|
194
|
+
};
|
|
195
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Omniview",
|
|
3
3
|
"license": "AGPL-3.0-only",
|
|
4
4
|
"name": "@omniviewdev/runtime",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.24.0",
|
|
6
6
|
"description": "Runtime shared library for Omniview",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"type": "module",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"omniview"
|
|
53
53
|
],
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@omniviewdev/base-ui": "~0.11.
|
|
55
|
+
"@omniviewdev/base-ui": "~0.11.1",
|
|
56
56
|
"@tanstack/react-query": "5.105.0",
|
|
57
57
|
"@types/node": "26.6.5",
|
|
58
58
|
"@types/react": "19.3.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@typescript/native": "npm:typescript@7.0.2"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@omniviewdev/base-ui": "~0.11.
|
|
71
|
+
"@omniviewdev/base-ui": "~0.11.1",
|
|
72
72
|
"@tanstack/react-query": "^5.105.0",
|
|
73
73
|
"react": "^19.3.1",
|
|
74
74
|
"react-dom": "^19.3.1",
|