@opencxh/domain 1.280.0 → 1.281.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.
@@ -20,6 +20,12 @@ export interface DashboardSection {
20
20
  metricIds: string[];
21
21
  /** Row dimension for bar/table (line/heatmap imply the time axis). */
22
22
  groupBy?: DimensionId;
23
+ /**
24
+ * column only: stack the series into one bar per period. Only the source can
25
+ * say its series add up to a whole (answered + missed = offered); two
26
+ * unrelated counts stacked would draw a total that means nothing.
27
+ */
28
+ stacked?: boolean;
23
29
  }
24
30
  /**
25
31
  * A preset dashboard shipped by an owning app (or by analytics for cross-source ones). Discovered like
@@ -8,6 +8,11 @@ import { DimensionId } from './dimensions';
8
8
  */
9
9
  export type MetricValueType = "count" | "duration_ms" | "percent" | "currency";
10
10
  export type MetricAggregation = "sum" | "avg" | "rate" | "distinct" | "p50" | "p90" | "min" | "max";
11
+ /**
12
+ * Which direction of change is good news. `neutral` is for volume: more
13
+ * conversations is more work, not better work, so its delta stays grey.
14
+ */
15
+ export type MetricPolarity = "higher" | "lower" | "neutral";
11
16
  export interface MetricDefinition {
12
17
  /**
13
18
  * Globally-unique, app-namespaced id: "<source>.<family>.<name>", e.g. "comms.reply_time.first",
@@ -35,4 +40,6 @@ export interface MetricDefinition {
35
40
  description?: string;
36
41
  /** Hidden from the picker (e.g. a numerator/denominator base metric of a rate). */
37
42
  hidden?: boolean;
43
+ /** Good direction for a delta. Omitted = the analytics app guesses from id and aggregation. */
44
+ polarity?: MetricPolarity;
38
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencxh/domain",
3
- "version": "1.280.0",
3
+ "version": "1.281.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",