@lightdash-tools/client 0.13.1 → 0.14.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.
@@ -2,7 +2,8 @@
2
2
  * Projects API client. Endpoints for project and project-scoped resources.
3
3
  */
4
4
  import { BaseApiClient } from '../base-client';
5
- import type { Project, OrganizationProject, SpaceQuery } from '@lightdash-tools/common';
5
+ import type { Project, OrganizationProject, SpaceQuery, components } from '@lightdash-tools/common';
6
+ export type VerifiedContentListItem = components['schemas']['VerifiedContentListItem'];
6
7
  export declare class ProjectsClient extends BaseApiClient {
7
8
  /** Get a project by UUID. */
8
9
  getProject(projectUuid: string): Promise<Project>;
@@ -10,4 +11,6 @@ export declare class ProjectsClient extends BaseApiClient {
10
11
  listProjects(): Promise<OrganizationProject[]>;
11
12
  /** List charts in a project. */
12
13
  listChartsInProject(projectUuid: string): Promise<SpaceQuery[]>;
14
+ /** List admin-verified charts and dashboards in a project. */
15
+ listVerifiedContent(projectUuid: string): Promise<VerifiedContentListItem[]>;
13
16
  }
@@ -18,5 +18,9 @@ class ProjectsClient extends base_client_1.BaseApiClient {
18
18
  async listChartsInProject(projectUuid) {
19
19
  return this.http.get(`/projects/${projectUuid}/charts`);
20
20
  }
21
+ /** List admin-verified charts and dashboards in a project. */
22
+ async listVerifiedContent(projectUuid) {
23
+ return this.http.get(`/projects/${projectUuid}/content-verification`);
24
+ }
21
25
  }
22
26
  exports.ProjectsClient = ProjectsClient;
@@ -37,4 +37,28 @@ const projects_1 = require("./projects");
37
37
  (0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/projects/p1/charts');
38
38
  (0, vitest_1.expect)(result).toEqual(charts);
39
39
  });
40
+ (0, vitest_1.it)('listVerifiedContent should call GET /projects/{projectUuid}/content-verification', async () => {
41
+ const client = new projects_1.ProjectsClient(mockHttp);
42
+ const items = [
43
+ {
44
+ contentType: 'chart',
45
+ uuid: 'c1',
46
+ contentUuid: 'c1',
47
+ name: 'Verified chart',
48
+ description: null,
49
+ spaceUuid: 's1',
50
+ spaceName: 'Space',
51
+ views: 10,
52
+ lastUpdatedAt: null,
53
+ verifiedAt: '2026-01-01T00:00:00.000Z',
54
+ verifiedBy: { userUuid: 'u1', firstName: 'Ada', lastName: 'Lovelace' },
55
+ chartKind: 'vertical_bar',
56
+ exploreName: 'orders',
57
+ },
58
+ ];
59
+ vitest_1.vi.mocked(mockHttp.get).mockResolvedValue(items);
60
+ const result = await client.listVerifiedContent('p1');
61
+ (0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/projects/p1/content-verification');
62
+ (0, vitest_1.expect)(result).toEqual(items);
63
+ });
40
64
  });
@@ -15,8 +15,3 @@ export declare function createAxiosInstanceV1(config: ResolvedLightdashClientCon
15
15
  * Creates a configured Axios instance for the Lightdash API v2.
16
16
  */
17
17
  export declare function createAxiosInstanceV2(config: ResolvedLightdashClientConfig): AxiosInstance;
18
- /**
19
- * Creates a configured Axios instance for the Lightdash API v1.
20
- * @deprecated Use `createAxiosInstanceV1` instead. This function is kept for backward compatibility.
21
- */
22
- export declare function createAxiosInstance(config: ResolvedLightdashClientConfig): AxiosInstance;
@@ -8,7 +8,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.createAxiosInstanceV1 = createAxiosInstanceV1;
10
10
  exports.createAxiosInstanceV2 = createAxiosInstanceV2;
11
- exports.createAxiosInstance = createAxiosInstance;
12
11
  const axios_1 = __importDefault(require("axios"));
13
12
  const config_1 = require("../config");
14
13
  const interceptors_1 = require("./interceptors");
@@ -42,10 +41,3 @@ function createAxiosInstanceV1(config) {
42
41
  function createAxiosInstanceV2(config) {
43
42
  return createAxiosInstanceForVersion(config, 'v2');
44
43
  }
45
- /**
46
- * Creates a configured Axios instance for the Lightdash API v1.
47
- * @deprecated Use `createAxiosInstanceV1` instead. This function is kept for backward compatibility.
48
- */
49
- function createAxiosInstance(config) {
50
- return createAxiosInstanceV1(config);
51
- }
package/dist/index.d.ts CHANGED
@@ -37,8 +37,8 @@ export { DEFAULT_BINARY_MAX_BYTES, isBlockedBinaryHostname, type GetBytesOptions
37
37
  export { loadConfigFromEnv, mergeConfig, createBearerConfig } from './utils/env';
38
38
  export { ENV_LIGHTDASH_API_KEY, ENV_LIGHTDASH_URL, ENV_LIGHTDASH_PROXY_AUTHORIZATION, } from './utils/env';
39
39
  export { HttpClient } from './http/http-client';
40
- export { isApiSuccessEnvelope, unwrapApiSuccessResults, type ApiEnvelope, type ApiErrorEnvelope, type ApiSuccessEnvelope, } from './http/unwrap-api-success';
40
+ export { isApiSuccessEnvelope, type ApiEnvelope, type ApiErrorEnvelope, type ApiSuccessEnvelope, } from './http/unwrap-api-success';
41
41
  export { RateLimiter } from './http/rate-limiter';
42
42
  export { SecretString } from './utils/secret-string';
43
- export type { ApiResponseOk, ApiResponseError, ApiResponseBody, ApiError } from './types/api';
43
+ export type { ApiError } from './types/api';
44
44
  export type { paths, components, operations } from './types/api';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SecretString = exports.RateLimiter = exports.unwrapApiSuccessResults = exports.isApiSuccessEnvelope = exports.HttpClient = exports.ENV_LIGHTDASH_PROXY_AUTHORIZATION = exports.ENV_LIGHTDASH_URL = exports.ENV_LIGHTDASH_API_KEY = exports.createBearerConfig = exports.mergeConfig = exports.loadConfigFromEnv = exports.isBlockedBinaryHostname = exports.DEFAULT_BINARY_MAX_BYTES = exports.CHART_IMAGE_MAX_BYTES = exports.CHART_IMAGE_EXPORT_TIMEOUT_MS = exports.CONTRACT_ERROR_MESSAGE = exports.CONTRACT_ERROR_NAME = exports.ChartImageSizeError = exports.NetworkError = exports.RateLimitError = exports.LightdashApiError = exports.DEFAULT_RETRY = exports.DEFAULT_TIMEOUT = exports.DEFAULT_RATE_LIMIT = exports.consoleLogger = exports.noopLogger = exports.DashboardsClientV2 = exports.ChartsClientV2 = exports.ContentClient = exports.AnalyticsClient = exports.TagsClient = exports.SchedulersClient = exports.MetricsClient = exports.ValidationClientV2 = exports.ValidationClient = exports.ProjectAccessClient = exports.AiAgentsClient = exports.ProjectRoleAssignmentsClient = exports.OrganizationRolesClient = exports.GroupsClient = exports.UsersClient = exports.resolveEvaluationRun = exports.applyBundleDiff = exports.fetchBundleCurrentState = exports.V2ApiClients = exports.V1ApiClients = exports.LightdashClient = void 0;
3
+ exports.SecretString = exports.RateLimiter = exports.isApiSuccessEnvelope = exports.HttpClient = exports.ENV_LIGHTDASH_PROXY_AUTHORIZATION = exports.ENV_LIGHTDASH_URL = exports.ENV_LIGHTDASH_API_KEY = exports.createBearerConfig = exports.mergeConfig = exports.loadConfigFromEnv = exports.isBlockedBinaryHostname = exports.DEFAULT_BINARY_MAX_BYTES = exports.CHART_IMAGE_MAX_BYTES = exports.CHART_IMAGE_EXPORT_TIMEOUT_MS = exports.CONTRACT_ERROR_MESSAGE = exports.CONTRACT_ERROR_NAME = exports.ChartImageSizeError = exports.NetworkError = exports.RateLimitError = exports.LightdashApiError = exports.DEFAULT_RETRY = exports.DEFAULT_TIMEOUT = exports.DEFAULT_RATE_LIMIT = exports.consoleLogger = exports.noopLogger = exports.DashboardsClientV2 = exports.ChartsClientV2 = exports.ContentClient = exports.AnalyticsClient = exports.TagsClient = exports.SchedulersClient = exports.MetricsClient = exports.ValidationClientV2 = exports.ValidationClient = exports.ProjectAccessClient = exports.AiAgentsClient = exports.ProjectRoleAssignmentsClient = exports.OrganizationRolesClient = exports.GroupsClient = exports.UsersClient = exports.resolveEvaluationRun = exports.applyBundleDiff = exports.fetchBundleCurrentState = exports.V2ApiClients = exports.V1ApiClients = exports.LightdashClient = void 0;
4
4
  var client_1 = require("./client");
5
5
  Object.defineProperty(exports, "LightdashClient", { enumerable: true, get: function () { return client_1.LightdashClient; } });
6
6
  Object.defineProperty(exports, "V1ApiClients", { enumerable: true, get: function () { return client_1.V1ApiClients; } });
@@ -71,7 +71,6 @@ var http_client_2 = require("./http/http-client");
71
71
  Object.defineProperty(exports, "HttpClient", { enumerable: true, get: function () { return http_client_2.HttpClient; } });
72
72
  var unwrap_api_success_1 = require("./http/unwrap-api-success");
73
73
  Object.defineProperty(exports, "isApiSuccessEnvelope", { enumerable: true, get: function () { return unwrap_api_success_1.isApiSuccessEnvelope; } });
74
- Object.defineProperty(exports, "unwrapApiSuccessResults", { enumerable: true, get: function () { return unwrap_api_success_1.unwrapApiSuccessResults; } });
75
74
  var rate_limiter_1 = require("./http/rate-limiter");
76
75
  Object.defineProperty(exports, "RateLimiter", { enumerable: true, get: function () { return rate_limiter_1.RateLimiter; } });
77
76
  var secret_string_1 = require("./utils/secret-string");
@@ -1,22 +1,11 @@
1
1
  /**
2
- * Helper types for Lightdash API. Re-exports generated OpenAPI types and adds response helpers.
2
+ * Helper types for Lightdash API. Re-exports generated OpenAPI types.
3
3
  *
4
4
  * Note: Domain models (Project, Organization, etc.) are available from @lightdash-tools/common.
5
- * Use this module for advanced types (paths, components, operations) or response helpers.
5
+ * Use this module for advanced types (paths, components, operations).
6
+ * Response envelopes live in `http/unwrap-api-success` (re-exported from the package root).
6
7
  */
7
8
  import type { components } from '@lightdash-tools/common';
8
9
  export type { paths, components, operations } from '@lightdash-tools/common';
9
10
  /** API error schema from OpenAPI. */
10
11
  export type ApiError = components['schemas']['ApiErrorPayload'];
11
- /** Successful API response wrapper (status ok + results). */
12
- export interface ApiResponseOk<T> {
13
- status: 'ok';
14
- results: T;
15
- }
16
- /** Failed API response wrapper (status error + error). */
17
- export interface ApiResponseError {
18
- status: 'error';
19
- error: ApiError['error'];
20
- }
21
- /** Discriminated union for API response body. */
22
- export type ApiResponseBody<T> = ApiResponseError | ApiResponseOk<T>;
package/dist/types/api.js CHANGED
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  /**
3
- * Helper types for Lightdash API. Re-exports generated OpenAPI types and adds response helpers.
3
+ * Helper types for Lightdash API. Re-exports generated OpenAPI types.
4
4
  *
5
5
  * Note: Domain models (Project, Organization, etc.) are available from @lightdash-tools/common.
6
- * Use this module for advanced types (paths, components, operations) or response helpers.
6
+ * Use this module for advanced types (paths, components, operations).
7
+ * Response envelopes live in `http/unwrap-api-success` (re-exported from the package root).
7
8
  */
8
9
  Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash-tools/client",
3
- "version": "0.13.1",
3
+ "version": "0.14.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.13.1"
18
+ "@lightdash-tools/common": "0.14.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/node": "^25.9.3"
@@ -43,4 +43,29 @@ describe('ProjectsClient', () => {
43
43
  expect(mockHttp.get).toHaveBeenCalledWith('/projects/p1/charts');
44
44
  expect(result).toEqual(charts);
45
45
  });
46
+
47
+ it('listVerifiedContent should call GET /projects/{projectUuid}/content-verification', async () => {
48
+ const client = new ProjectsClient(mockHttp);
49
+ const items = [
50
+ {
51
+ contentType: 'chart' as const,
52
+ uuid: 'c1',
53
+ contentUuid: 'c1',
54
+ name: 'Verified chart',
55
+ description: null,
56
+ spaceUuid: 's1',
57
+ spaceName: 'Space',
58
+ views: 10,
59
+ lastUpdatedAt: null,
60
+ verifiedAt: '2026-01-01T00:00:00.000Z',
61
+ verifiedBy: { userUuid: 'u1', firstName: 'Ada', lastName: 'Lovelace' },
62
+ chartKind: 'vertical_bar' as const,
63
+ exploreName: 'orders',
64
+ },
65
+ ];
66
+ vi.mocked(mockHttp.get).mockResolvedValue(items);
67
+ const result = await client.listVerifiedContent('p1');
68
+ expect(mockHttp.get).toHaveBeenCalledWith('/projects/p1/content-verification');
69
+ expect(result).toEqual(items);
70
+ });
46
71
  });
@@ -4,7 +4,9 @@
4
4
 
5
5
  import { BaseApiClient } from '../base-client';
6
6
 
7
- import type { Project, OrganizationProject, SpaceQuery } from '@lightdash-tools/common';
7
+ import type { Project, OrganizationProject, SpaceQuery, components } from '@lightdash-tools/common';
8
+
9
+ export type VerifiedContentListItem = components['schemas']['VerifiedContentListItem'];
8
10
 
9
11
  export class ProjectsClient extends BaseApiClient {
10
12
  /** Get a project by UUID. */
@@ -21,4 +23,11 @@ export class ProjectsClient extends BaseApiClient {
21
23
  async listChartsInProject(projectUuid: string): Promise<SpaceQuery[]> {
22
24
  return this.http.get<SpaceQuery[]>(`/projects/${projectUuid}/charts`);
23
25
  }
26
+
27
+ /** List admin-verified charts and dashboards in a project. */
28
+ async listVerifiedContent(projectUuid: string): Promise<VerifiedContentListItem[]> {
29
+ return this.http.get<VerifiedContentListItem[]>(
30
+ `/projects/${projectUuid}/content-verification`,
31
+ );
32
+ }
24
33
  }
@@ -52,11 +52,3 @@ export function createAxiosInstanceV1(config: ResolvedLightdashClientConfig): Ax
52
52
  export function createAxiosInstanceV2(config: ResolvedLightdashClientConfig): AxiosInstance {
53
53
  return createAxiosInstanceForVersion(config, 'v2');
54
54
  }
55
-
56
- /**
57
- * Creates a configured Axios instance for the Lightdash API v1.
58
- * @deprecated Use `createAxiosInstanceV1` instead. This function is kept for backward compatibility.
59
- */
60
- export function createAxiosInstance(config: ResolvedLightdashClientConfig): AxiosInstance {
61
- return createAxiosInstanceV1(config);
62
- }
package/src/index.ts CHANGED
@@ -93,12 +93,11 @@ export {
93
93
  export { HttpClient } from './http/http-client';
94
94
  export {
95
95
  isApiSuccessEnvelope,
96
- unwrapApiSuccessResults,
97
96
  type ApiEnvelope,
98
97
  type ApiErrorEnvelope,
99
98
  type ApiSuccessEnvelope,
100
99
  } from './http/unwrap-api-success';
101
100
  export { RateLimiter } from './http/rate-limiter';
102
101
  export { SecretString } from './utils/secret-string';
103
- export type { ApiResponseOk, ApiResponseError, ApiResponseBody, ApiError } from './types/api';
102
+ export type { ApiError } from './types/api';
104
103
  export type { paths, components, operations } from './types/api';
package/src/types/api.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  /**
2
- * Helper types for Lightdash API. Re-exports generated OpenAPI types and adds response helpers.
2
+ * Helper types for Lightdash API. Re-exports generated OpenAPI types.
3
3
  *
4
4
  * Note: Domain models (Project, Organization, etc.) are available from @lightdash-tools/common.
5
- * Use this module for advanced types (paths, components, operations) or response helpers.
5
+ * Use this module for advanced types (paths, components, operations).
6
+ * Response envelopes live in `http/unwrap-api-success` (re-exported from the package root).
6
7
  */
7
8
 
8
9
  import type { components } from '@lightdash-tools/common';
@@ -11,18 +12,3 @@ export type { paths, components, operations } from '@lightdash-tools/common';
11
12
 
12
13
  /** API error schema from OpenAPI. */
13
14
  export type ApiError = components['schemas']['ApiErrorPayload'];
14
-
15
- /** Successful API response wrapper (status ok + results). */
16
- export interface ApiResponseOk<T> {
17
- status: 'ok';
18
- results: T;
19
- }
20
-
21
- /** Failed API response wrapper (status error + error). */
22
- export interface ApiResponseError {
23
- status: 'error';
24
- error: ApiError['error'];
25
- }
26
-
27
- /** Discriminated union for API response body. */
28
- export type ApiResponseBody<T> = ApiResponseError | ApiResponseOk<T>;