@dx-do/client 9.0.0 → 9.1.0

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 (69) hide show
  1. package/dist/index.cjs.js +6330 -1797
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +6198 -1798
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/src/index.d.ts +14 -0
  6. package/dist/src/index.d.ts.map +1 -1
  7. package/dist/src/lib/model/alarm/alarm-queue.d.ts.map +1 -1
  8. package/dist/src/lib/model/alert/metric-query-spec.d.ts +49 -0
  9. package/dist/src/lib/model/alert/metric-query-spec.d.ts.map +1 -0
  10. package/dist/src/lib/model/dashboard/CanvasPanel.d.ts +1035 -0
  11. package/dist/src/lib/model/dashboard/CanvasPanel.d.ts.map +1 -0
  12. package/dist/src/lib/model/dashboard/spec/DashboardSpec.d.ts +4530 -0
  13. package/dist/src/lib/model/dashboard/spec/DashboardSpec.d.ts.map +1 -0
  14. package/dist/src/lib/model/dashboard/spec/describe.d.ts +40 -0
  15. package/dist/src/lib/model/dashboard/spec/describe.d.ts.map +1 -0
  16. package/dist/src/lib/model/dashboard/spec/expand.d.ts +65 -0
  17. package/dist/src/lib/model/dashboard/spec/expand.d.ts.map +1 -0
  18. package/dist/src/lib/model/dashboard/spec/layout.d.ts +43 -0
  19. package/dist/src/lib/model/dashboard/spec/layout.d.ts.map +1 -0
  20. package/dist/src/lib/model/dashboard/spec/legend.d.ts +99 -0
  21. package/dist/src/lib/model/dashboard/spec/legend.d.ts.map +1 -0
  22. package/dist/src/lib/model/dashboard/spec/links.d.ts +57 -0
  23. package/dist/src/lib/model/dashboard/spec/links.d.ts.map +1 -0
  24. package/dist/src/lib/model/dashboard/spec/metrics-query.d.ts +39 -0
  25. package/dist/src/lib/model/dashboard/spec/metrics-query.d.ts.map +1 -0
  26. package/dist/src/lib/model/dashboard/spec/panel-options.d.ts +33 -0
  27. package/dist/src/lib/model/dashboard/spec/panel-options.d.ts.map +1 -0
  28. package/dist/src/lib/model/dashboard/spec/panel-options.generated.d.ts +3 -0
  29. package/dist/src/lib/model/dashboard/spec/panel-options.generated.d.ts.map +1 -0
  30. package/dist/src/lib/model/dashboard/targets/ElasticTarget.d.ts +246 -0
  31. package/dist/src/lib/model/dashboard/targets/ElasticTarget.d.ts.map +1 -0
  32. package/dist/src/lib/model/dashboard/targets/NasTarget.d.ts +147 -0
  33. package/dist/src/lib/model/dashboard/targets/NasTarget.d.ts.map +1 -0
  34. package/dist/src/lib/model/dashboard/targets/TasTarget.d.ts +74 -0
  35. package/dist/src/lib/model/dashboard/targets/TasTarget.d.ts.map +1 -0
  36. package/dist/src/lib/model/datastore/audit/response.d.ts.map +1 -1
  37. package/dist/src/lib/model/datastore/metrics-metadata/attribute-name-specifier.d.ts +10 -10
  38. package/dist/src/lib/model/datastore/metrics-metadata/query-specifier.d.ts +4 -4
  39. package/dist/src/lib/model/datastore/metrics-metadata/register.d.ts.map +1 -1
  40. package/dist/src/lib/model/datastore/metrics-metadata/source-name-specifier.d.ts +2 -2
  41. package/dist/src/lib/model/datastore/nass/store.d.ts.map +1 -1
  42. package/dist/src/lib/model/datastore/nassql/filter-specs.d.ts +1 -1
  43. package/dist/src/lib/model/datastore/nassql/operations.d.ts +1 -1
  44. package/dist/src/lib/model/datastore/nassql/query.d.ts +1 -1
  45. package/dist/src/lib/model/datastore/states/query.d.ts +4 -4
  46. package/dist/src/lib/model/datastore/tas/filters.d.ts +15 -15
  47. package/dist/src/lib/model/datastore/tas/query.d.ts +2 -2
  48. package/dist/src/lib/model/datastore/tas/store.d.ts.map +1 -1
  49. package/dist/src/lib/model/managementmodule/management-module-transform-presets.d.ts.map +1 -1
  50. package/dist/src/lib/model/managementmodule/management-module-transform.d.ts +54 -0
  51. package/dist/src/lib/model/managementmodule/management-module-transform.d.ts.map +1 -1
  52. package/dist/src/lib/model/metricgrouping/metric-grouping-filter.d.ts +10 -0
  53. package/dist/src/lib/model/metricgrouping/metric-grouping-filter.d.ts.map +1 -1
  54. package/dist/src/lib/model/nass/NASS.d.ts +10 -6
  55. package/dist/src/lib/model/nass/NASS.d.ts.map +1 -1
  56. package/dist/src/lib/model/sli/definition.d.ts +15 -12
  57. package/dist/src/lib/model/sli/definition.d.ts.map +1 -1
  58. package/dist/src/lib/model/synthetics/query.d.ts +1 -1
  59. package/dist/src/lib/services/alarm.service.d.ts +18 -0
  60. package/dist/src/lib/services/alarm.service.d.ts.map +1 -1
  61. package/dist/src/lib/services/dx-saas.service.d.ts +6 -0
  62. package/dist/src/lib/services/dx-saas.service.d.ts.map +1 -1
  63. package/dist/src/lib/services/nass.service.d.ts +6 -0
  64. package/dist/src/lib/services/nass.service.d.ts.map +1 -1
  65. package/dist/src/lib/services/platform-alert.service.d.ts +11 -0
  66. package/dist/src/lib/services/platform-alert.service.d.ts.map +1 -1
  67. package/dist/src/lib/services/service.service.d.ts +3 -2
  68. package/dist/src/lib/services/service.service.d.ts.map +1 -1
  69. package/package.json +3 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashboardSpec.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/model/dashboard/spec/DashboardSpec.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAS3B,eAAO,MAAM,wBAAwB;;;;;;oBAQa,CAAC;AAEnD,eAAO,MAAM,WAAW;;;;;;qBAQrB,CAAC;AAEJ,eAAO,MAAM,WAAW;;;kBASrB,CAAC;AAEJ,eAAO,MAAM,qBAAqB;;;;;;;;;;;;kBAG4D,CAAC;AAI/F,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2ChC,CAAC;AAEJ,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAIoE,CAAC;AAEjG,eAAO,MAAM,gBAAgB;;;;;kBAOsD,CAAC;AAEpF,eA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cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,mEAAmE;AACnE,wBAAgB,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEjE"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * `describeDashboard` (#1741): an existing DX Dashboards dashboard as a dashboard spec, the inverse of
3
+ * `expandDashboardSpec`, so an agent edits a spec and never Grafana JSON. Pure: no tenant calls.
4
+ *
5
+ * Fidelity first. What the spec models is described in its own terms (panel kinds, exact grid positions,
6
+ * units, attribute-first selections, dropdowns); everything else is carried through `raw` (options, field
7
+ * config, other panel keys) or as a whole `kind: "raw"` panel (other plugins, rows, aggregated or NASSQL
8
+ * targets), and every such case is listed in `gaps`. A query is described as `where` / `match` / `anyOf` only
9
+ * when recompiling that selection reproduces the original specifier; otherwise it stays as it was.
10
+ *
11
+ * Ownership: a dashboard dx-do did not build is described without its uid, so building the spec makes a copy
12
+ * (dx-do never overwrites it).
13
+ */
14
+ import { type LinkContext } from './links';
15
+ import { type DashboardSpecInput } from './DashboardSpec';
16
+ type Json = Record<string, unknown>;
17
+ export interface DescribeGap {
18
+ /** Where in the spec, e.g. `panels[3]` or `variables`. */
19
+ path: string;
20
+ /** What could not be described in the spec's terms, and where it went. */
21
+ what: string;
22
+ }
23
+ export interface DescribedDashboard {
24
+ spec: DashboardSpecInput;
25
+ gaps: DescribeGap[];
26
+ /** Tagged `dx-do:built`: the spec keeps the uid, and building it updates the dashboard in place. */
27
+ builtByDxdo: boolean;
28
+ /**
29
+ * The DXO2 address and service ids read from DXO2 page links, so `expandDashboardSpec(spec, context)` reproduces
30
+ * them without a tenant. Building through `dashboard build` looks them up again instead.
31
+ */
32
+ context: {
33
+ dxo2?: NonNullable<LinkContext['dxo2']>;
34
+ };
35
+ }
36
+ /** The selection forms of a specifier, or undefined when it has none. */
37
+ export declare function invertSpecifier(specifier: Json): Json | undefined;
38
+ export declare function describeDashboard(dashboard: Json): DescribedDashboard;
39
+ export {};
40
+ //# sourceMappingURL=describe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/model/dashboard/spec/describe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAuC,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAEhF,OAAO,EAOL,KAAK,kBAAkB,EAExB,MAAM,iBAAiB,CAAC;AAMzB,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAGpC,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,oGAAoG;IACpG,WAAW,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA;KAAE,CAAC;CACtD;AA6DD,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAOjE;AA2OD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,IAAI,GAAG,kBAAkB,CAkDrE"}
@@ -0,0 +1,65 @@
1
+ import { type NasTarget } from '../targets/NasTarget';
2
+ import { type DashboardSpec, type MetricsQuerySpec, type VariableSpec } from './DashboardSpec';
3
+ import { type LinkContext } from './links';
4
+ import { type TargetLegend } from './legend';
5
+ export declare const BUILT_TAG = "dx-do:built";
6
+ export interface SpecIssue {
7
+ /** Where in the spec, e.g. `panels[2].queries[0].metrics.specifier.op`. */
8
+ path: string;
9
+ message: string;
10
+ }
11
+ export interface SpecWarning {
12
+ code: 'raw-used' | 'unknown-option' | 'unlisted-value' | 'unknown-variable' | 'link-scope';
13
+ /** Where in the spec (`raw-used`) or the emitted panel (`panels[i].options.<path>`). */
14
+ path: string;
15
+ message: string;
16
+ }
17
+ export declare class DashboardSpecError extends Error {
18
+ readonly issues: SpecIssue[];
19
+ constructor(issues: SpecIssue[]);
20
+ }
21
+ export interface ExpandContext {
22
+ /** Datasource names on the tenant; default the DXO2 names. */
23
+ datasources?: {
24
+ metrics?: string;
25
+ };
26
+ /** The tenant's DXO2 address and service ids, for links to DXO2 pages (`to: {dxo2}`, `inDxo2`); the build supplies them. */
27
+ dxo2?: LinkContext['dxo2'];
28
+ }
29
+ export interface ExpandedDashboard {
30
+ dashboard: Record<string, unknown>;
31
+ warnings: SpecWarning[];
32
+ }
33
+ /** Validates a spec; the issues carry spec paths an agent can act on. */
34
+ export declare function parseDashboardSpec(input: unknown): {
35
+ ok: true;
36
+ spec: DashboardSpec;
37
+ } | {
38
+ ok: false;
39
+ issues: SpecIssue[];
40
+ };
41
+ type Json = Record<string, unknown>;
42
+ /** Deep merge of plain objects; arrays and scalars from `patch` replace. */
43
+ export declare function deepMerge(base: Json, patch: Json): Json;
44
+ /** The datasource's server-side grouping for a query's `aggregate` (none: the editor's defaults, disabled). */
45
+ export declare function aggregationsFor(aggregate: MetricsQuerySpec['aggregate']): Json;
46
+ /**
47
+ * One AIOps_Metrics target. `where` / `match` / `anyOf` go out as builder rows (the only form whose variables the
48
+ * datasource substitutes); `rawQuery` then records the specifier those rows compile to. `specifier` goes out raw.
49
+ */
50
+ export declare function metricsTarget(query: MetricsQuerySpec, refId: string, datasource: string, legend?: TargetLegend): NasTarget;
51
+ export declare function expandDashboardSpec(input: unknown, context?: ExpandContext): ExpandedDashboard;
52
+ type AttributeVariable = Extract<VariableSpec, {
53
+ kind: 'attribute';
54
+ }>;
55
+ /** The metrics an attribute variable reads its values from, as a metrics query. */
56
+ export declare function attributeVariableQuery(v: AttributeVariable): MetricsQuerySpec;
57
+ /**
58
+ * The AIOps_Metrics variable query (VariableQueryEditor / metricFindQuery, measured on the lab 2026-11-17): one
59
+ * filter row, which may carry a whole compiled specifier (variables are substituted through it); values are the
60
+ * `customAttribute` of the result, read from aggregation buckets keyed by that attribute, so they are distinct
61
+ * whatever the number of metrics. `aggregations` must be present: the datasource destructures it.
62
+ */
63
+ export declare function attributeVariableDefinition(v: AttributeVariable): string;
64
+ export {};
65
+ //# sourceMappingURL=expand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/model/dashboard/spec/expand.ts"],"names":[],"mappings":"AAQA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAA+C,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE5I,OAAO,EAA8C,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAEvF,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAGzD,eAAO,MAAM,SAAS,gBAAgB,CAAC;AAEvC,MAAM,WAAW,SAAS;IACxB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,UAAU,GAAG,gBAAgB,GAAG,gBAAgB,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AO,EAAE,OAAO,GAAE,aAAkB,GAAG,iBAAiB,CA6HlG;AAqDD,KAAK,iBAAiB,GAAG,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC,CAAC;AAGtE,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,CAO7E;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAiBxE"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Grid layout for a spec: top-level panels and `section` blocks flow left to right on 24 columns (explicit x/y
3
+ * kept). A section's panels flow inside its block, each row stretched to its tallest panel, and section blocks
4
+ * that share a row are stretched to the same height.
5
+ *
6
+ * Why the stretching (measured on THE_LABORATORY, 2026-11-17): DX Dashboards (Grafana 7.5) compacts the grid
7
+ * upward, so any empty cell above a panel is closed and the panels below drift up, out of line with their
8
+ * heading. A layout without gaps is the only stable one. Text panels cannot centre their text either (inline
9
+ * styles are stripped), so headings sit at the top of their cell.
10
+ */
11
+ import type { LeafPanelSpec, PanelSpec } from './DashboardSpec';
12
+ export declare const GRID_COLUMNS = 24;
13
+ export declare const HEADING_HEIGHT = 2;
14
+ export interface GridPos {
15
+ x: number;
16
+ y: number;
17
+ w: number;
18
+ h: number;
19
+ }
20
+ /** One panel to emit, where it goes, and how a section shapes it. */
21
+ export interface PlacedPanel {
22
+ spec: LeafPanelSpec;
23
+ /** Where the panel is in the spec, for warnings and errors. */
24
+ path: string;
25
+ gridPos: GridPos;
26
+ /** Set for a section's heading panel and for the panels inside a section. */
27
+ section?: {
28
+ title: string;
29
+ role: 'heading' | 'member';
30
+ };
31
+ }
32
+ export declare const DEFAULT_SIZE: Record<LeafPanelSpec['kind'], {
33
+ w: number;
34
+ h: number;
35
+ }>;
36
+ /** Every panel that shows something, sections opened, with its spec path. */
37
+ export declare function leafPanels(panels: PanelSpec[]): {
38
+ panel: LeafPanelSpec;
39
+ path: string;
40
+ }[];
41
+ /** Lays out the whole spec; returns the panels to emit in reading order. */
42
+ export declare function layoutSpec(panels: PanelSpec[]): PlacedPanel[];
43
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/model/dashboard/spec/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAe,MAAM,iBAAiB,CAAC;AAE7E,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,MAAM,WAAW,OAAO;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,aAAa,CAAC;IACpB,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAA;KAAE,CAAC;CACzD;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAQhF,CAAC;AAEF,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG;IAAE,KAAK,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAIxF;AAqDD,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,WAAW,EAAE,CAwE7D"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The legend concern (owner-confirmed design, 2026-11-17): show only what tells a panel's series apart.
3
+ *
4
+ * - **Built up** from attributes (OpenTelemetry, JMX): the datasource's Custom Attribute mode joins the chosen
5
+ * attribute values with spaces, e.g. `service.name` + `span.name` → `charon-payments GET /api/payments/status`.
6
+ * - **Cut down** from the name (APM path metrics). A series name is `<source>|<metric path>:<metric>`; the target
7
+ * names series in full and a Grafana "Rename by regex" transform keeps only the chosen parts: source
8
+ * segments by position (sources align: SuperDomain|<cluster>|<service>|<pod>), the metric path from a segment on
9
+ * (paths vary in depth: Frontends|Apps|edge vs Frontends|Apps|charon-payments|URLs|GET /…), and the metric.
10
+ * Rules are positional, so they survive a dropdown change.
11
+ *
12
+ * `resolveAutoLegends` measures each `auto` panel's series set through a metadata lookup (the tenant), under
13
+ * every dropdown value, and writes a concrete legend. Without it, `auto` drops the domain, and the metric when
14
+ * the panel's selections fix one `metric_name`.
15
+ *
16
+ * Measured in the datasource (nass_response.ts): with several targets and no alias, series names get a
17
+ * `Series <refId>: ` prefix; with an alias, `<alias>: `; with several plot values, a ` - <Value|Max|…>` suffix.
18
+ */
19
+ import { type DashboardSpec, type LegendSpec, type MetricsQuerySpec } from './DashboardSpec';
20
+ /** What the target's additionalParams carry for a legend. */
21
+ export interface TargetLegend {
22
+ field: string;
23
+ custom: string[];
24
+ }
25
+ export interface LegendEmission {
26
+ target: TargetLegend;
27
+ transformations: Record<string, unknown>[];
28
+ }
29
+ type NameLegend = {
30
+ sourceTokens: number;
31
+ source: number[];
32
+ pathFrom?: number | undefined;
33
+ metric: boolean;
34
+ dropRepeats: boolean;
35
+ };
36
+ /** A series name as the planner and the rename see it. */
37
+ export interface NameParts {
38
+ source: string[];
39
+ path: string[];
40
+ metric: string | undefined;
41
+ }
42
+ export declare function nameParts(sourceName: string, attributeName: string): NameParts;
43
+ /** The legend a `name` rule gives one series (what the rename produces, without prefix and suffix). */
44
+ export declare function renderName(parts: NameParts, legend: NameLegend): string;
45
+ /**
46
+ * The renames for a `name` legend: the cut (one group per source segment, the path tail, the metric), then,
47
+ * when a repeated segment can empty the path tail, a clean-up of the dangling "|" the cut leaves (a replacement
48
+ * pattern cannot be conditional). Grafana applies transformations in order.
49
+ */
50
+ export declare function nameRename(legend: NameLegend): Record<string, unknown>[];
51
+ /** How a panel's legend reaches its targets and transformations. */
52
+ export declare function emitLegend(legend: LegendSpec, queries: MetricsQuerySpec[]): LegendEmission;
53
+ export interface MetricRecord {
54
+ sourceName: string;
55
+ attributeName: string;
56
+ attributes?: Record<string, unknown>;
57
+ }
58
+ /** Metrics-Metadata lookup: the metrics a specifier selects, at most `clamp`. */
59
+ export type MetricLookup = (specifier: Record<string, unknown>, clamp: number) => Promise<MetricRecord[]>;
60
+ export interface LegendDecision {
61
+ /** Where the panel is in the spec, e.g. `panels[2]` or `panels[1].panels[0]` (a section member). */
62
+ path: string;
63
+ title: string;
64
+ legend: LegendSpec;
65
+ reason: string;
66
+ /** Series in each dropdown assignment that was measured. */
67
+ sets: number[];
68
+ }
69
+ type Assignment = Record<string, string[]>;
70
+ /** The query as the datasource sends it under one assignment: list values csv-split, regexes pipe-joined. */
71
+ export declare function substituteQuery(q: MetricsQuerySpec, a: Assignment): MetricsQuerySpec;
72
+ /** The fewest attributes, most readable first, whose joined values tell every set's series apart. */
73
+ /**
74
+ * One series. Source and metric name are not enough: tagged OTel metrics (`mysql.threads` by `kind`,
75
+ * `mongodb.connection.count` by `type`, …) share both and differ only by their attribute values, so every
76
+ * attribute is part of the key (measured on THE_LABORATORY: keyed by name alone, four MySQL thread series
77
+ * counted as one and the legend fell back to service.name, the same on every line).
78
+ */
79
+ export declare function seriesKey(r: MetricRecord): string;
80
+ export declare function chooseAttributes(sets: MetricRecord[][]): string[] | undefined;
81
+ /**
82
+ * The smallest set of name parts that tells every set's series apart: source segments by position (sources must
83
+ * align), the metric path after the segments every set shares, the metric. Shortest parts first, then pruned.
84
+ */
85
+ export declare function chooseNameParts(sets: NameParts[][]): NameLegend | undefined;
86
+ /**
87
+ * Resolves every panel whose legend is `auto` by measuring its series set (all of its queries) under each
88
+ * dropdown assignment. Panels with an explicit legend are left alone; a panel with no series keeps `auto`.
89
+ */
90
+ export declare function resolveAutoLegends(input: unknown, lookup: MetricLookup, options?: {
91
+ maxAssignments?: number;
92
+ }): Promise<{
93
+ spec: DashboardSpec;
94
+ decisions: LegendDecision[];
95
+ }>;
96
+ /** Applies renames in order, the way Grafana's renameByRegex does (JS replace when the regex matches). */
97
+ export declare function applyRename(transformations: Record<string, unknown> | Record<string, unknown>[], name: string): string;
98
+ export {};
99
+ //# sourceMappingURL=legend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/model/dashboard/spec/legend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAA+C,KAAK,aAAa,EAAE,KAAK,UAAU,EAAsB,KAAK,gBAAgB,EAAqC,MAAM,iBAAiB,CAAC;AAGjM,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,YAAY,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CAC5C;AAED,KAAK,UAAU,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC;AAUnI,0DAA0D;AAC1D,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,G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GAAG,MAAM,CAGjD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,CAiB7E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,GAAG,UAAU,GAAG,SAAS,CA+C3E;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,YAAY,EACpB,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,OAAO,CAAC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC,CA8C/D;AAED,0GAA0G;AAC1G,wBAAgB,WAAW,CAAC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMtH"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The linking concern (#1692): one link declared once by target, carried context and attachment, emitted with
3
+ * the mechanism and placeholders of each surface. Every rule comes from the linking row of the capability
4
+ * matrix (docs/internal/dsh-capability-matrix.md), measured on THE_LABORATORY 2026-11-17 (#1718):
5
+ *
6
+ * - time travels as `from=${__from}&to=${__to}`, which resolves on every surface (`${__url_time_range}`
7
+ * does not resolve on dashboard links, canvas, traffic lights, SVG, worldmap or the external pie chart);
8
+ * - variables as one `var-<name>=$<name>` each (`${__all_variables}` resolves in panel links only);
9
+ * - the clicked value through each surface's own placeholder; canvas element links, panel links and dashboard
10
+ * links have none, so asking for a value there is an error, never a literal in the URL;
11
+ * - the clicked series' name (`${__series.name}`) on data links: under `aggregate: {attribute}` it is that
12
+ * attribute's value (measured 2026-11-18: a stat per service.name gave `edge`, `hermes-dispatch`, …);
13
+ * - a table's data links attach to every column, so a `field` link becomes a by-name override.
14
+ *
15
+ * Policy (overridable per link): a link to a dashboard carries the time range and every variable and stays in
16
+ * the tab; a link to a URL carries nothing and opens a new tab.
17
+ */
18
+ import type { LinkSpec } from './DashboardSpec';
19
+ type Json = Record<string, unknown>;
20
+ /** Where a link is attached; decides mechanism and placeholders. */
21
+ export type LinkSurface = 'dashboard' | 'panel' | 'data' | 'canvas' | 'polystat' | 'trafficlights' | 'svg' | 'worldmap' | 'piechart';
22
+ export declare class LinkError extends Error {
23
+ readonly path: string;
24
+ constructor(path: string, message: string);
25
+ }
26
+ /**
27
+ * What DXO2 page links need from the tenant, supplied by the build. `base` is `<gateway>/<cohort>`: DX Dashboards
28
+ * rewrites root-relative paths into its own base (measured 2026-11-18: `/digital-oi/…` and `/<cohort>/digital-oi/…`
29
+ * both broke when the dashboard was opened on its own), so these links are absolute. `serviceIds` maps a DXO2
30
+ * service name to its vertex externalId (`SA:<COHORT>:<uuid>`), which the service page is addressed by.
31
+ */
32
+ export interface LinkContext {
33
+ dxo2?: {
34
+ base: string;
35
+ serviceIds?: Record<string, string>;
36
+ };
37
+ }
38
+ /** The link's URL on a surface. `variables` are the dashboard's variable names (for `carry.variables: "all"`). */
39
+ export declare function linkUrl(link: LinkSpec, surface: LinkSurface, variables: string[], path?: string, ctx?: LinkContext): string;
40
+ /** `dashboard.links[]`: plain links; time and variables are in the URL (keepTime / includeVars would append them again). */
41
+ export declare function dashboardLinks(links: LinkSpec[], variables: string[], ctx?: LinkContext): Json[];
42
+ /**
43
+ * Applies a panel's links to its emitted JSON (mutates `panel`). `kind` is the spec kind (for `raw`, the
44
+ * panel's plugin `type` picks the surface). Returns warnings for links that land on every table column.
45
+ */
46
+ export declare function applyPanelLinks(kind: string, panel: Json, links: LinkSpec[], variables: string[], path: string, ctx?: LinkContext): string[];
47
+ /**
48
+ * The spec link that emits exactly `emitted` (a panel or data link object, or a dashboard link) on `surface`,
49
+ * or undefined when the spec has no such form. Verified by emitting the candidate again.
50
+ */
51
+ export declare function invertLink(emitted: unknown, surface: 'dashboard' | 'panel' | 'data', variables: string[], attach?: Pick<LinkSpec, 'field'>, found?: LinkContext): LinkSpec | undefined;
52
+ /** The DXO2 service names a spec links to (`to: {dxo2: "service"}`), anywhere in it: the build looks up their ids. */
53
+ export declare function dxo2ServiceNames(spec: unknown): string[];
54
+ /** The `field` link a by-name links override was emitted from, or undefined. */
55
+ export declare function invertFieldLinkOverride(override: unknown, variables: string[], found?: LinkContext): LinkSpec | undefined;
56
+ export {};
57
+ //# sourceMappingURL=links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/model/dashboard/spec/links.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpC,oEAAoE;AACpE,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,eAAe,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,CAAC;AAoBrI,qBAAa,SAAU,SAAQ,KAAK;IAEhC,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM;CAKlB;AAOD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;CAC9D;AA0CD,kHAAkH;AAClH,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,IAAI,SAAS,EAAE,GAAG,GAAE,WAAgB,GAAG,MAAM,CAkC/H;AA+BD,4HAA4H;AAC5H,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,WAAgB,GAAG,IAAI,EAAE,CAiBpG;AA6BD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,WAAgB,GAAG,MAAM,EAAE,CA2DhJ;AAiGD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,WAAW,GAAG,OAAO,GAAG,MAAM,EACvC,SAAS,EAAE,MAAM,EAAE,EACnB,MAAM,GAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAM,EACpC,KAAK,GAAE,WAAgB,GACtB,QAAQ,GAAG,SAAS,CA+BtB;AAED,sHAAsH;AACtH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,CAYxD;AAED,gFAAgF;AAChF,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,KAAK,GAAE,WAAgB,GAAG,QAAQ,GAAG,SAAS,CAS7H"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * How a spec's metrics query becomes an AIOps_Metrics target selection (#1730, owner direction 2026-11-17:
3
+ * attributes first, name regexes for what only the name carries).
4
+ *
5
+ * Measured from the datasource (queryBuilder.ts) and on THE_LABORATORY:
6
+ * - `rawQuery` is JSON.parsed as is: dashboard variables are never substituted in it.
7
+ * - Builder rows (`basicFilters`) are compiled to a specifier, then every string is substituted: list
8
+ * values with the csv format and split on commas (a multi-value variable becomes several values), other
9
+ * strings with the pipe format (a multi-value variable becomes a|b, which suits regexes).
10
+ * - ATTRIBUTE rows select tagged metrics (OpenTelemetry, JMX) that name-only SPEC reads return no data for (#1728).
11
+ *
12
+ * So `where` / `match` / `anyOf` are always sent as rows; `specifier` (the escape hatch) is sent raw.
13
+ */
14
+ import { type NasFilterRow } from '../targets/NasTarget';
15
+ import type { MetricSelection, MetricsQuerySpec } from './DashboardSpec';
16
+ export type TargetSelection = {
17
+ mode: 'rows';
18
+ rows: NasFilterRow[];
19
+ specifier: Record<string, unknown>;
20
+ } | {
21
+ mode: 'raw';
22
+ specifier: Record<string, unknown>;
23
+ };
24
+ /**
25
+ * Rewrites escaped literals outside character classes as one-character classes (`\.` → `[.]`, `\|` → `[|]`).
26
+ * The match is identical. The server does not find tagged OpenTelemetry/JMX metrics through a regex that is
27
+ * only an escaped literal (measured on THE_LABORATORY 2026-11-17, #1734): `system\.memory\.usage` selects
28
+ * nothing, `system[.]memory[.]usage` selects them.
29
+ */
30
+ export declare function classifyEscapes(pattern: string): string;
31
+ /** The selections a query names: `anyOf`, or its single where/match selection. Empty for `specifier`. */
32
+ export declare function querySelections(query: MetricsQuerySpec): MetricSelection[];
33
+ /** Rows for the query (an OR row starts each further selection) and the specifier the datasource compiles them to. */
34
+ export declare function targetSelection(query: MetricsQuerySpec): TargetSelection;
35
+ /** Variable names referenced in a string ($name, ${name}, ${name:format}, [[name]]). */
36
+ export declare function variableRefs(text: string): string[];
37
+ /** Every string a query's selection puts in front of the datasource. */
38
+ export declare function selectionStrings(query: MetricsQuerySpec): string[];
39
+ //# sourceMappingURL=metrics-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics-query.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/model/dashboard/spec/metrics-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,KAAK,EAAsB,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE7F,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,YAAY,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAC1E;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC;AAaxD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAgBvD;AAqBD,yGAAyG;AACzG,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,eAAe,EAAE,CAI1E;AAED,sHAAsH;AACtH,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,eAAe,CAQxE;AAID,wFAAwF;AACxF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAEnD;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAQlE"}
@@ -0,0 +1,33 @@
1
+ export interface PanelOptionFact {
2
+ /** The options-builder method (`addRadio`, `addSelect`, `addCustomEditor`, …). */
3
+ builder: string;
4
+ /** The default as written in source, when it is a literal. */
5
+ default?: string;
6
+ /** Allowed values for a radio or select, when listed literally. */
7
+ values?: string[];
8
+ }
9
+ export interface PanelOptionIndexEntry {
10
+ /** What a saved panel of this type carries; anything else makes its migration handler run. */
11
+ pluginVersion: string;
12
+ /** Whether the panel uses the standard field config (unit, decimals, thresholds, mappings, links, …). */
13
+ standardFieldConfig: boolean;
14
+ /** `options.<path>` */
15
+ panel: Record<string, PanelOptionFact>;
16
+ /** `fieldConfig.defaults.custom.<path>` */
17
+ field: Record<string, PanelOptionFact>;
18
+ }
19
+ export interface OptionIssue {
20
+ /** Dotted path from `options` or `fieldConfig.defaults.custom`. */
21
+ path: string;
22
+ problem: 'unknown-option' | 'unlisted-value';
23
+ detail: string;
24
+ }
25
+ export declare function panelOptionEntry(panelType: string): PanelOptionIndexEntry | undefined;
26
+ /**
27
+ * Checks an `options` (scope `panel`) or `fieldConfig.defaults.custom` (scope `field`) object against the
28
+ * index. A path the index lists is checked for its listed values and not descended into (its value may be
29
+ * an object, e.g. a custom editor's); an object on the way to listed paths is descended; anything else is
30
+ * `unknown-option`.
31
+ */
32
+ export declare function checkPanelOptions(panelType: string, scope: 'panel' | 'field', value: Record<string, unknown>): OptionIssue[];
33
+ //# sourceMappingURL=panel-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panel-options.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/model/dashboard/spec/panel-options.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,eAAe;IAC9B,kFAAkF;IAClF,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,8FAA8F;IAC9F,aAAa,EAAE,MAAM,CAAC;IACtB,yGAAyG;IACzG,mBAAmB,EAAE,OAAO,CAAC;IAC7B,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACvC,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,WAAW;IAC1B,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAErF;AAID;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,EAAE,CAuB5H"}
@@ -0,0 +1,3 @@
1
+ import type { PanelOptionIndexEntry } from './panel-options';
2
+ export declare const PANEL_OPTION_INDEX: Record<string, PanelOptionIndexEntry>;
3
+ //# sourceMappingURL=panel-options.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panel-options.generated.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/model/dashboard/spec/panel-options.generated.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAovCpE,CAAC"}