@odigos/ui-kit 0.0.273 → 0.0.275
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 +23 -0
- package/docs/api-context.md +6 -2
- package/lib/chunks/helpers-BkaWRtR9.js +9 -0
- package/lib/chunks/{index-C18_FX5i.js → index-D3cEk2g_.js} +3 -3
- package/lib/chunks/source-instrument-form-context-B40tRNcP.js +5 -0
- package/lib/chunks/ui-components-BUMZXMZ4.js +1596 -0
- package/lib/components/note/index.d.ts +2 -1
- package/lib/components.js +1 -1
- package/lib/constants/actions/categories.d.ts +6 -0
- package/lib/constants/actions/index.d.ts +1 -0
- package/lib/constants/strings/index.d.ts +0 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_drawers/add-action-drawer/lists-column/index.d.ts +10 -0
- package/lib/containers/central-connections/helpers.d.ts +2 -1
- package/lib/containers/central-connections/index.d.ts +1 -1
- package/lib/containers.js +274 -275
- package/lib/contexts/odigos-api/capabilities.d.ts +0 -4
- package/lib/contexts/odigos-api/hooks/use-namespace-api.d.ts +16 -1
- package/lib/contexts/odigos-api/hooks/use-snapshots-api.d.ts +17 -2
- package/lib/contexts/odigos-api/types.d.ts +1 -1
- package/lib/contexts/odigos-api/use-api-query.d.ts +3 -1
- package/lib/contexts/odigos-context.d.ts +3 -1
- package/lib/contexts.js +1 -1
- package/lib/functions/get-action-icon/index.d.ts +2 -2
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icons/actions/enrichment-icon/index.d.ts +2 -0
- package/lib/icons/actions/index.d.ts +3 -0
- package/lib/icons/actions/normalization-icon/index.d.ts +2 -0
- package/lib/icons/actions/privacy-icon/index.d.ts +2 -0
- package/lib/icons/compute-platform/ecs-logo/index.d.ts +2 -0
- package/lib/icons/compute-platform/index.d.ts +1 -1
- package/lib/icons.js +1 -1
- package/lib/snippets/wide-drawer/index.d.ts +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/actions/index.d.ts +9 -0
- package/lib/types/common/index.d.ts +2 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +1 -1
- package/lib/chunks/helpers-B3Ne2tBs.js +0 -9
- package/lib/chunks/source-instrument-form-context-DsVdhWzt.js +0 -5
- package/lib/chunks/ui-components-Cz05Wzh4.js +0 -1596
- package/lib/containers/_drawers/edit-source-drawer/helpers.d.ts +0 -16
- package/lib/icons/compute-platform/cloud-connector-policy-icon/index.d.ts +0 -2
|
@@ -37,9 +37,5 @@ export interface Capabilities {
|
|
|
37
37
|
canFetchProfiling: boolean;
|
|
38
38
|
canFetchCollectorInfo: boolean;
|
|
39
39
|
canManageSamplingRules: boolean;
|
|
40
|
-
isEnterprise: boolean;
|
|
41
|
-
isVm: boolean;
|
|
42
|
-
isConnector: boolean;
|
|
43
|
-
isK8s: boolean;
|
|
44
40
|
}
|
|
45
41
|
export declare const deriveCapabilities: (operations: OdigosApiOperations, ctx: OperationContext) => Capabilities;
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* concurrent consumers and shares the cached list, so the
|
|
7
7
|
* `<AddSourceDrawer>` and `<DiagnoseTab>` (and any other consumer)
|
|
8
8
|
* see the same data once any of them has triggered the fetch.
|
|
9
|
+
*
|
|
10
|
+
* `useNamespaces({ skip })` lets a consumer opt out of triggering that
|
|
11
|
+
* fetch. The query is a full cluster-wide workload inventory, so a
|
|
12
|
+
* consumer that has a cheaper source for the same data should gate it
|
|
13
|
+
* rather than pay for both round-trips (PLAT-1345).
|
|
9
14
|
*/
|
|
10
15
|
import { type Namespace } from '../../../types';
|
|
11
16
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
@@ -21,13 +26,23 @@ export interface UseNamespacesResult {
|
|
|
21
26
|
error?: string;
|
|
22
27
|
}>;
|
|
23
28
|
}
|
|
29
|
+
export interface UseNamespacesOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Skip the query entirely: no request is sent, `items` stays the stable
|
|
32
|
+
* empty array and `loading` stays `false`. `GET_NAMESPACES_WITH_WORKLOADS`
|
|
33
|
+
* is a cluster-wide workload inventory, so a container that can source the
|
|
34
|
+
* same data more cheaply should gate it — the `<AddSourceDrawer>` only
|
|
35
|
+
* needs it when no cluster snapshot is available (PLAT-1345).
|
|
36
|
+
*/
|
|
37
|
+
skip?: boolean;
|
|
38
|
+
}
|
|
24
39
|
export interface NamespaceApi {
|
|
25
40
|
/**
|
|
26
41
|
* Subscribe to the namespaces (with workloads) list. Owns a
|
|
27
42
|
* `useApiQuery('GET_NAMESPACES_WITH_WORKLOADS')` — call at the top level of a
|
|
28
43
|
* container. Returns the reactive `{ items, loading, refetch }`.
|
|
29
44
|
*/
|
|
30
|
-
useNamespaces: () => UseNamespacesResult;
|
|
45
|
+
useNamespaces: (options?: UseNamespacesOptions) => UseNamespacesResult;
|
|
31
46
|
fetchAll: () => Promise<{
|
|
32
47
|
data?: NamespacesEnvelope;
|
|
33
48
|
error?: string;
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
* blocks the op for the active context (e.g. central-ui can't snapshot a
|
|
15
15
|
* < v1.20 proxy, or a VM proxy) the query is skipped and `data` stays
|
|
16
16
|
* `undefined` — consumers treat that as the signal to fall back to the
|
|
17
|
-
* per-proxy `namespacesApi` path.
|
|
18
|
-
*
|
|
17
|
+
* per-proxy `namespacesApi` path. `pending` tells them WHEN that signal is
|
|
18
|
+
* trustworthy, so a consumer can gate its fallback request instead of firing
|
|
19
|
+
* it speculatively alongside the snapshot. Imperative `getAllClusterSnapshots`
|
|
20
|
+
* / `getClusterSnapshot` remain for fire-and-forget reads.
|
|
19
21
|
*/
|
|
20
22
|
import type { AllClusterSnapshots, ClusterSnapshot } from '../../../types';
|
|
21
23
|
import type { OperationContext, OdigosApiOperations } from '../types';
|
|
@@ -23,6 +25,19 @@ export interface UseSnapshotsResult {
|
|
|
23
25
|
/** All-cluster snapshot for the active context (undefined while loading, skipped, or blocked by the op's guard). */
|
|
24
26
|
data?: AllClusterSnapshots;
|
|
25
27
|
loading: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* True while the snapshot outcome is still unknown — a request is in flight
|
|
30
|
+
* and nothing has landed yet. Once this is `false`, `data === undefined`
|
|
31
|
+
* definitively means "no snapshot for this context" (the op is missing, its
|
|
32
|
+
* `canRun` guard blocked it, or the backend returned none), which is the
|
|
33
|
+
* signal to fall back to the per-proxy namespaces path.
|
|
34
|
+
*
|
|
35
|
+
* Distinct from `loading`, which is also `true` while `cache-and-network`
|
|
36
|
+
* revalidates a snapshot that's already rendered. Consumers gating a
|
|
37
|
+
* fallback request need `pending`: gating on `!data` alone fires the
|
|
38
|
+
* fallback on the first render, before the snapshot had a chance to arrive.
|
|
39
|
+
*/
|
|
40
|
+
pending: boolean;
|
|
26
41
|
/** True when the host adapter doesn't expose `GET_ALL_CLUSTER_SNAPSHOTS` at all. */
|
|
27
42
|
unsupported: boolean;
|
|
28
43
|
refetch: () => Promise<{
|
|
@@ -28,7 +28,7 @@ import type { Action, ActionFormData, AllClusterSnapshots, ClusterSnapshot, Conf
|
|
|
28
28
|
* changes (e.g. central-ui re-derives this from `useProxy()`).
|
|
29
29
|
*/
|
|
30
30
|
export interface OperationContext {
|
|
31
|
-
/** k8s | vm — used to pick a platform-specific GraphQL string in versioned-query maps. */
|
|
31
|
+
/** k8s | vm | ecs | connector — used to pick a platform-specific GraphQL string in versioned-query maps. */
|
|
32
32
|
platformType: PlatformType;
|
|
33
33
|
/** community | onprem — used to gate enterprise-only capabilities. */
|
|
34
34
|
tier: Tier;
|
|
@@ -67,7 +67,9 @@ export interface UseApiQueryResult<TData> {
|
|
|
67
67
|
/**
|
|
68
68
|
* Re-execute the query with the same variables, returning the
|
|
69
69
|
* transformed data. Wraps Apollo's `refetch` so callers don't see
|
|
70
|
-
* the raw envelope.
|
|
70
|
+
* the raw envelope. No-ops to `{ data: undefined }` while the query is
|
|
71
|
+
* skipped — by `options.skip`, a missing slot, or the op's `canRun` guard —
|
|
72
|
+
* so a "refresh on open" effect can't smuggle a request past those gates.
|
|
71
73
|
*/
|
|
72
74
|
refetch: () => Promise<{
|
|
73
75
|
data: TData | undefined;
|
|
@@ -11,10 +11,12 @@ export declare const checkVersionSupport: (currentVersion: string, minSupportedV
|
|
|
11
11
|
export declare const useOdigos: (minSupportedVersion?: MinSupportedVersion) => {
|
|
12
12
|
isVersionSupported: boolean;
|
|
13
13
|
minSupportedVersion: number;
|
|
14
|
+
isK8s: boolean;
|
|
14
15
|
isVm: boolean;
|
|
15
16
|
isConnector: boolean;
|
|
16
|
-
|
|
17
|
+
isAwsEcs: boolean;
|
|
17
18
|
isEnterprise: boolean;
|
|
19
|
+
isEcs?: boolean;
|
|
18
20
|
version: string;
|
|
19
21
|
platformType: PlatformType;
|
|
20
22
|
tier: Tier;
|
package/lib/contexts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a,r as x,a as y}from"./chunks/source-instrument-form-context-
|
|
1
|
+
import{u as a,r as x,a as y}from"./chunks/source-instrument-form-context-B40tRNcP.js";export{A as ActionFormContextProvider,C as CloudConnectorFormContextProvider,D as DataStreamFormContextProvider,b as DestinationFormContextProvider,O as OdigosApiConnectionsScope,c as OdigosApiProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,d as SamplingRulesFormProvider,e as SourceEditFormContextProvider,f as SourceInstrumentFormContextProvider,p as prepareNamespacePayloads,g as prepareSourcePayloads,h as useActionFormContext,i as useApiLazyQuery,j as useApiMutation,k as useApiQuery,l as useCloudConnectorFormContext,m as useDataStreamFormContext,n as useDestinationFormContext,o as useOdigosApi,q as useRuleFormContext,s as useSamplingRulesFormContext,t as useSourceEditFormContext,v as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-B40tRNcP.js";export{O as OdigosProvider,c as checkVersionSupport,r as resolveMinSupportedVersion,u as useOdigos}from"./chunks/helpers-BkaWRtR9.js";import{jsx as F}from"react/jsx-runtime";import{useMemo as P,useContext as E,createContext as T}from"react";import{P as I,t as _}from"./chunks/ui-components-BUMZXMZ4.js";import{useApolloClient as M}from"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";const V=()=>{const o=M(),{operations:r,context:e}=a();return{multiFetch:async(t,s,n)=>{const i=r[t];return i?y(o,i,s,n,e):{results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:s.length,error:`Operation ${String(t)} not configured`}},bulkPersistSources:async(t,s)=>{const n=[];for(const i of t){const t={...e,proxyID:i},{error:a}=await x(o,r.PERSIST_SOURCES,s,t);a&&n.push(`${i}: ${a}`)}return n.length?{error:n.join(", ")}:void 0},applyConfigurations:async(t,s)=>{if(!r.UPDATE_REMOTE_CONFIG)return{error:"UPDATE_REMOTE_CONFIG not configured"};const{error:n}=await x(o,r.UPDATE_REMOTE_CONFIG,{formData:s,connectionIds:t},e);return n?{error:n}:void 0}}},w=(o,r)=>o.platformType===I.K8s?r.K8s:[I.Vm,I.Connector,I.AwsEcs].includes(o.platformType)?r.Vm:void 0,N=o=>r=>{const e=o[r.platformType];if(!e)return;const t=Object.keys(e);if(0===t.length)return;const s=_(r.schemaVersion??r.version),n=[...t].sort((o,r)=>_(r)-_(o)).find(o=>s>=_(o));return n?e[n]:void 0},U=(o,r)=>{const e={};for(const t of Object.keys(o))e[t]=r(o[t]);return e},z=T({formType:void 0}),G=({children:o,formType:r})=>{const e=P(()=>({formType:r}),[r]);return F(z.Provider,{value:e,children:o})},$=()=>E(z);export{G as StorybookProvider,w as pickByPlatform,V as useApiForConnections,$ as useStorybook,N as versionedDocument,U as vmDialectMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getActionIcon: (type: ActionType) => SVG;
|
|
1
|
+
import { type ActionType } from '../../types';
|
|
2
|
+
export declare const getActionIcon: (type: ActionType) => import("../../types").SVG;
|
package/lib/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{bk as adaptInstrumentationRuleFromWire,bi as adaptInstrumentationRuleInputForWire,
|
|
1
|
+
export{bk as adaptInstrumentationRuleFromWire,bi as adaptInstrumentationRuleInputForWire,ci as buildBadgeForDesiredStatus,c9 as buildCatalogFieldsDataCard,fs as capitalizeFirstLetter,ft as cleanObjectEmptyStringsValues,a3 as compareCondition,fu as decimalsOnly,aY as deepClone,eA as entityIdKey,eF as filterActions,eE as filterDestinations,cd as filterDestinationsByStream,eD as filterSources,eq as filterSourcesByStream,fv as flattenObjectKeys,cw as formatBytes,fw as formatDuration,b4 as generateId,ex as getActionConditions,cb as getActionIcon,ey as getConditionsBooleans,cM as getContainersIcons,fx as getContainersInstrumentedCount,fy as getDeepValue,c1 as getDestinationIcon,fz as getDetectedLanguageIcons,cm as getEffectiveLanguage,cE as getEffectiveRuntimeVersion,eB as getEntityIcon,bh as getEntityId,ew as getEntityIdKey,ez as getEntityLabel,fA as getHealthBadgeLabel,bf as getIdFromSseTarget,cf as getInstrumentationRuleIcon,fB as getMainContainerLanguage,fC as getMetricForEntity,fD as getMonitorIcon,fE as getNearestTypographySize,cL as getPlatformIcon,em as getPlatformLabel,O as getProgrammingLanguageIcon,fF as getRecursiveValues,cv as getSourceKindLabel,cs as getSourceLanguageIcons,b8 as getSseTargetFromId,cC as getStatusColor,eH as getStatusFromPodStatus,cD as getStatusIcon,cx as getStatusTypeFromOdigosHealth,fG as getValueForRange,cr as getVirtualServiceIcon,cq as getWorkloadId,ce as getYamlFieldsForDestination,fH as hasUnhealthyInstances,fI as instrumentationRuleSourceScopesFromWire,fJ as instrumentationRuleSourceScopesToWire,bp as isEmpty,bq as isLegalK8sLabel,d5 as isOverTime,fK as isStringABoolean,fL as isTimeElapsed,cB as isValidVersion,fM as mapConditions,ck as mapDesiredStatusToConditionStatus,c7 as mapDesiredStatusesToConditions,cc as mapDestinationFieldsForDisplay,bu as mapExportedSignals,bs as mapSupportedSignals,fN as numbersOnly,fO as parseBooleanFromString,fP as parseJsonStringToPrettyString,bK as prepareDestinationFormData,fQ as removeEmptyValuesFromObject,v as safeJsonParse,fR as safeJsonStringify,fS as setDeepValue,fT as sleep,ag as splitCamelString,fU as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-BUMZXMZ4.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
package/lib/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{g9 as IGNORE_OUTSIDE_CLICK_ATTR,ga as useActionFormData,gb as useBodyScroll,eC as useContainerSize,b3 as useCopy,gc as useDataStreamFormData,gd as useDestinationFormData,bl as useGenericForm,ge as useInstrumentationRuleFormData,d4 as useKeyDown,cy as useOnClickOutside,gf as useOverflow,gg as usePopup,ch as useScrollIntoViewWhen,f0 as useScrollTo,et as useSessionStorage,gh as useSourceFormData,cg as useTimeAgo}from"./chunks/ui-components-BUMZXMZ4.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"react-dom";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export * from './add-cluster-info-icon';
|
|
2
2
|
export * from './delete-attribute-icon';
|
|
3
|
+
export * from './enrichment-icon';
|
|
4
|
+
export * from './normalization-icon';
|
|
3
5
|
export * from './pii-masking-icon';
|
|
6
|
+
export * from './privacy-icon';
|
|
4
7
|
export * from './rename-attribute-icon';
|
|
5
8
|
export * from './sampler-icon';
|