@lightdash-tools/client 0.7.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.
- package/dist/api/v1/charts.d.ts +9 -1
- package/dist/api/v1/charts.js +8 -0
- package/dist/api/v1/charts.test.js +16 -0
- 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/http/http-client.d.ts +0 -11
- package/dist/http/http-client.js +2 -4
- 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 +6 -1
- package/dist/index.js +6 -1
- package/package.json +2 -2
- package/src/api/v1/charts.test.ts +18 -0
- package/src/api/v1/charts.ts +17 -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/http/http-client.ts +4 -19
- package/src/http/unwrap-api-success.test.ts +23 -0
- package/src/http/unwrap-api-success.ts +40 -0
- package/src/index.ts +21 -1
package/dist/api/v1/charts.d.ts
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
* Charts API client. Endpoints for saved charts and chart-as-code operations.
|
|
3
3
|
*/
|
|
4
4
|
import { BaseApiClient } from '../base-client';
|
|
5
|
-
import type { SpaceQuery, ChartAsCodeListResults, ChartAsCodeUpsertResults, UpsertChartAsCodeBody } from '@lightdash-tools/common';
|
|
5
|
+
import type { SpaceQuery, ChartAsCodeListResults, ChartAsCodeUpsertResults, UpsertChartAsCodeBody, components } from '@lightdash-tools/common';
|
|
6
6
|
export interface GetChartsAsCodeOptions {
|
|
7
7
|
ids?: string[];
|
|
8
8
|
offset?: number;
|
|
9
9
|
languageMap?: boolean;
|
|
10
10
|
}
|
|
11
|
+
/** Results of GET saved/{chartUuid}/history (chart version history). */
|
|
12
|
+
export type ChartHistoryResults = components['schemas']['ApiGetChartHistoryResponse']['results'];
|
|
13
|
+
/** Results of GET saved/{chartUuid}/version/{versionUuid} (a single chart version). */
|
|
14
|
+
export type ChartVersionResults = components['schemas']['ApiGetChartVersionResponse']['results'];
|
|
11
15
|
export declare class ChartsClient extends BaseApiClient {
|
|
12
16
|
/**
|
|
13
17
|
* List charts in a project (returns SpaceQuery array).
|
|
@@ -18,4 +22,8 @@ export declare class ChartsClient extends BaseApiClient {
|
|
|
18
22
|
getChartsAsCode(projectUuid: string, options?: GetChartsAsCodeOptions): Promise<ChartAsCodeListResults>;
|
|
19
23
|
/** Upsert a chart from code representation (create or update by slug). */
|
|
20
24
|
upsertChartAsCode(projectUuid: string, slug: string, body: UpsertChartAsCodeBody): Promise<ChartAsCodeUpsertResults>;
|
|
25
|
+
/** Get chart version history from the last 30 days. */
|
|
26
|
+
getChartHistory(chartUuid: string): Promise<ChartHistoryResults>;
|
|
27
|
+
/** Get a single chart version by UUID. */
|
|
28
|
+
getChartVersion(chartUuid: string, versionUuid: string): Promise<ChartVersionResults>;
|
|
21
29
|
}
|
package/dist/api/v1/charts.js
CHANGED
|
@@ -29,5 +29,13 @@ class ChartsClient extends base_client_1.BaseApiClient {
|
|
|
29
29
|
async upsertChartAsCode(projectUuid, slug, body) {
|
|
30
30
|
return this.http.post(`/projects/${projectUuid}/code/charts/${encodeURIComponent(slug)}`, body);
|
|
31
31
|
}
|
|
32
|
+
/** Get chart version history from the last 30 days. */
|
|
33
|
+
async getChartHistory(chartUuid) {
|
|
34
|
+
return this.http.get(`/saved/${chartUuid}/history`);
|
|
35
|
+
}
|
|
36
|
+
/** Get a single chart version by UUID. */
|
|
37
|
+
async getChartVersion(chartUuid, versionUuid) {
|
|
38
|
+
return this.http.get(`/saved/${chartUuid}/version/${versionUuid}`);
|
|
39
|
+
}
|
|
32
40
|
}
|
|
33
41
|
exports.ChartsClient = ChartsClient;
|
|
@@ -94,4 +94,20 @@ const charts_1 = require("./charts");
|
|
|
94
94
|
await client.upsertChartAsCode('p1', 'chart/slug', body);
|
|
95
95
|
(0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/code/charts/chart%2Fslug', body);
|
|
96
96
|
});
|
|
97
|
+
(0, vitest_1.it)('getChartHistory should call GET /saved/{chartUuid}/history', async () => {
|
|
98
|
+
const client = new charts_1.ChartsClient(mockHttp);
|
|
99
|
+
const history = { chartUuid: 'c1', history: [] };
|
|
100
|
+
vitest_1.vi.mocked(mockHttp.get).mockResolvedValue(history);
|
|
101
|
+
const result = await client.getChartHistory('c1');
|
|
102
|
+
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/saved/c1/history');
|
|
103
|
+
(0, vitest_1.expect)(result).toEqual(history);
|
|
104
|
+
});
|
|
105
|
+
(0, vitest_1.it)('getChartVersion should call GET /saved/{chartUuid}/version/{versionUuid}', async () => {
|
|
106
|
+
const client = new charts_1.ChartsClient(mockHttp);
|
|
107
|
+
const version = { chartUuid: 'c1', versionUuid: 'v1' };
|
|
108
|
+
vitest_1.vi.mocked(mockHttp.get).mockResolvedValue(version);
|
|
109
|
+
const result = await client.getChartVersion('c1', 'v1');
|
|
110
|
+
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/saved/c1/version/v1');
|
|
111
|
+
(0, vitest_1.expect)(result).toEqual(version);
|
|
112
|
+
});
|
|
97
113
|
});
|
|
@@ -2,12 +2,33 @@
|
|
|
2
2
|
* Dashboards API client. Endpoints for project dashboards and dashboard-as-code operations.
|
|
3
3
|
*/
|
|
4
4
|
import { BaseApiClient } from '../base-client';
|
|
5
|
-
import type { DashboardBasicDetailsWithTileTypes, DashboardAsCodeListResults, DashboardAsCodeUpsertResults, UpsertDashboardAsCodeBody } from '@lightdash-tools/common';
|
|
5
|
+
import type { DashboardBasicDetailsWithTileTypes, DashboardAsCodeListResults, DashboardAsCodeUpsertResults, UpsertDashboardAsCodeBody, components } from '@lightdash-tools/common';
|
|
6
6
|
export interface GetDashboardsAsCodeOptions {
|
|
7
7
|
ids?: string[];
|
|
8
8
|
offset?: number;
|
|
9
9
|
languageMap?: boolean;
|
|
10
10
|
}
|
|
11
|
+
/** Request body for POST projects/{projectUuid}/dashboards (create dashboard, or duplicate via query param). */
|
|
12
|
+
export type CreateDashboardBody = components['schemas']['CreateDashboard'] | components['schemas']['DuplicateDashboardParams'];
|
|
13
|
+
/** Options for createDashboard. */
|
|
14
|
+
export interface CreateDashboardOptions {
|
|
15
|
+
/** UUID of an existing dashboard to duplicate from. When set, body should be DuplicateDashboardParams. */
|
|
16
|
+
duplicateFrom?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Result of POST projects/{projectUuid}/dashboards (create dashboard). */
|
|
19
|
+
export type CreateDashboardResult = components['schemas']['ApiCreateDashboardResponse']['results'];
|
|
20
|
+
/** Results of GET dashboards/{dashboardUuidOrSlug}/history (dashboard version history). */
|
|
21
|
+
export type DashboardHistoryResults = components['schemas']['ApiGetDashboardHistoryResponse']['results'];
|
|
22
|
+
/** Results of GET dashboards/{dashboardUuidOrSlug}/version/{versionUuid} (a single dashboard version). */
|
|
23
|
+
export type DashboardVersionResults = components['schemas']['ApiGetDashboardVersionResponse']['results'];
|
|
24
|
+
/** Results of GET dashboards/{dashboardUuidOrSlug}/promoteDiff. */
|
|
25
|
+
export type DashboardPromoteDiffResults = components['schemas']['PromotionChanges'];
|
|
26
|
+
/** Results of POST dashboards/{dashboardUuidOrSlug}/promote. */
|
|
27
|
+
export type PromoteDashboardResult = components['schemas']['DashboardDAO'];
|
|
28
|
+
/** Optional query for promote / promoteDiff when a slug exists in multiple projects. */
|
|
29
|
+
export interface DashboardPromoteOptions {
|
|
30
|
+
projectUuid?: string;
|
|
31
|
+
}
|
|
11
32
|
export declare class DashboardsClient extends BaseApiClient {
|
|
12
33
|
/** List dashboards in a project. */
|
|
13
34
|
listDashboards(projectUuid: string): Promise<DashboardBasicDetailsWithTileTypes[]>;
|
|
@@ -15,4 +36,14 @@ export declare class DashboardsClient extends BaseApiClient {
|
|
|
15
36
|
getDashboardsAsCode(projectUuid: string, options?: GetDashboardsAsCodeOptions): Promise<DashboardAsCodeListResults>;
|
|
16
37
|
/** Upsert a dashboard from code representation (create or update by slug). */
|
|
17
38
|
upsertDashboardAsCode(projectUuid: string, slug: string, body: UpsertDashboardAsCodeBody): Promise<DashboardAsCodeUpsertResults>;
|
|
39
|
+
/** Create a new dashboard in a project, or duplicate an existing one via `duplicateFrom`. */
|
|
40
|
+
createDashboard(projectUuid: string, body: CreateDashboardBody, options?: CreateDashboardOptions): Promise<CreateDashboardResult>;
|
|
41
|
+
/** Get dashboard version history from the last 30 days. */
|
|
42
|
+
getDashboardHistory(dashboardUuidOrSlug: string): Promise<DashboardHistoryResults>;
|
|
43
|
+
/** Get a single dashboard version by UUID. */
|
|
44
|
+
getDashboardVersion(dashboardUuidOrSlug: string, versionUuid: string): Promise<DashboardVersionResults>;
|
|
45
|
+
/** Get promotion diff for a dashboard against its configured upstream project. */
|
|
46
|
+
getDashboardPromoteDiff(dashboardUuidOrSlug: string, options?: DashboardPromoteOptions): Promise<DashboardPromoteDiffResults>;
|
|
47
|
+
/** Promote a dashboard (and nested charts) to its configured upstream project. */
|
|
48
|
+
promoteDashboard(dashboardUuidOrSlug: string, options?: DashboardPromoteOptions): Promise<PromoteDashboardResult>;
|
|
18
49
|
}
|
|
@@ -26,5 +26,25 @@ class DashboardsClient extends base_client_1.BaseApiClient {
|
|
|
26
26
|
async upsertDashboardAsCode(projectUuid, slug, body) {
|
|
27
27
|
return this.http.post(`/projects/${projectUuid}/code/dashboards/${encodeURIComponent(slug)}`, body);
|
|
28
28
|
}
|
|
29
|
+
/** Create a new dashboard in a project, or duplicate an existing one via `duplicateFrom`. */
|
|
30
|
+
async createDashboard(projectUuid, body, options) {
|
|
31
|
+
return this.http.post(`/projects/${projectUuid}/dashboards`, body, (options === null || options === void 0 ? void 0 : options.duplicateFrom) ? { params: { duplicateFrom: options.duplicateFrom } } : undefined);
|
|
32
|
+
}
|
|
33
|
+
/** Get dashboard version history from the last 30 days. */
|
|
34
|
+
async getDashboardHistory(dashboardUuidOrSlug) {
|
|
35
|
+
return this.http.get(`/dashboards/${encodeURIComponent(dashboardUuidOrSlug)}/history`);
|
|
36
|
+
}
|
|
37
|
+
/** Get a single dashboard version by UUID. */
|
|
38
|
+
async getDashboardVersion(dashboardUuidOrSlug, versionUuid) {
|
|
39
|
+
return this.http.get(`/dashboards/${encodeURIComponent(dashboardUuidOrSlug)}/version/${versionUuid}`);
|
|
40
|
+
}
|
|
41
|
+
/** Get promotion diff for a dashboard against its configured upstream project. */
|
|
42
|
+
async getDashboardPromoteDiff(dashboardUuidOrSlug, options) {
|
|
43
|
+
return this.http.get(`/dashboards/${encodeURIComponent(dashboardUuidOrSlug)}/promoteDiff`, (options === null || options === void 0 ? void 0 : options.projectUuid) ? { params: { projectUuid: options.projectUuid } } : undefined);
|
|
44
|
+
}
|
|
45
|
+
/** Promote a dashboard (and nested charts) to its configured upstream project. */
|
|
46
|
+
async promoteDashboard(dashboardUuidOrSlug, options) {
|
|
47
|
+
return this.http.post(`/dashboards/${encodeURIComponent(dashboardUuidOrSlug)}/promote`, undefined, (options === null || options === void 0 ? void 0 : options.projectUuid) ? { params: { projectUuid: options.projectUuid } } : undefined);
|
|
48
|
+
}
|
|
29
49
|
}
|
|
30
50
|
exports.DashboardsClient = DashboardsClient;
|
|
@@ -72,4 +72,76 @@ const dashboards_1 = require("./dashboards");
|
|
|
72
72
|
await client.upsertDashboardAsCode('p1', 'dash/slug', body);
|
|
73
73
|
(0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/code/dashboards/dash%2Fslug', body);
|
|
74
74
|
});
|
|
75
|
+
(0, vitest_1.it)('createDashboard should call POST /projects/{projectUuid}/dashboards with body and no params by default', async () => {
|
|
76
|
+
const client = new dashboards_1.DashboardsClient(mockHttp);
|
|
77
|
+
const body = { name: 'New Dashboard', tiles: [], tabs: [] };
|
|
78
|
+
const created = { uuid: 'd1', name: 'New Dashboard', projectUuid: 'p1' };
|
|
79
|
+
vitest_1.vi.mocked(mockHttp.post).mockResolvedValue(created);
|
|
80
|
+
const result = await client.createDashboard('p1', body);
|
|
81
|
+
(0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/dashboards', body, undefined);
|
|
82
|
+
(0, vitest_1.expect)(result).toEqual(created);
|
|
83
|
+
});
|
|
84
|
+
(0, vitest_1.it)('createDashboard should call POST with duplicateFrom query param when provided', async () => {
|
|
85
|
+
const client = new dashboards_1.DashboardsClient(mockHttp);
|
|
86
|
+
const body = { dashboardDesc: 'Copy', dashboardName: 'Copy of Dashboard' };
|
|
87
|
+
vitest_1.vi.mocked(mockHttp.post).mockResolvedValue({});
|
|
88
|
+
await client.createDashboard('p1', body, { duplicateFrom: 'd0' });
|
|
89
|
+
(0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/dashboards', body, {
|
|
90
|
+
params: { duplicateFrom: 'd0' },
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
(0, vitest_1.it)('getDashboardHistory should call GET /dashboards/{dashboardUuidOrSlug}/history', async () => {
|
|
94
|
+
const client = new dashboards_1.DashboardsClient(mockHttp);
|
|
95
|
+
const history = { dashboardUuid: 'd1', history: [] };
|
|
96
|
+
vitest_1.vi.mocked(mockHttp.get).mockResolvedValue(history);
|
|
97
|
+
const result = await client.getDashboardHistory('d1');
|
|
98
|
+
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/dashboards/d1/history');
|
|
99
|
+
(0, vitest_1.expect)(result).toEqual(history);
|
|
100
|
+
});
|
|
101
|
+
(0, vitest_1.it)('getDashboardHistory should encode slug in path', async () => {
|
|
102
|
+
const client = new dashboards_1.DashboardsClient(mockHttp);
|
|
103
|
+
vitest_1.vi.mocked(mockHttp.get).mockResolvedValue({});
|
|
104
|
+
await client.getDashboardHistory('dash/slug');
|
|
105
|
+
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/dashboards/dash%2Fslug/history');
|
|
106
|
+
});
|
|
107
|
+
(0, vitest_1.it)('getDashboardVersion should call GET /dashboards/{dashboardUuidOrSlug}/version/{versionUuid}', async () => {
|
|
108
|
+
const client = new dashboards_1.DashboardsClient(mockHttp);
|
|
109
|
+
const version = { dashboardUuid: 'd1', versionUuid: 'v1' };
|
|
110
|
+
vitest_1.vi.mocked(mockHttp.get).mockResolvedValue(version);
|
|
111
|
+
const result = await client.getDashboardVersion('d1', 'v1');
|
|
112
|
+
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/dashboards/d1/version/v1');
|
|
113
|
+
(0, vitest_1.expect)(result).toEqual(version);
|
|
114
|
+
});
|
|
115
|
+
(0, vitest_1.it)('getDashboardPromoteDiff should call GET /dashboards/{id}/promoteDiff', async () => {
|
|
116
|
+
const client = new dashboards_1.DashboardsClient(mockHttp);
|
|
117
|
+
const diff = { charts: [], dashboards: [], spaces: [] };
|
|
118
|
+
vitest_1.vi.mocked(mockHttp.get).mockResolvedValue(diff);
|
|
119
|
+
const result = await client.getDashboardPromoteDiff('d1');
|
|
120
|
+
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/dashboards/d1/promoteDiff', undefined);
|
|
121
|
+
(0, vitest_1.expect)(result).toEqual(diff);
|
|
122
|
+
});
|
|
123
|
+
(0, vitest_1.it)('getDashboardPromoteDiff should pass projectUuid query and encode slug', async () => {
|
|
124
|
+
const client = new dashboards_1.DashboardsClient(mockHttp);
|
|
125
|
+
vitest_1.vi.mocked(mockHttp.get).mockResolvedValue({ charts: [], dashboards: [], spaces: [] });
|
|
126
|
+
await client.getDashboardPromoteDiff('dash/slug', { projectUuid: 'p1' });
|
|
127
|
+
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/dashboards/dash%2Fslug/promoteDiff', {
|
|
128
|
+
params: { projectUuid: 'p1' },
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
(0, vitest_1.it)('promoteDashboard should call POST /dashboards/{id}/promote', async () => {
|
|
132
|
+
const client = new dashboards_1.DashboardsClient(mockHttp);
|
|
133
|
+
const promoted = { uuid: 'd1', name: 'Board', projectUuid: 'upstream' };
|
|
134
|
+
vitest_1.vi.mocked(mockHttp.post).mockResolvedValue(promoted);
|
|
135
|
+
const result = await client.promoteDashboard('d1');
|
|
136
|
+
(0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/dashboards/d1/promote', undefined, undefined);
|
|
137
|
+
(0, vitest_1.expect)(result).toEqual(promoted);
|
|
138
|
+
});
|
|
139
|
+
(0, vitest_1.it)('promoteDashboard should pass projectUuid query and encode slug', async () => {
|
|
140
|
+
const client = new dashboards_1.DashboardsClient(mockHttp);
|
|
141
|
+
vitest_1.vi.mocked(mockHttp.post).mockResolvedValue({});
|
|
142
|
+
await client.promoteDashboard('dash/slug', { projectUuid: 'p1' });
|
|
143
|
+
(0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/dashboards/dash%2Fslug/promote', undefined, {
|
|
144
|
+
params: { projectUuid: 'p1' },
|
|
145
|
+
});
|
|
146
|
+
});
|
|
75
147
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Validation API client.
|
|
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 getting validation results. */
|
|
7
7
|
export interface GetValidationResultsParams {
|
|
8
8
|
fromSettings?: boolean;
|
|
@@ -22,4 +22,8 @@ export declare class ValidationClient extends BaseApiClient {
|
|
|
22
22
|
getValidationResults(projectUuid: string, params?: GetValidationResultsParams): Promise<LightdashApi.Validation.ApiValidateResponse>;
|
|
23
23
|
/** Validate content inside a project. Starts a validation job and returns the job ID. */
|
|
24
24
|
validateProject(projectUuid: string, body?: ValidateProjectBody): Promise<LightdashApi.Validation.ApiJobScheduledResponse>;
|
|
25
|
+
/** Validate a single chart's fields against its underlying explore/table. */
|
|
26
|
+
validateChart(projectUuid: string, chartUuid: string): Promise<components['schemas']['ApiChartValidationResponse']['results']>;
|
|
27
|
+
/** Validate a single dashboard's fields against its underlying explores/tables. */
|
|
28
|
+
validateDashboard(projectUuid: string, dashboardUuid: string): Promise<components['schemas']['ApiDashboardValidationResponse']['results']>;
|
|
25
29
|
}
|
|
@@ -17,5 +17,13 @@ class ValidationClient extends base_client_1.BaseApiClient {
|
|
|
17
17
|
async validateProject(projectUuid, body) {
|
|
18
18
|
return this.http.post(`/projects/${projectUuid}/validate`, body);
|
|
19
19
|
}
|
|
20
|
+
/** Validate a single chart's fields against its underlying explore/table. */
|
|
21
|
+
async validateChart(projectUuid, chartUuid) {
|
|
22
|
+
return this.http.post(`/projects/${projectUuid}/validate/chart/${chartUuid}`);
|
|
23
|
+
}
|
|
24
|
+
/** Validate a single dashboard's fields against its underlying explores/tables. */
|
|
25
|
+
async validateDashboard(projectUuid, dashboardUuid) {
|
|
26
|
+
return this.http.post(`/projects/${projectUuid}/validate/dashboard/${dashboardUuid}`);
|
|
27
|
+
}
|
|
20
28
|
}
|
|
21
29
|
exports.ValidationClient = ValidationClient;
|
|
@@ -31,4 +31,20 @@ const validation_1 = require("./validation");
|
|
|
31
31
|
(0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/validate', undefined);
|
|
32
32
|
(0, vitest_1.expect)(result).toEqual(mockResponse);
|
|
33
33
|
});
|
|
34
|
+
(0, vitest_1.it)('validateChart should call POST /projects/{projectUuid}/validate/chart/{chartUuid}', async () => {
|
|
35
|
+
const client = new validation_1.ValidationClient(mockHttp);
|
|
36
|
+
const mockResponse = { errors: [] };
|
|
37
|
+
vitest_1.vi.mocked(mockHttp.post).mockResolvedValue(mockResponse);
|
|
38
|
+
const result = await client.validateChart('p1', 'c1');
|
|
39
|
+
(0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/validate/chart/c1');
|
|
40
|
+
(0, vitest_1.expect)(result).toEqual(mockResponse);
|
|
41
|
+
});
|
|
42
|
+
(0, vitest_1.it)('validateDashboard should call POST /projects/{projectUuid}/validate/dashboard/{dashboardUuid}', async () => {
|
|
43
|
+
const client = new validation_1.ValidationClient(mockHttp);
|
|
44
|
+
const mockResponse = { errors: [] };
|
|
45
|
+
vitest_1.vi.mocked(mockHttp.post).mockResolvedValue(mockResponse);
|
|
46
|
+
const result = await client.validateDashboard('p1', 'd1');
|
|
47
|
+
(0, vitest_1.expect)(mockHttp.post).toHaveBeenCalledWith('/projects/p1/validate/dashboard/d1');
|
|
48
|
+
(0, vitest_1.expect)(result).toEqual(mockResponse);
|
|
49
|
+
});
|
|
34
50
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Charts API client (v2). Metadata reads and soft-delete (no query execution).
|
|
3
|
+
*/
|
|
4
|
+
import { BaseApiClient } from '../base-client';
|
|
5
|
+
import type { components } from '@lightdash-tools/common';
|
|
6
|
+
export type SavedChart = components['schemas']['SavedChart'];
|
|
7
|
+
export declare class ChartsClientV2 extends BaseApiClient {
|
|
8
|
+
/** Get saved chart metadata by UUID or slug within a project. Does not run queries. */
|
|
9
|
+
getSavedChart(projectUuid: string, chartUuidOrSlug: string): Promise<SavedChart>;
|
|
10
|
+
/** Soft-delete a saved chart by UUID or slug within a project. */
|
|
11
|
+
deleteSavedChart(projectUuid: string, chartUuidOrSlug: string): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Charts API client (v2). Metadata reads and soft-delete (no query execution).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ChartsClientV2 = void 0;
|
|
7
|
+
const base_client_1 = require("../base-client");
|
|
8
|
+
class ChartsClientV2 extends base_client_1.BaseApiClient {
|
|
9
|
+
/** Get saved chart metadata by UUID or slug within a project. Does not run queries. */
|
|
10
|
+
async getSavedChart(projectUuid, chartUuidOrSlug) {
|
|
11
|
+
return this.http.get(`/projects/${projectUuid}/saved/${encodeURIComponent(chartUuidOrSlug)}`);
|
|
12
|
+
}
|
|
13
|
+
/** Soft-delete a saved chart by UUID or slug within a project. */
|
|
14
|
+
async deleteSavedChart(projectUuid, chartUuidOrSlug) {
|
|
15
|
+
await this.http.delete(`/projects/${projectUuid}/saved/${encodeURIComponent(chartUuidOrSlug)}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ChartsClientV2 = ChartsClientV2;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* V2 charts client unit tests.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const vitest_1 = require("vitest");
|
|
7
|
+
const charts_1 = require("./charts");
|
|
8
|
+
(0, vitest_1.describe)('ChartsClientV2', () => {
|
|
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)('getSavedChart calls GET /projects/{projectUuid}/saved/{id}', async () => {
|
|
20
|
+
const client = new charts_1.ChartsClientV2(mockHttp);
|
|
21
|
+
const mockResponse = { uuid: 'c1', name: 'Revenue' };
|
|
22
|
+
vitest_1.vi.mocked(mockHttp.get).mockResolvedValue(mockResponse);
|
|
23
|
+
const result = await client.getSavedChart('p1', 'c1');
|
|
24
|
+
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/projects/p1/saved/c1');
|
|
25
|
+
(0, vitest_1.expect)(result).toEqual(mockResponse);
|
|
26
|
+
});
|
|
27
|
+
(0, vitest_1.it)('getSavedChart encodes slug path segments', async () => {
|
|
28
|
+
const client = new charts_1.ChartsClientV2(mockHttp);
|
|
29
|
+
vitest_1.vi.mocked(mockHttp.get).mockResolvedValue({ uuid: 'c1' });
|
|
30
|
+
await client.getSavedChart('p1', 'my/chart');
|
|
31
|
+
(0, vitest_1.expect)(mockHttp.get).toHaveBeenCalledWith('/projects/p1/saved/my%2Fchart');
|
|
32
|
+
});
|
|
33
|
+
(0, vitest_1.it)('deleteSavedChart calls DELETE /projects/{projectUuid}/saved/{id}', async () => {
|
|
34
|
+
const client = new charts_1.ChartsClientV2(mockHttp);
|
|
35
|
+
vitest_1.vi.mocked(mockHttp.delete).mockResolvedValue(undefined);
|
|
36
|
+
await client.deleteSavedChart('p1', 'c1');
|
|
37
|
+
(0, vitest_1.expect)(mockHttp.delete).toHaveBeenCalledWith('/projects/p1/saved/c1');
|
|
38
|
+
});
|
|
39
|
+
(0, vitest_1.it)('deleteSavedChart encodes slug path segments', async () => {
|
|
40
|
+
const client = new charts_1.ChartsClientV2(mockHttp);
|
|
41
|
+
vitest_1.vi.mocked(mockHttp.delete).mockResolvedValue(undefined);
|
|
42
|
+
await client.deleteSavedChart('p1', 'my/chart');
|
|
43
|
+
(0, vitest_1.expect)(mockHttp.delete).toHaveBeenCalledWith('/projects/p1/saved/my%2Fchart');
|
|
44
|
+
});
|
|
45
|
+
});
|
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;
|