@bonnard/cli 0.2.10 → 0.2.12

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.
@@ -6,7 +6,7 @@
6
6
 
7
7
  Each query fetches data from your semantic layer and makes it available to chart components. Queries use the same measures and dimensions defined in your cubes and views — field names stay consistent whether you're querying from a dashboard, MCP, or the API.
8
8
 
9
- Query blocks have a unique name and map to a `QueryOptions` shape. Components reference them using `data={query_name}`. Field names are unqualified use `count` not `orders.count` — because the `cube` property provides the context.
9
+ Query blocks have a unique name and map to a `QueryOptions` shape. Components reference them using `data={query_name}`. All field names must be fully qualified with the cube or view name (e.g. `orders.count`, `orders.created_at`).
10
10
 
11
11
  ## Syntax
12
12
 
@@ -14,10 +14,9 @@ Query blocks use fenced code with the `query` language tag followed by a name:
14
14
 
15
15
  ````markdown
16
16
  ```query revenue_trend
17
- cube: orders
18
- measures: [total_revenue]
17
+ measures: [orders.total_revenue]
19
18
  timeDimension:
20
- dimension: created_at
19
+ dimension: orders.created_at
21
20
  granularity: month
22
21
  dateRange: [2025-01-01, 2025-12-31]
23
22
  ```
@@ -27,19 +26,18 @@ timeDimension:
27
26
 
28
27
  | Property | Type | Required | Description |
29
28
  |----------|------|----------|-------------|
30
- | `cube` | string | Yes | The cube or view to query (e.g. `orders`) |
31
- | `measures` | string[] | No | Measures to aggregate (e.g. `[count, total_revenue]`) |
32
- | `dimensions` | string[] | No | Dimensions to group by (e.g. `[status, city]`) |
29
+ | `measures` | string[] | No | Fully qualified measures to aggregate (e.g. `[orders.count, orders.total_revenue]`) |
30
+ | `dimensions` | string[] | No | Fully qualified dimensions to group by (e.g. `[orders.status, orders.city]`) |
33
31
  | `filters` | Filter[] | No | Row-level filters |
34
32
  | `timeDimension` | object | No | Time-based grouping and date range |
35
- | `orderBy` | object | No | Sort specification (e.g. `{total_revenue: desc}`) |
33
+ | `orderBy` | object | No | Sort specification (e.g. `{orders.total_revenue: desc}`) |
36
34
  | `limit` | number | No | Maximum rows to return |
37
35
 
38
36
  ### timeDimension
39
37
 
40
38
  | Property | Type | Required | Description |
41
39
  |----------|------|----------|-------------|
42
- | `dimension` | string | Yes | Time dimension name (e.g. `created_at`) |
40
+ | `dimension` | string | Yes | Fully qualified time dimension name (e.g. `orders.created_at`) |
43
41
  | `granularity` | string | No | `day`, `week`, `month`, `quarter`, or `year` |
44
42
  | `dateRange` | string[] | No | `[start, end]` in `YYYY-MM-DD` format |
45
43
 
@@ -59,8 +57,7 @@ Each filter is an object with:
59
57
 
60
58
  ````markdown
61
59
  ```query total_orders
62
- cube: orders
63
- measures: [count]
60
+ measures: [orders.count]
64
61
  ```
65
62
  ````
66
63
 
@@ -68,11 +65,10 @@ measures: [count]
68
65
 
69
66
  ````markdown
70
67
  ```query revenue_by_city
71
- cube: orders
72
- measures: [total_revenue]
73
- dimensions: [city]
68
+ measures: [orders.total_revenue]
69
+ dimensions: [orders.city]
74
70
  orderBy:
75
- total_revenue: desc
71
+ orders.total_revenue: desc
76
72
  limit: 10
77
73
  ```
78
74
  ````
@@ -81,10 +77,9 @@ limit: 10
81
77
 
82
78
  ````markdown
83
79
  ```query monthly_revenue
84
- cube: orders
85
- measures: [total_revenue]
80
+ measures: [orders.total_revenue]
86
81
  timeDimension:
87
- dimension: created_at
82
+ dimension: orders.created_at
88
83
  granularity: month
89
84
  dateRange: [2025-01-01, 2025-12-31]
90
85
  ```
@@ -94,11 +89,10 @@ timeDimension:
94
89
 
95
90
  ````markdown
96
91
  ```query completed_orders
97
- cube: orders
98
- measures: [count, total_revenue]
99
- dimensions: [category]
92
+ measures: [orders.count, orders.total_revenue]
93
+ dimensions: [orders.category]
100
94
  filters:
101
- - dimension: status
95
+ - dimension: orders.status
102
96
  operator: equals
103
97
  values: [completed]
104
98
  ```
@@ -108,8 +102,7 @@ filters:
108
102
 
109
103
  - Query names must be valid identifiers (letters, numbers, `_`, `$`)
110
104
  - Query names must be unique within a dashboard
111
- - Every query must specify a `cube`
112
- - Field names are unqualified (use `count` not `orders.count`) — the `cube` provides the context
105
+ - All field names must be fully qualified with the cube or view name (e.g. `orders.count`, not `count`)
113
106
  - Components reference queries by name: `data={query_name}`
114
107
 
115
108
  ## See Also
@@ -18,11 +18,10 @@ const bonnard = createClient({
18
18
  });
19
19
 
20
20
  const result = await bonnard.query({
21
- cube: 'orders',
22
- measures: ['revenue', 'count'],
23
- dimensions: ['status'],
21
+ measures: ['orders.revenue', 'orders.count'],
22
+ dimensions: ['orders.status'],
24
23
  timeDimension: {
25
- dimension: 'created_at',
24
+ dimension: 'orders.created_at',
26
25
  granularity: 'month',
27
26
  dateRange: ['2025-01-01', '2025-12-31'],
28
27
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonnard/cli",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "bon": "./dist/bin/bon.mjs"