@odigos/ui-kit 0.0.249 → 0.0.251

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.
Files changed (140) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/docs/api-context.md +687 -0
  3. package/lib/chunks/connections-scope-CneIqjeg.js +1 -0
  4. package/lib/chunks/flow-CQi_KYfs.js +49 -0
  5. package/lib/chunks/helpers-K1tnyqhm.js +19 -0
  6. package/lib/chunks/{index-CRKgHzab.js → index-Dv0RvKAp.js} +8 -8
  7. package/lib/chunks/source-instrument-form-context-C79I_5cH.js +1 -0
  8. package/lib/chunks/{ui-components-DODwSdKu.js → ui-components-BKrLf2tx.js} +214 -214
  9. package/lib/chunks/use-odigos-api-CDHW7ekQ.js +5 -0
  10. package/lib/chunks/vendor-BFqT13Me.js +1 -0
  11. package/lib/components/_v2/segment/index.d.ts +4 -2
  12. package/lib/components/v2.js +1 -1
  13. package/lib/components.js +1 -1
  14. package/lib/constants/strings/index.d.ts +7 -0
  15. package/lib/constants.js +1 -1
  16. package/lib/containers/_v2/_drawers/add-action-drawer/index.d.ts +0 -2
  17. package/lib/containers/_v2/_drawers/add-destination-drawer/form-column/index.d.ts +1 -5
  18. package/lib/containers/_v2/_drawers/add-destination-drawer/index.d.ts +0 -6
  19. package/lib/containers/_v2/_drawers/add-destination-drawer/lists-filters/index.d.ts +2 -1
  20. package/lib/containers/_v2/_drawers/add-rule-drawer/index.d.ts +0 -2
  21. package/lib/containers/_v2/_drawers/add-source-drawer/index.d.ts +1 -4
  22. package/lib/containers/_v2/_drawers/edit-action-drawer/index.d.ts +0 -3
  23. package/lib/containers/_v2/_drawers/edit-config-drawer/index.d.ts +1 -3
  24. package/lib/containers/_v2/_drawers/edit-destination-drawer/index.d.ts +0 -5
  25. package/lib/containers/_v2/_drawers/edit-rule-drawer/index.d.ts +0 -3
  26. package/lib/containers/_v2/_drawers/edit-source-drawer/debug/index.d.ts +1 -2
  27. package/lib/containers/_v2/_drawers/edit-source-drawer/index.d.ts +3 -14
  28. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/index.d.ts +1 -2
  29. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/index.d.ts +0 -2
  30. package/lib/containers/_v2/_drawers/edit-source-drawer/peers/index.d.ts +1 -6
  31. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/index.d.ts +1 -15
  32. package/lib/containers/_v2/_drawers/edit-source-drawer/sampling/index.d.ts +8 -0
  33. package/lib/containers/_v2/_drawers/edit-source-drawer/sampling/rule-row.d.ts +8 -0
  34. package/lib/containers/_v2/_drawers/edit-source-drawer/tabs.d.ts +1 -0
  35. package/lib/containers/_v2/_drawers/system-drawer/describe/index.d.ts +1 -8
  36. package/lib/containers/_v2/_drawers/system-drawer/diagnose/index.d.ts +1 -4
  37. package/lib/containers/_v2/_drawers/system-drawer/index.d.ts +1 -4
  38. package/lib/containers/_v2/_drawers/system-drawer/tokens/index.d.ts +1 -2
  39. package/lib/containers/_v2/_forms/add-destination-form/index.d.ts +1 -2
  40. package/lib/containers/_v2/_modals/add-data-stream-modal/index.d.ts +0 -3
  41. package/lib/containers/_v2/_modals/edit-data-stream-modal/index.d.ts +0 -2
  42. package/lib/containers/_v2/_modals/sampling-onboarding-modal/types.d.ts +1 -4
  43. package/lib/containers/_v2/central-connections/index.d.ts +1 -12
  44. package/lib/containers/_v2/onboarding/index.d.ts +0 -8
  45. package/lib/containers/_v2/overview/columns/column/head.d.ts +1 -1
  46. package/lib/containers/_v2/overview/columns/column/index.d.ts +2 -1
  47. package/lib/containers/_v2/overview/columns/index.d.ts +1 -8
  48. package/lib/containers/_v2/overview/data-stream-select/index.d.ts +1 -10
  49. package/lib/containers/_v2/overview/drawers/index.d.ts +2 -29
  50. package/lib/containers/_v2/overview/index.d.ts +2 -8
  51. package/lib/containers/_v2/overview/multi-source-control/index.d.ts +1 -5
  52. package/lib/containers/_v2/pipeline-collectors/index.d.ts +0 -7
  53. package/lib/containers/_v2/pipeline-collectors/pods-info/index.d.ts +1 -2
  54. package/lib/containers/_v2/pipeline-collectors/pods-info/pod-drawer/index.d.ts +1 -2
  55. package/lib/containers/_v2/sampling-rules/helpers.d.ts +2 -0
  56. package/lib/containers/_v2/sampling-rules/types.d.ts +2 -16
  57. package/lib/containers/_v2/settings/index.d.ts +0 -9
  58. package/lib/containers/service-map/index.d.ts +4 -2
  59. package/lib/containers/v2.js +197 -166
  60. package/lib/containers.js +7 -7
  61. package/lib/contexts/index.d.ts +1 -0
  62. package/lib/contexts/odigos-api/capabilities.d.ts +38 -0
  63. package/lib/contexts/odigos-api/client.d.ts +22 -0
  64. package/lib/contexts/odigos-api/connections-scope.d.ts +18 -0
  65. package/lib/contexts/odigos-api/hooks/use-actions-api.d.ts +26 -0
  66. package/lib/contexts/odigos-api/hooks/use-collectors-api.d.ts +25 -0
  67. package/lib/contexts/odigos-api/hooks/use-config-api.d.ts +24 -0
  68. package/lib/contexts/odigos-api/hooks/use-data-streams-api.d.ts +26 -0
  69. package/lib/contexts/odigos-api/hooks/use-describe-api.d.ts +33 -0
  70. package/lib/contexts/odigos-api/hooks/use-destinations-api.d.ts +50 -0
  71. package/lib/contexts/odigos-api/hooks/use-instrumentation-rules-api.d.ts +35 -0
  72. package/lib/contexts/odigos-api/hooks/use-k8s-manifest-api.d.ts +14 -0
  73. package/lib/contexts/odigos-api/hooks/use-metrics-api.d.ts +13 -0
  74. package/lib/contexts/odigos-api/hooks/use-namespace-api.d.ts +30 -0
  75. package/lib/contexts/odigos-api/hooks/use-profiling-api.d.ts +17 -0
  76. package/lib/contexts/odigos-api/hooks/use-sampling-api.d.ts +39 -0
  77. package/lib/contexts/odigos-api/hooks/use-service-map-api.d.ts +13 -0
  78. package/lib/contexts/odigos-api/hooks/use-snapshots-api.d.ts +13 -0
  79. package/lib/contexts/odigos-api/hooks/use-sources-api.d.ts +75 -0
  80. package/lib/contexts/odigos-api/hooks/use-tokens-api.d.ts +12 -0
  81. package/lib/contexts/odigos-api/index.d.ts +37 -0
  82. package/lib/contexts/odigos-api/internal/notify.d.ts +49 -0
  83. package/lib/contexts/odigos-api/internal/source-payloads.d.ts +53 -0
  84. package/lib/contexts/odigos-api/platform-helpers.d.ts +98 -0
  85. package/lib/contexts/odigos-api/provider.d.ts +28 -0
  86. package/lib/contexts/odigos-api/runner.d.ts +32 -0
  87. package/lib/contexts/odigos-api/types.d.ts +831 -0
  88. package/lib/contexts/odigos-api/use-api-for-connections.d.ts +43 -0
  89. package/lib/contexts/odigos-api/use-api-query.d.ts +130 -0
  90. package/lib/contexts/odigos-api/use-odigos-api.d.ts +103 -0
  91. package/lib/contexts/odigos-api.js +1 -0
  92. package/lib/contexts/odigos-context.d.ts +2 -2
  93. package/lib/contexts/storybook-context.d.ts +2 -2
  94. package/lib/contexts.js +1 -1
  95. package/lib/functions.js +1 -1
  96. package/lib/hooks.js +1 -1
  97. package/lib/icons/destinations/open-telemetry-logo/index.d.ts +2 -1
  98. package/lib/snippets/_v2/sampling-rule-form-sections/preset-with-custom-input.d.ts +1 -1
  99. package/lib/snippets/v2.js +1 -1
  100. package/lib/snippets.js +1 -49
  101. package/lib/store/index.d.ts +0 -1
  102. package/lib/store/useDrawerStore.d.ts +6 -1
  103. package/lib/store.js +1 -1
  104. package/lib/theme.js +1 -1
  105. package/lib/types/actions/index.d.ts +0 -5
  106. package/lib/types/common/index.d.ts +29 -4
  107. package/lib/types/destinations/index.d.ts +0 -10
  108. package/lib/types/index.d.ts +0 -1
  109. package/lib/types/instrumentation-rules/index.d.ts +0 -5
  110. package/lib/types/namespaces/index.d.ts +0 -5
  111. package/lib/types/pipeline-collectors/index.d.ts +0 -5
  112. package/lib/types/snapshot/index.d.ts +0 -2
  113. package/lib/types/sources/index.d.ts +0 -30
  114. package/lib/types/tokens/index.d.ts +0 -6
  115. package/lib/types/workload/index.d.ts +46 -22
  116. package/lib/types.js +1 -1
  117. package/lib/visuals.js +1 -1
  118. package/package.json +31 -22
  119. package/lib/chunks/helpers-IEFhGXc7.js +0 -19
  120. package/lib/chunks/source-instrument-form-context-DjIHPYQJ.js +0 -1
  121. package/lib/chunks/vendor-Be0cOokr.js +0 -1
  122. package/lib/mock-data/actions/index.d.ts +0 -2
  123. package/lib/mock-data/config/index.d.ts +0 -3
  124. package/lib/mock-data/connections/index.d.ts +0 -2
  125. package/lib/mock-data/describe/index.d.ts +0 -3
  126. package/lib/mock-data/destinations/index.d.ts +0 -4
  127. package/lib/mock-data/index.d.ts +0 -15
  128. package/lib/mock-data/instrumentation-instances/index.d.ts +0 -2
  129. package/lib/mock-data/instrumentation-rules/index.d.ts +0 -2
  130. package/lib/mock-data/namespaces/index.d.ts +0 -2
  131. package/lib/mock-data/pipeline-collectors/index.d.ts +0 -6
  132. package/lib/mock-data/profiling/index.d.ts +0 -8
  133. package/lib/mock-data/service-map/index.d.ts +0 -4
  134. package/lib/mock-data/snapshot/index.d.ts +0 -5
  135. package/lib/mock-data/sources/index.d.ts +0 -4
  136. package/lib/mock-data/sources/yamls.d.ts +0 -22
  137. package/lib/mock-data/tokens/index.d.ts +0 -2
  138. package/lib/mock-data/traces/index.d.ts +0 -2
  139. package/lib/store/useEntityStore.d.ts +0 -24
  140. package/lib/types/k8s-manifest/index.d.ts +0 -2
@@ -0,0 +1,43 @@
1
+ /**
2
+ * `useApiForConnections(connectionIds)` — operate against a specific list
3
+ * of central-ui proxy clusters rather than the currently-selected proxy.
4
+ *
5
+ * Used by `<CentralConnections>` and `<EditConfigDrawer>` which run
6
+ * "out-of-proxy" — the user picks one or more clusters and applies an
7
+ * operation across them. Internally this returns a `multi: <method>` shim
8
+ * over each domain's bulk-capable methods.
9
+ *
10
+ * For odigos webapp (single-cluster), this still works because the runner
11
+ * falls back to `Promise.all` of single-fetch when the operation lacks
12
+ * `documentMulti`/`transformVariablesMulti`.
13
+ */
14
+ import type { Operation, MultiFetchResponse, OdigosApiOperations, PersistSourcesVars, UpdateRemoteConfigVars } from './types';
15
+ /**
16
+ * Subset of `OdigosApiOperations` keys that are valid for multi-cluster
17
+ * fan-out. Restricted to read paths + a few aggregate reads — we do not
18
+ * expose mutation-style operations here because their multi-cluster
19
+ * semantics (idempotency, partial failures) deserve dedicated helpers.
20
+ */
21
+ type MultiFetchableKey = 'GET_WORKLOADS' | 'GET_WORKLOADS_BY_IDS' | 'GET_DESTINATIONS' | 'GET_ACTIONS' | 'GET_INSTRUMENTATION_RULES' | 'GET_ALL_CLUSTER_SNAPSHOTS' | 'GET_CLUSTER_SNAPSHOT' | 'GET_EFFECTIVE_CONFIG';
22
+ /** Extract `TData` from an `Operation<TData, TVars>` slot (handles optional `| undefined`). */
23
+ type SlotData<K extends MultiFetchableKey> = NonNullable<OdigosApiOperations[K]> extends Operation<infer T, unknown> ? T : never;
24
+ /** Extract `TVars` from an `Operation<TData, TVars>` slot. */
25
+ type SlotVars<K extends MultiFetchableKey> = NonNullable<OdigosApiOperations[K]> extends Operation<unknown, infer V> ? V : never;
26
+ export interface ApiForConnections {
27
+ /**
28
+ * Run a query against multiple proxy clusters and aggregate results.
29
+ * Generics are inferred from the slot key — callers don't need to
30
+ * spell out `<TData, TVars>`.
31
+ */
32
+ multiFetch<K extends MultiFetchableKey>(operationName: K, proxyIDs: string[], vars?: SlotVars<K>): Promise<MultiFetchResponse<SlotData<K>>>;
33
+ /** Bulk persist sources across the supplied connections. */
34
+ bulkPersistSources(proxyIDs: string[], payload: PersistSourcesVars): Promise<{
35
+ error?: string;
36
+ } | undefined>;
37
+ /** Bulk apply effective-config overrides across the supplied connections. */
38
+ applyConfigurations(connectionIds: string[], formData: UpdateRemoteConfigVars['formData']): Promise<{
39
+ error?: string;
40
+ } | undefined>;
41
+ }
42
+ export declare const useApiForConnections: () => ApiForConnections;
43
+ export {};
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Declarative query / mutation hooks layered on top of Apollo's
3
+ * `useQuery` / `useLazyQuery` / `useMutation`, typed against the kit's
4
+ * `OdigosApiOperations` slot map.
5
+ *
6
+ * Why three hooks (and not just one)?
7
+ * - `useApiQuery(key, vars)` — auto-fetching, polls, cache-aware. The
8
+ * 90% case for "fetch some thing on mount and render its loading /
9
+ * data / error states".
10
+ * - `useApiLazyQuery(key)` — fetches imperatively (e.g. on a button
11
+ * click). Mirrors Apollo's `useLazyQuery` shape.
12
+ * - `useApiMutation(key)` — wraps `useMutation` with the slot's typed
13
+ * vars + result; exposes `refetchQueries` for cache invalidation.
14
+ *
15
+ * All three:
16
+ * - Accept the slot key (`'GET_WORKLOADS'` / `'CREATE_ACTION'` / …) and
17
+ * derive `TData` and `TVars` from `OdigosApiOperations[key]`. No
18
+ * `<TData, TVars>` generics required at the call site.
19
+ * - Apply `op.transformVariables` and `op.transformResult` automatically.
20
+ * - Honor `op.client` (per-op ApolloClient override) — same way the
21
+ * imperative `runner.ts` does.
22
+ * - Short-circuit gracefully when the host adapter doesn't expose the
23
+ * slot (capability missing) or when the resolved document is
24
+ * undefined for the active platform/version. The hook returns
25
+ * `unsupported: true` and never fires the request.
26
+ *
27
+ * The existing imperative `runQuery` / `runMutation` are still available
28
+ * for fire-and-forget call sites (event handlers, store-syncing domain
29
+ * hooks). Use whichever fits — declarative for "render data + states",
30
+ * imperative for "do this thing now and react to the result".
31
+ */
32
+ import type { OdigosApiOperations, Operation } from './types';
33
+ import { type ApolloError, type MutationHookOptions, type WatchQueryFetchPolicy } from '@apollo/client';
34
+ type Slot<K extends keyof OdigosApiOperations> = NonNullable<OdigosApiOperations[K]>;
35
+ type SlotData<K extends keyof OdigosApiOperations> = Slot<K> extends Operation<infer T, unknown> ? T : never;
36
+ type SlotVars<K extends keyof OdigosApiOperations> = Slot<K> extends Operation<unknown, infer V> ? V : never;
37
+ export interface UseApiQueryOptions<TData> {
38
+ /** Skip the request entirely (e.g. while inputs are pending). */
39
+ skip?: boolean;
40
+ /** Apollo polling interval in ms. */
41
+ pollInterval?: number;
42
+ /**
43
+ * Apollo fetch policy. Defaults to `cache-and-network` so consumers
44
+ * see cached data instantly while a fresh request runs in the
45
+ * background — closer to the "always-fresh" feel the kit's imperative
46
+ * `runQuery` had (which used `network-only`), without paying the
47
+ * latency tax of an empty cache on every render.
48
+ */
49
+ fetchPolicy?: WatchQueryFetchPolicy;
50
+ /**
51
+ * When true, `loading` flips on during refetches and polls (default
52
+ * Apollo behavior is to keep `loading: false` after the first response
53
+ * and only update via `networkStatus`). Useful for "refresh"
54
+ * spinners.
55
+ */
56
+ notifyOnNetworkStatusChange?: boolean;
57
+ /** Callback fired with the transformed data when a request succeeds. */
58
+ onCompleted?: (data: TData) => void;
59
+ /** Callback fired with an `ApolloError` when a request fails. */
60
+ onError?: (error: ApolloError) => void;
61
+ }
62
+ export interface UseApiQueryResult<TData> {
63
+ data: TData | undefined;
64
+ loading: boolean;
65
+ error: ApolloError | undefined;
66
+ /**
67
+ * Re-execute the query with the same variables, returning the
68
+ * transformed data. Wraps Apollo's `refetch` so callers don't see
69
+ * the raw envelope.
70
+ */
71
+ refetch: () => Promise<{
72
+ data: TData | undefined;
73
+ }>;
74
+ /**
75
+ * True when the active context can't satisfy this slot — either the
76
+ * host adapter omitted it, or the slot's `document(ctx)` callback
77
+ * returned undefined for this platform/version. Containers should
78
+ * render an "operation not supported" UI (or hide the affordance via
79
+ * `capabilities.canX`) when this is true.
80
+ */
81
+ unsupported: boolean;
82
+ }
83
+ export declare const useApiQuery: <K extends keyof OdigosApiOperations>(key: K, vars?: SlotVars<K>, options?: UseApiQueryOptions<SlotData<K>>) => UseApiQueryResult<SlotData<K>>;
84
+ export interface UseApiLazyQueryResult<TData, TVars> {
85
+ /**
86
+ * Trigger the query. Returns the transformed data (or an Apollo error)
87
+ * for the caller to act on — the hook's state object also reflects
88
+ * the same result, so consumers can choose either pattern.
89
+ */
90
+ execute: (vars?: TVars) => Promise<{
91
+ data?: TData;
92
+ error?: ApolloError;
93
+ }>;
94
+ data: TData | undefined;
95
+ loading: boolean;
96
+ error: ApolloError | undefined;
97
+ called: boolean;
98
+ unsupported: boolean;
99
+ }
100
+ export declare const useApiLazyQuery: <K extends keyof OdigosApiOperations>(key: K, options?: UseApiQueryOptions<SlotData<K>>) => UseApiLazyQueryResult<SlotData<K>, SlotVars<K>>;
101
+ export interface UseApiMutationOptions<TData> {
102
+ /**
103
+ * Apollo-style cache invalidation. After the mutation succeeds, refetch
104
+ * each named query. Useful for "create destination" → refetch
105
+ * destinations list.
106
+ */
107
+ refetchQueries?: MutationHookOptions['refetchQueries'];
108
+ /**
109
+ * Wait for refetched queries to settle before resolving the mutation
110
+ * promise. Mirrors Apollo's flag of the same name.
111
+ */
112
+ awaitRefetchQueries?: boolean;
113
+ onCompleted?: (data: TData) => void;
114
+ onError?: (error: ApolloError) => void;
115
+ }
116
+ export interface UseApiMutationResult<TData> {
117
+ data: TData | undefined;
118
+ loading: boolean;
119
+ error: ApolloError | undefined;
120
+ called: boolean;
121
+ unsupported: boolean;
122
+ reset: () => void;
123
+ }
124
+ /** Imperative `execute(vars)` plus Apollo-shaped state. */
125
+ export type UseApiMutationTuple<TData, TVars> = [(vars: TVars) => Promise<{
126
+ data?: TData;
127
+ error?: ApolloError;
128
+ }>, UseApiMutationResult<TData>];
129
+ export declare const useApiMutation: <K extends keyof OdigosApiOperations>(key: K, options?: UseApiMutationOptions<SlotData<K>>) => UseApiMutationTuple<SlotData<K>, SlotVars<K>>;
130
+ export {};
@@ -0,0 +1,103 @@
1
+ /**
2
+ * `useOdigosApi()` — the public consumer hook for the kit's API context.
3
+ *
4
+ * Returns a namespaced object grouping per-domain APIs (`sourcesApi`,
5
+ * `destinationsApi`, `actionsApi`, …) plus computed `capabilities` and
6
+ * a `resetCache` helper. Containers call this once at the top of the
7
+ * file and consume only the slice(s) they need; the `*Api` suffix
8
+ * makes destructuring a no-rename operation:
9
+ *
10
+ * ```ts
11
+ * // Imperative-only — no entity-list queries fire.
12
+ * const { configApi, sourcesApi } = useOdigosApi();
13
+ * configApi.applyConfigurations?.(formData, ids);
14
+ * sourcesApi.update(workloadId, payload);
15
+ *
16
+ * // Subscribe-to-data — reads `.items` / `.loading` and lets the kit
17
+ * // auto-fetch the underlying list query.
18
+ * const { sourcesApi } = useOdigosApi({ subscribe: ['sources'] });
19
+ * sourcesApi.items.length; // Workload[]
20
+ * ```
21
+ *
22
+ * ### Subscribe opt-in
23
+ *
24
+ * The six entity-list domain APIs (`sourcesApi`, `destinationsApi`,
25
+ * `actionsApi`, `instrumentationRulesApi`, `namespacesApi`, `dataStreamsApi`) own a
26
+ * `useApiQuery('GET_…')` subscription that auto-fetches and broadcasts
27
+ * to every consumer via Apollo's normalized cache.
28
+ *
29
+ * Without an opt-in, calling `useOdigosApi()` from a page like
30
+ * `/settings` (which only needs `configApi`) used to fire all six
31
+ * list queries unconditionally, plus a redundant fetch on every host
32
+ * page that mounts a header/system-drawer. The `subscribe` option
33
+ * makes the auto-fetch explicit: containers that read `.items` /
34
+ * `.loading` list which entities they need; everyone else gets the
35
+ * imperative methods (create/update/delete/fetchAll) but no auto-fetch.
36
+ *
37
+ * Containers that opt out still receive a fully-typed `*Api` object —
38
+ * `.items` will be an empty array (the slot is `skip: true`'d), and
39
+ * `.loading` will stay `false`. Reading those is a no-op the
40
+ * type system happily allows; missing the opt-in for a container
41
+ * that DOES need data shows up as "no rows" in the UI.
42
+ *
43
+ * All data flow runs through the operations map supplied to
44
+ * `<OdigosApiProvider>`. Build-time tooling (Storybook) installs its
45
+ * own Apollo client + stub operations to render mock data —
46
+ * production code has zero awareness of mocks.
47
+ */
48
+ import { type ConfigApi } from './hooks/use-config-api';
49
+ import { type TokensApi } from './hooks/use-tokens-api';
50
+ import { type Capabilities } from './capabilities';
51
+ import { type SourcesApi } from './hooks/use-sources-api';
52
+ import { type ActionsApi } from './hooks/use-actions-api';
53
+ import { type MetricsApi } from './hooks/use-metrics-api';
54
+ import { type DescribeApi } from './hooks/use-describe-api';
55
+ import { type SamplingApi } from './hooks/use-sampling-api';
56
+ import { type NamespaceApi } from './hooks/use-namespace-api';
57
+ import { type SnapshotsApi } from './hooks/use-snapshots-api';
58
+ import { type ProfilingApi } from './hooks/use-profiling-api';
59
+ import { type CollectorsApi } from './hooks/use-collectors-api';
60
+ import { type ServiceMapApi } from './hooks/use-service-map-api';
61
+ import { type DataStreamsApi } from './hooks/use-data-streams-api';
62
+ import { type K8sManifestApi } from './hooks/use-k8s-manifest-api';
63
+ import { type DestinationsApi } from './hooks/use-destinations-api';
64
+ import { type InstrumentationRulesApi } from './hooks/use-instrumentation-rules-api';
65
+ /**
66
+ * Names of entity-list domain hooks whose `useApiQuery` subscription
67
+ * is opt-in. Pass any subset to `useOdigosApi({ subscribe: [...] })`.
68
+ */
69
+ export type SubscribableDomain = 'sources' | 'destinations' | 'actions' | 'rules' | 'namespaces' | 'dataStreams' | 'destinationCategories' | 'potentialDestinations';
70
+ export interface UseOdigosApiOptions {
71
+ /**
72
+ * Which entity-list domains should auto-fetch their list query.
73
+ * Containers that read `.items` / `.loading` from a domain MUST list it here;
74
+ * otherwise the kit hands back an empty array and `false` loading.
75
+ * Containers that only need imperative methods (create/update/delete/fetchAll) should omit the option entirely — no list query fires.
76
+ */
77
+ subscribe?: SubscribableDomain[];
78
+ }
79
+ export interface UseOdigosApiReturn {
80
+ sourcesApi: SourcesApi;
81
+ destinationsApi: DestinationsApi;
82
+ actionsApi: ActionsApi;
83
+ instrumentationRulesApi: InstrumentationRulesApi;
84
+ dataStreamsApi: DataStreamsApi;
85
+ namespacesApi: NamespaceApi;
86
+ k8sManifestApi: K8sManifestApi;
87
+ configApi: ConfigApi;
88
+ describeApi: DescribeApi;
89
+ tokensApi: TokensApi;
90
+ metricsApi: MetricsApi;
91
+ serviceMapApi: ServiceMapApi;
92
+ profilingApi: ProfilingApi;
93
+ collectorsApi: CollectorsApi;
94
+ samplingApi: SamplingApi;
95
+ snapshotsApi: SnapshotsApi;
96
+ capabilities: Capabilities;
97
+ /**
98
+ * Wipe Apollo's normalized cache. Used by hosts that need to drop all cached entity data on a context boundary (e.g. central-ui switching between proxies under different cluster identities).
99
+ * Delegates to `client.cache.reset()`, so active subscribers re-fetch on the next render via their cache-first observers and in-flight requests are NOT cancelled (avoids Apollo error #42, "Store reset while query was in flight").
100
+ */
101
+ resetCache: () => Promise<void>;
102
+ }
103
+ export declare const useOdigosApi: (options?: UseOdigosApiOptions) => UseOdigosApiReturn;
@@ -0,0 +1 @@
1
+ import{e as o,r,f as t}from"../chunks/use-odigos-api-CDHW7ekQ.js";export{O as OdigosApiProvider,p as prepareNamespacePayloads,a as prepareSourcePayloads,u as useApiLazyQuery,b as useApiMutation,c as useApiQuery,d as useOdigosApi}from"../chunks/use-odigos-api-CDHW7ekQ.js";export{O as OdigosApiConnectionsScope}from"../chunks/connections-scope-CneIqjeg.js";import{useApolloClient as e}from"@apollo/client";import{P as s,t as i}from"../chunks/ui-components-BKrLf2tx.js";import"react";import"react/jsx-runtime";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"styled-components";import"../icons.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";const n=()=>{const s=e(),{operations:i,context:n}=o();return{multiFetch:async(o,r,e)=>{const a=i[o];return a?t(s,a,r,e,n):{results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:r.length,error:`Operation ${String(o)} not configured`}},bulkPersistSources:async(o,t)=>{const e=[];for(const a of o){const o={...n,proxyID:a},{error:c}=await r(s,i.PERSIST_SOURCES,t,o);c&&e.push(`${a}: ${c}`)}return e.length?{error:e.join(", ")}:void 0},applyConfigurations:async(o,t)=>{if(!i.UPDATE_REMOTE_CONFIG)return{error:"UPDATE_REMOTE_CONFIG not configured"};const{error:e}=await r(s,i.UPDATE_REMOTE_CONFIG,{formData:t,connectionIds:o},n);return e?{error:e}:void 0}}},m=(o,r)=>o.platformType===s.K8s?r.K8s:o.platformType===s.Vm?r.Vm:void 0,l=o=>r=>{const t=o[r.platformType];if(!t)return;const e=Object.keys(t);if(0===e.length)return;const s=i(r.version),n=[...e].sort((o,r)=>i(r)-i(o)).find(o=>s>=i(o));return n?t[n]:void 0},f=(o,r)=>{const t={};for(const e of Object.keys(o))t[e]=r(o[e]);return t};export{m as pickByPlatform,n as useApiForConnections,l as versionedDocument,f as vmDialectMap};
@@ -1,11 +1,11 @@
1
- import { type PropsWithChildren } from 'react';
1
+ import React, { type PropsWithChildren } from 'react';
2
2
  import { PlatformType, Tier } from '@/types';
3
3
  interface ContextProps extends PropsWithChildren {
4
4
  platformType: PlatformType;
5
5
  tier: Tier;
6
6
  version: string;
7
7
  }
8
- export declare const OdigosProvider: ({ children, platformType, tier, version }: ContextProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const OdigosProvider: ({ children, platformType, tier, version }: ContextProps) => React.JSX.Element;
9
9
  export declare const checkVersionSupport: (currentVersion: string, minSupportedVersion?: number) => boolean;
10
10
  export declare const useOdigos: (minSupportedVersion?: number) => {
11
11
  isVersionSupported: boolean;
@@ -1,8 +1,8 @@
1
- import { type PropsWithChildren } from 'react';
1
+ import React, { type PropsWithChildren } from 'react';
2
2
  interface ContextProps extends PropsWithChildren {
3
3
  formType?: string;
4
4
  }
5
5
  type ContextValues = Omit<ContextProps, 'children'>;
6
- export declare const StorybookProvider: ({ children, formType }: ContextProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const StorybookProvider: ({ children, formType }: ContextProps) => React.JSX.Element;
7
7
  export declare const useStorybook: () => ContextValues;
8
8
  export {};
package/lib/contexts.js CHANGED
@@ -1 +1 @@
1
- export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-DjIHPYQJ.js";export{O as OdigosProvider,c as checkVersionSupport,u as useOdigos}from"./chunks/helpers-IEFhGXc7.js";import{jsx as r}from"react/jsx-runtime";import{useMemo as o,useContext as t,createContext as s}from"react";import"./chunks/ui-components-DODwSdKu.js";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const m=s({formType:void 0}),n=({children:e,formType:t})=>{const s=o(()=>({formType:t}),[t]);return r(m.Provider,{value:s,children:e})},p=()=>t(m);export{n as StorybookProvider,p as useStorybook};
1
+ export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-C79I_5cH.js";export{O as OdigosProvider,c as checkVersionSupport,u as useOdigos}from"./chunks/helpers-K1tnyqhm.js";import{jsx as o}from"react/jsx-runtime";import{useMemo as r,useContext as t,createContext as s}from"react";export{O as OdigosApiConnectionsScope}from"./chunks/connections-scope-CneIqjeg.js";export{O as OdigosApiProvider,p as prepareNamespacePayloads,a as prepareSourcePayloads,u as useApiLazyQuery,b as useApiMutation,c as useApiQuery,d as useOdigosApi}from"./chunks/use-odigos-api-CDHW7ekQ.js";export{pickByPlatform,useApiForConnections,versionedDocument,vmDialectMap}from"./contexts/odigos-api.js";import"./chunks/ui-components-BKrLf2tx.js";import"styled-components";import"./icons.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";const n=s({formType:void 0}),m=({children:e,formType:t})=>{const s=r(()=>({formType:t}),[t]);return o(n.Provider,{value:s,children:e})},l=()=>t(n);export{m as StorybookProvider,l as useStorybook};
package/lib/functions.js CHANGED
@@ -1 +1 @@
1
- export{fa as adaptInstrumentationRuleFromWire,fb as adaptInstrumentationRuleInputForWire,b1 as buildBadgeForDesiredStatus,fc as capitalizeFirstLetter,fd as cleanObjectEmptyStringsValues,ah as compareCondition,fe as decimalsOnly,p as deepClone,dh as entityIdKey,dl as filterActions,dk as filterDestinations,aW as filterDestinationsByStream,dj as filterSources,d6 as filterSourcesByStream,ff as flattenObjectKeys,bh as formatBytes,fg as formatDuration,bQ as generateId,aU as getActionIcon,e as getConditionsBooleans,bt as getContainersIcons,fh as getContainersInstrumentedCount,fi as getDeepValue,aH as getDestinationIcon,fj as getDetectedLanguageIcons,b6 as getEffectiveLanguage,bo as getEffectiveRuntimeVersion,dc as getEntityIcon,aP as getEntityId,dg as getEntityIdKey,db as getEntityLabel,fk as getHealthBadgeLabel,fl as getIdFromSseTarget,a_ as getInstrumentationRuleIcon,fm as getMainContainerLanguage,fn as getMetricForEntity,fo as getMonitorIcon,fp as getPlatformIcon,fq as getPlatformLabel,ao as getProgrammingLanguageIcon,fr as getRecursiveValues,d as getSourceLanguageIcons,fs as getSseTargetFromId,ft as getStatusColor,dr as getStatusFromPodStatus,df as getStatusIcon,bj as getStatusTypeFromOdigosHealth,fu as getValueForRange,g as getVirtualServiceIcon,be as getWorkloadId,aX as getYamlFieldsForDestination,fv as hasUnhealthyInstances,fw as instrumentationRuleSourceScopesFromWire,fx as instrumentationRuleSourceScopesToWire,s as isEmpty,x as isLegalK8sLabel,bM as isOverTime,fy as isStringABoolean,fz as isTimeElapsed,bn as isValidVersion,fA as mapConditions,b4 as mapDesiredStatusToConditionStatus,aV as mapDestinationFieldsForDisplay,G as mapExportedSignals,z as mapSupportedSignals,fB as numbersOnly,fC as parseBooleanFromString,fD as parseJsonStringToPrettyString,ai as prepareDestinationFormData,fE as removeEmptyValuesFromObject,C as safeJsonParse,fF as safeJsonStringify,fG as setDeepValue,fH as sleep,aY as splitCamelString,fI as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-DODwSdKu.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{a1 as adaptInstrumentationRuleFromWire,a2 as adaptInstrumentationRuleInputForWire,b9 as buildBadgeForDesiredStatus,fe as capitalizeFirstLetter,ff as cleanObjectEmptyStringsValues,ar as compareCondition,fg as decimalsOnly,s as deepClone,dm as entityIdKey,ds as filterActions,dr as filterDestinations,b2 as filterDestinationsByStream,dq as filterSources,de as filterSourcesByStream,fh as flattenObjectKeys,bp as formatBytes,fi as formatDuration,bY as generateId,b0 as getActionIcon,k as getConditionsBooleans,bB as getContainersIcons,fj as getContainersInstrumentedCount,fk as getDeepValue,aR as getDestinationIcon,fl as getDetectedLanguageIcons,be as getEffectiveLanguage,bw as getEffectiveRuntimeVersion,dn as getEntityIcon,aX as getEntityId,dk as getEntityIdKey,dl as getEntityLabel,fm as getHealthBadgeLabel,a0 as getIdFromSseTarget,b6 as getInstrumentationRuleIcon,fn as getMainContainerLanguage,fo as getMetricForEntity,fp as getMonitorIcon,fq as getPlatformIcon,fr as getPlatformLabel,ay as getProgrammingLanguageIcon,fs as getRecursiveValues,j as getSourceLanguageIcons,X as getSseTargetFromId,ft as getStatusColor,dw as getStatusFromPodStatus,g as getStatusIcon,br as getStatusTypeFromOdigosHealth,fu as getValueForRange,i as getVirtualServiceIcon,bm as getWorkloadId,b3 as getYamlFieldsForDestination,fv as hasUnhealthyInstances,fw as instrumentationRuleSourceScopesFromWire,fx as instrumentationRuleSourceScopesToWire,x as isEmpty,B as isLegalK8sLabel,bU as isOverTime,fy as isStringABoolean,fz as isTimeElapsed,bv as isValidVersion,fA as mapConditions,bc as mapDesiredStatusToConditionStatus,b1 as mapDestinationFieldsForDisplay,K as mapExportedSignals,G as mapSupportedSignals,fB as numbersOnly,fC as parseBooleanFromString,fD as parseJsonStringToPrettyString,as as prepareDestinationFormData,fE as removeEmptyValuesFromObject,J as safeJsonParse,fF as safeJsonStringify,fG as setDeepValue,fH as sleep,b4 as splitCamelString,fI as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-BKrLf2tx.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"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
package/lib/hooks.js CHANGED
@@ -1 +1 @@
1
- export{fT as IGNORE_OUTSIDE_CLICK_ATTR,fU as useActionFormData,fV as useBodyScroll,da as useClickNode,m as useClickNotification,di as useContainerSize,bi as useCopy,fW as useDataStreamFormData,fX as useDestinationFormData,o as useGenericForm,fY as useInstrumentationRuleFormData,bL as useKeyDown,bk as useOnClickOutside,fZ as useOverflow,u as usePopup,b0 as useScrollIntoViewWhen,dN as useScrollTo,d9 as useSessionStorage,f_ as useSourceFormData,a$ as useTimeAgo}from"./chunks/ui-components-DODwSdKu.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{fT as IGNORE_OUTSIDE_CLICK_ATTR,fU as useActionFormData,fV as useBodyScroll,u as useClickNode,p as useClickNotification,dp as useContainerSize,bq as useCopy,fW as useDataStreamFormData,fX as useDestinationFormData,r as useGenericForm,fY as useInstrumentationRuleFormData,bT as useKeyDown,bs as useOnClickOutside,fZ as useOverflow,d as usePopup,b8 as useScrollIntoViewWhen,dS as useScrollTo,dh as useSessionStorage,f_ as useSourceFormData,b7 as useTimeAgo}from"./chunks/ui-components-BKrLf2tx.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"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { SVG } from '@/types';
2
- export declare const OpenTelemetryLogoStripped: () => import("react/jsx-runtime").JSX.Element;
3
+ export declare const OpenTelemetryLogoStripped: () => React.JSX.Element;
3
4
  export declare const OpenTelemetryLogo: SVG;
@@ -29,4 +29,4 @@ export interface PresetWithCustomInputProps<T extends string = string> {
29
29
  customMin?: number;
30
30
  customMax?: number;
31
31
  }
32
- export declare const PresetWithCustomInput: <T extends string>({ description, options, selected, onSelect, customName, customLabel, customPlaceholder, customValue, onCustomChange, customInputType, customMin, customMax, }: PresetWithCustomInputProps<T>) => import("react/jsx-runtime").JSX.Element;
32
+ export declare const PresetWithCustomInput: <T extends string>({ description, options, selected, onSelect, customName, customLabel, customPlaceholder, customValue, onCustomChange, customInputType, customMin, customMax, }: PresetWithCustomInputProps<T>) => React.JSX.Element;
@@ -1 +1 @@
1
- export{ba as ActionType,dq as Actions,dp as RichTitle}from"../chunks/ui-components-DODwSdKu.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,b as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,c as SamplingPreviewSection,S as SignalsCheckboxList,a as SourceScopeSection,U as UpgradeModal,i as WIDE_DRAWER_WIDTH,W as WideDrawer,Y as YamlSectionCard}from"../chunks/index-CRKgHzab.js";export{C as ColoredSpan,y as ColoredSpanVariant}from"../chunks/helpers-IEFhGXc7.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{bi as ActionType,dv as Actions,du as RichTitle}from"../chunks/ui-components-BKrLf2tx.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,b as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,c as SamplingPreviewSection,S as SignalsCheckboxList,a as SourceScopeSection,U as UpgradeModal,i as WIDE_DRAWER_WIDTH,W as WideDrawer,Y as YamlSectionCard}from"../chunks/index-Dv0RvKAp.js";export{C as ColoredSpan,D as ColoredSpanVariant}from"../chunks/helpers-K1tnyqhm.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"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
package/lib/snippets.js CHANGED
@@ -1,49 +1 @@
1
- import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{memo as r,useRef as i,useEffect as n}from"react";import"./chunks/vendor-Be0cOokr.js";import d,{useTheme as s}from"styled-components";import{ac as a,R as l,eJ as c,h as p,S as m,df as u,da as h,k as g,N as b}from"./chunks/ui-components-DODwSdKu.js";import{Handle as x,Position as f,ReactFlowProvider as v,ReactFlow as y,Controls as w,ControlButton as N,useReactFlow as k}from"@xyflow/react";import{RefreshIcon as $}from"./icons.js";import"javascript-time-ago";import"zustand";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";const C=d(l)`
2
- max-width: 300px;
3
- padding: 12px;
4
- border-radius: 12px;
5
- background-color: ${({theme:e})=>e.colors.dropdown_bg};
6
- justify-content: center;
7
- `,E=r(({id:o,data:t})=>{const{title:r,subTitle:i}=t;return e(C,{"data-id":o,children:e(a,{title:r,subTitle:i})})});E.displayName=E.name;const V=d.div`
8
- padding: 6px;
9
- border-radius: 12px;
10
- background-color: ${({theme:e})=>e.colors.dropdown_bg};
11
- cursor: pointer;
12
- ${({$isVirtual:e,theme:o})=>e&&`\n border: 1px dashed ${o.colors.border};\n opacity: 0.8;\n `}
13
- `,_=d.div`
14
- position: relative;
15
- `,j=d.div`
16
- position: absolute;
17
- top: 100%;
18
- margin-top: 4px;
19
- left: 50%;
20
- transform: translateX(-50%);
21
- display: flex;
22
- flex-direction: column;
23
- align-items: center;
24
- gap: 2px;
25
- width: 140px;
26
- text-align: center;
27
- `,z=r(({id:r,data:i})=>{const{id:n,status:d,title:a,icons:l,isVirtual:h}=i,g=s(),b=h||d!==m.Error?null:u(d,g);return o(t,{children:[e(x,{type:"source",position:f.Right,style:{visibility:"hidden"}}),e(x,{type:"target",position:f.Left,style:{visibility:"hidden"}}),o(_,{"data-id":r,children:[e(V,{$isVirtual:h,children:e(c,{id:n,icons:l,status:h?void 0:d})}),o(j,{children:[b&&e(b,{}),e(p,{size:12,style:{textAlign:"center",wordBreak:"break-word",lineHeight:"1.3"},children:a})]})]})]})});z.displayName=z.name;const M={duration:300,padding:.1,includeHiddenNodes:!0},T=d.div`
28
- height: 100%;
29
- .react-flow__attribution {
30
- visibility: hidden;
31
- }
32
- `,A=d.div`
33
- button {
34
- padding: 8px;
35
- margin: 8px;
36
- border-radius: 8px;
37
- border: 1px solid ${({theme:e})=>e.colors.border} !important;
38
- background-color: ${({theme:e})=>e.colors.dropdown_bg};
39
- path {
40
- fill: ${({theme:e})=>e.text.secondary};
41
- }
42
- &:hover {
43
- background-color: ${({theme:e})=>e.colors.dropdown_bg_2};
44
- }
45
- &:last-child svg {
46
- transform: scale(1.4);
47
- }
48
- }
49
- `,I={[b.MapItem]:z,[b.NoData]:E},L=({trigger:e})=>{const{fitView:o}=k(),t=i(!0);return n(()=>{t.current?t.current=!1:e>0&&requestAnimationFrame(()=>o(M))},[e,o]),null},O=({nodes:t,edges:r,onNodesChange:i,onEdgesChange:n,fitViewTrigger:d=0,zoomOnScroll:s=!1,onEdgeClick:a,onNodeMouseEnter:l,onNodeMouseLeave:c,onRefresh:p})=>{const{onClickNode:m}=h(),{setActiveNodeType:u,setActiveNodeId:b}=g();return o(y,{zoomOnScroll:s,nodes:t,nodeTypes:I,edges:r,onNodeClick:m,onEdgeClick:a,onNodeMouseEnter:l,onNodeMouseLeave:c,onNodesChange:i,onEdgesChange:n,onBlur:()=>{u(null),b(null)},children:[e(L,{trigger:d}),e(A,{children:e(w,{position:"bottom-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:M,children:p&&e(N,{onClick:p,children:e($,{size:20})})})})]})},R=o=>e(T,{children:e(v,{children:e(O,{...o})})});export{R as Flow,z as MapItemNode,E as NoDataNode};
1
+ export{F as Flow,M as MapItemNode,N as NoDataNode}from"./chunks/flow-CQi_KYfs.js";import"react/jsx-runtime";import"react";import"@xyflow/react/dist/style.css";import"styled-components";import"./chunks/ui-components-BKrLf2tx.js";import"./icons.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"@xyflow/react";
@@ -2,7 +2,6 @@ export * from './useActiveNodeStore';
2
2
  export * from './useDarkMode';
3
3
  export * from './useDataStreamStore';
4
4
  export * from './useDrawerStore';
5
- export * from './useEntityStore';
6
5
  export * from './useFilterStore';
7
6
  export * from './useModalStore';
8
7
  export * from './useNotificationStore';
@@ -1,11 +1,16 @@
1
- import { EntityTypes, type WorkloadId } from '@/types';
1
+ import { EntityTypes, type SamplingRuleCategory, type WorkloadId } from '@/types';
2
2
  export interface DrawerStoreState {
3
3
  drawerType: EntityTypes | null;
4
4
  drawerEntityId: string | WorkloadId | null;
5
+ pendingViewSamplingRule: {
6
+ ruleId: string;
7
+ category: SamplingRuleCategory;
8
+ } | null;
5
9
  }
6
10
  interface DrawerStoreStateSetters {
7
11
  setDrawerType: (value: DrawerStoreState['drawerType']) => void;
8
12
  setDrawerEntityId: (value: DrawerStoreState['drawerEntityId']) => void;
13
+ setPendingViewSamplingRule: (value: DrawerStoreState['pendingViewSamplingRule']) => void;
9
14
  }
10
15
  export declare const useDrawerStore: import("zustand").UseBoundStore<import("zustand").StoreApi<DrawerStoreState & DrawerStoreStateSetters>>;
11
16
  export {};
package/lib/store.js CHANGED
@@ -1 +1 @@
1
- export{aM as ProgressKeys,k as useActiveNodeStore,fS as useDarkMode,w as useDataStreamStore,bd as useDrawerStore,j as useEntityStore,d5 as useFilterStore,bR as useModalStore,l as useNotificationStore,aL as useProgressStore,de as useSelectedStore,dm as useSetupStore}from"./chunks/ui-components-DODwSdKu.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{$ as ProgressKeys,a as useActiveNodeStore,fS as useDarkMode,z as useDataStreamStore,bl as useDrawerStore,dd as useFilterStore,bZ as useModalStore,o as useNotificationStore,Z as useProgressStore,dj as useSelectedStore,_ as useSetupStore}from"./chunks/ui-components-BKrLf2tx.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"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
package/lib/theme.js CHANGED
@@ -1 +1 @@
1
- export{f$ as Provider,g0 as animations,g1 as opacity,g2 as palettes}from"./chunks/ui-components-DODwSdKu.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{f$ as Provider,g0 as animations,g1 as opacity,g2 as palettes}from"./chunks/ui-components-BKrLf2tx.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"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
@@ -46,11 +46,6 @@ export interface Action {
46
46
  conditions?: Condition[] | null;
47
47
  }
48
48
  export type ActionFormData = Omit<Action, 'id' | 'conditions'>;
49
- export type CreateActionFunc = (payload: ActionFormData, connectionIds?: string[]) => Promise<{
50
- error?: string;
51
- } | undefined>;
52
- export type UpdateActionFunc = (id: string, payload: ActionFormData, connectionIds?: string[]) => void | Promise<void>;
53
- export type DeleteActionFunc = (id: string, actionType: ActionType, connectionIds?: string[]) => void | Promise<void>;
54
49
  export interface ActionFields {
55
50
  [ActionKeyTypes.CollectContainerAttributes]?: boolean | null;
56
51
  [ActionKeyTypes.CollectReplicaSetAttributes]?: boolean | null;
@@ -47,6 +47,35 @@ export declare enum InstallationMethod {
47
47
  Helm = "helm",
48
48
  Operator = "odigos-operator"
49
49
  }
50
+ /**
51
+ * Lifecycle stage of the cluster's onboarding flow. Returned by the
52
+ * `GET_CONFIG` operation alongside `tier` / `readonly` / etc., and
53
+ * consumed by the host applications to gate setup screens.
54
+ */
55
+ export declare enum InstallationStatus {
56
+ New = "NEW",
57
+ AppsSelected = "APPS_SELECTED",
58
+ Finished = "FINISHED"
59
+ }
60
+ /**
61
+ * The cluster's basic, top-level configuration — fetched once at
62
+ * layout level and used to seed the kit's `OperationContext`
63
+ * (platform / tier / version) plus host-side concerns like
64
+ * read-only gating and setup-flow status.
65
+ *
66
+ * `platformType` and `odigosVersion` are optional so the same shape
67
+ * fits both host adapters: the standalone webapp populates them from
68
+ * the cluster config, while central-ui derives them from the active
69
+ * proxy and leaves these fields off this slot.
70
+ */
71
+ export interface FetchedConfig {
72
+ tier: Tier;
73
+ readonly: boolean;
74
+ installationMethod: InstallationMethod;
75
+ installationStatus: InstallationStatus;
76
+ platformType?: PlatformType;
77
+ odigosVersion?: string;
78
+ }
50
79
  export declare enum ProgrammingLanguages {
51
80
  Go = "go",
52
81
  JavaScript = "javascript",
@@ -537,10 +566,6 @@ export interface EffectiveConfigInput {
537
566
  } | null;
538
567
  manifestYAML?: string | null;
539
568
  }
540
- export type GetEffectiveConfigFunc = (id: string) => Promise<EffectiveConfig | undefined>;
541
- export type ApplyConfigurationsFunc = (formData: Partial<EffectiveConfigInput>, connectionIds: string[]) => Promise<{
542
- error?: string;
543
- } | undefined>;
544
569
  export declare enum Profile {
545
570
  CodeAttributes = "code-attributes",
546
571
  FullPayloadCollection = "full-payload-collection",
@@ -153,14 +153,12 @@ export interface GetDestinationCategoriesResult {
153
153
  categories: DestinationCategories;
154
154
  };
155
155
  }
156
- export type GetDestinationCategoriesFunc = () => Promise<GetDestinationCategoriesResult | undefined>;
157
156
  export interface GetPotentialDestinationsResult {
158
157
  potentialDestinations: {
159
158
  type: DestinationTypes;
160
159
  fields: string;
161
160
  }[];
162
161
  }
163
- export type GetPotentialDestinationsFunc = () => Promise<GetPotentialDestinationsResult | undefined>;
164
162
  export interface DestinationFormData {
165
163
  type: Destination['destinationType']['type'];
166
164
  name: Destination['destinationType']['displayName'];
@@ -172,13 +170,6 @@ export interface DestinationFormData {
172
170
  value: string;
173
171
  }[];
174
172
  }
175
- export type CreateDestinationFunc = (payload: DestinationFormData, connectionIds?: string[]) => Promise<{
176
- error?: string;
177
- } | undefined>;
178
- export type UpdateDestinationFunc = (id: string, payload: DestinationFormData, connectionIds?: string[]) => Promise<{
179
- error?: string;
180
- } | undefined>;
181
- export type DeleteDestinationFunc = (id: string, connectionIds?: string[]) => void | Promise<void>;
182
173
  export interface TestConnectionResponse {
183
174
  destinationType: DestinationTypes;
184
175
  statusCode: number;
@@ -186,4 +177,3 @@ export interface TestConnectionResponse {
186
177
  message?: string | null;
187
178
  reason?: string | null;
188
179
  }
189
- export type TestConnectionFunc = (payload: DestinationFormData, connectionIds?: string[]) => Promise<TestConnectionResponse | undefined>;
@@ -9,7 +9,6 @@ export * from './diagnose';
9
9
  export * from './enum';
10
10
  export * from './instrumentation-instances';
11
11
  export * from './instrumentation-rules';
12
- export * from './k8s-manifest';
13
12
  export * from './metrics';
14
13
  export * from './namespaces';
15
14
  export * from './pipeline-collectors';
@@ -41,11 +41,6 @@ export interface InstrumentationRule {
41
41
  customInstrumentations?: CustomInstrumentations | null;
42
42
  }
43
43
  export type InstrumentationRuleFormData = Omit<InstrumentationRule, 'ruleId' | 'type' | 'mutable' | 'profileName'>;
44
- export type CreateInstrumentationRuleFunc = (payload: InstrumentationRuleFormData, connectionIds?: string[]) => Promise<{
45
- error?: string;
46
- } | undefined>;
47
- export type UpdateInstrumentationRuleFunc = (ruleId: string, payload: InstrumentationRuleFormData, connectionIds?: string[]) => void | Promise<void>;
48
- export type DeleteInstrumentationRuleFunc = (ruleId: string, connectionIds?: string[]) => void | Promise<void>;
49
44
  export declare enum CodeAttributesKeyTypes {
50
45
  Column = "column",
51
46
  FilePath = "filePath",
@@ -5,8 +5,3 @@ export interface Namespace {
5
5
  dataStreamNames: string[];
6
6
  workloads?: Pick<Workload, 'id' | 'markedForInstrumentation' | 'dataStreamNames' | 'numberOfInstances'>[];
7
7
  }
8
- export type FetchNamespacesWithWorkloads = () => Promise<{
9
- loading: boolean;
10
- error?: string;
11
- data?: Namespace[];
12
- }>;
@@ -97,10 +97,6 @@ export interface PodInfo {
97
97
  image: string;
98
98
  collectorMetrics?: CollectorPodMetrics | null;
99
99
  }
100
- export type GetGatewayInfo = () => Promise<GatewayInfo | undefined>;
101
- export type GetGatewayPods = () => Promise<PodInfo[] | undefined>;
102
- export type GetNodeCollectorInfo = () => Promise<NodeCollectoInfo | undefined>;
103
- export type GetNodeCollectorPods = () => Promise<PodInfo[] | undefined>;
104
100
  interface PodContainer {
105
101
  name: string;
106
102
  image?: string | null;
@@ -120,5 +116,4 @@ export interface ExtendedPodInfo {
120
116
  containers: PodContainer[];
121
117
  manifestYAML: string;
122
118
  }
123
- export type GetExtendedPodInfo = (namespace: string, name: string) => Promise<ExtendedPodInfo | undefined>;
124
119
  export {};
@@ -24,5 +24,3 @@ export interface AllClusterSnapshots {
24
24
  totalNamespaces?: number;
25
25
  lastUpdated?: number;
26
26
  }
27
- export type GetAllClusterSnapshots = () => Promise<AllClusterSnapshots | undefined>;
28
- export type GetClusterSnapshot = (clusterId: string) => Promise<ClusterSnapshot | undefined>;