@gravitee/gamma-lib-observability 4.0.3 → 4.1.0-fix-obs-53-scope-ceiling-data-source-boundary.6da6f59
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/QUERYING.md +9 -0
- package/dist/dashboard-access-provider.js +148 -63
- package/dist/dashboards/editor/WidgetConfigForm.d.ts.map +1 -1
- package/dist/dashboards/editor/dashboard-json.d.ts.map +1 -1
- package/dist/dashboards/renderers/CartesianWidgetRenderer.d.ts.map +1 -1
- package/dist/filters/FilterBar.d.ts.map +1 -1
- package/dist/filters/FilterChip.d.ts +5 -0
- package/dist/filters/FilterChip.d.ts.map +1 -1
- package/dist/filters/FilterPopoverForm.d.ts +12 -1
- package/dist/filters/FilterPopoverForm.d.ts.map +1 -1
- package/dist/filters/utils/filter-display.d.ts +3 -0
- package/dist/filters/utils/filter-display.d.ts.map +1 -1
- package/dist/filters/utils/merge-conditions.d.ts +12 -0
- package/dist/filters/utils/merge-conditions.d.ts.map +1 -1
- package/dist/filters/utils/range-chips.d.ts +24 -0
- package/dist/filters/utils/range-chips.d.ts.map +1 -0
- package/dist/index.js +3818 -3714
- package/dist/providers/ContextFiltersProvider.d.ts +6 -0
- package/dist/providers/ContextFiltersProvider.d.ts.map +1 -1
- package/dist/providers/clamped-data-sources.d.ts +27 -0
- package/dist/providers/clamped-data-sources.d.ts.map +1 -0
- package/dist/providers/logs-data-source-provider.d.ts +8 -0
- package/dist/providers/logs-data-source-provider.d.ts.map +1 -1
- package/dist/providers/metrics-data-source-provider.d.ts +8 -0
- package/dist/providers/metrics-data-source-provider.d.ts.map +1 -1
- package/dist/styles/observability.css +1 -1
- package/dist/testing.js +3 -3
- package/package.json +5 -5
|
@@ -4,6 +4,12 @@ export interface ContextFiltersProviderProps {
|
|
|
4
4
|
filters: readonly FilterCondition[];
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The value keeps its identity for as long as its content is unchanged. A host,
|
|
9
|
+
* and `ObservabilityRoutes` itself, build the filters inline on every render,
|
|
10
|
+
* and the data source accessors are memoized on them: following the reference
|
|
11
|
+
* would hand every consumer a new data source on each parent render.
|
|
12
|
+
*/
|
|
7
13
|
export declare function ContextFiltersProvider({ filters, children }: ContextFiltersProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
14
|
export declare function useContextFilters(): readonly FilterCondition[];
|
|
9
15
|
//# sourceMappingURL=ContextFiltersProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextFiltersProvider.d.ts","sourceRoot":"","sources":["../../src/providers/ContextFiltersProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IACpC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,2BAA2B,
|
|
1
|
+
{"version":3,"file":"ContextFiltersProvider.d.ts","sourceRoot":"","sources":["../../src/providers/ContextFiltersProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IACpC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,2BAA2B,2CAKxF;AAED,wBAAgB,iBAAiB,IAAI,SAAS,eAAe,EAAE,CAE9D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LogsDataSource } from '../data-sources/logs-data-source';
|
|
2
|
+
import { MetricsDataSource } from '../data-sources/metrics-data-source';
|
|
3
|
+
import { FilterCondition } from '../types/domain';
|
|
4
|
+
/**
|
|
5
|
+
* Wraps a metrics source so every request leaves with its top-level `filters`
|
|
6
|
+
* clamped to the host's scope. See `clampToScope` for what the clamp does.
|
|
7
|
+
*
|
|
8
|
+
* This is the boundary the data source accessors hand out, so a component that
|
|
9
|
+
* queries the source directly cannot forget the scope, and a filter merged
|
|
10
|
+
* after the caller's own clamp cannot step outside it either. The query hooks
|
|
11
|
+
* still clamp on their side, because their cache keys have to be derived from
|
|
12
|
+
* the filters actually sent; clamping twice is idempotent.
|
|
13
|
+
*
|
|
14
|
+
* Per-metric `metrics[].filters` are left alone: the server ANDs them under the
|
|
15
|
+
* top-level ones, so they can only narrow inside the scope.
|
|
16
|
+
*/
|
|
17
|
+
export declare function clampMetricsDataSource(source: MetricsDataSource, ceilings: readonly FilterCondition[]): MetricsDataSource;
|
|
18
|
+
/**
|
|
19
|
+
* Wraps a logs source so every `fetchLogs` leaves with its `filters` clamped to
|
|
20
|
+
* the host's scope, for the same reasons as `clampMetricsDataSource`.
|
|
21
|
+
*
|
|
22
|
+
* `getById` is kept only when the source has one, since its presence is what
|
|
23
|
+
* tells the detail views they can open an entry. It takes no filters, so there
|
|
24
|
+
* is nothing to clamp: the `apiId` it receives is forwarded as is.
|
|
25
|
+
*/
|
|
26
|
+
export declare function clampLogsDataSource<TRow>(source: LogsDataSource<TRow>, ceilings: readonly FilterCondition[]): LogsDataSource<TRow>;
|
|
27
|
+
//# sourceMappingURL=clamped-data-sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clamped-data-sources.d.ts","sourceRoot":"","sources":["../../src/providers/clamped-data-sources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,SAAS,eAAe,EAAE,GACnC,iBAAiB,CAOnB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EACtC,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,EAC5B,QAAQ,EAAE,SAAS,eAAe,EAAE,GACnC,cAAc,CAAC,IAAI,CAAC,CAMtB"}
|
|
@@ -5,6 +5,14 @@ export interface LogsDataSourceProviderProps<TRow> {
|
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
}
|
|
7
7
|
export declare function LogsDataSourceProvider<TRow>({ dataSource, children }: LogsDataSourceProviderProps<TRow>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* The mounted logs source, clamped to the host's scope: every query it sends
|
|
10
|
+
* carries the context filters as a ceiling. See `clampLogsDataSource`.
|
|
11
|
+
*/
|
|
8
12
|
export declare function useLogsDataSource<TRow>(): LogsDataSource<TRow>;
|
|
13
|
+
/**
|
|
14
|
+
* Same as `useLogsDataSource`, or `null` when no source is mounted, so it
|
|
15
|
+
* doubles as a presence test.
|
|
16
|
+
*/
|
|
9
17
|
export declare function useOptionalLogsDataSource<TRow>(): LogsDataSource<TRow> | null;
|
|
10
18
|
//# sourceMappingURL=logs-data-source-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs-data-source-provider.d.ts","sourceRoot":"","sources":["../../src/providers/logs-data-source-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"logs-data-source-provider.d.ts","sourceRoot":"","sources":["../../src/providers/logs-data-source-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAMvE,MAAM,WAAW,2BAA2B,CAAC,IAAI;IAC/C,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IACjC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,2BAA2B,CAAC,IAAI,CAAC,2CAMvG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,KAAK,cAAc,CAAC,IAAI,CAAC,CAS9D;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,KAAK,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAI7E"}
|
|
@@ -5,6 +5,14 @@ export interface MetricsDataSourceProviderProps {
|
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
}
|
|
7
7
|
export declare function MetricsDataSourceProvider({ dataSource, children }: MetricsDataSourceProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* The mounted metrics source, clamped to the host's scope: every request it
|
|
10
|
+
* sends carries the context filters as a ceiling. See `clampMetricsDataSource`.
|
|
11
|
+
*/
|
|
8
12
|
export declare function useMetricsDataSource(): MetricsDataSource;
|
|
13
|
+
/**
|
|
14
|
+
* Same as `useMetricsDataSource`, or `null` when no source is mounted, so it
|
|
15
|
+
* doubles as a presence test.
|
|
16
|
+
*/
|
|
9
17
|
export declare function useOptionalMetricsDataSource(): MetricsDataSource | null;
|
|
10
18
|
//# sourceMappingURL=metrics-data-source-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-data-source-provider.d.ts","sourceRoot":"","sources":["../../src/providers/metrics-data-source-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"metrics-data-source-provider.d.ts","sourceRoot":"","sources":["../../src/providers/metrics-data-source-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAM7E,MAAM,WAAW,8BAA8B;IAC7C,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,yBAAyB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,8BAA8B,2CAEjG;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CASxD;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,iBAAiB,GAAG,IAAI,CAIvE"}
|