@lightdash-tools/client 0.6.0 → 0.8.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 (256) hide show
  1. package/README.md +2 -2
  2. package/dist/agentops/apply-agent-change.d.ts +3 -0
  3. package/dist/agentops/apply-agent-change.js +63 -0
  4. package/dist/agentops/apply-bundle-diff.d.ts +13 -0
  5. package/dist/agentops/apply-bundle-diff.js +44 -0
  6. package/dist/agentops/apply-bundle-diff.test.d.ts +1 -0
  7. package/dist/agentops/apply-bundle-diff.test.js +397 -0
  8. package/dist/agentops/apply-context.d.ts +14 -0
  9. package/dist/agentops/apply-context.js +6 -0
  10. package/dist/agentops/apply-evaluation-change.d.ts +3 -0
  11. package/dist/agentops/apply-evaluation-change.js +78 -0
  12. package/dist/agentops/fetch-bundle-state.d.ts +6 -0
  13. package/dist/agentops/fetch-bundle-state.js +20 -0
  14. package/dist/agentops/fetch-bundle-state.test.d.ts +1 -0
  15. package/dist/agentops/fetch-bundle-state.test.js +44 -0
  16. package/dist/agentops/index.d.ts +3 -0
  17. package/dist/agentops/index.js +9 -0
  18. package/dist/agentops/resolve-evaluation-run.d.ts +15 -0
  19. package/dist/agentops/resolve-evaluation-run.js +48 -0
  20. package/dist/api/v1/ai-agents/admin.d.ts +16 -0
  21. package/dist/api/v1/ai-agents/admin.js +29 -0
  22. package/dist/api/v1/ai-agents/agents.d.ts +18 -0
  23. package/dist/api/v1/ai-agents/agents.js +31 -0
  24. package/dist/api/v1/ai-agents/artifacts.d.ts +26 -0
  25. package/dist/api/v1/ai-agents/artifacts.js +41 -0
  26. package/dist/api/v1/ai-agents/artifacts.test.d.ts +1 -0
  27. package/dist/api/v1/ai-agents/artifacts.test.js +69 -0
  28. package/dist/api/v1/ai-agents/discovery.d.ts +28 -0
  29. package/dist/api/v1/ai-agents/discovery.js +46 -0
  30. package/dist/api/v1/ai-agents/discovery.test.d.ts +1 -0
  31. package/dist/api/v1/ai-agents/discovery.test.js +90 -0
  32. package/dist/api/v1/ai-agents/evaluations.d.ts +39 -0
  33. package/dist/api/v1/ai-agents/evaluations.js +70 -0
  34. package/dist/api/v1/ai-agents/facade.d.ts +79 -0
  35. package/dist/api/v1/ai-agents/facade.js +193 -0
  36. package/dist/api/v1/ai-agents/feedback.d.ts +10 -0
  37. package/dist/api/v1/ai-agents/feedback.js +15 -0
  38. package/dist/api/v1/ai-agents/feedback.test.d.ts +1 -0
  39. package/dist/api/v1/ai-agents/feedback.test.js +23 -0
  40. package/dist/api/v1/ai-agents/index.d.ts +1 -0
  41. package/dist/api/v1/ai-agents/index.js +5 -0
  42. package/dist/api/v1/ai-agents/mcp-servers.d.ts +20 -0
  43. package/dist/api/v1/ai-agents/mcp-servers.js +35 -0
  44. package/dist/api/v1/ai-agents/mcp-servers.test.d.ts +1 -0
  45. package/dist/api/v1/ai-agents/mcp-servers.test.js +66 -0
  46. package/dist/api/v1/ai-agents/request-options.d.ts +12 -0
  47. package/dist/api/v1/ai-agents/request-options.js +20 -0
  48. package/dist/api/v1/ai-agents/sql-approval.d.ts +10 -0
  49. package/dist/api/v1/ai-agents/sql-approval.js +15 -0
  50. package/dist/api/v1/ai-agents/sql-approval.test.d.ts +1 -0
  51. package/dist/api/v1/ai-agents/sql-approval.test.js +25 -0
  52. package/dist/api/v1/ai-agents/threads.d.ts +56 -0
  53. package/dist/api/v1/ai-agents/threads.js +97 -0
  54. package/dist/api/v1/ai-agents/threads.test.d.ts +1 -0
  55. package/dist/api/v1/ai-agents/threads.test.js +39 -0
  56. package/dist/api/v1/ai-agents.test.js +172 -89
  57. package/dist/api/v1/analytics.d.ts +10 -0
  58. package/dist/api/v1/analytics.js +14 -0
  59. package/dist/api/v1/analytics.test.d.ts +4 -0
  60. package/dist/api/v1/analytics.test.js +27 -0
  61. package/dist/api/v1/charts.d.ts +13 -2
  62. package/dist/api/v1/charts.js +26 -30
  63. package/dist/api/v1/charts.test.js +35 -28
  64. package/dist/api/v1/dashboards.d.ts +42 -2
  65. package/dist/api/v1/dashboards.js +39 -14
  66. package/dist/api/v1/dashboards.test.js +126 -12
  67. package/dist/api/v1/explores.d.ts +4 -2
  68. package/dist/api/v1/explores.js +20 -29
  69. package/dist/api/v1/explores.test.js +31 -21
  70. package/dist/api/v1/groups.d.ts +1 -1
  71. package/dist/api/v1/groups.js +25 -51
  72. package/dist/api/v1/groups.test.js +15 -24
  73. package/dist/api/v1/metrics.d.ts +2 -2
  74. package/dist/api/v1/metrics.js +4 -17
  75. package/dist/api/v1/metrics.test.js +6 -15
  76. package/dist/api/v1/organizations.d.ts +1 -1
  77. package/dist/api/v1/organizations.js +2 -13
  78. package/dist/api/v1/organizations.test.js +3 -12
  79. package/dist/api/v1/project-access.d.ts +1 -1
  80. package/dist/api/v1/project-access.js +18 -45
  81. package/dist/api/v1/project-access.test.js +27 -36
  82. package/dist/api/v1/projects.d.ts +1 -1
  83. package/dist/api/v1/projects.js +6 -21
  84. package/dist/api/v1/projects.test.js +9 -18
  85. package/dist/api/v1/query.d.ts +5 -2
  86. package/dist/api/v1/query.js +8 -18
  87. package/dist/api/v1/query.test.js +6 -15
  88. package/dist/api/v1/schedulers.d.ts +2 -2
  89. package/dist/api/v1/schedulers.js +4 -17
  90. package/dist/api/v1/schedulers.test.js +6 -15
  91. package/dist/api/v1/spaces.d.ts +1 -1
  92. package/dist/api/v1/spaces.js +18 -45
  93. package/dist/api/v1/spaces.test.js +27 -36
  94. package/dist/api/v1/tags.d.ts +1 -1
  95. package/dist/api/v1/tags.js +4 -17
  96. package/dist/api/v1/tags.test.js +6 -15
  97. package/dist/api/v1/users.d.ts +3 -1
  98. package/dist/api/v1/users.js +22 -39
  99. package/dist/api/v1/users.test.js +44 -30
  100. package/dist/api/v1/validation.d.ts +9 -2
  101. package/dist/api/v1/validation.js +16 -18
  102. package/dist/api/v1/validation.test.js +22 -15
  103. package/dist/api/v2/charts.d.ts +12 -0
  104. package/dist/api/v2/charts.js +18 -0
  105. package/dist/api/v2/charts.test.d.ts +4 -0
  106. package/dist/api/v2/charts.test.js +45 -0
  107. package/dist/api/v2/content.d.ts +20 -3
  108. package/dist/api/v2/content.js +18 -14
  109. package/dist/api/v2/content.test.js +44 -12
  110. package/dist/api/v2/dashboards.d.ts +16 -0
  111. package/dist/api/v2/dashboards.js +22 -0
  112. package/dist/api/v2/dashboards.test.d.ts +4 -0
  113. package/dist/api/v2/dashboards.test.js +61 -0
  114. package/dist/api/v2/organization-roles.d.ts +1 -1
  115. package/dist/api/v2/organization-roles.js +21 -50
  116. package/dist/api/v2/organization-roles.test.js +33 -42
  117. package/dist/api/v2/parameters.d.ts +20 -0
  118. package/dist/api/v2/parameters.js +22 -0
  119. package/dist/api/v2/parameters.test.d.ts +4 -0
  120. package/dist/api/v2/parameters.test.js +39 -0
  121. package/dist/api/v2/project-role-assignments.d.ts +1 -1
  122. package/dist/api/v2/project-role-assignments.js +12 -33
  123. package/dist/api/v2/project-role-assignments.test.js +18 -27
  124. package/dist/api/v2/query.d.ts +16 -1
  125. package/dist/api/v2/query.js +26 -29
  126. package/dist/api/v2/query.test.js +31 -24
  127. package/dist/api/v2/validation.d.ts +28 -0
  128. package/dist/api/v2/validation.js +23 -0
  129. package/dist/client.d.ts +24 -14
  130. package/dist/client.js +26 -16
  131. package/dist/client.test.js +2 -0
  132. package/dist/config.d.ts +35 -10
  133. package/dist/http/axios-client.d.ts +4 -4
  134. package/dist/http/http-client.d.ts +3 -14
  135. package/dist/http/http-client.js +20 -43
  136. package/dist/http/interceptors.d.ts +3 -3
  137. package/dist/http/interceptors.js +16 -3
  138. package/dist/http/rate-limiter.js +2 -13
  139. package/dist/http/rate-limiter.test.js +15 -24
  140. package/dist/http/unwrap-api-success.d.ts +26 -0
  141. package/dist/http/unwrap-api-success.js +25 -0
  142. package/dist/http/unwrap-api-success.test.d.ts +1 -0
  143. package/dist/http/unwrap-api-success.test.js +19 -0
  144. package/dist/index.d.ts +13 -3
  145. package/dist/index.js +17 -1
  146. package/dist/index.test.js +13 -5
  147. package/dist/pagination/fetch-all-pages.js +18 -29
  148. package/dist/pagination/fetch-all-pages.test.js +15 -24
  149. package/dist/types/api.d.ts +1 -1
  150. package/dist/utils/env.d.ts +11 -2
  151. package/dist/utils/env.js +41 -8
  152. package/dist/utils/env.test.js +14 -4
  153. package/dist/utils/logger.js +5 -4
  154. package/dist/utils/retry.js +17 -28
  155. package/dist/utils/retry.test.js +9 -18
  156. package/dist/utils/secret-string.test.d.ts +1 -0
  157. package/dist/utils/secret-string.test.js +25 -0
  158. package/package.json +12 -4
  159. package/src/agentops/apply-agent-change.ts +82 -0
  160. package/src/agentops/apply-bundle-diff.test.ts +453 -0
  161. package/src/agentops/apply-bundle-diff.ts +63 -0
  162. package/src/agentops/apply-context.ts +23 -0
  163. package/src/agentops/apply-evaluation-change.ts +125 -0
  164. package/src/agentops/fetch-bundle-state.test.ts +51 -0
  165. package/src/agentops/fetch-bundle-state.ts +33 -0
  166. package/src/agentops/index.ts +11 -0
  167. package/src/agentops/resolve-evaluation-run.ts +94 -0
  168. package/src/api/v1/ai-agents/admin.ts +41 -0
  169. package/src/api/v1/ai-agents/agents.ts +40 -0
  170. package/src/api/v1/ai-agents/artifacts.test.ts +84 -0
  171. package/src/api/v1/ai-agents/artifacts.ts +92 -0
  172. package/src/api/v1/ai-agents/discovery.test.ts +102 -0
  173. package/src/api/v1/ai-agents/discovery.ts +79 -0
  174. package/src/api/v1/ai-agents/evaluations.ts +152 -0
  175. package/src/api/v1/ai-agents/facade.ts +489 -0
  176. package/src/api/v1/ai-agents/feedback.test.ts +30 -0
  177. package/src/api/v1/ai-agents/feedback.ts +24 -0
  178. package/src/api/v1/ai-agents/index.ts +1 -0
  179. package/src/api/v1/ai-agents/mcp-servers.test.ts +81 -0
  180. package/src/api/v1/ai-agents/mcp-servers.ts +67 -0
  181. package/src/api/v1/ai-agents/request-options.ts +32 -0
  182. package/src/api/v1/ai-agents/sql-approval.test.ts +32 -0
  183. package/src/api/v1/ai-agents/sql-approval.ts +24 -0
  184. package/src/api/v1/ai-agents/threads.test.ts +55 -0
  185. package/src/api/v1/ai-agents/threads.ts +216 -0
  186. package/src/api/v1/ai-agents.test.ts +189 -13
  187. package/src/api/v1/analytics.test.ts +32 -0
  188. package/src/api/v1/analytics.ts +16 -0
  189. package/src/api/v1/charts.test.ts +26 -6
  190. package/src/api/v1/charts.ts +25 -4
  191. package/src/api/v1/dashboards.test.ts +142 -0
  192. package/src/api/v1/dashboards.ts +127 -2
  193. package/src/api/v1/explores.test.ts +22 -0
  194. package/src/api/v1/explores.ts +13 -2
  195. package/src/api/v1/groups.test.ts +2 -0
  196. package/src/api/v1/groups.ts +9 -7
  197. package/src/api/v1/metrics.test.ts +2 -0
  198. package/src/api/v1/metrics.ts +3 -2
  199. package/src/api/v1/organizations.test.ts +2 -0
  200. package/src/api/v1/organizations.ts +2 -1
  201. package/src/api/v1/project-access.test.ts +3 -1
  202. package/src/api/v1/project-access.ts +2 -1
  203. package/src/api/v1/projects.test.ts +2 -0
  204. package/src/api/v1/projects.ts +2 -1
  205. package/src/api/v1/query.test.ts +2 -0
  206. package/src/api/v1/query.ts +6 -2
  207. package/src/api/v1/schedulers.test.ts +2 -0
  208. package/src/api/v1/schedulers.ts +3 -2
  209. package/src/api/v1/spaces.test.ts +2 -0
  210. package/src/api/v1/spaces.ts +2 -1
  211. package/src/api/v1/tags.test.ts +2 -0
  212. package/src/api/v1/tags.ts +2 -1
  213. package/src/api/v1/users.test.ts +26 -0
  214. package/src/api/v1/users.ts +8 -2
  215. package/src/api/v1/validation.test.ts +20 -0
  216. package/src/api/v1/validation.ts +26 -2
  217. package/src/api/v2/charts.test.ts +53 -0
  218. package/src/api/v2/charts.ts +23 -0
  219. package/src/api/v2/content.test.ts +47 -0
  220. package/src/api/v2/content.ts +37 -3
  221. package/src/api/v2/dashboards.test.ts +71 -0
  222. package/src/api/v2/dashboards.ts +40 -0
  223. package/src/api/v2/organization-roles.test.ts +2 -0
  224. package/src/api/v2/organization-roles.ts +2 -1
  225. package/src/api/v2/parameters.test.ts +45 -0
  226. package/src/api/v2/parameters.ts +38 -0
  227. package/src/api/v2/project-role-assignments.test.ts +2 -0
  228. package/src/api/v2/project-role-assignments.ts +2 -1
  229. package/src/api/v2/query.test.ts +20 -0
  230. package/src/api/v2/query.ts +55 -1
  231. package/src/api/v2/validation.ts +48 -0
  232. package/src/client.test.ts +3 -0
  233. package/src/client.ts +33 -17
  234. package/src/config.ts +38 -10
  235. package/src/errors.test.ts +1 -0
  236. package/src/http/axios-client.ts +8 -5
  237. package/src/http/http-client.ts +8 -21
  238. package/src/http/interceptors.ts +23 -10
  239. package/src/http/rate-limiter.test.ts +1 -0
  240. package/src/http/rate-limiter.ts +3 -1
  241. package/src/http/unwrap-api-success.test.ts +23 -0
  242. package/src/http/unwrap-api-success.ts +40 -0
  243. package/src/index.test.ts +16 -7
  244. package/src/index.ts +37 -2
  245. package/src/pagination/fetch-all-pages.test.ts +2 -0
  246. package/src/types/api.ts +1 -1
  247. package/src/utils/env.test.ts +16 -4
  248. package/src/utils/env.ts +61 -10
  249. package/src/utils/logger.ts +6 -4
  250. package/src/utils/retry.test.ts +1 -0
  251. package/src/utils/retry.ts +2 -1
  252. package/src/utils/secret-string.test.ts +27 -0
  253. package/tsconfig.json +4 -2
  254. package/dist/api/v1/ai-agents.d.ts +0 -63
  255. package/dist/api/v1/ai-agents.js +0 -173
  256. package/src/api/v1/ai-agents.ts +0 -252
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /**
3
+ * V2 parameters client unit tests.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const vitest_1 = require("vitest");
7
+ const parameters_1 = require("./parameters");
8
+ (0, vitest_1.describe)('ParametersClientV2', () => {
9
+ let mockHttp;
10
+ (0, vitest_1.beforeEach)(() => {
11
+ mockHttp = {
12
+ get: vitest_1.vi.fn(),
13
+ post: vitest_1.vi.fn(),
14
+ put: vitest_1.vi.fn(),
15
+ patch: vitest_1.vi.fn(),
16
+ delete: vitest_1.vi.fn(),
17
+ };
18
+ });
19
+ (0, vitest_1.it)('listParameters calls GET /projects/{projectUuid}/parameters/list', async () => {
20
+ const client = new parameters_1.ParametersClientV2(mockHttp);
21
+ const mockResponse = { data: [], pagination: {} };
22
+ vitest_1.vi.mocked(mockHttp.get).mockResolvedValue(mockResponse);
23
+ const result = await client.listParameters('p1', { search: 'region', page: 1 });
24
+ (0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/projects/p1/parameters/list', {
25
+ params: { search: 'region', page: 1 },
26
+ });
27
+ (0, vitest_1.expect)(result).toEqual(mockResponse);
28
+ });
29
+ (0, vitest_1.it)('getParameters calls GET /projects/{projectUuid}/parameters', async () => {
30
+ const client = new parameters_1.ParametersClientV2(mockHttp);
31
+ const mockResponse = { region: { type: 'string' } };
32
+ vitest_1.vi.mocked(mockHttp.get).mockResolvedValue(mockResponse);
33
+ const result = await client.getParameters('p1', ['region']);
34
+ (0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/projects/p1/parameters', {
35
+ params: { names: ['region'] },
36
+ });
37
+ (0, vitest_1.expect)(result).toEqual(mockResponse);
38
+ });
39
+ });
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Project role assignments API client (v2). Manage project-level role assignments for users and groups.
3
3
  */
4
- import type { components } from '@lightdash-tools/common';
5
4
  import { BaseApiClient } from '../base-client';
5
+ import type { components } from '@lightdash-tools/common';
6
6
  type RoleAssignment = components['schemas']['RoleAssignment'];
7
7
  type UpsertUserRoleAssignmentRequest = components['schemas']['UpsertUserRoleAssignmentRequest'];
8
8
  type UpdateRoleAssignmentRequest = components['schemas']['UpdateRoleAssignmentRequest'];
@@ -2,54 +2,33 @@
2
2
  /**
3
3
  * Project role assignments API client (v2). Manage project-level role assignments for users and groups.
4
4
  */
5
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
- return new (P || (P = Promise))(function (resolve, reject) {
8
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
- step((generator = generator.apply(thisArg, _arguments || [])).next());
12
- });
13
- };
14
5
  Object.defineProperty(exports, "__esModule", { value: true });
15
6
  exports.ProjectRoleAssignmentsClient = void 0;
16
7
  const base_client_1 = require("../base-client");
17
8
  class ProjectRoleAssignmentsClient extends base_client_1.BaseApiClient {
18
9
  /** List project role assignments. */
19
- listAssignments(projectId) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- return this.http.get(`/projects/${projectId}/roles/assignments`);
22
- });
10
+ async listAssignments(projectId) {
11
+ return this.http.get(`/projects/${projectId}/roles/assignments`);
23
12
  }
24
13
  /** Create or update project role assignment for a user (upsert). */
25
- upsertUserAssignment(projectId, userId, body) {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- return this.http.post(`/projects/${projectId}/roles/assignments/user/${userId}`, body);
28
- });
14
+ async upsertUserAssignment(projectId, userId, body) {
15
+ return this.http.post(`/projects/${projectId}/roles/assignments/user/${userId}`, body);
29
16
  }
30
17
  /** Delete project role assignment for a user. */
31
- deleteUserAssignment(projectId, userId) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- yield this.http.delete(`/projects/${projectId}/roles/assignments/user/${userId}`);
34
- });
18
+ async deleteUserAssignment(projectId, userId) {
19
+ await this.http.delete(`/projects/${projectId}/roles/assignments/user/${userId}`);
35
20
  }
36
21
  /** Create or update project role assignment for a group (upsert). */
37
- upsertGroupAssignment(projectId, groupId, body) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- return this.http.post(`/projects/${projectId}/roles/assignments/group/${groupId}`, body);
40
- });
22
+ async upsertGroupAssignment(projectId, groupId, body) {
23
+ return this.http.post(`/projects/${projectId}/roles/assignments/group/${groupId}`, body);
41
24
  }
42
25
  /** Delete project role assignment for a group. */
43
- deleteGroupAssignment(projectId, groupId) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- yield this.http.delete(`/projects/${projectId}/roles/assignments/group/${groupId}`);
46
- });
26
+ async deleteGroupAssignment(projectId, groupId) {
27
+ await this.http.delete(`/projects/${projectId}/roles/assignments/group/${groupId}`);
47
28
  }
48
29
  /** Update project role assignment for a group. */
49
- updateGroupAssignment(projectId, groupId, body) {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- return this.http.patch(`/projects/${projectId}/roles/assignments/group/${groupId}`, body);
52
- });
30
+ async updateGroupAssignment(projectId, groupId, body) {
31
+ return this.http.patch(`/projects/${projectId}/roles/assignments/group/${groupId}`, body);
53
32
  }
54
33
  }
55
34
  exports.ProjectRoleAssignmentsClient = ProjectRoleAssignmentsClient;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  const vitest_1 = require("vitest");
13
4
  const project_role_assignments_1 = require("./project-role-assignments");
@@ -22,45 +13,45 @@ const project_role_assignments_1 = require("./project-role-assignments");
22
13
  delete: vitest_1.vi.fn(),
23
14
  };
24
15
  });
25
- (0, vitest_1.it)('listAssignments should call GET /projects/{projectId}/roles/assignments', () => __awaiter(void 0, void 0, void 0, function* () {
16
+ (0, vitest_1.it)('listAssignments should call GET /projects/{projectId}/roles/assignments', async () => {
26
17
  const client = new project_role_assignments_1.ProjectRoleAssignmentsClient(mockHttp);
27
18
  const assignments = [{ roleId: 'r1', roleName: 'Editor' }];
28
19
  vitest_1.vi.mocked(mockHttp.get).mockResolvedValue(assignments);
29
- const result = yield client.listAssignments('proj-1');
20
+ const result = await client.listAssignments('proj-1');
30
21
  (0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/projects/proj-1/roles/assignments');
31
22
  (0, vitest_1.expect)(result).toEqual(assignments);
32
- }));
33
- (0, vitest_1.it)('upsertUserAssignment should call POST .../user/{userId} with body', () => __awaiter(void 0, void 0, void 0, function* () {
23
+ });
24
+ (0, vitest_1.it)('upsertUserAssignment should call POST .../user/{userId} with body', async () => {
34
25
  const client = new project_role_assignments_1.ProjectRoleAssignmentsClient(mockHttp);
35
26
  const body = { roleId: 'r1' };
36
27
  vitest_1.vi.mocked(mockHttp.post).mockResolvedValue({ roleId: 'r1' });
37
- yield client.upsertUserAssignment('proj-1', 'user-1', body);
28
+ await client.upsertUserAssignment('proj-1', 'user-1', body);
38
29
  (0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/proj-1/roles/assignments/user/user-1', body);
39
- }));
40
- (0, vitest_1.it)('deleteUserAssignment should call DELETE .../user/{userId}', () => __awaiter(void 0, void 0, void 0, function* () {
30
+ });
31
+ (0, vitest_1.it)('deleteUserAssignment should call DELETE .../user/{userId}', async () => {
41
32
  const client = new project_role_assignments_1.ProjectRoleAssignmentsClient(mockHttp);
42
33
  vitest_1.vi.mocked(mockHttp.delete).mockResolvedValue(undefined);
43
- yield client.deleteUserAssignment('proj-1', 'user-1');
34
+ await client.deleteUserAssignment('proj-1', 'user-1');
44
35
  (0, vitest_1.expect)(mockHttp.delete).toHaveBeenCalledWith('/projects/proj-1/roles/assignments/user/user-1');
45
- }));
46
- (0, vitest_1.it)('upsertGroupAssignment should call POST .../group/{groupId} with body', () => __awaiter(void 0, void 0, void 0, function* () {
36
+ });
37
+ (0, vitest_1.it)('upsertGroupAssignment should call POST .../group/{groupId} with body', async () => {
47
38
  const client = new project_role_assignments_1.ProjectRoleAssignmentsClient(mockHttp);
48
39
  const body = { roleId: 'r1' };
49
40
  vitest_1.vi.mocked(mockHttp.post).mockResolvedValue({ roleId: 'r1' });
50
- yield client.upsertGroupAssignment('proj-1', 'group-1', body);
41
+ await client.upsertGroupAssignment('proj-1', 'group-1', body);
51
42
  (0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/proj-1/roles/assignments/group/group-1', body);
52
- }));
53
- (0, vitest_1.it)('deleteGroupAssignment should call DELETE .../group/{groupId}', () => __awaiter(void 0, void 0, void 0, function* () {
43
+ });
44
+ (0, vitest_1.it)('deleteGroupAssignment should call DELETE .../group/{groupId}', async () => {
54
45
  const client = new project_role_assignments_1.ProjectRoleAssignmentsClient(mockHttp);
55
46
  vitest_1.vi.mocked(mockHttp.delete).mockResolvedValue(undefined);
56
- yield client.deleteGroupAssignment('proj-1', 'group-1');
47
+ await client.deleteGroupAssignment('proj-1', 'group-1');
57
48
  (0, vitest_1.expect)(mockHttp.delete).toHaveBeenCalledWith('/projects/proj-1/roles/assignments/group/group-1');
58
- }));
59
- (0, vitest_1.it)('updateGroupAssignment should call PATCH .../group/{groupId}', () => __awaiter(void 0, void 0, void 0, function* () {
49
+ });
50
+ (0, vitest_1.it)('updateGroupAssignment should call PATCH .../group/{groupId}', async () => {
60
51
  const client = new project_role_assignments_1.ProjectRoleAssignmentsClient(mockHttp);
61
52
  const body = { roleId: 'r2' };
62
53
  vitest_1.vi.mocked(mockHttp.patch).mockResolvedValue({ roleId: 'r2' });
63
- yield client.updateGroupAssignment('proj-1', 'group-1', body);
54
+ await client.updateGroupAssignment('proj-1', 'group-1', body);
64
55
  (0, vitest_1.expect)(mockHttp.patch).toHaveBeenCalledWith('/projects/proj-1/roles/assignments/group/group-1', body);
65
- }));
56
+ });
66
57
  });
@@ -1,8 +1,15 @@
1
1
  /**
2
2
  * Query API client for v2 endpoints. Run metric/SQL/underlying data queries using v2 API.
3
3
  */
4
- import type { ExecuteAsyncMetricQueryRequestParams, ExecuteAsyncSqlQueryRequestParams, ExecuteAsyncSavedChartRequestParams, ExecuteAsyncDashboardChartRequestParams, ExecuteAsyncUnderlyingDataRequestParams, ExecuteAsyncMetricQueryResults, ExecuteAsyncDashboardChartResults, ExecuteAsyncSqlQueryResults } from '@lightdash-tools/common';
5
4
  import { BaseApiClient } from '../base-client';
5
+ import type { ExecuteAsyncMetricQueryRequestParams, ExecuteAsyncSqlQueryRequestParams, ExecuteAsyncSavedChartRequestParams, ExecuteAsyncDashboardChartRequestParams, ExecuteAsyncUnderlyingDataRequestParams, ExecuteAsyncMetricQueryResults, ExecuteAsyncDashboardChartResults, ExecuteAsyncSqlQueryResults, components } from '@lightdash-tools/common';
6
+ export type AsyncQueryResults = components['schemas']['ApiGetAsyncQueryResults'];
7
+ export type ExecuteAsyncSqlChartRequestParams = components['schemas']['ExecuteAsyncSqlChartRequestParams'];
8
+ export type ExecuteAsyncDashboardSqlChartRequestParams = components['schemas']['ExecuteAsyncDashboardSqlChartRequestParams'];
9
+ export type GetAsyncQueryResultsParams = {
10
+ page?: number;
11
+ pageSize?: number;
12
+ };
6
13
  export declare class QueryClientV2 extends BaseApiClient {
7
14
  /** Run a metric query (v2 endpoint). */
8
15
  runMetricQuery(projectUuid: string, body: ExecuteAsyncMetricQueryRequestParams): Promise<ExecuteAsyncMetricQueryResults>;
@@ -14,4 +21,12 @@ export declare class QueryClientV2 extends BaseApiClient {
14
21
  runDashboardChartQuery(projectUuid: string, body: ExecuteAsyncDashboardChartRequestParams): Promise<ExecuteAsyncDashboardChartResults>;
15
22
  /** Run an underlying data query (v2 endpoint). */
16
23
  runUnderlyingDataQuery(projectUuid: string, body: ExecuteAsyncUnderlyingDataRequestParams): Promise<ExecuteAsyncMetricQueryResults>;
24
+ /** Run a saved SQL chart query (v2). Present for completeness; MCP content-reader keeps SQL off by default. */
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. */
27
+ runDashboardSqlChartQuery(projectUuid: string, body: ExecuteAsyncDashboardSqlChartRequestParams): Promise<ExecuteAsyncSqlQueryResults>;
28
+ /** Poll paginated async query results. */
29
+ getAsyncQueryResults(projectUuid: string, queryUuid: string, params?: GetAsyncQueryResultsParams): Promise<AsyncQueryResults>;
30
+ /** Cancel a running async query. */
31
+ cancelAsyncQuery(projectUuid: string, queryUuid: string): Promise<void>;
17
32
  }
@@ -2,48 +2,45 @@
2
2
  /**
3
3
  * Query API client for v2 endpoints. Run metric/SQL/underlying data queries using v2 API.
4
4
  */
5
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
- return new (P || (P = Promise))(function (resolve, reject) {
8
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
- step((generator = generator.apply(thisArg, _arguments || [])).next());
12
- });
13
- };
14
5
  Object.defineProperty(exports, "__esModule", { value: true });
15
6
  exports.QueryClientV2 = void 0;
16
7
  const base_client_1 = require("../base-client");
17
8
  class QueryClientV2 extends base_client_1.BaseApiClient {
18
9
  /** Run a metric query (v2 endpoint). */
19
- runMetricQuery(projectUuid, body) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- return this.http.post(`/projects/${projectUuid}/query/metric-query`, body);
22
- });
10
+ async runMetricQuery(projectUuid, body) {
11
+ return this.http.post(`/projects/${projectUuid}/query/metric-query`, body);
23
12
  }
24
13
  /** Run a SQL query (v2 endpoint). */
25
- runSqlQuery(projectUuid, body) {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- return this.http.post(`/projects/${projectUuid}/query/sql`, body);
28
- });
14
+ async runSqlQuery(projectUuid, body) {
15
+ return this.http.post(`/projects/${projectUuid}/query/sql`, body);
29
16
  }
30
17
  /** Run a chart query (v2 endpoint). */
31
- runChartQuery(projectUuid, body) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return this.http.post(`/projects/${projectUuid}/query/chart`, body);
34
- });
18
+ async runChartQuery(projectUuid, body) {
19
+ return this.http.post(`/projects/${projectUuid}/query/chart`, body);
35
20
  }
36
21
  /** Run a dashboard chart query (v2 endpoint). */
37
- runDashboardChartQuery(projectUuid, body) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- return this.http.post(`/projects/${projectUuid}/query/dashboard-chart`, body);
40
- });
22
+ async runDashboardChartQuery(projectUuid, body) {
23
+ return this.http.post(`/projects/${projectUuid}/query/dashboard-chart`, body);
41
24
  }
42
25
  /** Run an underlying data query (v2 endpoint). */
43
- runUnderlyingDataQuery(projectUuid, body) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- return this.http.post(`/projects/${projectUuid}/query/underlying-data`, body);
46
- });
26
+ async runUnderlyingDataQuery(projectUuid, body) {
27
+ return this.http.post(`/projects/${projectUuid}/query/underlying-data`, body);
28
+ }
29
+ /** Run a saved SQL chart query (v2). Present for completeness; MCP content-reader keeps SQL off by default. */
30
+ async runSqlChartQuery(projectUuid, body) {
31
+ return this.http.post(`/projects/${projectUuid}/query/sql-chart`, body);
32
+ }
33
+ /** Run a dashboard SQL chart query (v2). Present for completeness; MCP content-reader keeps SQL off by default. */
34
+ async runDashboardSqlChartQuery(projectUuid, body) {
35
+ return this.http.post(`/projects/${projectUuid}/query/dashboard-sql-chart`, body);
36
+ }
37
+ /** Poll paginated async query results. */
38
+ async getAsyncQueryResults(projectUuid, queryUuid, params) {
39
+ return this.http.get(`/projects/${projectUuid}/query/${encodeURIComponent(queryUuid)}`, { params });
40
+ }
41
+ /** Cancel a running async query. */
42
+ async cancelAsyncQuery(projectUuid, queryUuid) {
43
+ await this.http.post(`/projects/${projectUuid}/query/${encodeURIComponent(queryUuid)}/cancel`);
47
44
  }
48
45
  }
49
46
  exports.QueryClientV2 = QueryClientV2;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  const vitest_1 = require("vitest");
13
4
  const query_1 = require("./query");
@@ -22,7 +13,7 @@ const query_1 = require("./query");
22
13
  delete: vitest_1.vi.fn(),
23
14
  };
24
15
  });
25
- (0, vitest_1.it)('runMetricQuery should call POST /projects/{projectUuid}/query/metric-query with body', () => __awaiter(void 0, void 0, void 0, function* () {
16
+ (0, vitest_1.it)('runMetricQuery should call POST /projects/{projectUuid}/query/metric-query with body', async () => {
26
17
  const client = new query_1.QueryClientV2(mockHttp);
27
18
  const body = {
28
19
  exploreName: 'e1',
@@ -30,40 +21,40 @@ const query_1 = require("./query");
30
21
  };
31
22
  const results = { queryId: 'q1', status: 'running' };
32
23
  vitest_1.vi.mocked(mockHttp.post).mockResolvedValue(results);
33
- const result = yield client.runMetricQuery('p1', body);
24
+ const result = await client.runMetricQuery('p1', body);
34
25
  (0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/query/metric-query', body);
35
26
  (0, vitest_1.expect)(result).toEqual(results);
36
- }));
37
- (0, vitest_1.it)('runSqlQuery should call POST /projects/{projectUuid}/query/sql with body', () => __awaiter(void 0, void 0, void 0, function* () {
27
+ });
28
+ (0, vitest_1.it)('runSqlQuery should call POST /projects/{projectUuid}/query/sql with body', async () => {
38
29
  const client = new query_1.QueryClientV2(mockHttp);
39
30
  const body = { sql: 'SELECT 1' };
40
31
  const results = { queryId: 'q1', status: 'running' };
41
32
  vitest_1.vi.mocked(mockHttp.post).mockResolvedValue(results);
42
- const result = yield client.runSqlQuery('p1', body);
33
+ const result = await client.runSqlQuery('p1', body);
43
34
  (0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/query/sql', body);
44
35
  (0, vitest_1.expect)(result).toEqual(results);
45
- }));
46
- (0, vitest_1.it)('runChartQuery should call POST /projects/{projectUuid}/query/chart with body', () => __awaiter(void 0, void 0, void 0, function* () {
36
+ });
37
+ (0, vitest_1.it)('runChartQuery should call POST /projects/{projectUuid}/query/chart with body', async () => {
47
38
  const client = new query_1.QueryClientV2(mockHttp);
48
39
  const body = { chartUuid: 'c1' };
49
40
  const results = { queryId: 'q1', status: 'running' };
50
41
  vitest_1.vi.mocked(mockHttp.post).mockResolvedValue(results);
51
- const result = yield client.runChartQuery('p1', body);
42
+ const result = await client.runChartQuery('p1', body);
52
43
  (0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/query/chart', body);
53
44
  (0, vitest_1.expect)(result).toEqual(results);
54
- }));
55
- (0, vitest_1.it)('runDashboardChartQuery should call POST /projects/{projectUuid}/query/dashboard-chart with body', () => __awaiter(void 0, void 0, void 0, function* () {
45
+ });
46
+ (0, vitest_1.it)('runDashboardChartQuery should call POST /projects/{projectUuid}/query/dashboard-chart with body', async () => {
56
47
  const client = new query_1.QueryClientV2(mockHttp);
57
48
  const body = {
58
49
  dashboardChartUuid: 'dc1',
59
50
  };
60
51
  const results = { queryId: 'q1', status: 'running' };
61
52
  vitest_1.vi.mocked(mockHttp.post).mockResolvedValue(results);
62
- const result = yield client.runDashboardChartQuery('p1', body);
53
+ const result = await client.runDashboardChartQuery('p1', body);
63
54
  (0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/query/dashboard-chart', body);
64
55
  (0, vitest_1.expect)(result).toEqual(results);
65
- }));
66
- (0, vitest_1.it)('runUnderlyingDataQuery should call POST /projects/{projectUuid}/query/underlying-data with body', () => __awaiter(void 0, void 0, void 0, function* () {
56
+ });
57
+ (0, vitest_1.it)('runUnderlyingDataQuery should call POST /projects/{projectUuid}/query/underlying-data with body', async () => {
67
58
  const client = new query_1.QueryClientV2(mockHttp);
68
59
  const body = {
69
60
  exploreName: 'e1',
@@ -71,8 +62,24 @@ const query_1 = require("./query");
71
62
  };
72
63
  const results = { queryId: 'q1', status: 'running' };
73
64
  vitest_1.vi.mocked(mockHttp.post).mockResolvedValue(results);
74
- const result = yield client.runUnderlyingDataQuery('p1', body);
65
+ const result = await client.runUnderlyingDataQuery('p1', body);
75
66
  (0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/query/underlying-data', body);
76
67
  (0, vitest_1.expect)(result).toEqual(results);
77
- }));
68
+ });
69
+ (0, vitest_1.it)('getAsyncQueryResults should call GET /projects/{projectUuid}/query/{queryUuid}', async () => {
70
+ const client = new query_1.QueryClientV2(mockHttp);
71
+ const results = { queryUuid: 'q1', status: 'ready', rows: [] };
72
+ vitest_1.vi.mocked(mockHttp.get).mockResolvedValue(results);
73
+ const result = await client.getAsyncQueryResults('p1', 'q1', { page: 1, pageSize: 100 });
74
+ (0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/projects/p1/query/q1', {
75
+ params: { page: 1, pageSize: 100 },
76
+ });
77
+ (0, vitest_1.expect)(result).toEqual(results);
78
+ });
79
+ (0, vitest_1.it)('cancelAsyncQuery should call POST /projects/{projectUuid}/query/{queryUuid}/cancel', async () => {
80
+ const client = new query_1.QueryClientV2(mockHttp);
81
+ vitest_1.vi.mocked(mockHttp.post).mockResolvedValue(undefined);
82
+ await client.cancelAsyncQuery('p1', 'q1');
83
+ (0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/query/q1/cancel');
84
+ });
78
85
  });
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Validation API client (v2). Paginated validation results with search, filter, and sort support.
3
+ */
4
+ import { BaseApiClient } from '../base-client';
5
+ import type { components } from '@lightdash-tools/common';
6
+ /** Query params for listing validation results (v2). */
7
+ export interface ListValidationResultsParams {
8
+ page?: number;
9
+ pageSize?: number;
10
+ searchQuery?: string;
11
+ sortBy?: 'createdAt' | 'errorType' | 'name' | 'source';
12
+ sortDirection?: 'asc' | 'desc';
13
+ sourceTypes?: string;
14
+ errorTypes?: string;
15
+ includeChartConfigWarnings?: boolean;
16
+ fromSettings?: boolean;
17
+ }
18
+ export declare class ValidationClientV2 extends BaseApiClient {
19
+ /**
20
+ * List validation results for a project (v2 endpoint).
21
+ * Returns paginated results with search, filter, and sort support.
22
+ */
23
+ listValidationResults(projectUuid: string, params?: ListValidationResultsParams): Promise<components['schemas']['ApiPaginatedValidateResponse']>;
24
+ /**
25
+ * Get a single validation result by ID (v2 endpoint).
26
+ */
27
+ getValidationResult(projectUuid: string, validationId: number): Promise<components['schemas']['ApiSingleValidationResponse']>;
28
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /**
3
+ * Validation API client (v2). Paginated validation results with search, filter, and sort support.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ValidationClientV2 = void 0;
7
+ const base_client_1 = require("../base-client");
8
+ class ValidationClientV2 extends base_client_1.BaseApiClient {
9
+ /**
10
+ * List validation results for a project (v2 endpoint).
11
+ * Returns paginated results with search, filter, and sort support.
12
+ */
13
+ async listValidationResults(projectUuid, params) {
14
+ return this.http.get(`/projects/${projectUuid}/validate`, { params });
15
+ }
16
+ /**
17
+ * Get a single validation result by ID (v2 endpoint).
18
+ */
19
+ async getValidationResult(projectUuid, validationId) {
20
+ return this.http.get(`/projects/${projectUuid}/validate/${validationId}`);
21
+ }
22
+ }
23
+ exports.ValidationClientV2 = ValidationClientV2;
package/dist/client.d.ts CHANGED
@@ -1,27 +1,32 @@
1
1
  /**
2
2
  * Main Lightdash API client. Configuration can be explicit or loaded from environment variables.
3
3
  */
4
- import type { PartialLightdashClientConfig } from './config';
5
- import { HttpClient } from './http/http-client';
6
- import { ProjectsClient } from './api/v1/projects';
7
- import { OrganizationsClient } from './api/v1/organizations';
4
+ import { AiAgentsClient } from './api/v1/ai-agents';
5
+ import { AnalyticsClient } from './api/v1/analytics';
8
6
  import { ChartsClient } from './api/v1/charts';
9
7
  import { DashboardsClient } from './api/v1/dashboards';
10
- import { SpacesClient } from './api/v1/spaces';
11
- import { QueryClient } from './api/v1/query';
12
- import { QueryClientV2 } from './api/v2/query';
13
- import { OrganizationRolesClient } from './api/v2/organization-roles';
14
- import { ProjectRoleAssignmentsClient } from './api/v2/project-role-assignments';
15
- import { UsersClient } from './api/v1/users';
16
- import { GroupsClient } from './api/v1/groups';
17
- import { AiAgentsClient } from './api/v1/ai-agents';
18
- import { ProjectAccessClient } from './api/v1/project-access';
19
8
  import { ExploresClient } from './api/v1/explores';
20
- import { ValidationClient } from './api/v1/validation';
9
+ import { GroupsClient } from './api/v1/groups';
21
10
  import { MetricsClient } from './api/v1/metrics';
11
+ import { OrganizationsClient } from './api/v1/organizations';
12
+ import { ProjectAccessClient } from './api/v1/project-access';
13
+ import { ProjectsClient } from './api/v1/projects';
14
+ import { QueryClient } from './api/v1/query';
22
15
  import { SchedulersClient } from './api/v1/schedulers';
16
+ import { SpacesClient } from './api/v1/spaces';
23
17
  import { TagsClient } from './api/v1/tags';
18
+ import { UsersClient } from './api/v1/users';
19
+ import { ValidationClient } from './api/v1/validation';
20
+ import { ChartsClientV2 } from './api/v2/charts';
24
21
  import { ContentClient } from './api/v2/content';
22
+ import { DashboardsClientV2 } from './api/v2/dashboards';
23
+ import { OrganizationRolesClient } from './api/v2/organization-roles';
24
+ import { ParametersClientV2 } from './api/v2/parameters';
25
+ import { ProjectRoleAssignmentsClient } from './api/v2/project-role-assignments';
26
+ import { QueryClientV2 } from './api/v2/query';
27
+ import { ValidationClientV2 } from './api/v2/validation';
28
+ import { HttpClient } from './http/http-client';
29
+ import type { PartialLightdashClientConfig } from './config';
25
30
  /**
26
31
  * V1 API clients namespace. Contains all v1 API clients.
27
32
  */
@@ -41,6 +46,7 @@ export declare class V1ApiClients {
41
46
  readonly metrics: MetricsClient;
42
47
  readonly schedulers: SchedulersClient;
43
48
  readonly tags: TagsClient;
49
+ readonly analytics: AnalyticsClient;
44
50
  constructor(http: HttpClient);
45
51
  }
46
52
  /**
@@ -51,6 +57,10 @@ export declare class V2ApiClients {
51
57
  readonly organizationRoles: OrganizationRolesClient;
52
58
  readonly projectRoleAssignments: ProjectRoleAssignmentsClient;
53
59
  readonly content: ContentClient;
60
+ readonly validation: ValidationClientV2;
61
+ readonly dashboards: DashboardsClientV2;
62
+ readonly charts: ChartsClientV2;
63
+ readonly parameters: ParametersClientV2;
54
64
  constructor(http: HttpClient);
55
65
  }
56
66
  /**
package/dist/client.js CHANGED
@@ -4,29 +4,34 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.LightdashClient = exports.V2ApiClients = exports.V1ApiClients = void 0;
7
- const env_1 = require("./utils/env");
8
- const axios_client_1 = require("./http/axios-client");
9
- const rate_limiter_1 = require("./http/rate-limiter");
10
- const http_client_1 = require("./http/http-client");
11
- const projects_1 = require("./api/v1/projects");
12
- const organizations_1 = require("./api/v1/organizations");
7
+ const ai_agents_1 = require("./api/v1/ai-agents");
8
+ const analytics_1 = require("./api/v1/analytics");
13
9
  const charts_1 = require("./api/v1/charts");
14
10
  const dashboards_1 = require("./api/v1/dashboards");
15
- const spaces_1 = require("./api/v1/spaces");
16
- const query_1 = require("./api/v1/query");
17
- const query_2 = require("./api/v2/query");
18
- const organization_roles_1 = require("./api/v2/organization-roles");
19
- const project_role_assignments_1 = require("./api/v2/project-role-assignments");
20
- const users_1 = require("./api/v1/users");
21
- const groups_1 = require("./api/v1/groups");
22
- const ai_agents_1 = require("./api/v1/ai-agents");
23
- const project_access_1 = require("./api/v1/project-access");
24
11
  const explores_1 = require("./api/v1/explores");
25
- const validation_1 = require("./api/v1/validation");
12
+ const groups_1 = require("./api/v1/groups");
26
13
  const metrics_1 = require("./api/v1/metrics");
14
+ const organizations_1 = require("./api/v1/organizations");
15
+ const project_access_1 = require("./api/v1/project-access");
16
+ const projects_1 = require("./api/v1/projects");
17
+ const query_1 = require("./api/v1/query");
27
18
  const schedulers_1 = require("./api/v1/schedulers");
19
+ const spaces_1 = require("./api/v1/spaces");
28
20
  const tags_1 = require("./api/v1/tags");
21
+ const users_1 = require("./api/v1/users");
22
+ const validation_1 = require("./api/v1/validation");
23
+ const charts_2 = require("./api/v2/charts");
29
24
  const content_1 = require("./api/v2/content");
25
+ const dashboards_2 = require("./api/v2/dashboards");
26
+ const organization_roles_1 = require("./api/v2/organization-roles");
27
+ const parameters_1 = require("./api/v2/parameters");
28
+ const project_role_assignments_1 = require("./api/v2/project-role-assignments");
29
+ const query_2 = require("./api/v2/query");
30
+ const validation_2 = require("./api/v2/validation");
31
+ const axios_client_1 = require("./http/axios-client");
32
+ const http_client_1 = require("./http/http-client");
33
+ const rate_limiter_1 = require("./http/rate-limiter");
34
+ const env_1 = require("./utils/env");
30
35
  /**
31
36
  * V1 API clients namespace. Contains all v1 API clients.
32
37
  */
@@ -47,6 +52,7 @@ class V1ApiClients {
47
52
  this.metrics = new metrics_1.MetricsClient(http);
48
53
  this.schedulers = new schedulers_1.SchedulersClient(http);
49
54
  this.tags = new tags_1.TagsClient(http);
55
+ this.analytics = new analytics_1.AnalyticsClient(http);
50
56
  }
51
57
  }
52
58
  exports.V1ApiClients = V1ApiClients;
@@ -59,6 +65,10 @@ class V2ApiClients {
59
65
  this.organizationRoles = new organization_roles_1.OrganizationRolesClient(http);
60
66
  this.projectRoleAssignments = new project_role_assignments_1.ProjectRoleAssignmentsClient(http);
61
67
  this.content = new content_1.ContentClient(http);
68
+ this.validation = new validation_2.ValidationClientV2(http);
69
+ this.dashboards = new dashboards_2.DashboardsClientV2(http);
70
+ this.charts = new charts_2.ChartsClientV2(http);
71
+ this.parameters = new parameters_1.ParametersClientV2(http);
62
72
  }
63
73
  }
64
74
  exports.V2ApiClients = V2ApiClients;
@@ -37,6 +37,8 @@ const client_1 = require("./client");
37
37
  const client = new client_1.LightdashClient(config);
38
38
  (0, vitest_1.expect)(client.v2).toBeDefined();
39
39
  (0, vitest_1.expect)(client.v2.query).toBeDefined();
40
+ (0, vitest_1.expect)(client.v2.charts).toBeDefined();
41
+ (0, vitest_1.expect)(client.v2.parameters).toBeDefined();
40
42
  });
41
43
  (0, vitest_1.it)('v2.query.runMetricQuery should be a function', () => {
42
44
  const client = new client_1.LightdashClient(config);