@lightdash-tools/client 0.7.0 → 0.9.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.
- package/dist/api/v1/ai-agents/discovery.d.ts +7 -2
- package/dist/api/v1/ai-agents/discovery.js +3 -6
- package/dist/api/v1/ai-agents/discovery.test.js +17 -1
- package/dist/api/v1/ai-agents/facade.d.ts +5 -0
- package/dist/api/v1/ai-agents/facade.js +5 -2
- package/dist/api/v1/charts.d.ts +28 -1
- package/dist/api/v1/charts.js +51 -1
- package/dist/api/v1/charts.test.js +59 -6
- package/dist/api/v1/dashboards.d.ts +32 -1
- package/dist/api/v1/dashboards.js +20 -0
- package/dist/api/v1/dashboards.test.js +72 -0
- package/dist/api/v1/validation.d.ts +5 -1
- package/dist/api/v1/validation.js +8 -0
- package/dist/api/v1/validation.test.js +16 -0
- package/dist/api/v2/charts.d.ts +12 -0
- package/dist/api/v2/charts.js +18 -0
- package/dist/api/v2/charts.test.d.ts +4 -0
- package/dist/api/v2/charts.test.js +45 -0
- package/dist/api/v2/content.d.ts +19 -2
- package/dist/api/v2/content.js +15 -0
- package/dist/api/v2/content.test.js +41 -0
- package/dist/api/v2/dashboards.d.ts +7 -1
- package/dist/api/v2/dashboards.js +9 -1
- package/dist/api/v2/dashboards.test.js +34 -0
- package/dist/api/v2/parameters.d.ts +20 -0
- package/dist/api/v2/parameters.js +22 -0
- package/dist/api/v2/parameters.test.d.ts +4 -0
- package/dist/api/v2/parameters.test.js +39 -0
- package/dist/api/v2/query.d.ts +16 -1
- package/dist/api/v2/query.js +16 -0
- package/dist/api/v2/query.test.js +16 -0
- package/dist/client.d.ts +4 -0
- package/dist/client.js +4 -0
- package/dist/client.test.js +2 -0
- package/dist/errors.d.ts +22 -0
- package/dist/errors.js +37 -1
- package/dist/http/http-client.binary-url.test.d.ts +4 -0
- package/dist/http/http-client.binary-url.test.js +61 -0
- package/dist/http/http-client.d.ts +23 -11
- package/dist/http/http-client.envelope.test.d.ts +4 -0
- package/dist/http/http-client.envelope.test.js +59 -0
- package/dist/http/http-client.js +155 -6
- package/dist/http/unwrap-api-success.d.ts +26 -0
- package/dist/http/unwrap-api-success.js +25 -0
- package/dist/http/unwrap-api-success.test.d.ts +1 -0
- package/dist/http/unwrap-api-success.test.js +19 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.js +17 -3
- package/package.json +2 -2
- package/src/api/v1/ai-agents/discovery.test.ts +19 -1
- package/src/api/v1/ai-agents/discovery.ts +17 -3
- package/src/api/v1/ai-agents/facade.ts +17 -1
- package/src/api/v1/charts.test.ts +61 -1
- package/src/api/v1/charts.ts +68 -0
- package/src/api/v1/dashboards.test.ts +85 -0
- package/src/api/v1/dashboards.ts +86 -0
- package/src/api/v1/validation.test.ts +18 -0
- package/src/api/v1/validation.ts +21 -1
- package/src/api/v2/charts.test.ts +53 -0
- package/src/api/v2/charts.ts +23 -0
- package/src/api/v2/content.test.ts +45 -0
- package/src/api/v2/content.ts +35 -2
- package/src/api/v2/dashboards.test.ts +39 -0
- package/src/api/v2/dashboards.ts +23 -1
- package/src/api/v2/parameters.test.ts +45 -0
- package/src/api/v2/parameters.ts +38 -0
- package/src/api/v2/query.test.ts +18 -0
- package/src/api/v2/query.ts +53 -0
- package/src/client.test.ts +2 -0
- package/src/client.ts +6 -0
- package/src/errors.ts +46 -0
- package/src/http/http-client.binary-url.test.ts +88 -0
- package/src/http/http-client.envelope.test.ts +74 -0
- package/src/http/http-client.ts +194 -16
- package/src/http/unwrap-api-success.test.ts +23 -0
- package/src/http/unwrap-api-success.ts +40 -0
- package/src/index.ts +40 -2
package/dist/api/v2/content.d.ts
CHANGED
|
@@ -2,20 +2,37 @@
|
|
|
2
2
|
* Content API client (v2).
|
|
3
3
|
*/
|
|
4
4
|
import { BaseApiClient } from '../base-client';
|
|
5
|
-
import type { LightdashApi } from '@lightdash-tools/common';
|
|
5
|
+
import type { components, LightdashApi } from '@lightdash-tools/common';
|
|
6
6
|
/** Query params for searching content. */
|
|
7
7
|
export interface SearchContentParams {
|
|
8
8
|
projectUuids?: string[];
|
|
9
9
|
spaceUuids?: string[];
|
|
10
|
+
/** Exact content UUID filter (OpenAPI List content `uuids`). */
|
|
11
|
+
uuids?: string[];
|
|
10
12
|
parentSpaceUuid?: string;
|
|
11
|
-
contentTypes?: ('chart' | 'dashboard' | 'space')[];
|
|
13
|
+
contentTypes?: ('chart' | 'dashboard' | 'data_app' | 'space')[];
|
|
12
14
|
pageSize?: number;
|
|
13
15
|
page?: number;
|
|
14
16
|
search?: string;
|
|
15
17
|
sortBy?: LightdashApi.Content.ContentSortByColumns;
|
|
16
18
|
sortDirection?: 'asc' | 'desc';
|
|
17
19
|
}
|
|
20
|
+
/** Body for moving a single content item (chart, dashboard, or space) to another space. */
|
|
21
|
+
export type MoveContentBody = components['schemas']['ApiContentActionBody_ContentActionMove_'];
|
|
22
|
+
/** Body for moving multiple content items (charts, dashboards, spaces) to another space. */
|
|
23
|
+
export type BulkMoveContentBody = components['schemas']['ApiContentBulkActionBody_ContentActionMove_'];
|
|
24
|
+
/** Body for permanently deleting soft-deleted content (irrecoverable). */
|
|
25
|
+
export type PermanentlyDeleteContentBody = components['schemas']['ApiPermanentlyDeleteContentBody'];
|
|
18
26
|
export declare class ContentClient extends BaseApiClient {
|
|
19
27
|
/** Search project content (charts, dashboards, spaces). */
|
|
20
28
|
searchContent(params?: SearchContentParams): Promise<LightdashApi.Content.ApiContentResponse>;
|
|
29
|
+
/** Move a single content item (chart, dashboard, or space) to another space. */
|
|
30
|
+
moveContent(projectUuid: string, body: MoveContentBody): Promise<void>;
|
|
31
|
+
/** Move multiple content items (charts, dashboards, spaces) to another space in one call. */
|
|
32
|
+
bulkMoveContent(projectUuid: string, body: BulkMoveContentBody): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Permanently delete soft-deleted content (irrecoverable).
|
|
35
|
+
* Not exposed on MCP — use typed client only (ADR-0015).
|
|
36
|
+
*/
|
|
37
|
+
permanentlyDeleteContent(projectUuid: string, body: PermanentlyDeleteContentBody): Promise<void>;
|
|
21
38
|
}
|
package/dist/api/v2/content.js
CHANGED
|
@@ -12,5 +12,20 @@ class ContentClient extends base_client_1.BaseApiClient {
|
|
|
12
12
|
params,
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
+
/** Move a single content item (chart, dashboard, or space) to another space. */
|
|
16
|
+
async moveContent(projectUuid, body) {
|
|
17
|
+
await this.http.post(`/content/${projectUuid}/move`, body);
|
|
18
|
+
}
|
|
19
|
+
/** Move multiple content items (charts, dashboards, spaces) to another space in one call. */
|
|
20
|
+
async bulkMoveContent(projectUuid, body) {
|
|
21
|
+
await this.http.post(`/content/bulk-action/${projectUuid}/move`, body);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Permanently delete soft-deleted content (irrecoverable).
|
|
25
|
+
* Not exposed on MCP — use typed client only (ADR-0015).
|
|
26
|
+
*/
|
|
27
|
+
async permanentlyDeleteContent(projectUuid, body) {
|
|
28
|
+
await this.http.delete(`/content/${projectUuid}/permanent`, { data: body });
|
|
29
|
+
}
|
|
15
30
|
}
|
|
16
31
|
exports.ContentClient = ContentClient;
|
|
@@ -23,4 +23,45 @@ const content_1 = require("./content");
|
|
|
23
23
|
});
|
|
24
24
|
(0, vitest_1.expect)(result).toEqual(mockResponse);
|
|
25
25
|
});
|
|
26
|
+
(0, vitest_1.it)('searchContent passes exact uuids filter', async () => {
|
|
27
|
+
const client = new content_1.ContentClient(mockHttp);
|
|
28
|
+
vitest_1.vi.mocked(mockHttp.get).mockResolvedValue({ status: 'ok', results: [] });
|
|
29
|
+
await client.searchContent({
|
|
30
|
+
projectUuids: ['p1'],
|
|
31
|
+
uuids: ['c1'],
|
|
32
|
+
pageSize: 50,
|
|
33
|
+
});
|
|
34
|
+
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/content', {
|
|
35
|
+
params: { projectUuids: ['p1'], uuids: ['c1'], pageSize: 50 },
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
(0, vitest_1.it)('moveContent should call POST /content/{projectUuid}/move with body', async () => {
|
|
39
|
+
const client = new content_1.ContentClient(mockHttp);
|
|
40
|
+
const body = {
|
|
41
|
+
action: { type: 'move', targetSpaceUuid: 's2' },
|
|
42
|
+
item: { source: 'dbt_explore', contentType: 'chart', uuid: 'c1' },
|
|
43
|
+
};
|
|
44
|
+
vitest_1.vi.mocked(mockHttp.post).mockResolvedValue({ status: 'ok' });
|
|
45
|
+
await client.moveContent('p1', body);
|
|
46
|
+
(0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/content/p1/move', body);
|
|
47
|
+
});
|
|
48
|
+
(0, vitest_1.it)('bulkMoveContent should call POST /content/bulk-action/{projectUuid}/move with body', async () => {
|
|
49
|
+
const client = new content_1.ContentClient(mockHttp);
|
|
50
|
+
const body = {
|
|
51
|
+
action: { type: 'move', targetSpaceUuid: 's2' },
|
|
52
|
+
content: [{ source: 'dbt_explore', contentType: 'chart', uuid: 'c1' }],
|
|
53
|
+
};
|
|
54
|
+
vitest_1.vi.mocked(mockHttp.post).mockResolvedValue({ status: 'ok' });
|
|
55
|
+
await client.bulkMoveContent('p1', body);
|
|
56
|
+
(0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/content/bulk-action/p1/move', body);
|
|
57
|
+
});
|
|
58
|
+
(0, vitest_1.it)('permanentlyDeleteContent should call DELETE /content/{projectUuid}/permanent with body', async () => {
|
|
59
|
+
const client = new content_1.ContentClient(mockHttp);
|
|
60
|
+
const body = {
|
|
61
|
+
item: { contentType: 'chart', uuid: 'c1', source: 'dbt_explore' },
|
|
62
|
+
};
|
|
63
|
+
vitest_1.vi.mocked(mockHttp.delete).mockResolvedValue({ status: 'ok' });
|
|
64
|
+
await client.permanentlyDeleteContent('p1', body);
|
|
65
|
+
(0, vitest_1.expect)(mockHttp.delete).toHaveBeenCalledWith('/content/p1/permanent', { data: body });
|
|
66
|
+
});
|
|
26
67
|
});
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Dashboards API client (v2). Metadata reads
|
|
2
|
+
* Dashboards API client (v2). Metadata reads, updates, and soft-delete (no query execution).
|
|
3
3
|
*/
|
|
4
4
|
import { BaseApiClient } from '../base-client';
|
|
5
5
|
import type { components } from '@lightdash-tools/common';
|
|
6
6
|
export type Dashboard = components['schemas']['Dashboard'];
|
|
7
|
+
/** Request body for PATCH projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}. */
|
|
8
|
+
export type UpdateDashboardBody = components['schemas']['UpdateDashboard'];
|
|
7
9
|
export declare class DashboardsClientV2 extends BaseApiClient {
|
|
8
10
|
/** Get dashboard metadata by UUID or slug within a project. Does not run queries. */
|
|
9
11
|
getDashboard(projectUuid: string, dashboardUuidOrSlug: string): Promise<Dashboard>;
|
|
12
|
+
/** Update a dashboard by UUID or slug within a project. */
|
|
13
|
+
updateDashboard(projectUuid: string, dashboardUuidOrSlug: string, body: UpdateDashboardBody): Promise<Dashboard>;
|
|
14
|
+
/** Soft-delete a dashboard by UUID or slug within a project. */
|
|
15
|
+
deleteDashboard(projectUuid: string, dashboardUuidOrSlug: string): Promise<void>;
|
|
10
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Dashboards API client (v2). Metadata reads
|
|
3
|
+
* Dashboards API client (v2). Metadata reads, updates, and soft-delete (no query execution).
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DashboardsClientV2 = void 0;
|
|
@@ -10,5 +10,13 @@ class DashboardsClientV2 extends base_client_1.BaseApiClient {
|
|
|
10
10
|
async getDashboard(projectUuid, dashboardUuidOrSlug) {
|
|
11
11
|
return this.http.get(`/projects/${projectUuid}/dashboards/${encodeURIComponent(dashboardUuidOrSlug)}`);
|
|
12
12
|
}
|
|
13
|
+
/** Update a dashboard by UUID or slug within a project. */
|
|
14
|
+
async updateDashboard(projectUuid, dashboardUuidOrSlug, body) {
|
|
15
|
+
return this.http.patch(`/projects/${projectUuid}/dashboards/${encodeURIComponent(dashboardUuidOrSlug)}`, body);
|
|
16
|
+
}
|
|
17
|
+
/** Soft-delete a dashboard by UUID or slug within a project. */
|
|
18
|
+
async deleteDashboard(projectUuid, dashboardUuidOrSlug) {
|
|
19
|
+
await this.http.delete(`/projects/${projectUuid}/dashboards/${encodeURIComponent(dashboardUuidOrSlug)}`);
|
|
20
|
+
}
|
|
13
21
|
}
|
|
14
22
|
exports.DashboardsClientV2 = DashboardsClientV2;
|
|
@@ -24,4 +24,38 @@ const dashboards_1 = require("./dashboards");
|
|
|
24
24
|
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/projects/p1/dashboards/d1');
|
|
25
25
|
(0, vitest_1.expect)(result).toEqual(mockResponse);
|
|
26
26
|
});
|
|
27
|
+
(0, vitest_1.it)('getDashboard encodes slug in path', async () => {
|
|
28
|
+
const client = new dashboards_1.DashboardsClientV2(mockHttp);
|
|
29
|
+
vitest_1.vi.mocked(mockHttp.get).mockResolvedValue({});
|
|
30
|
+
await client.getDashboard('p1', 'dash/slug');
|
|
31
|
+
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/projects/p1/dashboards/dash%2Fslug');
|
|
32
|
+
});
|
|
33
|
+
(0, vitest_1.it)('updateDashboard calls PATCH /projects/{projectUuid}/dashboards/{id} with body', async () => {
|
|
34
|
+
const client = new dashboards_1.DashboardsClientV2(mockHttp);
|
|
35
|
+
const body = { name: 'Renamed' };
|
|
36
|
+
const updated = { uuid: 'd1', name: 'Renamed' };
|
|
37
|
+
vitest_1.vi.mocked(mockHttp.patch).mockResolvedValue(updated);
|
|
38
|
+
const result = await client.updateDashboard('p1', 'd1', body);
|
|
39
|
+
(0, vitest_1.expect)(mockHttp.patch).toHaveBeenCalledWith('/projects/p1/dashboards/d1', body);
|
|
40
|
+
(0, vitest_1.expect)(result).toEqual(updated);
|
|
41
|
+
});
|
|
42
|
+
(0, vitest_1.it)('updateDashboard encodes slug in path', async () => {
|
|
43
|
+
const client = new dashboards_1.DashboardsClientV2(mockHttp);
|
|
44
|
+
const body = { name: 'Renamed' };
|
|
45
|
+
vitest_1.vi.mocked(mockHttp.patch).mockResolvedValue({});
|
|
46
|
+
await client.updateDashboard('p1', 'dash/slug', body);
|
|
47
|
+
(0, vitest_1.expect)(mockHttp.patch).toHaveBeenCalledWith('/projects/p1/dashboards/dash%2Fslug', body);
|
|
48
|
+
});
|
|
49
|
+
(0, vitest_1.it)('deleteDashboard calls DELETE /projects/{projectUuid}/dashboards/{id}', async () => {
|
|
50
|
+
const client = new dashboards_1.DashboardsClientV2(mockHttp);
|
|
51
|
+
vitest_1.vi.mocked(mockHttp.delete).mockResolvedValue(undefined);
|
|
52
|
+
await client.deleteDashboard('p1', 'd1');
|
|
53
|
+
(0, vitest_1.expect)(mockHttp.delete).toHaveBeenCalledWith('/projects/p1/dashboards/d1');
|
|
54
|
+
});
|
|
55
|
+
(0, vitest_1.it)('deleteDashboard encodes slug in path', async () => {
|
|
56
|
+
const client = new dashboards_1.DashboardsClientV2(mockHttp);
|
|
57
|
+
vitest_1.vi.mocked(mockHttp.delete).mockResolvedValue(undefined);
|
|
58
|
+
await client.deleteDashboard('p1', 'dash/slug');
|
|
59
|
+
(0, vitest_1.expect)(mockHttp.delete).toHaveBeenCalledWith('/projects/p1/dashboards/dash%2Fslug');
|
|
60
|
+
});
|
|
27
61
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project parameters API client (v2). Read-only.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseApiClient } from '../base-client';
|
|
5
|
+
import type { components } from '@lightdash-tools/common';
|
|
6
|
+
export type ProjectParametersListResults = components['schemas']['ApiGetProjectParametersListResults'];
|
|
7
|
+
export type ProjectParameterDefinitions = components['schemas']['ApiGetProjectParametersResults'];
|
|
8
|
+
export type ListProjectParametersParams = {
|
|
9
|
+
search?: string;
|
|
10
|
+
sortBy?: 'name';
|
|
11
|
+
sortOrder?: 'asc' | 'desc';
|
|
12
|
+
page?: number;
|
|
13
|
+
pageSize?: number;
|
|
14
|
+
};
|
|
15
|
+
export declare class ParametersClientV2 extends BaseApiClient {
|
|
16
|
+
/** List project parameter definitions (paginated). */
|
|
17
|
+
listParameters(projectUuid: string, params?: ListProjectParametersParams): Promise<ProjectParametersListResults>;
|
|
18
|
+
/** Get project parameter definitions by name. */
|
|
19
|
+
getParameters(projectUuid: string, names?: string[]): Promise<ProjectParameterDefinitions>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Project parameters API client (v2). Read-only.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ParametersClientV2 = void 0;
|
|
7
|
+
const base_client_1 = require("../base-client");
|
|
8
|
+
class ParametersClientV2 extends base_client_1.BaseApiClient {
|
|
9
|
+
/** List project parameter definitions (paginated). */
|
|
10
|
+
async listParameters(projectUuid, params) {
|
|
11
|
+
return this.http.get(`/projects/${projectUuid}/parameters/list`, {
|
|
12
|
+
params,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/** Get project parameter definitions by name. */
|
|
16
|
+
async getParameters(projectUuid, names) {
|
|
17
|
+
return this.http.get(`/projects/${projectUuid}/parameters`, {
|
|
18
|
+
params: names !== undefined ? { names } : undefined,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.ParametersClientV2 = ParametersClientV2;
|
|
@@ -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
|
+
});
|
package/dist/api/v2/query.d.ts
CHANGED
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
* Query API client for v2 endpoints. Run metric/SQL/underlying data queries using v2 API.
|
|
3
3
|
*/
|
|
4
4
|
import { BaseApiClient } from '../base-client';
|
|
5
|
-
import type { ExecuteAsyncMetricQueryRequestParams, ExecuteAsyncSqlQueryRequestParams, ExecuteAsyncSavedChartRequestParams, ExecuteAsyncDashboardChartRequestParams, ExecuteAsyncUnderlyingDataRequestParams, ExecuteAsyncMetricQueryResults, ExecuteAsyncDashboardChartResults, ExecuteAsyncSqlQueryResults } from '@lightdash-tools/common';
|
|
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
|
}
|
package/dist/api/v2/query.js
CHANGED
|
@@ -26,5 +26,21 @@ class QueryClientV2 extends base_client_1.BaseApiClient {
|
|
|
26
26
|
async runUnderlyingDataQuery(projectUuid, body) {
|
|
27
27
|
return this.http.post(`/projects/${projectUuid}/query/underlying-data`, body);
|
|
28
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`);
|
|
44
|
+
}
|
|
29
45
|
}
|
|
30
46
|
exports.QueryClientV2 = QueryClientV2;
|
|
@@ -66,4 +66,20 @@ 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)('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
|
+
});
|
|
69
85
|
});
|
package/dist/client.d.ts
CHANGED
|
@@ -17,9 +17,11 @@ import { SpacesClient } from './api/v1/spaces';
|
|
|
17
17
|
import { TagsClient } from './api/v1/tags';
|
|
18
18
|
import { UsersClient } from './api/v1/users';
|
|
19
19
|
import { ValidationClient } from './api/v1/validation';
|
|
20
|
+
import { ChartsClientV2 } from './api/v2/charts';
|
|
20
21
|
import { ContentClient } from './api/v2/content';
|
|
21
22
|
import { DashboardsClientV2 } from './api/v2/dashboards';
|
|
22
23
|
import { OrganizationRolesClient } from './api/v2/organization-roles';
|
|
24
|
+
import { ParametersClientV2 } from './api/v2/parameters';
|
|
23
25
|
import { ProjectRoleAssignmentsClient } from './api/v2/project-role-assignments';
|
|
24
26
|
import { QueryClientV2 } from './api/v2/query';
|
|
25
27
|
import { ValidationClientV2 } from './api/v2/validation';
|
|
@@ -57,6 +59,8 @@ export declare class V2ApiClients {
|
|
|
57
59
|
readonly content: ContentClient;
|
|
58
60
|
readonly validation: ValidationClientV2;
|
|
59
61
|
readonly dashboards: DashboardsClientV2;
|
|
62
|
+
readonly charts: ChartsClientV2;
|
|
63
|
+
readonly parameters: ParametersClientV2;
|
|
60
64
|
constructor(http: HttpClient);
|
|
61
65
|
}
|
|
62
66
|
/**
|
package/dist/client.js
CHANGED
|
@@ -20,9 +20,11 @@ const spaces_1 = require("./api/v1/spaces");
|
|
|
20
20
|
const tags_1 = require("./api/v1/tags");
|
|
21
21
|
const users_1 = require("./api/v1/users");
|
|
22
22
|
const validation_1 = require("./api/v1/validation");
|
|
23
|
+
const charts_2 = require("./api/v2/charts");
|
|
23
24
|
const content_1 = require("./api/v2/content");
|
|
24
25
|
const dashboards_2 = require("./api/v2/dashboards");
|
|
25
26
|
const organization_roles_1 = require("./api/v2/organization-roles");
|
|
27
|
+
const parameters_1 = require("./api/v2/parameters");
|
|
26
28
|
const project_role_assignments_1 = require("./api/v2/project-role-assignments");
|
|
27
29
|
const query_2 = require("./api/v2/query");
|
|
28
30
|
const validation_2 = require("./api/v2/validation");
|
|
@@ -65,6 +67,8 @@ class V2ApiClients {
|
|
|
65
67
|
this.content = new content_1.ContentClient(http);
|
|
66
68
|
this.validation = new validation_2.ValidationClientV2(http);
|
|
67
69
|
this.dashboards = new dashboards_2.DashboardsClientV2(http);
|
|
70
|
+
this.charts = new charts_2.ChartsClientV2(http);
|
|
71
|
+
this.parameters = new parameters_1.ParametersClientV2(http);
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
exports.V2ApiClients = V2ApiClients;
|
package/dist/client.test.js
CHANGED
|
@@ -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);
|
package/dist/errors.d.ts
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Error types for the Lightdash HTTP client.
|
|
3
3
|
*/
|
|
4
4
|
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
5
|
+
/** HttpClient name when the response body is not a Lightdash success/error envelope. */
|
|
6
|
+
export declare const CONTRACT_ERROR_NAME = "ContractError";
|
|
7
|
+
/** Human-readable message for {@link CONTRACT_ERROR_NAME}. */
|
|
8
|
+
export declare const CONTRACT_ERROR_MESSAGE = "Unexpected Lightdash API response shape";
|
|
5
9
|
/** API error payload shape (from Lightdash ApiErrorPayload). */
|
|
6
10
|
export interface ApiErrorPayload {
|
|
7
11
|
error: {
|
|
@@ -37,3 +41,21 @@ export declare class NetworkError extends Error {
|
|
|
37
41
|
readonly originalError: Error;
|
|
38
42
|
constructor(message: string, originalError: Error);
|
|
39
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Thrown when a binary download exceeds the configured byte limit.
|
|
46
|
+
*/
|
|
47
|
+
export declare class BinarySizeLimitError extends Error {
|
|
48
|
+
readonly maxBytes: number;
|
|
49
|
+
readonly byteLength?: number | undefined;
|
|
50
|
+
readonly code: "PAYLOAD_TOO_LARGE";
|
|
51
|
+
constructor(maxBytes: number, byteLength?: number | undefined);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Thrown when a chart PNG export exceeds the configured byte limit.
|
|
55
|
+
*/
|
|
56
|
+
export declare class ChartImageSizeError extends Error {
|
|
57
|
+
readonly maxBytes: number;
|
|
58
|
+
readonly byteLength?: number | undefined;
|
|
59
|
+
readonly code: "IMAGE_TOO_LARGE";
|
|
60
|
+
constructor(maxBytes: number, byteLength?: number | undefined);
|
|
61
|
+
}
|
package/dist/errors.js
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
* Error types for the Lightdash HTTP client.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NetworkError = exports.RateLimitError = exports.LightdashApiError = void 0;
|
|
6
|
+
exports.ChartImageSizeError = exports.BinarySizeLimitError = exports.NetworkError = exports.RateLimitError = exports.LightdashApiError = exports.CONTRACT_ERROR_MESSAGE = exports.CONTRACT_ERROR_NAME = void 0;
|
|
7
|
+
/** HttpClient name when the response body is not a Lightdash success/error envelope. */
|
|
8
|
+
exports.CONTRACT_ERROR_NAME = 'ContractError';
|
|
9
|
+
/** Human-readable message for {@link CONTRACT_ERROR_NAME}. */
|
|
10
|
+
exports.CONTRACT_ERROR_MESSAGE = 'Unexpected Lightdash API response shape';
|
|
7
11
|
/**
|
|
8
12
|
* Base error for Lightdash API failures.
|
|
9
13
|
*/
|
|
@@ -44,3 +48,35 @@ class NetworkError extends Error {
|
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
exports.NetworkError = NetworkError;
|
|
51
|
+
/**
|
|
52
|
+
* Thrown when a binary download exceeds the configured byte limit.
|
|
53
|
+
*/
|
|
54
|
+
class BinarySizeLimitError extends Error {
|
|
55
|
+
constructor(maxBytes, byteLength) {
|
|
56
|
+
super(byteLength === undefined
|
|
57
|
+
? `Binary payload exceeds size limit (≥ ${maxBytes} bytes)`
|
|
58
|
+
: `Binary payload exceeds size limit (${byteLength} > ${maxBytes} bytes)`);
|
|
59
|
+
this.maxBytes = maxBytes;
|
|
60
|
+
this.byteLength = byteLength;
|
|
61
|
+
this.code = 'PAYLOAD_TOO_LARGE';
|
|
62
|
+
this.name = 'BinarySizeLimitError';
|
|
63
|
+
Object.setPrototypeOf(this, BinarySizeLimitError.prototype);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.BinarySizeLimitError = BinarySizeLimitError;
|
|
67
|
+
/**
|
|
68
|
+
* Thrown when a chart PNG export exceeds the configured byte limit.
|
|
69
|
+
*/
|
|
70
|
+
class ChartImageSizeError extends Error {
|
|
71
|
+
constructor(maxBytes, byteLength) {
|
|
72
|
+
super(byteLength === undefined
|
|
73
|
+
? `Chart image exceeds size limit (≥ ${maxBytes} bytes)`
|
|
74
|
+
: `Chart image exceeds size limit (${byteLength} > ${maxBytes} bytes)`);
|
|
75
|
+
this.maxBytes = maxBytes;
|
|
76
|
+
this.byteLength = byteLength;
|
|
77
|
+
this.code = 'IMAGE_TOO_LARGE';
|
|
78
|
+
this.name = 'ChartImageSizeError';
|
|
79
|
+
Object.setPrototypeOf(this, ChartImageSizeError.prototype);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.ChartImageSizeError = ChartImageSizeError;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Unit tests for binary download URL guards and getBytes error mapping.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const axios_1 = require("axios");
|
|
7
|
+
const vitest_1 = require("vitest");
|
|
8
|
+
const http_client_js_1 = require("./http-client.js");
|
|
9
|
+
(0, vitest_1.describe)('isBlockedBinaryHostname', () => {
|
|
10
|
+
(0, vitest_1.it)('blocks loopback and private IPv4 hosts', () => {
|
|
11
|
+
(0, vitest_1.expect)((0, http_client_js_1.isBlockedBinaryHostname)('localhost')).toBe(true);
|
|
12
|
+
(0, vitest_1.expect)((0, http_client_js_1.isBlockedBinaryHostname)('127.0.0.1')).toBe(true);
|
|
13
|
+
(0, vitest_1.expect)((0, http_client_js_1.isBlockedBinaryHostname)('10.0.0.1')).toBe(true);
|
|
14
|
+
(0, vitest_1.expect)((0, http_client_js_1.isBlockedBinaryHostname)('192.168.1.1')).toBe(true);
|
|
15
|
+
(0, vitest_1.expect)((0, http_client_js_1.isBlockedBinaryHostname)('172.16.0.1')).toBe(true);
|
|
16
|
+
(0, vitest_1.expect)((0, http_client_js_1.isBlockedBinaryHostname)('169.254.169.254')).toBe(true);
|
|
17
|
+
(0, vitest_1.expect)((0, http_client_js_1.isBlockedBinaryHostname)('metadata.google.internal')).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
(0, vitest_1.it)('allows public hostnames', () => {
|
|
20
|
+
(0, vitest_1.expect)((0, http_client_js_1.isBlockedBinaryHostname)('cdn.example.com')).toBe(false);
|
|
21
|
+
(0, vitest_1.expect)((0, http_client_js_1.isBlockedBinaryHostname)('s3.amazonaws.com')).toBe(false);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
(0, vitest_1.describe)('assertSafeBinaryFetchUrl', () => {
|
|
25
|
+
(0, vitest_1.it)('rejects same-host HTTPS to HTTP downgrades', () => {
|
|
26
|
+
(0, vitest_1.expect)(() => (0, http_client_js_1.assertSafeBinaryFetchUrl)('http://app.lightdash.com/export/chart.png', 'https://app.lightdash.com')).toThrow(/must not downgrade HTTPS to HTTP/);
|
|
27
|
+
});
|
|
28
|
+
(0, vitest_1.it)('allows same-host HTTPS URLs', () => {
|
|
29
|
+
(0, vitest_1.expect)(() => (0, http_client_js_1.assertSafeBinaryFetchUrl)('https://app.lightdash.com/export/chart.png', 'https://app.lightdash.com')).not.toThrow();
|
|
30
|
+
});
|
|
31
|
+
(0, vitest_1.it)('allows relative URLs without validation', () => {
|
|
32
|
+
(0, vitest_1.expect)(() => (0, http_client_js_1.assertSafeBinaryFetchUrl)('/api/v1/export.png', 'https://app.lightdash.com')).not.toThrow();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
(0, vitest_1.describe)('HttpClient.getBytes', () => {
|
|
36
|
+
function makeClient(getImpl) {
|
|
37
|
+
const axiosInstance = { get: getImpl };
|
|
38
|
+
const rateLimiter = {
|
|
39
|
+
schedule: (fn) => fn(),
|
|
40
|
+
};
|
|
41
|
+
const config = {
|
|
42
|
+
baseUrl: 'https://app.lightdash.com',
|
|
43
|
+
timeout: 30000,
|
|
44
|
+
retry: { maxRetries: 0 },
|
|
45
|
+
};
|
|
46
|
+
return new http_client_js_1.HttpClient(axiosInstance, rateLimiter, config);
|
|
47
|
+
}
|
|
48
|
+
(0, vitest_1.it)('maps axios maxContentLength errors to BinarySizeLimitError', async () => {
|
|
49
|
+
const maxBytes = 1024;
|
|
50
|
+
const axiosError = new axios_1.AxiosError('maxContentLength size of 1024 exceeded');
|
|
51
|
+
const client = makeClient(vitest_1.vi.fn().mockRejectedValue(axiosError));
|
|
52
|
+
await (0, vitest_1.expect)(client.getBytes('/chart.png', { maxBytes })).rejects.toMatchObject({
|
|
53
|
+
code: 'PAYLOAD_TOO_LARGE',
|
|
54
|
+
maxBytes,
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
(0, vitest_1.it)('rejects same-host HTTP downgrade before fetching', async () => {
|
|
58
|
+
const client = makeClient(vitest_1.vi.fn());
|
|
59
|
+
await (0, vitest_1.expect)(client.getBytes('http://app.lightdash.com/chart.png')).rejects.toThrow(/must not downgrade HTTPS to HTTP/);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -2,20 +2,25 @@
|
|
|
2
2
|
* HTTP client wrapper: rate limiter + axios + retry.
|
|
3
3
|
* All requests go through the rate limiter; retry applies to 5xx and network errors.
|
|
4
4
|
*/
|
|
5
|
-
import { type ApiErrorPayload } from '../errors';
|
|
6
5
|
import { type RateLimiter } from './rate-limiter';
|
|
7
6
|
import type { ResolvedLightdashClientConfig } from '../config';
|
|
8
7
|
import type { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
9
|
-
/**
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
/** Default max raw bytes for chart PNG downloads (8 MiB). */
|
|
9
|
+
export declare const DEFAULT_BINARY_MAX_BYTES: number;
|
|
10
|
+
export type GetBytesOptions = {
|
|
11
|
+
/** Hard cap on response body size in bytes. */
|
|
12
|
+
maxBytes?: number;
|
|
13
|
+
/** Per-request timeout override (ms). */
|
|
14
|
+
timeout?: number;
|
|
15
|
+
};
|
|
16
|
+
export type GetBytesResult = {
|
|
17
|
+
bytes: Buffer;
|
|
18
|
+
mimeType: string;
|
|
19
|
+
};
|
|
20
|
+
/** True when hostname is loopback, link-local, or RFC1918 (cross-host SSRF guard). */
|
|
21
|
+
export declare function isBlockedBinaryHostname(hostname: string): boolean;
|
|
22
|
+
/** Reject unsafe absolute binary download URLs (exported for unit tests). */
|
|
23
|
+
export declare function assertSafeBinaryFetchUrl(url: string, baseUrl: string): void;
|
|
19
24
|
/**
|
|
20
25
|
* HTTP client that wraps Axios with rate limiting and retry.
|
|
21
26
|
*/
|
|
@@ -30,4 +35,11 @@ export declare class HttpClient {
|
|
|
30
35
|
put<T>(url: string, body?: unknown, config?: AxiosRequestConfig): Promise<T>;
|
|
31
36
|
patch<T>(url: string, body?: unknown, config?: AxiosRequestConfig): Promise<T>;
|
|
32
37
|
delete<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
|
38
|
+
/**
|
|
39
|
+
* Fetch raw bytes (no ApiSuccess envelope unwrap). Relative URLs use the
|
|
40
|
+
* authenticated API client; absolute URLs on a different host (e.g. signed S3)
|
|
41
|
+
* are fetched without Lightdash Authorization. Cross-host fetches require https,
|
|
42
|
+
* disallow private/link-local hosts, and follow no redirects.
|
|
43
|
+
*/
|
|
44
|
+
getBytes(url: string, options?: GetBytesOptions): Promise<GetBytesResult>;
|
|
33
45
|
}
|