@gravitee/gamma-lib-observability 4.1.2 → 4.2.0-feat-obs-107-send-host-module-dashboards.d975628

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 (45) hide show
  1. package/INTEGRATION.md +48 -12
  2. package/USAGE_GUIDE.md +13 -1
  3. package/dist/dashboard-access-provider.js +1 -0
  4. package/dist/dashboards/dashboard-filters.d.ts +75 -1
  5. package/dist/dashboards/dashboard-filters.d.ts.map +1 -1
  6. package/dist/dashboards/editor/DashboardEditorPage.d.ts.map +1 -1
  7. package/dist/dashboards/editor/DashboardFiltersEditor.d.ts.map +1 -1
  8. package/dist/dashboards/editor/DashboardJsonTab.d.ts +9 -1
  9. package/dist/dashboards/editor/DashboardJsonTab.d.ts.map +1 -1
  10. package/dist/dashboards/editor/WidgetConfigForm.d.ts.map +1 -1
  11. package/dist/dashboards/editor/dashboard-json.d.ts +19 -1
  12. package/dist/dashboards/editor/dashboard-json.d.ts.map +1 -1
  13. package/dist/dashboards/metric-catalog.d.ts +2 -0
  14. package/dist/dashboards/metric-catalog.d.ts.map +1 -1
  15. package/dist/data-sources/dashboard-persistence.d.ts +16 -0
  16. package/dist/data-sources/dashboard-persistence.d.ts.map +1 -1
  17. package/dist/data-sources/dashboard-wire.d.ts +7 -0
  18. package/dist/data-sources/dashboard-wire.d.ts.map +1 -1
  19. package/dist/data-sources/http-dashboard-persistence.d.ts +12 -0
  20. package/dist/data-sources/http-dashboard-persistence.d.ts.map +1 -1
  21. package/dist/data-sources/with-grid-migration.d.ts +1 -0
  22. package/dist/data-sources/with-grid-migration.d.ts.map +1 -1
  23. package/dist/filters/SignalScopeIcons.d.ts.map +1 -1
  24. package/dist/filters/utils/partition-filters-by-signal.d.ts +6 -0
  25. package/dist/filters/utils/partition-filters-by-signal.d.ts.map +1 -1
  26. package/dist/hooks/query-keys.d.ts +16 -2
  27. package/dist/hooks/query-keys.d.ts.map +1 -1
  28. package/dist/hooks/use-custom-dashboards.d.ts.map +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +2372 -2252
  32. package/dist/logs/LogsExplorerPage.d.ts.map +1 -1
  33. package/dist/persistence/local-storage-dashboard-persistence.d.ts +10 -0
  34. package/dist/persistence/local-storage-dashboard-persistence.d.ts.map +1 -1
  35. package/dist/routing/ObservabilityDashboardPage.d.ts.map +1 -1
  36. package/dist/routing/ObservabilityRoutes.d.ts.map +1 -1
  37. package/dist/routing/types.d.ts +12 -5
  38. package/dist/routing/types.d.ts.map +1 -1
  39. package/dist/signal-registry.d.ts +6 -0
  40. package/dist/signal-registry.d.ts.map +1 -1
  41. package/dist/testing/graphene-core-icons-mock.d.ts +1 -0
  42. package/dist/testing/graphene-core-icons-mock.d.ts.map +1 -1
  43. package/dist/types/domain.d.ts +8 -0
  44. package/dist/types/domain.d.ts.map +1 -1
  45. package/package.json +1 -1
package/INTEGRATION.md CHANGED
@@ -171,6 +171,7 @@ import { defineObservabilityFeatures } from '@gravitee/gamma-lib-observability';
171
171
  import { myTemplates } from './dashboard-templates';
172
172
 
173
173
  export const observability = defineObservabilityFeatures({
174
+ module: 'aim', // your Gamma module id, required when dashboards are enabled
174
175
  features: {
175
176
  dashboards: {
176
177
  enabled: true,
@@ -221,6 +222,7 @@ That's it — you now have a working dashboards section. The library handles dat
221
222
 
222
223
  The lib is a **contributor**: it ships routes, nav and route metadata; the host owns the shell. Use this as a quick reference of everything the host must wire — most of it is derivable from data the lib already exposes, so prefer the provided helpers over hand-rolled parsing.
223
224
 
225
+ - [ ] **Module id** — set `module` in `defineObservabilityFeatures` when dashboards are enabled (see [Dashboards are scoped by module](#dashboards-are-scoped-by-module)). The routes refuse to mount without it.
224
226
  - [ ] **CSS** — import `@gravitee/gamma-lib-observability/styles` in the exposed entry (see [CSS](#css)).
225
227
  - [ ] **Query client** — wrap the app in a single `QueryClientProvider` (shared singleton under Module Federation).
226
228
  - [ ] **Authenticated HTTP** — pass the `http` prop (or an `HttpProvider`) once so every internal source is authenticated (see [Authenticated HTTP](#authenticated-http-http-prop)).
@@ -274,6 +276,30 @@ The `http` config is applied to **every** internally-built source. Resolution or
274
276
 
275
277
  ## Feature: Dashboards
276
278
 
279
+ ### Dashboards are scoped by module
280
+
281
+ A custom dashboard belongs to the Gamma module that created it. A dashboard created in AIM is not listed in APIM, and the other way round. Declare your module so the section knows which one it is:
282
+
283
+ ```ts
284
+ export const observability = defineObservabilityFeatures({
285
+ module: 'aim', // GammaModuleId, the same id the trace filters use
286
+ features: { dashboards: { enabled: true, templates } },
287
+ nav: { label: 'Observability' },
288
+ });
289
+ ```
290
+
291
+ `module` is **required** when `features.dashboards` is enabled: `observability.Routes` throws on its first render without it. A missing module would create every dashboard in no module and list them all everywhere, so the section fails loudly instead.
292
+
293
+ What the section does with it:
294
+
295
+ - **List and open** send `?module=<id>`. The API returns that module's dashboards only, and opening another module's dashboard by URL shows "not found".
296
+ - **Create** puts `module` in the body. The module is always the host's, never copied from a dashboard: _Duplicate_ and a JSON pasted from another module both create the dashboard in the current module.
297
+ - **Update** never sends it. A dashboard keeps its module for life.
298
+ - The JSON tab does not show it, like `id`, `createdAt` and `updatedAt`.
299
+ - The cache is keyed per module, so two modules sharing a `QueryClient` never see each other's lists.
300
+
301
+ At API level, listing **without** `module` returns the dashboards of every module. That is what a future cross-module screen would use; the lib's own screens always send it. The scope organises what each module shows. It is not a permission: access stays governed by `ENVIRONMENT_DASHBOARD` permissions.
302
+
277
303
  ### Dashboard templates
278
304
 
279
305
  Each module defines its own preset dashboards using `defineDashboardTemplate`:
@@ -317,6 +343,8 @@ export const apiOverviewTemplate = defineDashboardTemplate({
317
343
  | `requiredCapabilities` | `CapabilityKey[]` | Template hidden when user lacks any listed capability |
318
344
  | `dashboard` | `Dashboard \| (ctx) => Dashboard` | Static definition or factory receiving capabilities context |
319
345
 
346
+ Keep every filter of a template, on the dashboard and on its widgets, on a field the `ANALYTICS` signal covers. A filter on a field the catalog marks for another signal only, such as a logs-only `REQUEST_ID`, fails every widget once it has a value, and silently ignores the reader's value when it has none. The editor never offers such a field, its JSON tab refuses one, and its builder warns about one a saved dashboard already holds, but a template goes through none of them. To apply the same check to a document a module imports, pass the full filter catalog to `parseDashboardJson(text, { catalog: filterProviders })`, never one already narrowed to analytics fields. A field the catalog does not list is then refused too, except `API_TYPE`, which the editor writes itself when a metric needs it; an empty catalog checks nothing.
347
+
320
348
  ### Widget types
321
349
 
322
350
  | Type | Description | Key properties |
@@ -847,8 +875,9 @@ export const observability = defineObservabilityFeatures({
847
875
  });
848
876
  ```
849
877
 
850
- Omit `module` and only the cross-module filters are served — the pre-existing behaviour, so this is
851
- back-compatible. Filter definitions belong to a module, not to one API: the same palette is served
878
+ Omit `module` and only the cross-module filters are served, the pre-existing behaviour. A host that
879
+ enables dashboards must set it anyway (see [Dashboards are scoped by module](#dashboards-are-scoped-by-module)),
880
+ and the same id then scopes both. Filter definitions belong to a module, not to one API: the same palette is served
852
881
  for every API the tracing screen can select.
853
882
 
854
883
  ### tracesBaseUrl
@@ -1171,10 +1200,11 @@ The provider wraps the persistence it is given so that every dashboard reaches t
1171
1200
 
1172
1201
  Options of the built-in adapter, `createHttpDashboardPersistence(baseUrl, options?)`:
1173
1202
 
1174
- | Option | Purpose |
1175
- | --------------------------------- | ---------------------------------------------------------------------------------------- |
1176
- | `fetch`, `headers`, `credentials` | Same as the other HTTP adapters, see [Authenticated HTTP](#authenticated-http-http-prop) |
1177
- | `dashboardsPath` | Path appended to `baseUrl`. Defaults to `'/observability/dashboards'` |
1203
+ | Option | Purpose |
1204
+ | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1205
+ | `fetch`, `headers`, `credentials` | Same as the other HTTP adapters, see [Authenticated HTTP](#authenticated-http-http-prop) |
1206
+ | `dashboardsPath` | Path appended to `baseUrl`. Defaults to `'/observability/dashboards'` |
1207
+ | `module` | Module the adapter is scoped to. `ObservabilityRoutes` passes `config.module`. Omitted, the adapter sees every module and creates dashboards with none, as the API does |
1178
1208
 
1179
1209
  To store dashboards elsewhere, mount your own implementation instead. The browser-local one shipped with the library is the shortest example:
1180
1210
 
@@ -1186,8 +1216,10 @@ import {
1186
1216
 
1187
1217
  // Scope the key per environment: localStorage is origin-wide, so an unscoped
1188
1218
  // key leaks dashboards across environments served from the same console origin.
1219
+ // `module` scopes it per module within that key, like the API.
1189
1220
  const persistence = createLocalStorageDashboardPersistence({
1190
1221
  storageKey: `observability.dashboards.${environmentId}`,
1222
+ module: 'aim',
1191
1223
  });
1192
1224
 
1193
1225
  <DashboardPersistenceProvider persistence={persistence}>
@@ -1199,6 +1231,8 @@ A custom store implements:
1199
1231
 
1200
1232
  ```ts
1201
1233
  interface DashboardPersistence {
1234
+ /** The module this store is scoped to, absent for a store that sees every module. */
1235
+ readonly module?: string;
1202
1236
  fetchDashboard(id: string, signal?: AbortSignal): Promise<Dashboard>;
1203
1237
  fetchDashboards(signal?: AbortSignal): Promise<Dashboard[]>;
1204
1238
  createDashboard(dashboard: Dashboard, signal?: AbortSignal): Promise<Dashboard>;
@@ -1212,14 +1246,16 @@ interface DashboardPersistence {
1212
1246
 
1213
1247
  Creation and update are separate operations rather than one `save`: the caller always knows which it means, and a server-backed store maps them to endpoints guarded by different permissions. Implementations own `createdAt` and `updatedAt` and stamp them themselves.
1214
1248
 
1249
+ A store scoped to a module declares it in `module`, lists and reads only that module's dashboards (another module's reads as not found), stamps it on every create whatever the dashboard handed in says, and keeps it on update. The screens key their cache on `module`, so a store that scopes by module without declaring it shares its cache entries with every other module.
1250
+
1215
1251
  **Failures are typed**, so a screen can tell one outcome from another. The screens read the `status` carried by the error rather than testing classes, so an error that is structurally one of these (a `status: 404` or `status: 403` field) works across bundling boundaries; a store that throws plain `Error`s opts out of all of it and lands every failure on the generic error toast. The same predicates the screens use, `isDashboardGone(error)` and `isDashboardForbidden(error)`, are exported for hosts composing their own screens from the hooks — prefer them over `instanceof` on the classes, which fails when two copies of the library end up on one disk.
1216
1252
 
1217
- | Thrown | Meaning | What the UI does with it |
1218
- | --------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
1219
- | `DashboardConflictError` | The dashboard moved since it was read | Opens the conflict dialog on the editor's save |
1220
- | `DashboardNotFoundError` | No such dashboard in this environment | On a load, the "may have been deleted" panel with "Try again". On a write to an existing dashboard, the editor's deleted step |
1221
- | `DashboardForbiddenError` | The caller may not perform this verb | Degrades the screen instead of erroring — see [Backend refusals](#backend-refusals-403) |
1222
- | `DashboardPersistenceError` | Anything else | Error toast on writes; the editor's failed first load offers "Try again". The listing has no error state today: custom rows are absent, templates stay |
1253
+ | Thrown | Meaning | What the UI does with it |
1254
+ | --------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
1255
+ | `DashboardConflictError` | The dashboard moved since it was read | Opens the conflict dialog on the editor's save |
1256
+ | `DashboardNotFoundError` | No such dashboard in this environment and module | On a load, the "may have been deleted" panel with "Try again". On a write to an existing dashboard, the editor's deleted step |
1257
+ | `DashboardForbiddenError` | The caller may not perform this verb | Degrades the screen instead of erroring — see [Backend refusals](#backend-refusals-403) |
1258
+ | `DashboardPersistenceError` | Anything else | Error toast on writes; the editor's failed first load offers "Try again". The listing has no error state today: custom rows are absent, templates stay |
1223
1259
 
1224
1260
  ### Backend refusals (403)
1225
1261
 
package/USAGE_GUIDE.md CHANGED
@@ -32,6 +32,7 @@ import { defineObservabilityFeatures } from '@gravitee/gamma-lib-observability';
32
32
  import { myDashboardTemplates } from './templates';
33
33
 
34
34
  export const observability = defineObservabilityFeatures({
35
+ module: 'aim',
35
36
  scopeApiTypes: ['MCP', 'LLM'],
36
37
  features: {
37
38
  dashboards: { enabled: true, templates: myDashboardTemplates },
@@ -42,6 +43,8 @@ export const observability = defineObservabilityFeatures({
42
43
  });
43
44
  ```
44
45
 
46
+ `module` is your Gamma module id. It is **required** when dashboards are enabled: custom dashboards are created in, and listed for, that module only. See the [API reference](#defineobservabilityfeatures--api-reference).
47
+
45
48
  `scopeApiTypes` generates `API_TYPE` context filters and scoped filter providers for all features. Override per-feature when needed (e.g. logs scoped to `['MCP']` only while dashboards sees `['MCP', 'LLM']`).
46
49
 
47
50
  ### 2. Mount routes
@@ -154,6 +157,8 @@ import { observabilityQueryKeys } from '@gravitee/gamma-lib-observability';
154
157
 
155
158
  queryClient.invalidateQueries({ queryKey: observabilityQueryKeys.all });
156
159
  queryClient.invalidateQueries({ queryKey: observabilityQueryKeys.dashboard('dash-123') });
160
+ // Custom dashboards are keyed per module: pass the module your section declares.
161
+ queryClient.invalidateQueries({ queryKey: observabilityQueryKeys.customDashboards('aim') });
157
162
  ```
158
163
 
159
164
  ---
@@ -736,7 +741,14 @@ Template properties:
736
741
 
737
742
  ### `defineObservabilityFeatures` — API reference
738
743
 
739
- `defineObservabilityFeatures` is the entry point shown in [Quick start](#quick-start) step 1. It returns an `ObservabilityFeatures` object with the following members:
744
+ `defineObservabilityFeatures` is the entry point shown in [Quick start](#quick-start) step 1.
745
+
746
+ Its `module` option (`GammaModuleId`: `'aim'`, `'apim'`, `'esm'`) says which Gamma module mounts the section. It does two things:
747
+
748
+ - **Dashboards.** Custom dashboards belong to the module that created them. The section lists and opens only this module's dashboards, and creates new ones (duplicates and pasted JSON included) in this module. Required when `features.dashboards` is enabled: `Routes` throws on its first render without it.
749
+ - **Tracing.** Sent as the `module` query param of the trace filter endpoints, so the palette includes this module's filters on top of the cross-module ones. Optional when only tracing is enabled.
750
+
751
+ It returns an `ObservabilityFeatures` object with the following members:
740
752
 
741
753
  | Member | Type | Description |
742
754
  | -------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------- |
@@ -122,6 +122,7 @@ function w(e) {
122
122
  function T(e) {
123
123
  let t = (e) => Promise.resolve(e).then(_, E);
124
124
  return {
125
+ ...e.module !== void 0 && { module: e.module },
125
126
  fetchDashboard: (t, n) => Promise.resolve(e.fetchDashboard(t, n)).then(_),
126
127
  fetchDashboards: (t) => Promise.resolve(e.fetchDashboards(t)).then((e) => Array.isArray(e) ? e.map(_) : e),
127
128
  createDashboard: (n, r) => t(e.createDashboard(n, r)),
@@ -1,4 +1,78 @@
1
- import { FilterCondition } from '../types/domain';
1
+ import { FilterProvider } from '../filters/filter-provider';
2
+ import { Dashboard, FilterCondition, Widget } from '../types/domain';
3
+ /**
4
+ * The signal a dashboard filters on. A dashboard renders analytics widgets, so
5
+ * its filters, its widgets' filters and its reader's filters all come from the
6
+ * analytics catalog only. A field outside it fails one of two ways: with a
7
+ * value, the analytics request refuses it and the widgets fail to load; without
8
+ * one, the chip is offered to the reader, whose value is then silently dropped,
9
+ * because the dashboard page splits URL filters by this signal before
10
+ * resolving them.
11
+ *
12
+ * Stated once because every place that enforces it reads it from here: the
13
+ * builder's dashboard and widget filter pickers, the reader's filter bar, the
14
+ * page's split of URL filters, and {@link createDashboardFieldCheck}, which the
15
+ * JSON tab and the builder's warning share. The Management API applies the
16
+ * same rule to a dashboard's own filters when it is saved (OBS-68).
17
+ */
18
+ export declare const DASHBOARD_SIGNAL = "ANALYTICS";
19
+ /** {@link DASHBOARD_SIGNAL} in the shape the filter pickers take. */
20
+ export declare const DASHBOARD_VISIBLE_SIGNALS: readonly ["ANALYTICS"];
21
+ /** What the dashboard rule reads from the filter catalog. A `FilterProvider` list is one. */
22
+ export type DashboardFieldCatalog = readonly Pick<FilterProvider, 'field' | 'signals'>[];
23
+ /** Why a dashboard cannot filter on a field. */
24
+ export type DashboardFieldProblem = {
25
+ readonly kind: 'off-signal';
26
+ readonly signals: readonly string[];
27
+ } | {
28
+ readonly kind: 'unknown';
29
+ };
30
+ /** Why a dashboard cannot filter on `field`, or `undefined` when it can. */
31
+ export type DashboardFieldCheck = (field: string) => DashboardFieldProblem | undefined;
32
+ /**
33
+ * The rule deciding whether a dashboard can filter on a field, read against
34
+ * `catalog` once and then asked per field.
35
+ *
36
+ * Read against the full catalog, never one already narrowed to analytics
37
+ * fields, which would make every other field look unknown. A field whose
38
+ * entry declares no signals applies everywhere. A field the catalog does not
39
+ * list is refused, as the Management API refuses it: there is no filter by
40
+ * that name to query. Two exceptions: a field the library writes itself (see
41
+ * `LIBRARY_WRITTEN_FIELDS`), and an empty catalog, which means it failed to
42
+ * load: refusing every field would then lock the author out of their own
43
+ * dashboard, so nothing is refused and the save is left to decide (OBS-68).
44
+ */
45
+ export declare function createDashboardFieldCheck(catalog: DashboardFieldCatalog): DashboardFieldCheck;
46
+ /**
47
+ * The entries of a widget that carry filters of their own, and the key they
48
+ * sit under, or `undefined` for a type that has none. Reads the raw object, so
49
+ * the JSON tab's codec and the builder's warnings share one answer to "which
50
+ * levels carry filters", and a stored widget missing its list reads as empty
51
+ * rather than throwing.
52
+ */
53
+ export declare function nestedFilterEntries(widget: object): {
54
+ readonly key: 'series' | 'items';
55
+ readonly entries: readonly unknown[];
56
+ } | undefined;
57
+ export interface DashboardFilterSource {
58
+ readonly condition: FilterCondition;
59
+ /** The widget carrying it, absent for one of the dashboard's own filters. */
60
+ readonly widget?: Widget;
61
+ }
62
+ /** Every filter a dashboard sends: its own, its widgets', and their series' or items'. */
63
+ export declare function dashboardFilterSources(dashboard: Pick<Dashboard, 'filters' | 'widgets'>): DashboardFilterSource[];
64
+ export interface UnusableDashboardFilter extends DashboardFilterSource {
65
+ readonly problem: DashboardFieldProblem;
66
+ }
67
+ /**
68
+ * Every filter of a dashboard it cannot query (see {@link createDashboardFieldCheck}).
69
+ *
70
+ * The JSON tab refuses these as they are typed. This is for a dashboard that
71
+ * already holds one, saved before that check existed or written outside the
72
+ * editor, so the builder can say so on load instead of the author meeting it
73
+ * as a refused save.
74
+ */
75
+ export declare function findUnusableDashboardFilters(dashboard: Pick<Dashboard, 'filters' | 'widgets'>, catalog: DashboardFieldCatalog): UnusableDashboardFilter[];
2
76
  /**
3
77
  * How a filter with no value renders: every value passes, no query constraint.
4
78
  * It is a slot the author leaves open so a reader finds the field ready to fill
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-filters.d.ts","sourceRoot":"","sources":["../../src/dashboards/dashboard-filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAGvE;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AAEtC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAEzD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAE7D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAEpF;AA4BD,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7C,0DAA0D;IAC1D,QAAQ,CAAC,WAAW,EAAE,eAAe,EAAE,CAAC;IACxC,iFAAiF;IACjF,QAAQ,CAAC,eAAe,EAAE,eAAe,EAAE,CAAC;IAC5C;;;;;;;OAOG;IACH,QAAQ,CAAC,kBAAkB,EAAE,eAAe,EAAE,CAAC;IAC/C,8FAA8F;IAC9F,QAAQ,CAAC,YAAY,EAAE,eAAe,EAAE,CAAC;IACzC,4EAA4E;IAC5E,QAAQ,CAAC,cAAc,EAAE,eAAe,EAAE,CAAC;IAC3C,2FAA2F;IAC3F,QAAQ,CAAC,gBAAgB,EAAE,eAAe,EAAE,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,SAAS,eAAe,EAAE,EAC5C,UAAU,EAAE,SAAS,eAAe,EAAE,GACrC,wBAAwB,CAiE1B"}
1
+ {"version":3,"file":"dashboard-filters.d.ts","sourceRoot":"","sources":["../../src/dashboards/dashboard-filters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA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
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardEditorPage.d.ts","sourceRoot":"","sources":["../../../src/dashboards/editor/DashboardEditorPage.tsx"],"names":[],"mappings":"AAyEA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,gBAAgB,EAAE,EAAE,wBAAwB,2CAYjF"}
1
+ {"version":3,"file":"DashboardEditorPage.d.ts","sourceRoot":"","sources":["../../../src/dashboards/editor/DashboardEditorPage.tsx"],"names":[],"mappings":"AAgFA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,gBAAgB,EAAE,EAAE,wBAAwB,2CAYjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardFiltersEditor.d.ts","sourceRoot":"","sources":["../../../src/dashboards/editor/DashboardFiltersEditor.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAa1D,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;CACzD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,2BAA2B,2CAiD1G"}
1
+ {"version":3,"file":"DashboardFiltersEditor.d.ts","sourceRoot":"","sources":["../../../src/dashboards/editor/DashboardFiltersEditor.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1D,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;CACzD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,2BAA2B,2CAiD1G"}
@@ -1,9 +1,17 @@
1
+ import { FilterProvider } from '../../filters/filter-provider';
1
2
  import { EditableDashboardFields } from './dashboard-editor-state';
2
3
  export interface DashboardJsonTabProps {
3
4
  readonly text: string;
4
5
  readonly onTextChange: (text: string) => void;
5
6
  /** Whether the text differs from the current builder state. */
6
7
  readonly dirty: boolean;
8
+ /**
9
+ * The filter catalog, unnarrowed by the host scope, so a filter on a field no
10
+ * dashboard can query is refused here as the builder refuses it. Must be the
11
+ * one the editor checks with when leaving the tab, or Apply and the tab
12
+ * switch would disagree on the same document.
13
+ */
14
+ readonly catalog: readonly FilterProvider[];
7
15
  readonly onApply: (fields: EditableDashboardFields) => void;
8
16
  }
9
17
  /**
@@ -12,5 +20,5 @@ export interface DashboardJsonTabProps {
12
20
  * visual builder does not expose. Identity fields are not part of the
13
21
  * document and cannot be corrupted from here.
14
22
  */
15
- export declare function DashboardJsonTab({ text, onTextChange, dirty, onApply }: DashboardJsonTabProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function DashboardJsonTab({ text, onTextChange, dirty, catalog, onApply }: DashboardJsonTabProps): import("react/jsx-runtime").JSX.Element;
16
24
  //# sourceMappingURL=DashboardJsonTab.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardJsonTab.d.ts","sourceRoot":"","sources":["../../../src/dashboards/editor/DashboardJsonTab.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAoBxE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAC7D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,qBAAqB,2CA0D7F"}
1
+ {"version":3,"file":"DashboardJsonTab.d.ts","sourceRoot":"","sources":["../../../src/dashboards/editor/DashboardJsonTab.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAoBxE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAC7D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,qBAAqB,2CA0DtG"}
@@ -1 +1 @@
1
- {"version":3,"file":"WidgetConfigForm.d.ts","sourceRoot":"","sources":["../../../src/dashboards/editor/WidgetConfigForm.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAKV,MAAM,EAEP,MAAM,oBAAoB,CAAC;AAiB5B,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAYD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CAsE3E"}
1
+ {"version":3,"file":"WidgetConfigForm.d.ts","sourceRoot":"","sources":["../../../src/dashboards/editor/WidgetConfigForm.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAKV,MAAM,EAEP,MAAM,oBAAoB,CAAC;AAkB5B,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAYD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CAsE3E"}
@@ -1,4 +1,5 @@
1
1
  import { Dashboard } from '../../types/domain';
2
+ import { DashboardFieldCatalog, DashboardFieldProblem } from '../dashboard-filters';
2
3
  import { EditableDashboardFields } from './dashboard-editor-state';
3
4
  export type DashboardJsonParseResult = {
4
5
  readonly ok: true;
@@ -7,6 +8,14 @@ export type DashboardJsonParseResult = {
7
8
  readonly ok: false;
8
9
  readonly errors: readonly string[];
9
10
  };
11
+ export interface DashboardJsonParseOptions {
12
+ /**
13
+ * The full filter catalog, as `useFilterProviders()` returns it. Without it,
14
+ * or with an empty one, no filter is refused for its field. A list already
15
+ * narrowed to analytics fields would make every other field look unknown.
16
+ */
17
+ readonly catalog?: DashboardFieldCatalog;
18
+ }
10
19
  /**
11
20
  * Serializes only the user-editable fields of a dashboard. Identity fields
12
21
  * (`id`, `createdAt`, `updatedAt`) are deliberately excluded: they are managed
@@ -23,6 +32,15 @@ export declare function serializeDashboard(dashboard: Dashboard): string;
23
32
  * exported before the 24-column grid therefore comes back at half size, so a
24
33
  * host importing one converts it first:
25
34
  * `parseDashboardJson(JSON.stringify(migrateDashboardLayout(JSON.parse(text))))`.
35
+ *
36
+ * Given the filter catalog, it also refuses a filter a dashboard cannot query
37
+ * (see {@link createDashboardFieldCheck}): on the dashboard, on its widgets, and on
38
+ * their chart series and metric-group items, the rule the builder applies by
39
+ * never offering one. An empty catalog, one that failed to load, checks
40
+ * nothing. Templates a host registers and dashboards read from storage do not
41
+ * pass through here; the builder warns about the latter on load.
26
42
  */
27
- export declare function parseDashboardJson(input: string): DashboardJsonParseResult;
43
+ export declare function parseDashboardJson(input: string, { catalog }?: DashboardJsonParseOptions): DashboardJsonParseResult;
44
+ /** `only applies to Logs`: the predicate both the JSON tab and the builder's warning put after the field. */
45
+ export declare function describeFieldProblem(problem: DashboardFieldProblem): string;
28
46
  //# sourceMappingURL=dashboard-json.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-json.d.ts","sourceRoot":"","sources":["../../../src/dashboards/editor/dashboard-json.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,SAAS,EAKf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAY1F,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAA;CAAE,GAC/D;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAO/D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,wBAAwB,CAoC1E"}
1
+ {"version":3,"file":"dashboard-json.d.ts","sourceRoot":"","sources":["../../../src/dashboards/editor/dashboard-json.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,SAAS,EAKf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,qBAAqB,EAE1B,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAY1F,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAA;CAAE,GAC/D;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAE/D,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;CAC1C;AAKD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAO/D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,EAAE,OAAY,EAAE,GAAE,yBAA8B,GAC/C,wBAAwB,CAqC1B;AAiGD,6GAA6G;AAC7G,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAI3E"}
@@ -57,6 +57,8 @@ export declare function supportedMeasuresFor(metric: string): readonly Measure[]
57
57
  */
58
58
  export declare function resolveMeasureForMetric(metric: string, current: string | undefined): string | undefined;
59
59
  export declare function dimensionLabel(field: string): string;
60
+ /** The field the editor scopes a widget by when its metric belongs to an API type. */
61
+ export declare const API_TYPE_FIELD = "API_TYPE";
60
62
  /**
61
63
  * Collects the API-type scopes required by the metrics/dimensions referenced
62
64
  * in a widget configuration. Returns undefined when nothing is scoped.
@@ -1 +1 @@
1
- {"version":3,"file":"metric-catalog.d.ts","sourceRoot":"","sources":["../../src/dashboards/metric-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC;AAExC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACjD;AAED,eAAO,MAAM,QAAQ,mFAAoF,CAAC;AAE1G,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,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B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,OAAO,EAAE,GAAG,SAAS,CAEnF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKvG;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,sFAAsF;AACtF,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B,GAAG,SAAS,WAAW,EAAE,GAAG,SAAS,CASrC;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,EAC/C,KAAK,EAAE;IAAE,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACnE,eAAe,EAAE,GAAG,SAAS,CAc/B"}
@@ -44,6 +44,22 @@ export interface UpdateDashboardOptions {
44
44
  * is deliberately out of scope here.
45
45
  */
46
46
  export interface DashboardPersistence {
47
+ /**
48
+ * The Gamma module this store is scoped to, or absent for a store that sees
49
+ * every module's dashboards.
50
+ *
51
+ * A scoped store lists and reads only that module's dashboards (a dashboard
52
+ * of another module is not found), and stamps it on every dashboard it
53
+ * creates, whatever the dashboard handed in says. Update never changes it.
54
+ * Writes by id (update, delete) need not check the module: the screens only
55
+ * reach a dashboard through a scoped read, and the HTTP adapter leaves that
56
+ * check to the API.
57
+ *
58
+ * The screens key their cache on it, so two stores scoped to different
59
+ * modules never share cached dashboards. A store that scopes by module must
60
+ * declare it here for that reason.
61
+ */
62
+ readonly module?: string;
47
63
  /**
48
64
  * Reads one dashboard.
49
65
  *
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-persistence.d.ts","sourceRoot":"","sources":["../../src/data-sources/dashboard-persistence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;GAMG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACrE,eAAe,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAC5D,8EAA8E;IAC9E,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAChF;;;;;;;;OAQG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAClH,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE;;;;;;;;;;;OAWG;IACH,oBAAoB,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD;;;;;;;;;;;;;;;;;;OAkBG;IACH,gBAAgB,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9C"}
1
+ {"version":3,"file":"dashboard-persistence.d.ts","sourceRoot":"","sources":["../../src/data-sources/dashboard-persistence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;GAMG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACrE,eAAe,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAC5D,8EAA8E;IAC9E,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAChF;;;;;;;;OAQG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAClH,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE;;;;;;;;;;;OAWG;IACH,oBAAoB,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD;;;;;;;;;;;;;;;;;;OAkBG;IACH,gBAAgB,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9C"}
@@ -41,6 +41,8 @@ export interface WireDashboard {
41
41
  version?: number | null;
42
42
  createdAt?: number | null;
43
43
  updatedAt?: number | null;
44
+ /** Set once, on create. Null for a dashboard stored before modules existed. */
45
+ module?: string | null;
44
46
  }
45
47
  /**
46
48
  * Body of `POST` and `PUT`. Server-owned fields (`version`, `createdAt`,
@@ -55,6 +57,11 @@ export interface WireSaveDashboardRequest {
55
57
  filters: WireDashboardFilter[];
56
58
  timeRange: WireTimeRange;
57
59
  widgets: readonly Widget[];
60
+ /**
61
+ * The module the dashboard is created in, read on `POST` only: the API keeps
62
+ * it immutable, so a `PUT` never carries it.
63
+ */
64
+ module?: string;
58
65
  }
59
66
  export interface WirePagination {
60
67
  totalCount: number;
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-wire.d.ts","sourceRoot":"","sources":["../../src/data-sources/dashboard-wire.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAkC,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAErH;;;;;;;;;GASG;AAEH;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC;IAC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e,CASzE;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,aAAa,CAInE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,CAcnF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,CAmBhE;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GACvC,wBAAwB,CAS1B"}
@@ -8,6 +8,18 @@ export interface HttpDashboardPersistenceOptions extends HttpOptions {
8
8
  * @default '/observability/dashboards'
9
9
  */
10
10
  readonly dashboardsPath?: string;
11
+ /**
12
+ * The Gamma module this adapter is scoped to. Sent as `?module=` on the list
13
+ * and on get by id, so only that module's dashboards are seen, and in the
14
+ * body of every create, so the new dashboard belongs to it. Never taken from
15
+ * the dashboard being created, and never sent on update: the API keeps a
16
+ * dashboard's module for life.
17
+ *
18
+ * Omitted, the adapter sees every module's dashboards and creates dashboards
19
+ * with no module, which is what the API does without the param.
20
+ * `ObservabilityRoutes` always passes the host's `config.module`.
21
+ */
22
+ readonly module?: string;
11
23
  /**
12
24
  * Where this adapter remembers which revision each dashboard is being edited
13
25
  * from. Pass one in to give that memory a lifetime longer than the adapter's,
@@ -1 +1 @@
1
- {"version":3,"file":"http-dashboard-persistence.d.ts","sourceRoot":"","sources":["../../src/data-sources/http-dashboard-persistence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAOjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAgC,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAkBvG,MAAM,WAAW,+BA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sBAAsB,CAAC;CACjD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAClH,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7C;AAED,YAAY,EAAE,sBAAsB,EAAE,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,+BAA+B,GACxC,wBAAwB,CAoR1B"}
@@ -8,6 +8,7 @@ import { DashboardPersistence } from './dashboard-persistence';
8
8
  * dropped without a word, since leaving one off an object type-checks.
9
9
  */
10
10
  export declare const FORWARDED_PERSISTENCE_MEMBERS: {
11
+ readonly module: true;
11
12
  readonly fetchDashboard: true;
12
13
  readonly fetchDashboards: true;
13
14
  readonly createDashboard: true;
@@ -1 +1 @@
1
- {"version":3,"file":"with-grid-migration.d.ts","sourceRoot":"","sources":["../../src/data-sources/with-grid-migration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;CAQmB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,oBAAoB,GAAG,oBAAoB,CAqBzF"}
1
+ {"version":3,"file":"with-grid-migration.d.ts","sourceRoot":"","sources":["../../src/data-sources/with-grid-migration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;CASmB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,oBAAoB,GAAG,oBAAoB,CAsBzF"}
@@ -1 +1 @@
1
- {"version":3,"file":"SignalScopeIcons.d.ts","sourceRoot":"","sources":["../../src/filters/SignalScopeIcons.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CACxC;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,6DAqD3B,CAAC"}
1
+ {"version":3,"file":"SignalScopeIcons.d.ts","sourceRoot":"","sources":["../../src/filters/SignalScopeIcons.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CACxC;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,6DAkD3B,CAAC"}
@@ -35,4 +35,10 @@ export declare function partitionAllSignals(filters: readonly FilterCondition[],
35
35
  * (not universal)? Used to decide whether to show the desync indicator.
36
36
  */
37
37
  export declare function hasSignalRestrictedFilters(filters: readonly FilterCondition[], providers: readonly FilterProvider[]): boolean;
38
+ /**
39
+ * Whether a filter whose catalog entry is `provider` can be sent with a request
40
+ * for `signal`. An entry without `signals`, and a field the catalog does not
41
+ * know at all, apply everywhere.
42
+ */
43
+ export declare function appliesToSignal(provider: Pick<FilterProvider, 'signals'> | undefined, signal: ObservabilitySignal): boolean;
38
44
  //# sourceMappingURL=partition-filters-by-signal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"partition-filters-by-signal.d.ts","sourceRoot":"","sources":["../../../src/filters/utils/partition-filters-by-signal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,mBAAmB,EAA0B,CAAC;AAEpF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,WAAW,EAAE,eAAe,EAAE,CAAC;IACxC,QAAQ,CAAC,gBAAgB,EAAE,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,aAAa,EAAE,eAAe,EAAE,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,SAAS,EAAE,SAAS,cAAc,EAAE,EACpC,MAAM,EAAE,mBAAmB,GAC1B,kBAAkB,CAgBpB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,SAAS,EAAE,SAAS,cAAc,EAAE,GACnC,qBAAqB,CAoBvB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,SAAS,EAAE,SAAS,cAAc,EAAE,GACnC,OAAO,CAOT"}
1
+ {"version":3,"file":"partition-filters-by-signal.d.ts","sourceRoot":"","sources":["../../../src/filters/utils/partition-filters-by-signal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,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readonly dashboard: (id: string) => readonly ["observability", "dashboard", string];
60
- readonly customDashboards: () => readonly ["observability", "custom-dashboards"];
61
- readonly customDashboard: (id: string) => readonly ["observability", "custom-dashboards", string];
60
+ /**
61
+ * Custom dashboards are keyed on the module their store is scoped to, so two
62
+ * modules sharing a `QueryClient` never read each other's cached lists.
63
+ * `module` is the persistence's own (`DashboardPersistence.module`), absent
64
+ * for an unscoped store.
65
+ */
66
+ readonly customDashboards: (module?: string) => readonly ["observability", "custom-dashboards", {
67
+ readonly module: string | undefined;
68
+ }];
69
+ /**
70
+ * Nested under {@link customDashboards} for the same module, so invalidating
71
+ * that list also refreshes every dashboard of the module that is open.
72
+ */
73
+ readonly customDashboard: (id: string, module?: string) => readonly ["observability", "custom-dashboards", {
74
+ readonly module: string | undefined;
75
+ }, string];
62
76
  readonly filterLabels: (key: string) => readonly ["observability", "filterLabels", string];
63
77
  };
64
78
  //# sourceMappingURL=query-keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../../src/hooks/query-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAmB3E,eAAO,MAAM,sBAAsB;;mCAItB,SAAS,kBAAkB,EAAE,aAC3B,SAAS,YACV,MAAM,YACN,eAAe,EAAE,OACtB,SAAS,MAAM,EAAE,UACd,MAAM,WACL,SAAS,YAAY,EAAE;;;;;;;;;0BAS5B,SAAS,MAAM,EAAE,aACV,SAAS,YACV,eAAe,EAAE,YACjB;QACR,OAAO,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;QACxC,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;QACjC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB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4CAIb,MAAM;;;4CAEN,MAAM,UAAU,MAAM;;;;iDAGjB,MAAM;;;6BAE1B,MAAM;IAEtB;;;;;OAKG;yCACyB,MAAM;;;IAElC;;;OAGG;mCACmB,MAAM,WAAW,MAAM;;;iCAEzB,MAAM;CAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-custom-dashboards.d.ts","sourceRoot":"","sources":["../../src/hooks/use-custom-dashboards.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAqBjD;;;;GAIG;AACH,wBAAgB,wBAAwB,gFAiBvC;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,6EAuB7D;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,4FAEzC;AAED,wBAAgB,0BAA0B,4FAEzC;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,4FAI5C;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAexE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,IAAI,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAS5E;AAgCD,wBAAgB,0BAA0B,oFAuBzC"}
1
+ {"version":3,"file":"use-custom-dashboards.d.ts","sourceRoot":"","sources":["../../src/hooks/use-custom-dashboards.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAqBjD;;;;GAIG;AACH,wBAAgB,wBAAwB,gFAiBvC;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,6EAuB7D;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,4FAEzC;AAED,wBAAgB,0BAA0B,4FAEzC;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,4FAI5C;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAkBxE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,IAAI,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAS5E;AAgCD,wBAAgB,0BAA0B,oFAuBzC"}
package/dist/index.d.ts CHANGED
@@ -48,6 +48,6 @@ export { useStableTimeRange } from './hooks/use-stable-time-range';
48
48
  export { createLocalStorageDashboardPersistence, type LocalStorageDashboardPersistenceOptions, } from './persistence/local-storage-dashboard-persistence';
49
49
  export { DashboardConflictError, DashboardForbiddenError, DashboardNotFoundError, DashboardPersistenceError, isDashboardForbidden, isDashboardGone, } from './data-sources';
50
50
  export { useAdoptServerDashboard, useCustomDashboardQuery, useCustomDashboardsQuery, useDeleteDashboardMutation, useCreateDashboardMutation, useOverwriteDashboardMutation, useTakeReadDashboardRevision, useUpdateDashboardMutation, } from './hooks/use-custom-dashboards';
51
- export { parseDashboardJson, serializeDashboard, type DashboardJsonParseResult, } from './dashboards/editor/dashboard-json';
51
+ export { parseDashboardJson, serializeDashboard, type DashboardJsonParseOptions, type DashboardJsonParseResult, } from './dashboards/editor/dashboard-json';
52
52
  export type { EditableDashboardFields } from './dashboards/editor/dashboard-editor-state';
53
53
  //# sourceMappingURL=index.d.ts.map