@omniviewdev/runtime 0.9.2 → 0.11.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/api.cjs +1 -1
- package/dist/api.d.ts +8 -6
- package/dist/api.js +249 -117
- package/dist/bindings/events/index.d.ts +48 -0
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/invocation/index.d.ts +1 -0
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/invocation/models.d.ts +19 -0
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/exec/servicewrapper.d.ts +1 -1
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/logs/servicewrapper.d.ts +1 -1
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/metric/index.d.ts +1 -1
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/metric/models.d.ts +0 -20
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/metric/servicewrapper.d.ts +3 -6
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/networker/servicewrapper.d.ts +1 -1
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/resource/graph/index.d.ts +2 -2
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/resource/graph/models.d.ts +3 -15
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/resource/graphservice.d.ts +5 -18
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/resource/index.d.ts +1 -1
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/resource/models.d.ts +190 -9
- package/dist/bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/resource/servicewrapper.d.ts +34 -74
- package/dist/bindings/github.com/omniviewdev/omniview/backend/window/index.d.ts +3 -0
- package/dist/bindings/github.com/omniviewdev/omniview/backend/window/models.d.ts +190 -0
- package/dist/bindings/github.com/omniviewdev/omniview/backend/window/service.d.ts +83 -0
- package/dist/bindings/github.com/omniviewdev/omniview/internal/mcprelay/index.d.ts +3 -0
- package/dist/bindings/github.com/omniviewdev/omniview/internal/mcprelay/models.d.ts +178 -0
- package/dist/bindings/github.com/omniviewdev/omniview/internal/mcprelay/servicewrapper.d.ts +30 -0
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/config/models.d.ts +27 -0
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/resource/v2/index.d.ts +2 -0
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/resource/v2/models.d.ts +809 -0
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/types/models.d.ts +94 -0
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/exec/models.d.ts +16 -6
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/logs/index.d.ts +1 -1
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/logs/models.d.ts +27 -17
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/metric/index.d.ts +1 -1
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/metric/models.d.ts +47 -24
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/networker/index.d.ts +1 -1
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/networker/models.d.ts +41 -20
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/settings/models.d.ts +16 -4
- package/dist/{calls-Bg_uMVc9.cjs → calls-B-HP1Icv.cjs} +1 -1
- package/dist/{calls-BvZkVSse.js → calls-DYGtxNJ6.js} +1 -0
- package/dist/compat/types.d.ts +1 -1
- package/dist/context/drawer/RightDrawerContext.d.ts +8 -4
- package/dist/context/drawer/types.d.ts +11 -21
- package/dist/context/index.d.ts +1 -0
- package/dist/context/operations/OperationsContext.d.ts +5 -5
- package/dist/context/windows/WindowActionsContext.d.ts +31 -0
- package/dist/context/windows/activePageNavigator.d.ts +13 -0
- package/dist/context/windows/index.d.ts +2 -0
- package/dist/exec.d.ts +5 -0
- package/dist/graph-JDqyJC_i.js +10 -0
- package/dist/graph-wHun0Bkz.cjs +1 -0
- package/dist/hooks/connection/index.d.ts +2 -1
- package/dist/hooks/connection/useConnection.d.ts +9 -30
- package/dist/hooks/connection/useConnectionProfiles.d.ts +7 -0
- package/dist/hooks/connection/useConnectionStatus.d.ts +8 -1
- package/dist/hooks/connection/useConnections.d.ts +3 -2
- package/dist/hooks/connection/useScopeValues.d.ts +9 -0
- package/dist/hooks/logs/useLogSession.d.ts +4 -1
- package/dist/hooks/metric/useMetricStream.d.ts +6 -2
- package/dist/hooks/metric/useResourceMetrics.d.ts +6 -2
- package/dist/hooks/networker/types.d.ts +5 -2
- package/dist/hooks/networker/useResourcePortForwarder.d.ts +1 -1
- package/dist/hooks/resource/useConnectionQueryGuard.d.ts +1 -1
- package/dist/hooks/resource/useDependencyTree.d.ts +4 -12
- package/dist/hooks/resource/useEditorSchemas.d.ts +12 -7
- package/dist/hooks/resource/useEventBatcher.d.ts +11 -47
- package/dist/hooks/resource/useRelatedResources.d.ts +6 -14
- package/dist/hooks/resource/useResolvedResourceTarget.d.ts +162 -0
- package/dist/hooks/resource/useResource.d.ts +7 -58
- package/dist/hooks/resource/useResourceActions.d.ts +9 -58
- package/dist/hooks/resource/useResourceGraph.d.ts +4 -12
- package/dist/hooks/resource/useResourceGroups.d.ts +5 -19
- package/dist/hooks/resource/useResourceMutations.d.ts +5 -61
- package/dist/hooks/resource/useResourceSearch.d.ts +5 -34
- package/dist/hooks/resource/useResourceType.d.ts +6 -19
- package/dist/hooks/resource/useResourceTypes.d.ts +5 -20
- package/dist/hooks/resource/useResources.d.ts +32 -60
- package/dist/hooks/resource/useStreamAction.d.ts +4 -8
- package/dist/hooks/resource/useWatchState.d.ts +15 -22
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +6 -1
- package/dist/index.js +3007 -2881
- package/dist/logs.d.ts +14 -0
- package/dist/metric.d.ts +35 -0
- package/dist/models-Cg1YRHQm.js +583 -0
- package/dist/models-DSGyy8lg.cjs +1 -0
- package/dist/models-UwESEW2B.js +1232 -0
- package/dist/models-dzj-SsFZ.cjs +1 -0
- package/dist/models.cjs +1 -1
- package/dist/models.d.ts +14 -8
- package/dist/models.js +118 -208
- package/dist/networker.d.ts +31 -0
- package/dist/resource/v2/ancillary.d.ts +161 -0
- package/dist/resource/v2/client.d.ts +57 -0
- package/dist/resource/v2/domain.d.ts +204 -0
- package/dist/resource/v2/graph-client.d.ts +7 -0
- package/dist/resource/v2/graph.d.ts +35 -0
- package/dist/resource/v2/host.d.ts +129 -0
- package/dist/resource/v2/requestJSON.d.ts +2 -0
- package/dist/resource/v2/value.d.ts +9 -0
- package/dist/resourceQueryKeys.d.ts +8 -4
- package/dist/router/Link.d.ts +3 -0
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +1 -1
- package/dist/search.d.ts +9 -11
- package/dist/servicewrapper-BOM6A8IG.cjs +1 -0
- package/dist/servicewrapper-Bda7yi8z.js +684 -0
- package/dist/types/watch.d.ts +48 -21
- package/dist/utils/activeSyncAggregator.d.ts +2 -2
- package/package.json +3 -3
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/resource/index.d.ts +0 -2
- package/dist/bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/resource/models.d.ts +0 -1199
- package/dist/compat/resource.d.ts +0 -4
- package/dist/hooks/connection/useConnectionNamespaces.d.ts +0 -21
- package/dist/legacyEnum-CKqyRmbX.js +0 -15
- package/dist/legacyEnum-DkV5yRdA.cjs +0 -1
- package/dist/models-CT4kHj47.js +0 -2444
- package/dist/models-DQl7tqts.cjs +0 -1
- package/dist/models-DU8pTcoZ.js +0 -142
- package/dist/models-KV9f8Ceh.cjs +0 -1
- package/dist/servicewrapper-C6SURWw1.js +0 -850
- package/dist/servicewrapper-COMjQHnY.cjs +0 -1
- package/dist/utils/resourceKey.d.ts +0 -12
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { AccessRoute, ResourceReference } from '../../resource/v2/domain';
|
|
3
|
+
import { HostRecord } from '../../resource/v2/host';
|
|
2
4
|
/**
|
|
3
5
|
* A factory function that produces a DrawerComponent for a given resource.
|
|
4
6
|
* Plugins export these keyed by resource key so the host can build the full
|
|
@@ -119,28 +121,16 @@ export type DrawerContext<T = any> = {
|
|
|
119
121
|
* Resource information (if this drawer is being displayed as part of a resource)
|
|
120
122
|
*/
|
|
121
123
|
resource?: {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
|
|
128
|
-
*/
|
|
124
|
+
reference: ResourceReference;
|
|
125
|
+
targetId: string;
|
|
126
|
+
route: AccessRoute;
|
|
127
|
+
representation: string;
|
|
128
|
+
/** Opaque host-minted address key, when supplied by the host. */
|
|
129
|
+
key?: string;
|
|
129
130
|
name?: string;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
key: string;
|
|
134
|
-
/**
|
|
135
|
-
* A connection id, if this drawer is displaying something in the context
|
|
136
|
-
* of a connection.
|
|
137
|
-
*/
|
|
138
|
-
connectionID: string;
|
|
139
|
-
/**
|
|
140
|
-
* The plugin that owns this resource. When provided, host-level features
|
|
141
|
-
* like the Events tab can be injected automatically.
|
|
142
|
-
*/
|
|
143
|
-
pluginID?: string;
|
|
131
|
+
pluginID: string;
|
|
132
|
+
/** Original observed record, not a re-fetched replacement. */
|
|
133
|
+
record?: HostRecord;
|
|
144
134
|
};
|
|
145
135
|
};
|
|
146
136
|
export type BottomDrawerTab = {
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export type
|
|
2
|
+
export type BackgroundOperation = {
|
|
3
3
|
id: string;
|
|
4
4
|
label: string;
|
|
5
5
|
resourceKey: string;
|
|
6
6
|
resourceName: string;
|
|
7
|
-
namespace
|
|
7
|
+
namespace?: string;
|
|
8
8
|
connectionID: string;
|
|
9
9
|
status: 'running' | 'completed' | 'error' | 'cancelled';
|
|
10
10
|
progress?: {
|
|
@@ -16,9 +16,9 @@ export type Operation = {
|
|
|
16
16
|
completedAt?: number;
|
|
17
17
|
};
|
|
18
18
|
export type OperationsContextType = {
|
|
19
|
-
operations:
|
|
20
|
-
addOperation: (op:
|
|
21
|
-
updateOperation: (id: string, updates: Partial<
|
|
19
|
+
operations: BackgroundOperation[];
|
|
20
|
+
addOperation: (op: BackgroundOperation) => void;
|
|
21
|
+
updateOperation: (id: string, updates: Partial<BackgroundOperation>) => void;
|
|
22
22
|
removeOperation: (id: string) => void;
|
|
23
23
|
};
|
|
24
24
|
export declare const OperationsContext: React.Context<OperationsContextType | undefined>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type OpenInNewTabOptions = {
|
|
3
|
+
/** Keep the current tab active; the new tab opens behind it. */
|
|
4
|
+
background?: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Opens host routes (e.g. `/_plugin/kubernetes/cluster/abc/resources`) outside
|
|
8
|
+
* the current page tab. The host application provides the implementation.
|
|
9
|
+
*/
|
|
10
|
+
export type WindowActions = {
|
|
11
|
+
/** Opens the path in a new page tab next to the current one. */
|
|
12
|
+
openInNewTab: (path: string, options?: OpenInNewTabOptions) => void;
|
|
13
|
+
/** Opens the path in a new workspace window. */
|
|
14
|
+
openInNewWindow: (path: string) => void;
|
|
15
|
+
/** Opens the path in a new tab in the side-by-side pane, splitting the view if needed. */
|
|
16
|
+
openInSplit: (path: string) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare const WindowActionsContext: React.Context<WindowActions | null>;
|
|
19
|
+
export declare const WindowActionsProvider: React.FC<{
|
|
20
|
+
actions: WindowActions;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Window-level navigation for plugins: open a route in a new tab, a new window
|
|
25
|
+
* or the split pane.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const { openInNewTab } = useWindowActions();
|
|
29
|
+
* openInNewTab(`/_plugin/${pluginId}/cluster/${id}/resources`);
|
|
30
|
+
*/
|
|
31
|
+
export declare function useWindowActions(): WindowActions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type ActivePageNavigator = (path: string) => void;
|
|
2
|
+
/**
|
|
3
|
+
* The host registers how to navigate the page the user is looking at (the
|
|
4
|
+
* active page tab of this window). Returns the unregister function.
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerActivePageNavigator(navigator: ActivePageNavigator): () => void;
|
|
7
|
+
/**
|
|
8
|
+
* Navigates the active page of this window to a host route such as
|
|
9
|
+
* `/settings?category=developer`. Code outside React (error actions, event
|
|
10
|
+
* handlers) uses this instead of touching `window.location`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function navigateActivePage(path: string): void;
|
|
13
|
+
export {};
|
package/dist/exec.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CancellablePromise } from '@wailsio/runtime';
|
|
2
|
+
import { Session, SessionOptions } from './bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/exec/models';
|
|
3
|
+
export { AttachSession, CloseSession, CreateTerminal, DetachSession, GetHandler, GetHandlers, GetPluginHandlers, GetSession, HasPlugin, ListPlugins, ListSessions, ResizeSession, WriteSession, } from './bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/exec/servicewrapper';
|
|
4
|
+
/** Wails receives exact JSON text; the public SDK-shaped API remains typed. */
|
|
5
|
+
export declare function CreateSession(plugin: string, connectionID: string, options: SessionOptions): CancellablePromise<Session | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var o = /* @__PURE__ */ ((e) => (e[e.WatchStateIdle = 0] = "WatchStateIdle", e[e.WatchStateSyncing = 1] = "WatchStateSyncing", e[e.WatchStateSynced = 2] = "WatchStateSynced", e[e.WatchStateError = 3] = "WatchStateError", e[e.WatchStateStopped = 4] = "WatchStateStopped", e[e.WatchStateFailed = 5] = "WatchStateFailed", e[e.WatchStateForbidden = 6] = "WatchStateForbidden", e[e.WatchStateSkipped = 7] = "WatchStateSkipped", e))(o || {}), p = /* @__PURE__ */ ((e) => (e[e.SyncOnConnect = 0] = "SyncOnConnect", e[e.SyncOnFirstQuery = 1] = "SyncOnFirstQuery", e[e.SyncNever = 2] = "SyncNever", e))(p || {});
|
|
2
|
+
function s(e, d) {
|
|
3
|
+
const r = e.reference.address, n = d.reference.address;
|
|
4
|
+
return e.pluginId === d.pluginId && e.reference.incarnation === d.reference.incarnation && r.provider === n.provider && r.authority === n.authority && r.type === n.type && r.id === n.id && r.scope.length === n.scope.length && r.scope.every((t) => n.scope.some((i) => t.dimension === i.dimension && t.value === i.value));
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
p as S,
|
|
8
|
+
o as W,
|
|
9
|
+
s
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var o=(e=>(e[e.WatchStateIdle=0]="WatchStateIdle",e[e.WatchStateSyncing=1]="WatchStateSyncing",e[e.WatchStateSynced=2]="WatchStateSynced",e[e.WatchStateError=3]="WatchStateError",e[e.WatchStateStopped=4]="WatchStateStopped",e[e.WatchStateFailed=5]="WatchStateFailed",e[e.WatchStateForbidden=6]="WatchStateForbidden",e[e.WatchStateSkipped=7]="WatchStateSkipped",e))(o||{}),a=(e=>(e[e.SyncOnConnect=0]="SyncOnConnect",e[e.SyncOnFirstQuery=1]="SyncOnFirstQuery",e[e.SyncNever=2]="SyncNever",e))(a||{});function c(e,t){const r=e.reference.address,n=t.reference.address;return e.pluginId===t.pluginId&&e.reference.incarnation===t.reference.incarnation&&r.provider===n.provider&&r.authority===n.authority&&r.type===n.type&&r.id===n.id&&r.scope.length===n.scope.length&&r.scope.every(d=>n.scope.some(i=>d.dimension===i.dimension&&d.value===i.value))}exports.SyncPolicy=a;exports.WatchState=o;exports.sameGraphNode=c;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from './useConnection';
|
|
2
2
|
export * from './useConnections';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './useScopeValues';
|
|
4
4
|
export * from './useConnectionStatus';
|
|
5
|
+
export * from './useConnectionProfiles';
|
|
5
6
|
export * from './useConnectionReadiness';
|
|
6
7
|
export { requireConnectionReady, withConnectionReady } from '../../connection/connectionReadiness';
|
|
7
8
|
export { ConnectionBoundary, ConnectionBoundaryFallback } from '../../connection/ConnectionBoundary';
|
|
@@ -1,37 +1,16 @@
|
|
|
1
1
|
import { Connection } from '../../bindings/github.com/omniviewdev/plugin-sdk/pkg/types/models';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
2
|
+
import { ConnectionProfileResult } from '../../resource/v2/host';
|
|
3
|
+
/** Connection lifecycle and explicit desired profiles remain separate from native discovery. */
|
|
4
|
+
export declare const useConnection: ({ pluginID: explicitPluginID, connectionID, enabled, }: {
|
|
6
5
|
pluginID?: string;
|
|
7
|
-
/**
|
|
8
|
-
* The ID of the connection
|
|
9
|
-
*/
|
|
10
6
|
connectionID: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* Get and retreive connections from a plugin's connection manager..
|
|
14
|
-
*/
|
|
15
|
-
export declare const useConnection: ({ pluginID: explicitPluginID, connectionID }: UseConnectionOptions) => {
|
|
16
|
-
/**
|
|
17
|
-
* Get the connection
|
|
18
|
-
*/
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
}) => {
|
|
19
9
|
connection: import('@tanstack/react-query').UseQueryResult<Connection, Error>;
|
|
20
|
-
/**
|
|
21
|
-
* Start the connection
|
|
22
|
-
*/
|
|
23
10
|
startConnection: import('@tanstack/react-query').UseMutateAsyncFunction<import('../../models').ConnectionStatus, unknown, void, unknown>;
|
|
24
|
-
/**
|
|
25
|
-
* Stop the connection
|
|
26
|
-
*/
|
|
27
11
|
stopConnection: import('@tanstack/react-query').UseMutateAsyncFunction<Connection, unknown, void, unknown>;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Delete the connection
|
|
34
|
-
*/
|
|
35
|
-
deleteConnection: import('@tanstack/react-query').UseMutateAsyncFunction<void, unknown, void, unknown>;
|
|
12
|
+
saveConnectionProfile: import('@tanstack/react-query').UseMutateAsyncFunction<ConnectionProfileResult, unknown, Connection, unknown>;
|
|
13
|
+
importConnectionProfile: import('@tanstack/react-query').UseMutateAsyncFunction<ConnectionProfileResult, unknown, void, unknown>;
|
|
14
|
+
resetConnectionProfile: import('@tanstack/react-query').UseMutateAsyncFunction<ConnectionProfileResult, unknown, void, unknown>;
|
|
15
|
+
removeConnection: import('@tanstack/react-query').UseMutateAsyncFunction<void, unknown, void, unknown>;
|
|
36
16
|
};
|
|
37
|
-
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ConnectionProfile } from '../../resource/v2/host';
|
|
2
|
+
/** Desired profiles include disabled/review entries missing from effective discovery. */
|
|
3
|
+
export declare function useConnectionProfiles({ pluginID: explicitPluginID }: {
|
|
4
|
+
pluginID?: string;
|
|
5
|
+
}): {
|
|
6
|
+
profiles: import('@tanstack/react-query').UseQueryResult<readonly ConnectionProfile[], Error>;
|
|
7
|
+
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { NativeConnectionReadiness, HostConnectionState } from '../../resource/v2/host';
|
|
2
|
+
import { AppError } from '../../errors/types';
|
|
1
3
|
import { ActiveSync } from '../../utils/activeSyncAggregator';
|
|
2
4
|
export interface ConnectionStatusEntry {
|
|
3
5
|
pluginID: string;
|
|
4
6
|
connectionID: string;
|
|
5
7
|
name: string;
|
|
6
8
|
avatar: string;
|
|
7
|
-
|
|
9
|
+
readiness: NativeConnectionReadiness;
|
|
10
|
+
readinessError?: HostConnectionState['readinessError'];
|
|
8
11
|
sync?: ActiveSync;
|
|
9
12
|
isSyncing: boolean;
|
|
10
13
|
hasErrors: boolean;
|
|
@@ -14,6 +17,10 @@ export interface ConnectionStatusEntry {
|
|
|
14
17
|
pluginError?: string;
|
|
15
18
|
}
|
|
16
19
|
export interface ConnectionStatusSummary {
|
|
20
|
+
isLoading: boolean;
|
|
21
|
+
error?: AppError;
|
|
22
|
+
/** Explicitly refresh native readiness; failures are never retried automatically. */
|
|
23
|
+
refresh: () => Promise<void>;
|
|
17
24
|
entries: ConnectionStatusEntry[];
|
|
18
25
|
grouped: Map<string, ConnectionStatusEntry[]>;
|
|
19
26
|
connectedCount: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AccessRoute, ReadTarget } from '../../resource/v2/domain';
|
|
1
2
|
import { Connection } from '../../bindings/github.com/omniviewdev/plugin-sdk/pkg/types/models';
|
|
2
3
|
type UseConnectionsOptions = {
|
|
3
4
|
/**
|
|
@@ -12,7 +13,7 @@ export declare const connectionListQueryKey: (plugin: string) => string[];
|
|
|
12
13
|
*/
|
|
13
14
|
export declare const useConnections: ({ plugin: explicitPlugin }: UseConnectionsOptions) => {
|
|
14
15
|
connections: import('@tanstack/react-query').UseQueryResult<Connection[], Error>;
|
|
15
|
-
startWatch: import('@tanstack/react-query').UseMutateAsyncFunction<void, unknown,
|
|
16
|
-
stopWatch: import('@tanstack/react-query').UseMutateAsyncFunction<void, unknown,
|
|
16
|
+
startWatch: import('@tanstack/react-query').UseMutateAsyncFunction<void, unknown, readonly ReadTarget[], unknown>;
|
|
17
|
+
stopWatch: import('@tanstack/react-query').UseMutateAsyncFunction<void, unknown, AccessRoute, unknown>;
|
|
17
18
|
};
|
|
18
19
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AccessRoute } from '../../resource/v2/domain';
|
|
2
|
+
export declare const useScopeValues: ({ pluginID: explicitPluginID, route, dimension, enabled, }: {
|
|
3
|
+
pluginID?: string;
|
|
4
|
+
route: AccessRoute;
|
|
5
|
+
dimension: string;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
}) => {
|
|
8
|
+
values: import('@tanstack/react-query').UseQueryResult<string[], Error>;
|
|
9
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Value, ResourceReference, AccessRoute } from '../../resource/v2/domain';
|
|
1
2
|
type UseLogSessionOptions = {
|
|
2
3
|
pluginID?: string;
|
|
3
4
|
};
|
|
@@ -5,7 +6,9 @@ type CreateLogSessionArgs = {
|
|
|
5
6
|
connectionID: string;
|
|
6
7
|
resourceKey: string;
|
|
7
8
|
resourceID: string;
|
|
8
|
-
resourceData:
|
|
9
|
+
resourceData: Value;
|
|
10
|
+
reference?: ResourceReference;
|
|
11
|
+
route?: AccessRoute;
|
|
9
12
|
icon?: string | React.ReactNode;
|
|
10
13
|
label?: string;
|
|
11
14
|
target?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MetricResult } from '../../bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/metric/models';
|
|
2
|
+
import { Value, ResourceReference, AccessRoute } from '../../resource/v2/domain';
|
|
2
3
|
export type UseMetricStreamOptions = {
|
|
3
4
|
/** The plugin providing metrics */
|
|
4
5
|
pluginID?: string;
|
|
@@ -10,8 +11,11 @@ export type UseMetricStreamOptions = {
|
|
|
10
11
|
resourceID: string;
|
|
11
12
|
/** The resource namespace */
|
|
12
13
|
resourceNamespace?: string;
|
|
13
|
-
/**
|
|
14
|
-
resourceData?:
|
|
14
|
+
/** Canonical resource body, never the presentation projection. */
|
|
15
|
+
resourceData?: Value;
|
|
16
|
+
reference?: ResourceReference;
|
|
17
|
+
route?: AccessRoute;
|
|
18
|
+
params?: Record<string, string>;
|
|
15
19
|
/** Specific metric IDs to stream */
|
|
16
20
|
metricIDs?: string[];
|
|
17
21
|
/** Polling interval in milliseconds (default 10000) */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { QueryResponse } from '../../bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/metric/models';
|
|
2
2
|
import { MetricProviderSummary } from '../../bindings/github.com/omniviewdev/omniview/backend/pkg/plugin/metric/models';
|
|
3
|
+
import { Value, ResourceReference, AccessRoute } from '../../resource/v2/domain';
|
|
3
4
|
export type UseResourceMetricsOptions = {
|
|
4
5
|
/** The plugin that owns the resource (e.g., "kubernetes") */
|
|
5
6
|
pluginID?: string;
|
|
@@ -11,8 +12,11 @@ export type UseResourceMetricsOptions = {
|
|
|
11
12
|
resourceID: string;
|
|
12
13
|
/** The resource namespace (optional) */
|
|
13
14
|
resourceNamespace?: string;
|
|
14
|
-
/**
|
|
15
|
-
resourceData?:
|
|
15
|
+
/** Canonical resource body, absent for nonresource metrics. */
|
|
16
|
+
resourceData?: Value;
|
|
17
|
+
reference?: ResourceReference;
|
|
18
|
+
route?: AccessRoute;
|
|
19
|
+
params?: Record<string, string>;
|
|
16
20
|
/** Specific metric IDs to fetch (empty = all) */
|
|
17
21
|
metricIDs?: string[];
|
|
18
22
|
/** The shape of metric data to request */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PortForwardSession } from '../../bindings/github.com/omniviewdev/plugin-sdk/pkg/v1/networker/models';
|
|
2
|
+
import { Value, ResourceReference, AccessRoute } from '../../resource/v2/domain';
|
|
2
3
|
export type PortForwardResourceOpts = {
|
|
3
4
|
/**
|
|
4
5
|
* The resource key identifier.
|
|
@@ -11,9 +12,11 @@ export type PortForwardResourceOpts = {
|
|
|
11
12
|
*/
|
|
12
13
|
resourceId: string;
|
|
13
14
|
/**
|
|
14
|
-
* The resource
|
|
15
|
+
* The canonical resource body, never the presentation projection.
|
|
15
16
|
*/
|
|
16
|
-
resource:
|
|
17
|
+
resource: Value;
|
|
18
|
+
reference?: ResourceReference;
|
|
19
|
+
route?: AccessRoute;
|
|
17
20
|
/**
|
|
18
21
|
* The port to forward on the resource
|
|
19
22
|
* @example 8080
|
|
@@ -9,7 +9,7 @@ export declare function useResourcePortForwarder({ pluginID: explicitPluginID, c
|
|
|
9
9
|
}): {
|
|
10
10
|
sessions: import('@tanstack/react-query').UseQueryResult<never[] | (import('../../models').PortForwardSession | null)[], Error>;
|
|
11
11
|
forward: import('@tanstack/react-query').UseMutateAsyncFunction<import('../../models').PortForwardSession, unknown, {
|
|
12
|
-
opts:
|
|
12
|
+
opts: PortForwardResourceOpts;
|
|
13
13
|
}, unknown>;
|
|
14
14
|
close: import('@tanstack/react-query').UseMutateAsyncFunction<import('../../models').PortForwardSession | null, unknown, {
|
|
15
15
|
opts: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { QueryKey } from '@tanstack/react-query';
|
|
2
2
|
/** Cancel connection-scoped reads immediately and reject late results after invalidation. */
|
|
3
|
-
export declare function useConnectionQueryGuard(pluginID: string, connectionID: string): <T>(queryKey: QueryKey, signal: AbortSignal, operation: () => Promise<T
|
|
3
|
+
export declare function useConnectionQueryGuard(pluginID: string, connectionID: string): <T>(queryKey: QueryKey, signal: AbortSignal, operation: () => Promise<T>, routeConnectionID?: string) => Promise<T>;
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
+
import { AccessRoute, ResourceReference } from '../../resource/v2/domain';
|
|
1
2
|
type UseDependencyTreeOptions = {
|
|
2
3
|
/**
|
|
3
4
|
* The ID of the plugin responsible for this resource
|
|
4
5
|
* @example "kubernetes"
|
|
5
6
|
*/
|
|
6
7
|
pluginID?: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The resource key of the root resource
|
|
11
|
-
* @example "apps::v1::Deployment"
|
|
12
|
-
*/
|
|
13
|
-
resourceKey: string;
|
|
14
|
-
/** The ID of the root resource */
|
|
15
|
-
resourceID: string;
|
|
16
|
-
/** Namespace of the root resource, if the backend has namespaces */
|
|
17
|
-
namespace?: string;
|
|
8
|
+
reference: ResourceReference;
|
|
9
|
+
route: AccessRoute;
|
|
18
10
|
/** How many edges deep to follow. The host caps this at 5. */
|
|
19
11
|
maxDepth?: number;
|
|
20
12
|
/** Whether to enable the query */
|
|
@@ -31,7 +23,7 @@ type UseDependencyTreeOptions = {
|
|
|
31
23
|
* ReplicaSet → Pods → Node, ConfigMaps, PVCs). A resource reachable by more
|
|
32
24
|
* than one path appears once.
|
|
33
25
|
*/
|
|
34
|
-
export declare const useDependencyTree: ({ pluginID: explicitPluginID,
|
|
26
|
+
export declare const useDependencyTree: ({ pluginID: explicitPluginID, reference, route, maxDepth, enabled, refetchInterval, }: UseDependencyTreeOptions) => {
|
|
35
27
|
tree: import('../../models').DependencyTree | null;
|
|
36
28
|
isLoading: boolean;
|
|
37
29
|
isFetching: boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { AccessRoute } from '../../resource/v2/domain';
|
|
1
2
|
type UseEditorSchemasOptions = {
|
|
2
3
|
/** The plugin ID to fetch schemas for */
|
|
3
4
|
pluginID?: string;
|
|
4
|
-
/**
|
|
5
|
-
|
|
5
|
+
/** Route used to acquire schemas; never resource identity. */
|
|
6
|
+
route: AccessRoute;
|
|
6
7
|
/** Whether to enable the query */
|
|
7
8
|
enabled?: boolean;
|
|
8
9
|
};
|
|
@@ -10,13 +11,17 @@ type UseEditorSchemasOptions = {
|
|
|
10
11
|
* useEditorSchemas fetches editor schemas for a plugin + connection pair
|
|
11
12
|
* from the backend via Wails bindings.
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
* the
|
|
14
|
+
* Shared documents are fetched once per exact reference and published together
|
|
15
|
+
* with the schema bindings. Callers must pass both to the host SchemaRegistry.
|
|
15
16
|
*/
|
|
16
|
-
export declare const useEditorSchemas: ({ pluginID: explicitPluginID,
|
|
17
|
-
schemas: import('
|
|
17
|
+
export declare const useEditorSchemas: ({ pluginID: explicitPluginID, route, enabled, }: UseEditorSchemasOptions) => {
|
|
18
|
+
schemas: import('../..').EditorSchema[];
|
|
19
|
+
documents: import('../..').SchemaDocument[];
|
|
18
20
|
isLoading: boolean;
|
|
19
21
|
error: Error | null;
|
|
20
|
-
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<
|
|
22
|
+
refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<{
|
|
23
|
+
schemas: import('../..').EditorSchema[];
|
|
24
|
+
documents: import('../..').SchemaDocument[];
|
|
25
|
+
}, Error>>;
|
|
21
26
|
};
|
|
22
27
|
export default useEditorSchemas;
|
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
import { QueryClient, QueryKey } from '@tanstack/react-query';
|
|
2
|
+
import { HostWatchAddPayload, HostWatchDeletePayload, HostWatchUpdatePayload, ResourceView } from '../../resource/v2/host';
|
|
2
3
|
import { WatchState } from '../../types/watch';
|
|
3
|
-
export type AddPayload =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
id: string;
|
|
8
|
-
namespace: string;
|
|
9
|
-
};
|
|
10
|
-
export type UpdatePayload = {
|
|
11
|
-
data: any;
|
|
12
|
-
key: string;
|
|
13
|
-
connection: string;
|
|
14
|
-
id: string;
|
|
15
|
-
namespace: string;
|
|
16
|
-
};
|
|
17
|
-
export type DeletePayload = {
|
|
18
|
-
data: any;
|
|
19
|
-
key: string;
|
|
20
|
-
connection: string;
|
|
21
|
-
id: string;
|
|
22
|
-
namespace: string;
|
|
23
|
-
};
|
|
24
|
-
export type ResourceEvent = {
|
|
4
|
+
export type AddPayload = HostWatchAddPayload;
|
|
5
|
+
export type UpdatePayload = HostWatchUpdatePayload;
|
|
6
|
+
export type DeletePayload = HostWatchDeletePayload;
|
|
7
|
+
export type ResourceUpdateEvent = {
|
|
25
8
|
type: 'ADD';
|
|
26
9
|
payload: AddPayload;
|
|
27
10
|
} | {
|
|
@@ -31,30 +14,11 @@ export type ResourceEvent = {
|
|
|
31
14
|
type: 'DELETE';
|
|
32
15
|
payload: DeletePayload;
|
|
33
16
|
};
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
* Returns a new plain object (immutable-style) without relying on Immer,
|
|
39
|
-
* avoiding issues with Wails binding class instances that Immer cannot draft.
|
|
40
|
-
*/
|
|
41
|
-
export declare function applyBatch(oldData: any, events: ResourceEvent[], idAccessor: string): any;
|
|
42
|
-
/**
|
|
43
|
-
* Adaptive two-mode event batcher for resource watch events.
|
|
44
|
-
*
|
|
45
|
-
* **Mode 1 — Initial Sync (SYNCING state):** Uses `setTimeout` with a larger
|
|
46
|
-
* window (default 500ms) to batch the initial ADD flood into 1-2 flushes.
|
|
47
|
-
* Satisfies REQ-BATCH-2.
|
|
48
|
-
*
|
|
49
|
-
* **Mode 2 — Live Updates (all other states):** Races `requestAnimationFrame`
|
|
50
|
-
* against the same bounded window, retaining next-frame batching while allowing
|
|
51
|
-
* already-delivered data to progress when painting is withheld but timers run.
|
|
52
|
-
* This does not promise progress while the entire event loop is frozen.
|
|
53
|
-
*
|
|
54
|
-
* Mode transitions happen automatically when `watchState` changes.
|
|
55
|
-
* Pending timers flush normally; subsequent events use the new scheduling.
|
|
56
|
-
*/
|
|
57
|
-
export declare function useEventBatcher(queryClient: QueryClient, queryKey: QueryKey, getResourceKey: (id: string, ns: string) => QueryKey, idAccessor: string | undefined, watchState: WatchState, options?: {
|
|
17
|
+
/** Advisory events may patch observed host keys, never expand native page membership. */
|
|
18
|
+
export declare function applyBatch(oldData: ResourceView | undefined, events: readonly ResourceUpdateEvent[], membershipChanged?: boolean): ResourceView | undefined;
|
|
19
|
+
/** At most one pending event per observed page key; unseen row bodies are never retained. */
|
|
20
|
+
export declare function useEventBatcher(queryClient: QueryClient, queryKey: QueryKey, watchState: WatchState, options?: {
|
|
58
21
|
syncWindowMs?: number;
|
|
59
22
|
enabled?: boolean;
|
|
60
|
-
|
|
23
|
+
isCurrent?: () => boolean;
|
|
24
|
+
}): (event: ResourceUpdateEvent) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { GraphEdge, GraphNode } from '../../
|
|
1
|
+
import { GraphEdge, GraphNode } from '../../resource/v2/graph';
|
|
2
|
+
import { AccessRoute, ResourceReference } from '../../resource/v2/domain';
|
|
2
3
|
/** Which side of the relationship the viewed resource is on. */
|
|
3
4
|
export type RelationshipDirection = 'outgoing' | 'incoming';
|
|
4
5
|
/** A resource linked to the viewed resource by one relationship edge. */
|
|
@@ -26,17 +27,8 @@ type UseRelatedResourcesOptions = {
|
|
|
26
27
|
* @example "kubernetes"
|
|
27
28
|
*/
|
|
28
29
|
pluginID?: string;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The resource key of the viewed resource
|
|
33
|
-
* @example "core::v1::Pod"
|
|
34
|
-
*/
|
|
35
|
-
resourceKey: string;
|
|
36
|
-
/** The ID of the viewed resource */
|
|
37
|
-
resourceID: string;
|
|
38
|
-
/** Namespace of the viewed resource, if the backend has namespaces */
|
|
39
|
-
namespace?: string;
|
|
30
|
+
reference: ResourceReference;
|
|
31
|
+
route: AccessRoute;
|
|
40
32
|
/** Which edges to return. Defaults to both directions. */
|
|
41
33
|
direction?: RelationshipDirection | 'both';
|
|
42
34
|
/** Only return edges of this relationship type */
|
|
@@ -59,7 +51,7 @@ export declare function relationshipLabel(type: string, direction: RelationshipD
|
|
|
59
51
|
* toRelatedResources converts graph edges around `self` into one entry per
|
|
60
52
|
* edge, keyed by the resource at the other end.
|
|
61
53
|
*/
|
|
62
|
-
export declare function toRelatedResources(self: GraphNode, edges: GraphEdge[]): RelatedResource[];
|
|
54
|
+
export declare function toRelatedResources(self: Omit<GraphNode, 'key'>, edges: GraphEdge[]): RelatedResource[];
|
|
63
55
|
/**
|
|
64
56
|
* useRelatedResources returns the resources linked to one resource in the
|
|
65
57
|
* relationship graph the host builds from the plugin's relationship
|
|
@@ -68,7 +60,7 @@ export declare function toRelatedResources(self: GraphNode, edges: GraphEdge[]):
|
|
|
68
60
|
* Only resources the host is watching are indexed. Targets referenced by
|
|
69
61
|
* name (a Secret a Pod mounts) are returned even if they do not exist.
|
|
70
62
|
*/
|
|
71
|
-
export declare const useRelatedResources: ({ pluginID: explicitPluginID,
|
|
63
|
+
export declare const useRelatedResources: ({ pluginID: explicitPluginID, reference, route, direction, relationshipType, enabled, refetchInterval, }: UseRelatedResourcesOptions) => {
|
|
72
64
|
/** One entry per edge, from the viewed resource's side. */
|
|
73
65
|
related: RelatedResource[];
|
|
74
66
|
/** The raw graph edges. */
|