@lightdash-tools/client 0.16.1 → 0.18.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.
@@ -23,7 +23,7 @@ export declare class QueryClientV2 extends BaseApiClient {
23
23
  runUnderlyingDataQuery(projectUuid: string, body: ExecuteAsyncUnderlyingDataRequestParams): Promise<ExecuteAsyncMetricQueryResults>;
24
24
  /** Run a saved SQL chart query (v2). Present for completeness; MCP content-reader keeps SQL off by default. */
25
25
  runSqlChartQuery(projectUuid: string, body: ExecuteAsyncSqlChartRequestParams): Promise<ExecuteAsyncSqlQueryResults>;
26
- /** Run a dashboard SQL chart query (v2). Present for completeness; MCP content-reader keeps SQL off by default. */
26
+ /** Run a dashboard SQL chart query (v2). Used by content-reader `run_dashboard_tile` for `sql_chart` tiles (ADR-0028). */
27
27
  runDashboardSqlChartQuery(projectUuid: string, body: ExecuteAsyncDashboardSqlChartRequestParams): Promise<ExecuteAsyncSqlQueryResults>;
28
28
  /** Poll paginated async query results. */
29
29
  getAsyncQueryResults(projectUuid: string, queryUuid: string, params?: GetAsyncQueryResultsParams): Promise<AsyncQueryResults>;
@@ -30,7 +30,7 @@ class QueryClientV2 extends base_client_1.BaseApiClient {
30
30
  async runSqlChartQuery(projectUuid, body) {
31
31
  return this.http.post(`/projects/${projectUuid}/query/sql-chart`, body);
32
32
  }
33
- /** Run a dashboard SQL chart query (v2). Present for completeness; MCP content-reader keeps SQL off by default. */
33
+ /** Run a dashboard SQL chart query (v2). Used by content-reader `run_dashboard_tile` for `sql_chart` tiles (ADR-0028). */
34
34
  async runDashboardSqlChartQuery(projectUuid, body) {
35
35
  return this.http.post(`/projects/${projectUuid}/query/dashboard-sql-chart`, body);
36
36
  }
@@ -66,6 +66,21 @@ const query_1 = require("./query");
66
66
  (0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/query/underlying-data', body);
67
67
  (0, vitest_1.expect)(result).toEqual(results);
68
68
  });
69
+ (0, vitest_1.it)('runDashboardSqlChartQuery should call POST /projects/{projectUuid}/query/dashboard-sql-chart with body', async () => {
70
+ const client = new query_1.QueryClientV2(mockHttp);
71
+ const body = {
72
+ savedSqlUuid: 'sql-1',
73
+ dashboardUuid: 'd1',
74
+ tileUuid: 't1',
75
+ dashboardFilters: { dimensions: [], metrics: [], tableCalculations: [] },
76
+ dashboardSorts: [],
77
+ };
78
+ const results = { queryUuid: 'q1', status: 'running' };
79
+ vitest_1.vi.mocked(mockHttp.post).mockResolvedValue(results);
80
+ const result = await client.runDashboardSqlChartQuery('p1', body);
81
+ (0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/query/dashboard-sql-chart', body);
82
+ (0, vitest_1.expect)(result).toEqual(results);
83
+ });
69
84
  (0, vitest_1.it)('getAsyncQueryResults should call GET /projects/{projectUuid}/query/{queryUuid}', async () => {
70
85
  const client = new query_1.QueryClientV2(mockHttp);
71
86
  const results = { queryUuid: 'q1', status: 'ready', rows: [] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash-tools/client",
3
- "version": "0.16.1",
3
+ "version": "0.18.0",
4
4
  "description": "Client library for Lightdash AI.",
5
5
  "keywords": [],
6
6
  "repository": {
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "axios": "^1.19.0",
17
17
  "bottleneck": "^2.19.5",
18
- "@lightdash-tools/common": "0.16.1"
18
+ "@lightdash-tools/common": "0.18.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/node": "^25.9.3"
@@ -81,6 +81,22 @@ describe('QueryClientV2', () => {
81
81
  expect(result).toEqual(results);
82
82
  });
83
83
 
84
+ it('runDashboardSqlChartQuery should call POST /projects/{projectUuid}/query/dashboard-sql-chart with body', async () => {
85
+ const client = new QueryClientV2(mockHttp);
86
+ const body = {
87
+ savedSqlUuid: 'sql-1',
88
+ dashboardUuid: 'd1',
89
+ tileUuid: 't1',
90
+ dashboardFilters: { dimensions: [], metrics: [], tableCalculations: [] },
91
+ dashboardSorts: [],
92
+ };
93
+ const results = { queryUuid: 'q1', status: 'running' };
94
+ vi.mocked(mockHttp.post).mockResolvedValue(results);
95
+ const result = await client.runDashboardSqlChartQuery('p1', body);
96
+ expect(mockHttp.post).toHaveBeenCalledWith('/projects/p1/query/dashboard-sql-chart', body);
97
+ expect(result).toEqual(results);
98
+ });
99
+
84
100
  it('getAsyncQueryResults should call GET /projects/{projectUuid}/query/{queryUuid}', async () => {
85
101
  const client = new QueryClientV2(mockHttp);
86
102
  const results = { queryUuid: 'q1', status: 'ready', rows: [] };
@@ -91,7 +91,7 @@ export class QueryClientV2 extends BaseApiClient {
91
91
  );
92
92
  }
93
93
 
94
- /** Run a dashboard SQL chart query (v2). Present for completeness; MCP content-reader keeps SQL off by default. */
94
+ /** Run a dashboard SQL chart query (v2). Used by content-reader `run_dashboard_tile` for `sql_chart` tiles (ADR-0028). */
95
95
  async runDashboardSqlChartQuery(
96
96
  projectUuid: string,
97
97
  body: ExecuteAsyncDashboardSqlChartRequestParams,