@odigos/ui-kit 0.0.252 → 0.0.254
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/CHANGELOG.md +15 -0
- package/docs/api-context.md +44 -38
- package/lib/chunks/{connections-scope-Cb3gZ8MW.js → connections-scope-DDNmfpzA.js} +1 -1
- package/lib/chunks/{flow-CAOY59Tu.js → flow-Bu1VbeQt.js} +1 -1
- package/lib/chunks/{helpers-CXxRJd5C.js → helpers-Cy9W3KCg.js} +1 -1
- package/lib/chunks/{index-BgflYoEI.js → index-D2nQHheF.js} +1 -1
- package/lib/chunks/source-instrument-form-context-BJGS7jKX.js +1 -0
- package/lib/chunks/{ui-components-Dc15jc-B.js → ui-components-D_eeOuIL.js} +7 -7
- package/lib/chunks/use-odigos-api-W15RTo5l.js +5 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants/strings/index.d.ts +2 -1
- package/lib/constants.js +1 -1
- package/lib/containers/v2.js +138 -138
- package/lib/containers.js +7 -7
- package/lib/contexts/odigos-api/hooks/use-actions-api.d.ts +16 -8
- package/lib/contexts/odigos-api/hooks/use-collectors-api.d.ts +12 -1
- package/lib/contexts/odigos-api/hooks/use-config-api.d.ts +10 -1
- package/lib/contexts/odigos-api/hooks/use-data-streams-api.d.ts +19 -13
- package/lib/contexts/odigos-api/hooks/use-destinations-api.d.ts +30 -21
- package/lib/contexts/odigos-api/hooks/use-instrumentation-rules-api.d.ts +12 -4
- package/lib/contexts/odigos-api/hooks/use-metrics-api.d.ts +9 -3
- package/lib/contexts/odigos-api/hooks/use-namespace-api.d.ts +14 -4
- package/lib/contexts/odigos-api/hooks/use-profiling-api.d.ts +5 -0
- package/lib/contexts/odigos-api/hooks/use-sampling-api.d.ts +18 -1
- package/lib/contexts/odigos-api/hooks/use-service-map-api.d.ts +8 -1
- package/lib/contexts/odigos-api/hooks/use-snapshots-api.d.ts +24 -0
- package/lib/contexts/odigos-api/hooks/use-sources-api.d.ts +24 -6
- package/lib/contexts/odigos-api/hooks/use-tokens-api.d.ts +11 -4
- package/lib/contexts/odigos-api/index.d.ts +4 -3
- package/lib/contexts/odigos-api/platform-helpers.d.ts +4 -2
- package/lib/contexts/odigos-api/types.d.ts +41 -28
- package/lib/contexts/odigos-api/use-odigos-api.d.ts +21 -36
- package/lib/contexts/odigos-api.js +1 -1
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/v2.js +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/source-instrument-form-context-Rk2YlyRb.js +0 -1
- package/lib/chunks/use-odigos-api-qSWLSy9S.js +0 -5
package/lib/containers.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as i,useRef as n,useCallback as a,useEffect as o}from"react";import{MarkerType as s,useNodesState as c,useEdgesState as l}from"@xyflow/react";import{b as d,D as p,E as u,i as g,j as m,k as h,S as y,l as f,T as v,m as x,n as S,a as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as i,useRef as n,useCallback as a,useEffect as o}from"react";import{MarkerType as s,useNodesState as c,useEdgesState as l}from"@xyflow/react";import{b as d,D as p,E as u,i as g,j as m,k as h,S as y,l as f,T as v,m as x,n as S,a as N,o as b,p as k,q as w}from"./chunks/ui-components-D_eeOuIL.js";import{UserIcon as K,ImageErrorIcon as M,ChevronDownIcon as T,ChevronRightIcon as $}from"./icons.js";import I,{useTheme as z}from"styled-components";import C from"elkjs/lib/elk.bundled.js";import{d as E}from"./chunks/use-odigos-api-W15RTo5l.js";import{F as G}from"./chunks/flow-Bu1VbeQt.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@xyflow/react/dist/style.css";const V=e=>`${u.Source}-${e}-${d.MapItem}`,j=(e,t,r)=>{const i=e.isVirtual,n=r?[K]:i?[g(e)]:t?m(t):[M],{priorotizedStatus:a}=i?{priorotizedStatus:void 0}:h(t?.conditions||[]);return{id:e.graphKey,title:e.serviceName,icons:n,isVirtual:i,status:a,aggService:e}},A=e=>!(!e||"user"!==e.serviceName||e.id.namespace||e.id.name||e.id.kind),D=({theme:e,nodes:t,aggregatedServiceMap:r})=>{const i=[],n=new Map(t.map(e=>[e.id,e]));for(const t of r){const r=V(t.graphKey),a=n.get(r);if(!a)continue;const o=a.data?.status===y.Error;for(const a of t.connections){const c=V(a.targetGraphKey);n.has(c)&&i.push({id:`${r}-to-${c}`,type:"smoothstep",source:r,target:c,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:s.ArrowClosed},style:{stroke:o?e?.colors.dark_red:e?.colors.border}})}}return i},R=new C,O=`${u.Source}-user-${d.MapItem}`,q={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},_=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},B=I.div`
|
|
2
2
|
padding: 8px 0;
|
|
3
|
-
`,
|
|
3
|
+
`,F=I.div`
|
|
4
4
|
display: flex;
|
|
5
5
|
gap: 12px;
|
|
6
6
|
align-items: center;
|
|
7
7
|
padding: 4px 0 4px 16px;
|
|
8
|
-
`,
|
|
8
|
+
`,L=I.button`
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
gap: 4px;
|
|
@@ -19,16 +19,16 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState
|
|
|
19
19
|
&:hover {
|
|
20
20
|
text-decoration: underline;
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,P=I.div`
|
|
23
23
|
padding: 4px 0 8px;
|
|
24
|
-
`,
|
|
24
|
+
`,W=({conn:r,onToggle:i,isExpanded:n})=>{const a=r.details.length>0;return e(B,{children:t(S,{$justifyContent:"space-between",$alignItems:"center",children:[e(v,{size:14,weight:500,children:r.targetServiceName}),a&&t(L,{onClick:i,children:[e(n?T:$,{size:12}),n?"hide attributes":`${r.details.length} attribute${r.details.length>1?"s":""}`]})]})})},U=({conn:t})=>{const i=z();return e(r,{children:t.details.map((t,r)=>e(F,{children:e(v,{size:12,color:i.text.secondary,style:{flex:1},children:t.value})},`detail-${r}-${t.value}`))})},H=({connections:n,isVirtual:a,attributes:o})=>{const[s,c]=i(new Set),l=z();if(a){const i=Object.entries(o||{});return t(r,{children:[e(v,{size:12,color:l.text.info,children:"This service is not instrumented. It was detected from client-side spans of services that communicate with it."}),i.length>0&&t(r,{children:[e(P,{style:{paddingTop:16},children:e(v,{size:11,color:l.text.info,children:"Attributes"})}),i.map(([r,i])=>t(F,{children:[e(v,{size:12,color:l.text.secondary,children:r}),e(v,{size:12,children:i})]},r))]})]})}return n.length?t(r,{children:[e(P,{children:e(v,{size:11,color:l.text.info,children:"Connected services"})}),n.map(r=>t("div",{children:[e(W,{conn:r,isExpanded:s.has(r.targetGraphKey),onToggle:()=>{return e=r.targetGraphKey,void c(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r});var e}}),s.has(r.targetGraphKey)&&e(U,{conn:r}),e(x,{})]},r.targetGraphKey))]}):e(v,{size:12,color:l.text.info,children:"No outgoing connections"})},X=({conn:i})=>{const n=z();return i?e(r,{children:i.details.length>0?t(r,{children:[e(P,{children:e(v,{size:11,color:n.text.info,children:"Attribute breakdown"})}),i.details.map((t,r)=>e(F,{children:e(v,{size:12,style:{flex:1},children:t.value})},`detail-${r}-${t.value}`))]}):e(v,{size:12,color:n.text.info,style:{padding:"8px 0"},children:"No attribute breakdown"})}):e(v,{size:12,color:n.text.info,children:"No data for this connection"})},J=({drawerState:t,aggregatedData:r,onClose:i})=>{if(!t)return null;const n=new Map(r.map(e=>[e.graphKey,e]));let a="",o="",s=null;if("node"===t.type){const r=n.get(t.graphKey);a=r?.serviceName||t.graphKey,o=r?.isVirtual?"Virtual service (uninstrumented)":"Outgoing connections",s=e(H,{connections:r?.connections||[],isVirtual:r?.isVirtual,attributes:r?.attributes})}else{const r=n.get(t.sourceKey),i=r?.connections.find(e=>e.targetGraphKey===t.targetKey);a=`${r?.serviceName||t.sourceKey} → ${i?.targetServiceName||t.targetKey}`,o="Connection details",s=e(X,{conn:i})}return e(f,{isOpen:!0,width:"420px",position:"right",header:{title:a,subTitle:o,onClose:i},children:s})},Q=[],Y=I.div`
|
|
25
25
|
width: 100%;
|
|
26
26
|
flex: 1;
|
|
27
27
|
align-self: stretch;
|
|
28
28
|
min-height: 0;
|
|
29
29
|
height: 100%;
|
|
30
30
|
position: relative;
|
|
31
|
-
`,
|
|
31
|
+
`,Z={id:{namespace:"",name:"",kind:""},serviceName:"user",markedForInstrumentation:{markedForInstrumentation:!0}},ee=`${u.Source}-`,te=`-${d.MapItem}`,re=.15,ie=({serviceMap:r,pollIntervalMs:s=5e3})=>{const g=z(),{serviceMapApi:m,sourcesApi:h}=E(),y=h.useSources().items,{data:f,refetch:v}=m.useServiceMap({skip:!!r,pollInterval:s,fetchPolicy:"cache-and-network"}),x=r??(f?.serviceMap??Q),S=r?void 0:()=>{v()},[b,k,w]=c([]),[K,M,T]=l([]),[$,I]=i(0),[C,B]=i(null),F=n([]);F.current=b;const L=n(g);L.current=g;const P=n([]),W=n([]),U=a(()=>I(e=>e+1),[]),{activeNodeId:H,setActiveNodeType:X,setActiveNodeId:ie}=N();o(()=>{if(!H)return;const e=(t=H).startsWith(ee)&&t.endsWith(te)?t.slice(ee.length,-te.length):null;var t;e&&B({type:"node",graphKey:e})},[H]);const ne=a((e,t)=>{const{sourceGraphKey:r,targetGraphKey:i}=t.data||{};r&&i&&(X(null),ie(null),B({type:"edge",sourceKey:r,targetKey:i}))},[X,ie]),ae=a(()=>{B(null),X(null),ie(null)},[X,ie]),oe=a((e,t)=>{const r=t.id;M(e=>e.map(e=>e.source===r||e.target===r?{...e,animated:!0,style:{...e.style,strokeWidth:2.5},labelStyle:{...e.labelStyle,opacity:1},labelBgStyle:{...e.labelBgStyle,opacity:1}}:{...e,style:{...e.style,opacity:re},labelStyle:{...e.labelStyle,opacity:re},labelBgStyle:{...e.labelBgStyle,opacity:re}}))},[M]),se=a(()=>{M(W.current)},[M]);return o(()=>{let e=!1;const t=(e=>{const t=new Map,r=new Set,i=(e,r,i=!1)=>{let n=t.get(e);return n||(n={serviceName:r,isVirtual:i,attributes:{},connectionMap:new Map},t.set(e,n)),n},n=(e,t)=>{if(t)for(const{key:r,value:i}of t)r in e||(e[r]=i)};for(const t of e){const{graphKey:e}=_(t.nodeId),a=i(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:o}=_(e?.nodeId??"");e.isVirtual&&(r.add(t),n(i(t,e.serviceName,!0).attributes,e.nodeAttributes));let s=a.connectionMap.get(t);if(s||(s={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,s)),s.totalRequests+=e.requests,e.dateTime>s.lastDateTime&&(s.lastDateTime=e.dateTime),o){const t=s.details.find(e=>e.value===o);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):s.details.push({value:o,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[n,a]of e)t.has(n)||i(n,a.targetServiceName,r.has(n));const o=[];for(const[e,{serviceName:r,isVirtual:i,attributes:n,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),o.push({graphKey:e,serviceName:r,isVirtual:i,connections:t,attributes:n})}return o.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),o})(x);P.current=t;const r=(({sources:e,aggregatedServiceMap:t})=>{const r=[],i={x:0,y:0};if(t.length&&e.length)for(const n of t){const t=V(n.graphKey),a=e.find(e=>n.serviceName===e.serviceName||n.serviceName===e.id.name);r.push({id:t,type:d.MapItem,position:i,data:j(n,a,A(a)),measured:{width:80,height:80}})}else r.push({id:`${u.Source}-${d.NoData}`,type:d.NoData,position:i,data:{subTitle:p.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return r})({aggregatedServiceMap:t,sources:[Z].concat(y)});if(1===r.length&&r[0].id===`${u.Source}-${d.NoData}`)return k(r),M([]),void(W.current=[]);const i=new Set(F.current.map(e=>e.id)),n=new Set(r.map(e=>e.id)),a=r.some(e=>!i.has(e.id)),o=F.current.some(e=>!n.has(e.id));if(!(a||o)){const e=new Map(F.current.map(e=>[e.id,e.position]));k(r.map(t=>({...t,position:e.get(t.id)??t.position})));const i=D({theme:L.current,nodes:r,aggregatedServiceMap:t});return W.current=i,void M(i)}return(async(e,t,r={})=>{const i={id:"root",layoutOptions:{...q,...r},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===O?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},n=await R.layout(i),a=new Map;return n.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(r,D({theme:L.current,nodes:r,aggregatedServiceMap:t})).then(({nodes:t})=>{if(e)return;k(t);const r=D({theme:L.current,nodes:t,aggregatedServiceMap:P.current});W.current=r,M(r),U()}),()=>{e=!0}},[x,y]),o(()=>{if(!F.current.length)return;const e=D({theme:g,nodes:F.current,aggregatedServiceMap:P.current});W.current=e,M(e)},[g]),t(Y,{children:[e(G,{nodes:b,edges:K,onNodesChange:w,onEdgesChange:T,onEdgeClick:ne,onNodeMouseEnter:oe,onNodeMouseLeave:se,onRefresh:S,fitViewTrigger:$,zoomOnScroll:!0}),e(J,{drawerState:C,aggregatedData:P.current,onClose:ae})]})},ne=I.div`
|
|
32
32
|
position: fixed;
|
|
33
33
|
bottom: 12px;
|
|
34
34
|
left: 12px;
|
|
@@ -37,4 +37,4 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState
|
|
|
37
37
|
flex-direction: column-reverse;
|
|
38
38
|
gap: 6px;
|
|
39
39
|
max-width: 600px;
|
|
40
|
-
`,
|
|
40
|
+
`,ae=()=>{const{notifications:t,markAsDismissed:r,markAsSeen:i}=b(),{onClickNotification:n}=k(),a=t.filter(({dismissed:e})=>!e);return e(ne,{children:a.map(({id:t,type:o,title:s,message:c,crdType:l,target:d},p)=>{const u=c||s;if(!u)return null;const g=a.length-p;return e(w,{status:o,message:u,action:l&&d?{label:"go to details",onClick:()=>n({id:t,crdType:l,target:d},{dismissToast:!0})}:void 0,onClose:({asSeen:e})=>(({id:e,asSeen:t})=>{r(e),t&&i(e)})({id:t,asSeen:e}),zIndex:g},`toast-${t}`)})})};export{ie as ServiceMap,ae as ToastList};
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `useActionsApi` — actions CRUD.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* `useApiQuery('GET_ACTIONS')` so every consumer stays in sync via
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Reactive reads are exposed via the `useActions()` sub-hook, which owns a
|
|
5
|
+
* `useApiQuery('GET_ACTIONS')` so every consumer stays in sync via Apollo's
|
|
6
|
+
* cache broadcast. Calling the sub-hook IS the subscription — containers that
|
|
7
|
+
* only mutate never call it and never fire the list query. Mutations call
|
|
8
|
+
* `runMutation` and then `await fetchAll()` to refresh the cached list.
|
|
8
9
|
*/
|
|
9
10
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
10
11
|
import { type Action, type ActionFormData } from '@/types';
|
|
11
|
-
export interface
|
|
12
|
+
export interface UseActionsResult {
|
|
12
13
|
items: Action[];
|
|
13
14
|
loading: boolean;
|
|
15
|
+
refetch: () => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export interface ActionsApi {
|
|
18
|
+
/**
|
|
19
|
+
* Subscribe to the actions list. Owns a `useApiQuery('GET_ACTIONS')` — call
|
|
20
|
+
* at the top level of a container (it's a hook). Returns the reactive
|
|
21
|
+
* `{ items, loading, refetch }`.
|
|
22
|
+
*/
|
|
23
|
+
useActions: () => UseActionsResult;
|
|
14
24
|
fetchAll: () => Promise<void>;
|
|
15
25
|
create: (input: ActionFormData) => Promise<void>;
|
|
16
26
|
update: (id: string, input: ActionFormData) => Promise<void>;
|
|
@@ -21,6 +31,4 @@ export interface ActionsApi {
|
|
|
21
31
|
*/
|
|
22
32
|
remove: (id: string, actionType: string) => Promise<void>;
|
|
23
33
|
}
|
|
24
|
-
export declare const useActionsApi: (operations: OdigosApiOperations, ctx: OperationContext
|
|
25
|
-
subscribe?: boolean;
|
|
26
|
-
}) => ActionsApi;
|
|
34
|
+
export declare const useActionsApi: (operations: OdigosApiOperations, ctx: OperationContext) => ActionsApi;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
2
1
|
import type { ExtendedPodInfo, GatewayInfo, NodeCollectoInfo, PodInfo } from '@/types';
|
|
2
|
+
import type { OperationContext, OdigosApiOperations, GetCollectorPodInfoVars } from '../types';
|
|
3
|
+
import { type UseApiQueryOptions, type UseApiQueryResult } from '../use-api-query';
|
|
3
4
|
export interface CollectorsApi {
|
|
5
|
+
/** Subscribe to the gateway deployment info. */
|
|
6
|
+
useGatewayInfo: (options?: UseApiQueryOptions<GatewayInfo>) => UseApiQueryResult<GatewayInfo>;
|
|
7
|
+
/** Subscribe to the gateway collector pods. */
|
|
8
|
+
useGatewayPods: (options?: UseApiQueryOptions<PodInfo[]>) => UseApiQueryResult<PodInfo[]>;
|
|
9
|
+
/** Subscribe to the node-collector daemonset info. */
|
|
10
|
+
useNodeCollectorInfo: (options?: UseApiQueryOptions<NodeCollectoInfo>) => UseApiQueryResult<NodeCollectoInfo>;
|
|
11
|
+
/** Subscribe to the node-collector pods. */
|
|
12
|
+
useNodeCollectorPods: (options?: UseApiQueryOptions<PodInfo[]>) => UseApiQueryResult<PodInfo[]>;
|
|
13
|
+
/** Subscribe to a single collector pod's extended info. Pass `skip` when there's no selected pod. */
|
|
14
|
+
usePodInfo: (vars?: GetCollectorPodInfoVars, options?: UseApiQueryOptions<ExtendedPodInfo>) => UseApiQueryResult<ExtendedPodInfo>;
|
|
4
15
|
getGatewayInfo?: () => Promise<{
|
|
5
16
|
data?: GatewayInfo;
|
|
6
17
|
error?: string;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type UseApiQueryOptions, type UseApiQueryResult } from '../use-api-query';
|
|
2
|
+
import type { OperationContext, OdigosApiOperations, GetConfigYamlsData, GetEffectiveConfigVars } from '../types';
|
|
2
3
|
import { type ConfigYaml, type EffectiveConfig, type EffectiveConfigInput, type LocalUiConfigInput } from '@/types';
|
|
3
4
|
export interface ConfigApi {
|
|
5
|
+
/**
|
|
6
|
+
* Subscribe to the effective config. Owns a `useApiQuery('GET_EFFECTIVE_CONFIG')`.
|
|
7
|
+
* Pass `{ id }` to scope to a single connection (central-ui) and `skip` to
|
|
8
|
+
* gate the request. Call at the top level of a container.
|
|
9
|
+
*/
|
|
10
|
+
useEffectiveConfig: (vars?: GetEffectiveConfigVars, options?: UseApiQueryOptions<EffectiveConfig>) => UseApiQueryResult<EffectiveConfig>;
|
|
11
|
+
/** Subscribe to the config YAML field schemas. Owns a `useApiQuery('GET_CONFIG_YAMLS')`. */
|
|
12
|
+
useConfigYamls: (options?: UseApiQueryOptions<GetConfigYamlsData>) => UseApiQueryResult<GetConfigYamlsData>;
|
|
4
13
|
getEffectiveConfig: (id?: string) => Promise<{
|
|
5
14
|
data?: EffectiveConfig;
|
|
6
15
|
error?: string;
|
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `useDataStreamsApi` — data-streams CRUD.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* `useApiQuery('GET_DATA_STREAMS')
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Apollo cache as every other entity.
|
|
4
|
+
* Reactive reads (`items`, `loading`) flow through the `useDataStreams()`
|
|
5
|
+
* sub-hook, which owns a `useApiQuery('GET_DATA_STREAMS')`. Calling the
|
|
6
|
+
* sub-hook IS the subscription. The sub-hook also bridges the fetched list
|
|
7
|
+
* into `useDataStreamStore.dataStreams` so legacy consumers that read
|
|
8
|
+
* `useDataStreamStore` directly stay in sync — we keep the Zustand store as
|
|
9
|
+
* the canonical "selected stream" carrier (UI state) but the underlying list
|
|
10
|
+
* comes from the same Apollo cache as every other entity.
|
|
12
11
|
*/
|
|
13
12
|
import { type DataStream } from '@/types';
|
|
14
13
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
15
|
-
export interface
|
|
16
|
-
/** All data streams. Sourced from `useApiQuery('GET_DATA_STREAMS')`. */
|
|
14
|
+
export interface UseDataStreamsResult {
|
|
17
15
|
items: DataStream[];
|
|
18
16
|
loading: boolean;
|
|
17
|
+
refetch: () => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export interface DataStreamsApi {
|
|
20
|
+
/**
|
|
21
|
+
* Subscribe to the data-streams list. Owns a `useApiQuery('GET_DATA_STREAMS')`
|
|
22
|
+
* — call at the top level of a container. Returns the reactive
|
|
23
|
+
* `{ items, loading, refetch }` and, as a side effect, bridges the fetched
|
|
24
|
+
* list into `useDataStreamStore.dataStreams` for legacy store consumers.
|
|
25
|
+
*/
|
|
26
|
+
useDataStreams: () => UseDataStreamsResult;
|
|
19
27
|
fetchAll: () => Promise<void>;
|
|
20
28
|
create?: (stream: DataStream) => Promise<void>;
|
|
21
29
|
update: (name: string, stream: DataStream) => Promise<void>;
|
|
22
30
|
remove: (name: string) => Promise<void>;
|
|
23
31
|
}
|
|
24
|
-
export declare const useDataStreamsApi: (operations: OdigosApiOperations, ctx: OperationContext
|
|
25
|
-
subscribe?: boolean;
|
|
26
|
-
}) => DataStreamsApi;
|
|
32
|
+
export declare const useDataStreamsApi: (operations: OdigosApiOperations, ctx: OperationContext) => DataStreamsApi;
|
|
@@ -10,28 +10,41 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
12
12
|
import { type Destination, type DestinationFormData, type TestConnectionResponse, type GetDestinationCategoriesResult, type GetPotentialDestinationsResult } from '@/types';
|
|
13
|
-
export interface
|
|
13
|
+
export interface UseDestinationsResult {
|
|
14
14
|
items: Destination[];
|
|
15
15
|
loading: boolean;
|
|
16
|
-
|
|
16
|
+
refetch: () => Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export interface UseDestinationCategoriesResult {
|
|
19
|
+
/** Destination category definitions (the YAML field schemas grouped by "self hosted" / "managed"). `undefined` until resolved. */
|
|
20
|
+
data: GetDestinationCategoriesResult | undefined;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface UsePotentialDestinationsResult {
|
|
24
|
+
/** Auto-detected destinations from a cluster scan. `undefined` until resolved. */
|
|
25
|
+
data: GetPotentialDestinationsResult | undefined;
|
|
26
|
+
loading: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface DestinationsApi {
|
|
17
29
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* `
|
|
21
|
-
* `subscribeCategories` opt-in (see `useOdigosApi({ subscribe: ['destinationCategories'] })`).
|
|
22
|
-
* `undefined` until the consumer subscribes and the request resolves.
|
|
30
|
+
* Subscribe to the configured-destinations list. Owns a
|
|
31
|
+
* `useApiQuery('GET_DESTINATIONS')` — call at the top level of a container.
|
|
32
|
+
* Returns the reactive `{ items, loading, refetch }`.
|
|
23
33
|
*/
|
|
24
|
-
|
|
25
|
-
/** True while the categories request is in flight (only when subscribed). */
|
|
26
|
-
categoriesLoading: boolean;
|
|
34
|
+
useDestinations: () => UseDestinationsResult;
|
|
27
35
|
/**
|
|
28
|
-
*
|
|
29
|
-
* `useApiQuery('
|
|
30
|
-
*
|
|
36
|
+
* Subscribe to the destination category definitions. Owns a
|
|
37
|
+
* `useApiQuery('GET_DESTINATION_CATEGORIES')` — call at the top level of a
|
|
38
|
+
* container. Returns `{ data, loading }`.
|
|
31
39
|
*/
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
|
|
40
|
+
useDestinationCategories: () => UseDestinationCategoriesResult;
|
|
41
|
+
/**
|
|
42
|
+
* Subscribe to the auto-detected (potential) destinations from a cluster scan.
|
|
43
|
+
* Owns a `useApiQuery('GET_POTENTIAL_DESTINATIONS')` — call at the top level of
|
|
44
|
+
* a container. Returns `{ data, loading }`.
|
|
45
|
+
*/
|
|
46
|
+
usePotentialDestinations: () => UsePotentialDestinationsResult;
|
|
47
|
+
fetchAll: () => Promise<void>;
|
|
35
48
|
/**
|
|
36
49
|
* Test the destination connection. The host adapter's
|
|
37
50
|
* `TEST_DESTINATION_CONNECTION` operation should set `transformResult` to
|
|
@@ -43,8 +56,4 @@ export interface DestinationsApi {
|
|
|
43
56
|
update: (id: string, destination: DestinationFormData) => Promise<void>;
|
|
44
57
|
remove: (id: string) => Promise<void>;
|
|
45
58
|
}
|
|
46
|
-
export declare const useDestinationsApi: (operations: OdigosApiOperations, ctx: OperationContext
|
|
47
|
-
subscribe?: boolean;
|
|
48
|
-
subscribeCategories?: boolean;
|
|
49
|
-
subscribePotential?: boolean;
|
|
50
|
-
}) => DestinationsApi;
|
|
59
|
+
export declare const useDestinationsApi: (operations: OdigosApiOperations, ctx: OperationContext) => DestinationsApi;
|
|
@@ -22,14 +22,22 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
24
24
|
import { type InstrumentationRule, type InstrumentationRuleFormData, type InstrumentationRuleType } from '@/types';
|
|
25
|
-
export interface
|
|
25
|
+
export interface UseInstrumentationRulesResult {
|
|
26
26
|
items: InstrumentationRule[];
|
|
27
27
|
loading: boolean;
|
|
28
|
+
refetch: () => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export interface InstrumentationRulesApi {
|
|
31
|
+
/**
|
|
32
|
+
* Subscribe to the instrumentation-rules list. Owns a
|
|
33
|
+
* `useApiQuery('GET_INSTRUMENTATION_RULES')` — call at the top level of a
|
|
34
|
+
* container. Returns the reactive `{ items, loading, refetch }` (each rule
|
|
35
|
+
* already folded back into the kit's `sourceScopes` spec shape).
|
|
36
|
+
*/
|
|
37
|
+
useRules: () => UseInstrumentationRulesResult;
|
|
28
38
|
fetchAll: () => Promise<void>;
|
|
29
39
|
create: (input: InstrumentationRuleFormData, ruleType?: InstrumentationRuleType) => Promise<void>;
|
|
30
40
|
update: (id: string, input: InstrumentationRuleFormData, ruleType?: InstrumentationRuleType) => Promise<void>;
|
|
31
41
|
remove: (id: string, ruleType?: InstrumentationRuleType) => Promise<void>;
|
|
32
42
|
}
|
|
33
|
-
export declare const useInstrumentationRulesApi: (operations: OdigosApiOperations, ctx: OperationContext
|
|
34
|
-
subscribe?: boolean;
|
|
35
|
-
}) => InstrumentationRulesApi;
|
|
43
|
+
export declare const useInstrumentationRulesApi: (operations: OdigosApiOperations, ctx: OperationContext) => InstrumentationRulesApi;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
1
|
+
import type { OperationContext, OdigosApiOperations, GetMetricsData } from '../types';
|
|
2
|
+
import { type UseApiQueryOptions, type UseApiQueryResult } from '../use-api-query';
|
|
3
3
|
interface MetricsEnvelope {
|
|
4
|
-
getOverviewMetrics?:
|
|
4
|
+
getOverviewMetrics?: GetMetricsData['getOverviewMetrics'];
|
|
5
5
|
}
|
|
6
6
|
export interface MetricsApi {
|
|
7
|
+
/**
|
|
8
|
+
* Subscribe to the overview metrics. Owns a `useApiQuery('GET_METRICS')`;
|
|
9
|
+
* callers typically pass a `pollInterval` and a `skip` gate. Call at the
|
|
10
|
+
* top level of a container.
|
|
11
|
+
*/
|
|
12
|
+
useMetrics: (options?: UseApiQueryOptions<GetMetricsData>) => UseApiQueryResult<GetMetricsData>;
|
|
7
13
|
fetch: () => Promise<{
|
|
8
14
|
data?: MetricsEnvelope;
|
|
9
15
|
error?: string;
|
|
@@ -13,9 +13,21 @@ import type { NamespaceInstrumentInput } from '../internal/source-payloads';
|
|
|
13
13
|
interface NamespacesEnvelope {
|
|
14
14
|
namespaces?: Namespace[];
|
|
15
15
|
}
|
|
16
|
-
export interface
|
|
16
|
+
export interface UseNamespacesResult {
|
|
17
17
|
items: Namespace[];
|
|
18
18
|
loading: boolean;
|
|
19
|
+
refetch: () => Promise<{
|
|
20
|
+
data?: NamespacesEnvelope;
|
|
21
|
+
error?: string;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export interface NamespaceApi {
|
|
25
|
+
/**
|
|
26
|
+
* Subscribe to the namespaces (with workloads) list. Owns a
|
|
27
|
+
* `useApiQuery('GET_NAMESPACES_WITH_WORKLOADS')` — call at the top level of a
|
|
28
|
+
* container. Returns the reactive `{ items, loading, refetch }`.
|
|
29
|
+
*/
|
|
30
|
+
useNamespaces: () => UseNamespacesResult;
|
|
19
31
|
fetchAll: () => Promise<{
|
|
20
32
|
data?: NamespacesEnvelope;
|
|
21
33
|
error?: string;
|
|
@@ -24,7 +36,5 @@ export interface NamespaceApi {
|
|
|
24
36
|
error?: string;
|
|
25
37
|
} | void>;
|
|
26
38
|
}
|
|
27
|
-
export declare const useNamespaceApi: (operations: OdigosApiOperations, ctx: OperationContext
|
|
28
|
-
subscribe?: boolean;
|
|
29
|
-
}) => NamespaceApi;
|
|
39
|
+
export declare const useNamespaceApi: (operations: OdigosApiOperations, ctx: OperationContext) => NamespaceApi;
|
|
30
40
|
export {};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
2
|
+
import { type UseApiQueryOptions, type UseApiQueryResult } from '../use-api-query';
|
|
2
3
|
import type { EnableProfilingResult, ProfilingSlots, SourceProfilingResult, WorkloadId } from '@/types';
|
|
3
4
|
export interface ProfilingApi {
|
|
5
|
+
/** Subscribe to the profiling slots metadata. Typically polled while the Profiling tab is open. */
|
|
6
|
+
useSlots: (options?: UseApiQueryOptions<ProfilingSlots>) => UseApiQueryResult<ProfilingSlots>;
|
|
7
|
+
/** Subscribe to a single source's CPU profile. Typically polled while live; pass `skip` to pause. */
|
|
8
|
+
useSourceProfiling: (vars?: WorkloadId, options?: UseApiQueryOptions<SourceProfilingResult>) => UseApiQueryResult<SourceProfilingResult>;
|
|
4
9
|
fetchSlots?: () => Promise<{
|
|
5
10
|
data?: ProfilingSlots;
|
|
6
11
|
error?: string;
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
import { type CostReductionRuleInput, type HighlyRelevantOperationRuleInput, type NoisyOperationRuleInput } from '@/types';
|
|
1
|
+
import { type CostReductionRuleInput, type HighlyRelevantOperationRuleInput, type NoisyOperationRuleInput, type SamplingRules, type SamplingRulesK8sHealthConfig } from '@/types';
|
|
2
2
|
import type { GetSamplingRulesData, OperationContext, OdigosApiOperations, SamplingK8sHealthConfigVars, SamplingRuleCreateVars } from '../types';
|
|
3
|
+
export interface UseSamplingRulesResult {
|
|
4
|
+
/** Sampling rule groups. Empty array until the request resolves. */
|
|
5
|
+
items: SamplingRules[];
|
|
6
|
+
/** The cluster-wide k8s health-probes sampling config (auto noisy rule). `null` until resolved. */
|
|
7
|
+
k8sHealthProbesConfig: SamplingRulesK8sHealthConfig | null;
|
|
8
|
+
/** True while the initial `GET_SAMPLING_RULES` request is in flight. */
|
|
9
|
+
loading: boolean;
|
|
10
|
+
/** Re-execute the `GET_SAMPLING_RULES` query and broadcast the result via Apollo's cache. */
|
|
11
|
+
refetch: () => Promise<void>;
|
|
12
|
+
}
|
|
3
13
|
export interface SamplingApi {
|
|
14
|
+
/**
|
|
15
|
+
* Subscribe to the sampling rules. Owns a `useApiQuery('GET_SAMPLING_RULES')`
|
|
16
|
+
* — call at the top level of a container. Returns the reactive
|
|
17
|
+
* `{ items, k8sHealthProbesConfig, loading, refetch }`. Both the flat
|
|
18
|
+
* (`samplingRules`) and `computePlatform`-nested wire shapes are accepted.
|
|
19
|
+
*/
|
|
20
|
+
useSamplingRules: () => UseSamplingRulesResult;
|
|
4
21
|
fetchAll?: () => Promise<{
|
|
5
22
|
data?: GetSamplingRulesData;
|
|
6
23
|
error?: string;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
2
1
|
import type { AggregatedServiceMap, ServiceMapSources } from '@/types';
|
|
2
|
+
import type { OperationContext, OdigosApiOperations, GetServiceMapData } from '../types';
|
|
3
|
+
import { type UseApiQueryOptions, type UseApiQueryResult } from '../use-api-query';
|
|
3
4
|
interface ServiceMapEnvelope {
|
|
4
5
|
serviceMap?: AggregatedServiceMap | ServiceMapSources;
|
|
5
6
|
}
|
|
6
7
|
export interface ServiceMapApi {
|
|
8
|
+
/**
|
|
9
|
+
* Subscribe to the service map. Owns a `useApiQuery('GET_SERVICE_MAP')`;
|
|
10
|
+
* callers typically pass a `pollInterval` and a `skip` gate. Call at the
|
|
11
|
+
* top level of a container.
|
|
12
|
+
*/
|
|
13
|
+
useServiceMap: (options?: UseApiQueryOptions<GetServiceMapData>) => UseApiQueryResult<GetServiceMapData>;
|
|
7
14
|
fetch?: () => Promise<{
|
|
8
15
|
data?: ServiceMapEnvelope;
|
|
9
16
|
error?: string;
|
|
@@ -1,6 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useSnapshotsApi` — central-ui's cross-cluster snapshot reads.
|
|
3
|
+
*
|
|
4
|
+
* Reactive `data` / `loading` flow through the `useSnapshots()` sub-hook, which
|
|
5
|
+
* owns a `useApiQuery('GET_ALL_CLUSTER_SNAPSHOTS')`. The hook honors the
|
|
6
|
+
* operation's `canRun(ctx)` guard INTERNALLY: when the host blocks the op for
|
|
7
|
+
* the active context (e.g. central-ui can't snapshot a < v1.20 proxy) the query
|
|
8
|
+
* is skipped and `data` stays `undefined` — consumers treat that as the signal
|
|
9
|
+
* to fall back to the per-proxy `namespacesApi` path. Imperative
|
|
10
|
+
* `getAllClusterSnapshots` / `getClusterSnapshot` remain for fire-and-forget reads.
|
|
11
|
+
*/
|
|
1
12
|
import type { AllClusterSnapshots, ClusterSnapshot } from '@/types';
|
|
2
13
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
14
|
+
export interface UseSnapshotsResult {
|
|
15
|
+
/** All-cluster snapshot for the active context (undefined while loading, skipped, or blocked by the op's guard). */
|
|
16
|
+
data?: AllClusterSnapshots;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
/** True when the host adapter doesn't expose `GET_ALL_CLUSTER_SNAPSHOTS` at all. */
|
|
19
|
+
unsupported: boolean;
|
|
20
|
+
}
|
|
3
21
|
export interface SnapshotsApi {
|
|
22
|
+
/**
|
|
23
|
+
* Subscribe to the cross-cluster snapshot. Owns a
|
|
24
|
+
* `useApiQuery('GET_ALL_CLUSTER_SNAPSHOTS')` — call at the top level of a
|
|
25
|
+
* container. Returns the reactive `{ data, loading, unsupported }`.
|
|
26
|
+
*/
|
|
27
|
+
useSnapshots: () => UseSnapshotsResult;
|
|
4
28
|
getAllClusterSnapshots?: () => Promise<{
|
|
5
29
|
data?: AllClusterSnapshots;
|
|
6
30
|
error?: string;
|
|
@@ -24,8 +24,9 @@
|
|
|
24
24
|
* cluster events arrive; the cache write broadcasts to every active
|
|
25
25
|
* `useApiQuery('GET_WORKLOADS')` subscriber.
|
|
26
26
|
*/
|
|
27
|
+
import { type UseApiQueryOptions, type UseApiQueryResult } from '../use-api-query';
|
|
28
|
+
import type { GetSourceLibrariesData, GetPeerSourcesVars, OperationContext, OdigosApiOperations } from '../types';
|
|
27
29
|
import { type PeerSources, type SourceFormData, type Workload, type WorkloadId } from '@/types';
|
|
28
|
-
import type { GetSourceLibrariesData, OperationContext, OdigosApiOperations } from '../types';
|
|
29
30
|
import { type NamespaceSelectionFormData, type SourceSelectionFormData } from '@/store';
|
|
30
31
|
export interface PersistSourceInput {
|
|
31
32
|
[clusterId: string]: {
|
|
@@ -36,12 +37,22 @@ export interface PersistSourceInput {
|
|
|
36
37
|
currentStreamName: string;
|
|
37
38
|
}[];
|
|
38
39
|
}
|
|
39
|
-
export interface
|
|
40
|
-
/** All workloads marked for instrumentation.
|
|
40
|
+
export interface UseSourcesResult {
|
|
41
|
+
/** All workloads marked for instrumentation. */
|
|
41
42
|
items: Workload[];
|
|
42
43
|
/** True while the initial `GET_WORKLOADS` request is in flight. */
|
|
43
44
|
loading: boolean;
|
|
44
45
|
/** Trigger a fresh `GET_WORKLOADS` round-trip and broadcast the result via Apollo's cache. */
|
|
46
|
+
refetch: () => Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
export interface SourcesApi {
|
|
49
|
+
/**
|
|
50
|
+
* Subscribe to the workloads list. Owns a `useApiQuery('GET_WORKLOADS')` —
|
|
51
|
+
* call at the top level of a container. Returns the reactive
|
|
52
|
+
* `{ items, loading, refetch }`.
|
|
53
|
+
*/
|
|
54
|
+
useSources: () => UseSourcesResult;
|
|
55
|
+
/** Trigger a fresh `GET_WORKLOADS` round-trip and broadcast the result via Apollo's cache. */
|
|
45
56
|
fetchAll: () => Promise<void>;
|
|
46
57
|
/** Fetch specific workloads by SSE-target strings. The result is merged into Apollo's cache via the slot's normalization. */
|
|
47
58
|
fetchByTargets: (targets: string[], options?: {
|
|
@@ -59,6 +70,15 @@ export interface SourcesApi {
|
|
|
59
70
|
};
|
|
60
71
|
error?: string;
|
|
61
72
|
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Subscribe to a service's peer sources (inbound/outbound). Owns a
|
|
75
|
+
* `useApiQuery('GET_PEER_SOURCES')`; call at the top level of a container.
|
|
76
|
+
*/
|
|
77
|
+
usePeerSources: (vars?: GetPeerSourcesVars, options?: UseApiQueryOptions<{
|
|
78
|
+
peerSources?: PeerSources;
|
|
79
|
+
}>) => UseApiQueryResult<{
|
|
80
|
+
peerSources?: PeerSources;
|
|
81
|
+
}>;
|
|
62
82
|
/** Persist the legacy form-shape payload (used by `AddSourceDrawer` / `Onboarding`). */
|
|
63
83
|
persist: (selectAppsList: SourceSelectionFormData, futureSelectAppsList: NamespaceSelectionFormData) => Promise<void>;
|
|
64
84
|
/** Persist the V2 multi-cluster payload shape (used by `CentralConnections` / standalone overview's bulk persist). */
|
|
@@ -70,6 +90,4 @@ export interface SourcesApi {
|
|
|
70
90
|
restartPod: (namespace: string, name: string) => Promise<void>;
|
|
71
91
|
recoverFromRollback: (sourceId: WorkloadId) => Promise<void>;
|
|
72
92
|
}
|
|
73
|
-
export declare const useSourcesApi: (operations: OdigosApiOperations, ctx: OperationContext
|
|
74
|
-
subscribe?: boolean;
|
|
75
|
-
}) => SourcesApi;
|
|
93
|
+
export declare const useSourcesApi: (operations: OdigosApiOperations, ctx: OperationContext) => SourcesApi;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { type TokenPayload } from '@/types';
|
|
2
2
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
3
|
+
export interface UseTokensResult {
|
|
4
|
+
items: TokenPayload[];
|
|
5
|
+
loading: boolean;
|
|
6
|
+
refetch: () => Promise<void>;
|
|
7
|
+
}
|
|
3
8
|
export interface TokensApi {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Subscribe to the API tokens list. Owns a `useApiQuery('GET_TOKENS')` —
|
|
11
|
+
* call at the top level of a container. Returns the reactive
|
|
12
|
+
* `{ items, loading, refetch }`.
|
|
13
|
+
*/
|
|
14
|
+
useTokens: () => UseTokensResult;
|
|
8
15
|
updateToken?: (token: string) => Promise<{
|
|
9
16
|
error?: string;
|
|
10
17
|
} | undefined>;
|
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export { OdigosApiProvider } from './provider';
|
|
14
14
|
export { OdigosApiConnectionsScope } from './connections-scope';
|
|
15
|
+
export { useOdigosApi, type UseOdigosApiReturn } from './use-odigos-api';
|
|
16
|
+
export { useApiQuery, useApiLazyQuery, useApiMutation } from './use-api-query';
|
|
15
17
|
export { useApiForConnections, type ApiForConnections } from './use-api-for-connections';
|
|
16
|
-
export {
|
|
17
|
-
export { useApiQuery, useApiLazyQuery, useApiMutation, type UseApiQueryOptions, type UseApiQueryResult, type UseApiLazyQueryResult, type UseApiMutationOptions, type UseApiMutationResult, type UseApiMutationTuple, } from './use-api-query';
|
|
18
|
+
export type { UseApiQueryOptions, UseApiQueryResult, UseApiLazyQueryResult, UseApiMutationOptions, UseApiMutationResult, UseApiMutationTuple } from './use-api-query';
|
|
18
19
|
export { pickByPlatform, versionedDocument, vmDialectMap, type VersionedDocumentMap } from './platform-helpers';
|
|
19
|
-
export type { ApolloConfig, CreateActionResult, CreateActionVars, CreateCostReductionRuleResult, CreateDataStreamResult, CreateDataStreamVars, CreateDestinationResult, CreateDestinationVars, CreateHighlyRelevantOperationRuleResult, CreateInstrumentationRuleResult, CreateInstrumentationRuleVars, CreateNoisyOperationRuleResult, DeleteActionResult, DeleteActionVars, DeleteCostReductionRuleResult, DeleteDataStreamResult, DeleteDataStreamVars, DeleteDestinationResult, DeleteDestinationVars, DeleteHighlyRelevantOperationRuleResult, DeleteInstrumentationRuleResult, DeleteInstrumentationRuleVars, DeleteNoisyOperationRuleResult, DescribeOdigosData, DescribeSourceData, DestinationWireInput, DiagnoseResult, DiagnoseVars, GetActionsData, GetAllClusterSnapshotsData, GetClusterSnapshotData, GetClusterSnapshotVars, GetCollectorPodInfoData, GetCollectorPodInfoVars, GetConfigYamlsData, GetDataStreamsData, GetDestinationsData, GetEffectiveConfigVars, GetGatewayInfoData, GetGatewayPodsData, GetInstrumentationRulesData, GetK8sManifestData, GetK8sManifestVars, GetMetricsData,
|
|
20
|
+
export type { ApolloConfig, CreateActionResult, CreateActionVars, CreateCostReductionRuleResult, CreateDataStreamResult, CreateDataStreamVars, CreateDestinationResult, CreateDestinationVars, CreateHighlyRelevantOperationRuleResult, CreateInstrumentationRuleResult, CreateInstrumentationRuleVars, CreateNoisyOperationRuleResult, DeleteActionResult, DeleteActionVars, DeleteCostReductionRuleResult, DeleteDataStreamResult, DeleteDataStreamVars, DeleteDestinationResult, DeleteDestinationVars, DeleteHighlyRelevantOperationRuleResult, DeleteInstrumentationRuleResult, DeleteInstrumentationRuleVars, DeleteNoisyOperationRuleResult, DescribeOdigosData, DescribeSourceData, DestinationWireInput, DiagnoseResult, DiagnoseVars, GetActionsData, GetAllClusterSnapshotsData, GetClusterSnapshotData, GetClusterSnapshotVars, GetCollectorPodInfoData, GetCollectorPodInfoVars, GetConfigYamlsData, GetDataStreamsData, GetDestinationsData, GetEffectiveConfigVars, GetGatewayInfoData, GetGatewayPodsData, GetInstrumentationRulesData, GetK8sManifestData, GetK8sManifestVars, GetMetricsData, GetNamespacesWithWorkloadsData, GetNodeCollectorInfoData, GetNodeCollectorPodsData, GetPeerSourcesVars, GetProfilingSlotsData, GetSamplingRulesData, GetServiceMapData, GetSourceLibrariesData, GetSourceLibrariesVars, GetSourceProfilingData, GetTokensData, GetWorkloadsByIdsData, GetWorkloadsByIdsVars, GetWorkloadsData, GetWorkloadsVars, MultiFetchGroup, MultiFetchResponse, MultiFetchResult, OdigosApiOperations, OdigosApiProviderProps, Operation, OperationContext, PersistNamespacesResult, PersistNamespacesVars, PersistSourcesResult, PersistSourcesVars, RecoverFromRollbackVars, ResetLocalUiConfigResult, RestartPodVars, RestartWorkloadsVars, SamplingK8sHealthConfigInput, SamplingK8sHealthConfigVars, SamplingRuleCreateVars, SamplingRuleDeleteVars, SamplingRuleUpdateVars, TestDestinationConnectionVars, UpdateActionResult, UpdateActionVars, UpdateCostReductionRuleResult, UpdateDataStreamResult, UpdateDataStreamVars, UpdateDestinationData, UpdateDestinationVars, UpdateHighlyRelevantOperationRuleResult, UpdateInstrumentationRuleResult, UpdateInstrumentationRuleVars, UpdateLocalUiConfigResult, UpdateLocalUiConfigVars, UpdateLocalUiSamplingConfigResult, UpdateLocalUiSamplingConfigVars, UpdateNoisyOperationRuleResult, UpdateRemoteConfigResult, UpdateRemoteConfigVars, UpdateSourceVars, UpdateTokenResult, UpdateTokenVars, } from './types';
|
|
20
21
|
export type { Capabilities } from './capabilities';
|
|
21
22
|
export type { ConfigApi } from './hooks/use-config-api';
|
|
22
23
|
export type { TokensApi } from './hooks/use-tokens-api';
|
|
@@ -52,8 +52,10 @@ export type VersionedDocumentMap = {
|
|
|
52
52
|
* 1. Pick the platform branch matching `ctx.platformType`.
|
|
53
53
|
* 2. Sort that branch's versions descending (numeric-aware via
|
|
54
54
|
* `trimVersion`).
|
|
55
|
-
* 3. Return the highest version that's `<= ctx.version`.
|
|
56
|
-
*
|
|
55
|
+
* 3. Return the highest version that's `<= ctx.schemaVersion ?? ctx.version`.
|
|
56
|
+
* VM proxies report a GraphQL schema version distinct from their agent
|
|
57
|
+
* binary version, so we floor by the schema version when present. This
|
|
58
|
+
* "floor to the matching bucket" rule keeps older proxies/agents from
|
|
57
59
|
* receiving documents whose schemas they don't understand yet.
|
|
58
60
|
* 4. If no bucket fits (or the platform is missing), return undefined
|
|
59
61
|
* → the runner short-circuits with "Operation not supported in
|