@harnessio/react-ti-service-client 0.2.0 → 0.3.1
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/{fetcher → custom-fetcher}/index.d.ts +6 -1
- package/dist/{fetcher → custom-fetcher}/index.js +22 -24
- package/dist/ti-service/src/index.d.ts +1 -1
- package/dist/ti-service/src/index.js +1 -1
- package/dist/ti-service/src/services/hooks/useGetExecutionCoverageReportQuery.d.ts +10 -6
- package/dist/ti-service/src/services/hooks/useGetExecutionCoverageReportQuery.js +1 -1
- package/dist/ti-service/src/services/hooks/useGetTokenQuery.d.ts +12 -7
- package/dist/ti-service/src/services/hooks/useGetTokenQuery.js +1 -1
- package/dist/ti-service/src/services/hooks/useReportSummaryQuery.d.ts +12 -7
- package/dist/ti-service/src/services/hooks/useReportSummaryQuery.js +1 -1
- package/dist/ti-service/src/services/hooks/useReportsInfoQuery.d.ts +12 -7
- package/dist/ti-service/src/services/hooks/useReportsInfoQuery.js +1 -1
- package/dist/ti-service/src/services/hooks/useSearchCoverageFilesQuery.d.ts +9 -5
- package/dist/ti-service/src/services/hooks/useSearchCoverageFilesQuery.js +2 -2
- package/dist/ti-service/src/services/hooks/useTestInfoQuery.d.ts +12 -7
- package/dist/ti-service/src/services/hooks/useTestInfoQuery.js +1 -1
- package/dist/ti-service/src/services/hooks/useTestOverviewQuery.d.ts +13 -8
- package/dist/ti-service/src/services/hooks/useTestOverviewQuery.js +1 -1
- package/dist/ti-service/src/services/index.d.ts +4 -10
- package/dist/ti-service/src/services/index.js +0 -1
- package/dist/ti-service/src/services/responses/NotFoundResponse.d.ts +2 -0
- package/dist/ti-service/src/services/schemas/{FileSummary.d.ts → ItemSummary.d.ts} +1 -1
- package/dist/ti-service/src/services/schemas/PipelineExecutionReport.d.ts +4 -0
- package/dist/ti-service/src/services/schemas/ReportOutput.d.ts +8 -0
- package/package.json +1 -1
- package/dist/ti-service/src/services/helpers.d.ts +0 -14
- package/dist/ti-service/src/services/hooks/useTestCaseSummaryV2Query.d.ts +0 -42
- package/dist/ti-service/src/services/hooks/useTestCaseSummaryV2Query.js +0 -14
- package/dist/ti-service/src/services/schemas/ReportPipelineExecutionOutput.d.ts +0 -11
- package/dist/ti-service/src/services/schemas/ResponseMetadata.d.ts +0 -6
- package/dist/ti-service/src/services/schemas/ResponseMetadata.js +0 -4
- package/dist/ti-service/src/services/schemas/Result.d.ts +0 -16
- package/dist/ti-service/src/services/schemas/TestCase.d.ts +0 -21
- package/dist/ti-service/src/services/schemas/TestCase.js +0 -1
- package/dist/ti-service/src/services/schemas/TestCaseStatus.d.ts +0 -4
- package/dist/ti-service/src/services/schemas/TestCaseStatus.js +0 -4
- package/dist/ti-service/src/services/schemas/TestCases.d.ts +0 -6
- package/dist/ti-service/src/services/schemas/TestCases.js +0 -1
- /package/dist/ti-service/src/services/{helpers.js → responses/NotFoundResponse.js} +0 -0
- /package/dist/ti-service/src/services/schemas/{FileSummary.js → ItemSummary.js} +0 -0
- /package/dist/ti-service/src/services/schemas/{ReportPipelineExecutionOutput.js → PipelineExecutionReport.js} +0 -0
- /package/dist/ti-service/src/services/schemas/{Result.js → ReportOutput.js} +0 -0
|
@@ -14,4 +14,9 @@ export interface ClientCallbacks {
|
|
|
14
14
|
}
|
|
15
15
|
export declare function setupClient(callbacks: ClientCallbacks): void;
|
|
16
16
|
export declare const updateClientHeaders: (headers: Record<string, any>) => void;
|
|
17
|
-
|
|
17
|
+
interface ResponseContainer<T> {
|
|
18
|
+
body: T;
|
|
19
|
+
headers: Headers;
|
|
20
|
+
}
|
|
21
|
+
export declare function fetcher<TResponse = unknown, TQueryParams = never, TBody = never, THeaderParams = HeadersInit>(options: FetcherOptions<TQueryParams, TBody, THeaderParams>): Promise<ResponseContainer<TResponse>>;
|
|
22
|
+
export {};
|
|
@@ -15,50 +15,48 @@ export const updateClientHeaders = (headers) => {
|
|
|
15
15
|
customHeaders = Object.assign(Object.assign({}, customHeaders), headers);
|
|
16
16
|
};
|
|
17
17
|
export function fetcher(options) {
|
|
18
|
-
var _a
|
|
18
|
+
var _a;
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
20
|
// If not initialized throw error even without making request
|
|
21
21
|
if (!APIClientInitialized) {
|
|
22
22
|
throw { reason: 'HarnessReactAPIClient has not been initialized' };
|
|
23
23
|
}
|
|
24
|
-
const { stringifyQueryParamsOptions, headers, body, url, queryParams = {
|
|
25
|
-
const token = customHeaders.token;
|
|
24
|
+
const { stringifyQueryParamsOptions, headers, body, url, queryParams = {} } = options, rest = __rest(options, ["stringifyQueryParamsOptions", "headers", "body", "url", "queryParams"]);
|
|
26
25
|
let finalUrl = url;
|
|
27
26
|
if (queryParams) {
|
|
28
27
|
finalUrl += stringify(queryParams, Object.assign(Object.assign({}, stringifyQueryParamsOptions), { addQueryPrefix: true }));
|
|
29
28
|
}
|
|
30
29
|
if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.urlInterceptor) {
|
|
31
|
-
finalUrl =
|
|
30
|
+
finalUrl = fetcherCallbacks.urlInterceptor(finalUrl);
|
|
32
31
|
}
|
|
33
|
-
let
|
|
32
|
+
let requestBody;
|
|
33
|
+
let finalHeaders = Object.assign(Object.assign({}, headers), customHeaders);
|
|
34
|
+
if (body instanceof FormData) {
|
|
35
|
+
requestBody = body;
|
|
36
|
+
// remove Content-Type so browser sets correct multipart boundary
|
|
37
|
+
const _b = finalHeaders, { ['Content-Type']: _ } = _b, restHeaders = __rest(_b, ['Content-Type']);
|
|
38
|
+
finalHeaders = restHeaders;
|
|
39
|
+
}
|
|
40
|
+
else if (body !== undefined) {
|
|
41
|
+
requestBody = JSON.stringify(body);
|
|
42
|
+
finalHeaders = Object.assign(Object.assign({}, finalHeaders), { 'Content-Type': 'application/json' });
|
|
43
|
+
}
|
|
44
|
+
let request = new Request(finalUrl, Object.assign({ headers: finalHeaders, body: requestBody }, rest));
|
|
34
45
|
if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.requestInterceptor) {
|
|
35
46
|
request = fetcherCallbacks.requestInterceptor(request.clone());
|
|
36
47
|
}
|
|
37
48
|
let response = yield fetch(request);
|
|
38
49
|
if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.responseInterceptor) {
|
|
39
|
-
response =
|
|
40
|
-
}
|
|
41
|
-
const contentType = response.headers.get('Content-Type');
|
|
42
|
-
let total, pageSize, pageNumber, pageCount, pagination;
|
|
43
|
-
try {
|
|
44
|
-
total = response.headers.get('x-total-elements');
|
|
45
|
-
pageSize = response.headers.get('x-page-size');
|
|
46
|
-
pageNumber = response.headers.get('x-page-number');
|
|
47
|
-
pagination = total || pageSize || pageNumber;
|
|
48
|
-
if (pagination) {
|
|
49
|
-
total = Number(total);
|
|
50
|
-
pageSize = Number(pageSize);
|
|
51
|
-
pageCount = Math.ceil(total / pageSize);
|
|
52
|
-
pageNumber = Number(pageNumber);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch (e) {
|
|
56
|
-
throw new Error('HarnessReactAPIClient: An error occurred while parsing pagination headers. ' + e);
|
|
50
|
+
response = fetcherCallbacks.responseInterceptor(response.clone());
|
|
57
51
|
}
|
|
52
|
+
const contentType = (_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a.get('Content-Type');
|
|
58
53
|
const asJson = contentType && JSON_CONTENT_TYPES.some((h) => contentType.startsWith(h));
|
|
59
54
|
const data = yield (asJson ? response.json() : response.text());
|
|
60
55
|
if (response.ok) {
|
|
61
|
-
return
|
|
56
|
+
return {
|
|
57
|
+
body: data,
|
|
58
|
+
headers: response.headers,
|
|
59
|
+
};
|
|
62
60
|
}
|
|
63
61
|
throw data;
|
|
64
62
|
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PipelineExecutionReport } from '../schemas/PipelineExecutionReport';
|
|
3
3
|
import type { BadRequestResponse } from '../responses/BadRequestResponse';
|
|
4
4
|
import type { UnauthenticatedResponse } from '../responses/UnauthenticatedResponse';
|
|
5
5
|
import type { UnauthorizedResponse } from '../responses/UnauthorizedResponse';
|
|
6
6
|
import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
|
|
7
|
-
import
|
|
8
|
-
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
7
|
+
import { FetcherOptions } from '../../../../custom-fetcher/index.js';
|
|
9
8
|
export interface GetExecutionCoverageReportQueryPathParams {
|
|
10
9
|
account_identifier: string;
|
|
11
10
|
execution_id: string;
|
|
@@ -16,14 +15,19 @@ export interface GetExecutionCoverageReportQueryQueryParams {
|
|
|
16
15
|
}
|
|
17
16
|
export interface GetExecutionCoverageReportQueryHeaderParams {
|
|
18
17
|
'harness-account'?: string;
|
|
18
|
+
'X-Harness-Token': string;
|
|
19
19
|
}
|
|
20
|
-
export type GetExecutionCoverageReportOkResponse =
|
|
20
|
+
export type GetExecutionCoverageReportOkResponse = PipelineExecutionReport;
|
|
21
21
|
export type GetExecutionCoverageReportErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | InternalErrorResponse;
|
|
22
22
|
export interface GetExecutionCoverageReportProps extends GetExecutionCoverageReportQueryPathParams, Omit<FetcherOptions<GetExecutionCoverageReportQueryQueryParams, unknown, GetExecutionCoverageReportQueryHeaderParams>, 'url'> {
|
|
23
23
|
queryParams: GetExecutionCoverageReportQueryQueryParams;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
25
|
+
export interface GetExecutionCoverageReportResponseContainer {
|
|
26
|
+
body: GetExecutionCoverageReportOkResponse;
|
|
27
|
+
headers: Headers;
|
|
28
|
+
}
|
|
29
|
+
export declare function getExecutionCoverageReport(props: GetExecutionCoverageReportProps): Promise<GetExecutionCoverageReportResponseContainer>;
|
|
26
30
|
/**
|
|
27
31
|
* Retrieve pipeline execution coverage data for a specific file path or directory tree
|
|
28
32
|
*/
|
|
29
|
-
export declare function useGetExecutionCoverageReportQuery(props: GetExecutionCoverageReportProps, options?: Omit<UseQueryOptions<
|
|
33
|
+
export declare function useGetExecutionCoverageReportQuery(props: GetExecutionCoverageReportProps, options?: Omit<UseQueryOptions<GetExecutionCoverageReportResponseContainer, GetExecutionCoverageReportErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetExecutionCoverageReportResponseContainer, import("..").Error>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
3
|
// Please do not modify this code directly.
|
|
4
4
|
import { useQuery } from '@tanstack/react-query';
|
|
5
|
-
import { fetcher } from '../../../../fetcher/index.js';
|
|
5
|
+
import { fetcher } from '../../../../custom-fetcher/index.js';
|
|
6
6
|
export function getExecutionCoverageReport(props) {
|
|
7
7
|
return fetcher(Object.assign({ url: `/coverage/api/v1/accounts/${props.account_identifier}/executions/${props.execution_id}/tree/${props.tree_path}`, method: 'GET' }, props));
|
|
8
8
|
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
2
|
+
import type { BadRequestResponse } from '../responses/BadRequestResponse';
|
|
3
|
+
import type { NotFoundResponse } from '../responses/NotFoundResponse';
|
|
4
|
+
import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
|
|
5
|
+
import { FetcherOptions } from '../../../../custom-fetcher/index.js';
|
|
5
6
|
export interface GetTokenQueryQueryParams {
|
|
6
7
|
accountId: string;
|
|
7
8
|
}
|
|
8
|
-
export type GetTokenOkResponse =
|
|
9
|
-
export type GetTokenErrorResponse =
|
|
9
|
+
export type GetTokenOkResponse = string;
|
|
10
|
+
export type GetTokenErrorResponse = BadRequestResponse | NotFoundResponse | InternalErrorResponse;
|
|
10
11
|
export interface GetTokenProps extends Omit<FetcherOptions<GetTokenQueryQueryParams, unknown>, 'url'> {
|
|
11
12
|
queryParams: GetTokenQueryQueryParams;
|
|
12
13
|
}
|
|
13
|
-
export
|
|
14
|
+
export interface GetTokenResponseContainer {
|
|
15
|
+
body: GetTokenOkResponse;
|
|
16
|
+
headers: Headers;
|
|
17
|
+
}
|
|
18
|
+
export declare function getToken(props: GetTokenProps): Promise<GetTokenResponseContainer>;
|
|
14
19
|
/**
|
|
15
20
|
* Get an account level token
|
|
16
21
|
*/
|
|
17
|
-
export declare function useGetTokenQuery(props: GetTokenProps, options?: Omit<UseQueryOptions<
|
|
22
|
+
export declare function useGetTokenQuery(props: GetTokenProps, options?: Omit<UseQueryOptions<GetTokenResponseContainer, GetTokenErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetTokenResponseContainer, import("..").Error>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
3
|
// Please do not modify this code directly.
|
|
4
4
|
import { useQuery } from '@tanstack/react-query';
|
|
5
|
-
import { fetcher } from '../../../../fetcher/index.js';
|
|
5
|
+
import { fetcher } from '../../../../custom-fetcher/index.js';
|
|
6
6
|
export function getToken(props) {
|
|
7
7
|
return fetcher(Object.assign({ url: `/token`, method: 'GET' }, props));
|
|
8
8
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
2
|
import type { TestReportSummary } from '../schemas/TestReportSummary';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
3
|
+
import type { BadRequestResponse } from '../responses/BadRequestResponse';
|
|
4
|
+
import type { NotFoundResponse } from '../responses/NotFoundResponse';
|
|
5
|
+
import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
|
|
6
|
+
import { FetcherOptions } from '../../../../custom-fetcher/index.js';
|
|
6
7
|
export interface ReportSummaryQueryQueryParams {
|
|
7
8
|
accountId: string;
|
|
8
9
|
orgId: string;
|
|
@@ -13,13 +14,17 @@ export interface ReportSummaryQueryQueryParams {
|
|
|
13
14
|
stepId?: string;
|
|
14
15
|
stageId?: string;
|
|
15
16
|
}
|
|
16
|
-
export type ReportSummaryOkResponse =
|
|
17
|
-
export type ReportSummaryErrorResponse =
|
|
17
|
+
export type ReportSummaryOkResponse = TestReportSummary;
|
|
18
|
+
export type ReportSummaryErrorResponse = BadRequestResponse | NotFoundResponse | InternalErrorResponse;
|
|
18
19
|
export interface ReportSummaryProps extends Omit<FetcherOptions<ReportSummaryQueryQueryParams, unknown>, 'url'> {
|
|
19
20
|
queryParams: ReportSummaryQueryQueryParams;
|
|
20
21
|
}
|
|
21
|
-
export
|
|
22
|
+
export interface ReportSummaryResponseContainer {
|
|
23
|
+
body: ReportSummaryOkResponse;
|
|
24
|
+
headers: Headers;
|
|
25
|
+
}
|
|
26
|
+
export declare function reportSummary(props: ReportSummaryProps): Promise<ReportSummaryResponseContainer>;
|
|
22
27
|
/**
|
|
23
28
|
* Get summary of test reports
|
|
24
29
|
*/
|
|
25
|
-
export declare function useReportSummaryQuery(props: ReportSummaryProps, options?: Omit<UseQueryOptions<
|
|
30
|
+
export declare function useReportSummaryQuery(props: ReportSummaryProps, options?: Omit<UseQueryOptions<ReportSummaryResponseContainer, ReportSummaryErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ReportSummaryResponseContainer, import("..").Error>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
3
|
// Please do not modify this code directly.
|
|
4
4
|
import { useQuery } from '@tanstack/react-query';
|
|
5
|
-
import { fetcher } from '../../../../fetcher/index.js';
|
|
5
|
+
import { fetcher } from '../../../../custom-fetcher/index.js';
|
|
6
6
|
export function reportSummary(props) {
|
|
7
7
|
return fetcher(Object.assign({ url: `/reports/summary`, method: 'GET' }, props));
|
|
8
8
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
2
|
import type { StepInfo } from '../schemas/StepInfo';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
3
|
+
import type { BadRequestResponse } from '../responses/BadRequestResponse';
|
|
4
|
+
import type { NotFoundResponse } from '../responses/NotFoundResponse';
|
|
5
|
+
import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
|
|
6
|
+
import { FetcherOptions } from '../../../../custom-fetcher/index.js';
|
|
6
7
|
export interface ReportsInfoQueryQueryParams {
|
|
7
8
|
accountId: string;
|
|
8
9
|
orgId: string;
|
|
@@ -10,13 +11,17 @@ export interface ReportsInfoQueryQueryParams {
|
|
|
10
11
|
pipelineId: string;
|
|
11
12
|
buildId: string;
|
|
12
13
|
}
|
|
13
|
-
export type ReportsInfoOkResponse =
|
|
14
|
-
export type ReportsInfoErrorResponse =
|
|
14
|
+
export type ReportsInfoOkResponse = StepInfo[];
|
|
15
|
+
export type ReportsInfoErrorResponse = BadRequestResponse | NotFoundResponse | InternalErrorResponse;
|
|
15
16
|
export interface ReportsInfoProps extends Omit<FetcherOptions<ReportsInfoQueryQueryParams, unknown>, 'url'> {
|
|
16
17
|
queryParams: ReportsInfoQueryQueryParams;
|
|
17
18
|
}
|
|
18
|
-
export
|
|
19
|
+
export interface ReportsInfoResponseContainer {
|
|
20
|
+
body: ReportsInfoOkResponse;
|
|
21
|
+
headers: Headers;
|
|
22
|
+
}
|
|
23
|
+
export declare function reportsInfo(props: ReportsInfoProps): Promise<ReportsInfoResponseContainer>;
|
|
19
24
|
/**
|
|
20
25
|
* Get information about test reports
|
|
21
26
|
*/
|
|
22
|
-
export declare function useReportsInfoQuery(props: ReportsInfoProps, options?: Omit<UseQueryOptions<
|
|
27
|
+
export declare function useReportsInfoQuery(props: ReportsInfoProps, options?: Omit<UseQueryOptions<ReportsInfoResponseContainer, ReportsInfoErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ReportsInfoResponseContainer, import("..").Error>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
3
|
// Please do not modify this code directly.
|
|
4
4
|
import { useQuery } from '@tanstack/react-query';
|
|
5
|
-
import { fetcher } from '../../../../fetcher/index.js';
|
|
5
|
+
import { fetcher } from '../../../../custom-fetcher/index.js';
|
|
6
6
|
export function reportsInfo(props) {
|
|
7
7
|
return fetcher(Object.assign({ url: `/reports/info`, method: 'GET' }, props));
|
|
8
8
|
}
|
|
@@ -4,8 +4,7 @@ import type { BadRequestResponse } from '../responses/BadRequestResponse';
|
|
|
4
4
|
import type { UnauthenticatedResponse } from '../responses/UnauthenticatedResponse';
|
|
5
5
|
import type { UnauthorizedResponse } from '../responses/UnauthorizedResponse';
|
|
6
6
|
import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
|
|
7
|
-
import
|
|
8
|
-
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
7
|
+
import { FetcherOptions } from '../../../../custom-fetcher/index.js';
|
|
9
8
|
export interface SearchCoverageFilesQueryPathParams {
|
|
10
9
|
account_identifier: string;
|
|
11
10
|
execution_id: string;
|
|
@@ -15,14 +14,19 @@ export interface SearchCoverageFilesQueryQueryParams {
|
|
|
15
14
|
}
|
|
16
15
|
export interface SearchCoverageFilesQueryHeaderParams {
|
|
17
16
|
'harness-account'?: string;
|
|
17
|
+
'X-Harness-Token': string;
|
|
18
18
|
}
|
|
19
|
-
export type SearchCoverageFilesOkResponse =
|
|
19
|
+
export type SearchCoverageFilesOkResponse = SearchResults;
|
|
20
20
|
export type SearchCoverageFilesErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | InternalErrorResponse;
|
|
21
21
|
export interface SearchCoverageFilesProps extends SearchCoverageFilesQueryPathParams, Omit<FetcherOptions<SearchCoverageFilesQueryQueryParams, unknown, SearchCoverageFilesQueryHeaderParams>, 'url'> {
|
|
22
22
|
queryParams: SearchCoverageFilesQueryQueryParams;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
24
|
+
export interface SearchCoverageFilesResponseContainer {
|
|
25
|
+
body: SearchCoverageFilesOkResponse;
|
|
26
|
+
headers: Headers;
|
|
27
|
+
}
|
|
28
|
+
export declare function searchCoverageFiles(props: SearchCoverageFilesProps): Promise<SearchCoverageFilesResponseContainer>;
|
|
25
29
|
/**
|
|
26
30
|
* Search for files in a pipeline execution
|
|
27
31
|
*/
|
|
28
|
-
export declare function useSearchCoverageFilesQuery(props: SearchCoverageFilesProps, options?: Omit<UseQueryOptions<
|
|
32
|
+
export declare function useSearchCoverageFilesQuery(props: SearchCoverageFilesProps, options?: Omit<UseQueryOptions<SearchCoverageFilesResponseContainer, SearchCoverageFilesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<SearchCoverageFilesResponseContainer, import("..").Error>;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
3
|
// Please do not modify this code directly.
|
|
4
4
|
import { useQuery } from '@tanstack/react-query';
|
|
5
|
-
import { fetcher } from '../../../../fetcher/index.js';
|
|
5
|
+
import { fetcher } from '../../../../custom-fetcher/index.js';
|
|
6
6
|
export function searchCoverageFiles(props) {
|
|
7
|
-
return fetcher(Object.assign({ url: `/coverage/api/v1/accounts/${props.account_identifier}/executions/${props.execution_id}
|
|
7
|
+
return fetcher(Object.assign({ url: `/coverage/api/v1/accounts/${props.account_identifier}/executions/${props.execution_id}`, method: 'GET' }, props));
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Search for files in a pipeline execution
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
2
|
import type { StepInfo } from '../schemas/StepInfo';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
3
|
+
import type { BadRequestResponse } from '../responses/BadRequestResponse';
|
|
4
|
+
import type { NotFoundResponse } from '../responses/NotFoundResponse';
|
|
5
|
+
import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
|
|
6
|
+
import { FetcherOptions } from '../../../../custom-fetcher/index.js';
|
|
6
7
|
export interface TestInfoQueryQueryParams {
|
|
7
8
|
accountId: string;
|
|
8
9
|
orgId: string;
|
|
@@ -10,13 +11,17 @@ export interface TestInfoQueryQueryParams {
|
|
|
10
11
|
pipelineId: string;
|
|
11
12
|
buildId: string;
|
|
12
13
|
}
|
|
13
|
-
export type TestInfoOkResponse =
|
|
14
|
-
export type TestInfoErrorResponse =
|
|
14
|
+
export type TestInfoOkResponse = StepInfo[];
|
|
15
|
+
export type TestInfoErrorResponse = BadRequestResponse | NotFoundResponse | InternalErrorResponse;
|
|
15
16
|
export interface TestInfoProps extends Omit<FetcherOptions<TestInfoQueryQueryParams, unknown>, 'url'> {
|
|
16
17
|
queryParams: TestInfoQueryQueryParams;
|
|
17
18
|
}
|
|
18
|
-
export
|
|
19
|
+
export interface TestInfoResponseContainer {
|
|
20
|
+
body: TestInfoOkResponse;
|
|
21
|
+
headers: Headers;
|
|
22
|
+
}
|
|
23
|
+
export declare function testInfo(props: TestInfoProps): Promise<TestInfoResponseContainer>;
|
|
19
24
|
/**
|
|
20
25
|
* Get information about TI steps
|
|
21
26
|
*/
|
|
22
|
-
export declare function useTestInfoQuery(props: TestInfoProps, options?: Omit<UseQueryOptions<
|
|
27
|
+
export declare function useTestInfoQuery(props: TestInfoProps, options?: Omit<UseQueryOptions<TestInfoResponseContainer, TestInfoErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<TestInfoResponseContainer, import("..").Error>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
3
|
// Please do not modify this code directly.
|
|
4
4
|
import { useQuery } from '@tanstack/react-query';
|
|
5
|
-
import { fetcher } from '../../../../fetcher/index.js';
|
|
5
|
+
import { fetcher } from '../../../../custom-fetcher/index.js';
|
|
6
6
|
export function testInfo(props) {
|
|
7
7
|
return fetcher(Object.assign({ url: `/tests/info`, method: 'GET' }, props));
|
|
8
8
|
}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
2
|
import type { SelectionOverview } from '../schemas/SelectionOverview';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
3
|
+
import type { BadRequestResponse } from '../responses/BadRequestResponse';
|
|
4
|
+
import type { NotFoundResponse } from '../responses/NotFoundResponse';
|
|
5
|
+
import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
|
|
6
|
+
import { FetcherOptions } from '../../../../custom-fetcher/index.js';
|
|
6
7
|
export interface TestOverviewQueryQueryParams {
|
|
7
8
|
accountId: string;
|
|
8
9
|
orgId: string;
|
|
9
10
|
projectId: string;
|
|
10
11
|
pipelineId: string;
|
|
11
12
|
buildId: string;
|
|
12
|
-
stepId: string;
|
|
13
13
|
stageId: string;
|
|
14
|
+
stepId: string;
|
|
14
15
|
}
|
|
15
|
-
export type TestOverviewOkResponse =
|
|
16
|
-
export type TestOverviewErrorResponse =
|
|
16
|
+
export type TestOverviewOkResponse = SelectionOverview;
|
|
17
|
+
export type TestOverviewErrorResponse = BadRequestResponse | NotFoundResponse | InternalErrorResponse;
|
|
17
18
|
export interface TestOverviewProps extends Omit<FetcherOptions<TestOverviewQueryQueryParams, unknown>, 'url'> {
|
|
18
19
|
queryParams: TestOverviewQueryQueryParams;
|
|
19
20
|
}
|
|
20
|
-
export
|
|
21
|
+
export interface TestOverviewResponseContainer {
|
|
22
|
+
body: TestOverviewOkResponse;
|
|
23
|
+
headers: Headers;
|
|
24
|
+
}
|
|
25
|
+
export declare function testOverview(props: TestOverviewProps): Promise<TestOverviewResponseContainer>;
|
|
21
26
|
/**
|
|
22
27
|
* Get overview of selected tests.
|
|
23
28
|
*/
|
|
24
|
-
export declare function useTestOverviewQuery(props: TestOverviewProps, options?: Omit<UseQueryOptions<
|
|
29
|
+
export declare function useTestOverviewQuery(props: TestOverviewProps, options?: Omit<UseQueryOptions<TestOverviewResponseContainer, TestOverviewErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<TestOverviewResponseContainer, import("..").Error>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
3
|
// Please do not modify this code directly.
|
|
4
4
|
import { useQuery } from '@tanstack/react-query';
|
|
5
|
-
import { fetcher } from '../../../../fetcher/index.js';
|
|
5
|
+
import { fetcher } from '../../../../custom-fetcher/index.js';
|
|
6
6
|
export function testOverview(props) {
|
|
7
7
|
return fetcher(Object.assign({ url: `/tests/overview`, method: 'GET' }, props));
|
|
8
8
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export type { GetPathParamsType, ResponseWithPagination } from './helpers';
|
|
2
1
|
export type { GetExecutionCoverageReportErrorResponse, GetExecutionCoverageReportOkResponse, GetExecutionCoverageReportProps, GetExecutionCoverageReportQueryPathParams, GetExecutionCoverageReportQueryQueryParams, } from './hooks/useGetExecutionCoverageReportQuery';
|
|
3
2
|
export { getExecutionCoverageReport, useGetExecutionCoverageReportQuery, } from './hooks/useGetExecutionCoverageReportQuery';
|
|
4
3
|
export type { GetTokenErrorResponse, GetTokenOkResponse, GetTokenProps, GetTokenQueryQueryParams, } from './hooks/useGetTokenQuery';
|
|
@@ -9,27 +8,22 @@ export type { ReportsInfoErrorResponse, ReportsInfoOkResponse, ReportsInfoProps,
|
|
|
9
8
|
export { reportsInfo, useReportsInfoQuery } from './hooks/useReportsInfoQuery';
|
|
10
9
|
export type { SearchCoverageFilesErrorResponse, SearchCoverageFilesOkResponse, SearchCoverageFilesProps, SearchCoverageFilesQueryPathParams, SearchCoverageFilesQueryQueryParams, } from './hooks/useSearchCoverageFilesQuery';
|
|
11
10
|
export { searchCoverageFiles, useSearchCoverageFilesQuery, } from './hooks/useSearchCoverageFilesQuery';
|
|
12
|
-
export type { TestCaseSummaryV2ErrorResponse, TestCaseSummaryV2OkResponse, TestCaseSummaryV2Props, TestCaseSummaryV2QueryQueryParams, } from './hooks/useTestCaseSummaryV2Query';
|
|
13
|
-
export { testCaseSummaryV2, useTestCaseSummaryV2Query } from './hooks/useTestCaseSummaryV2Query';
|
|
14
11
|
export type { TestInfoErrorResponse, TestInfoOkResponse, TestInfoProps, TestInfoQueryQueryParams, } from './hooks/useTestInfoQuery';
|
|
15
12
|
export { testInfo, useTestInfoQuery } from './hooks/useTestInfoQuery';
|
|
16
13
|
export type { TestOverviewErrorResponse, TestOverviewOkResponse, TestOverviewProps, TestOverviewQueryQueryParams, } from './hooks/useTestOverviewQuery';
|
|
17
14
|
export { testOverview, useTestOverviewQuery } from './hooks/useTestOverviewQuery';
|
|
18
15
|
export type { BadRequestResponse } from './responses/BadRequestResponse';
|
|
19
16
|
export type { InternalErrorResponse } from './responses/InternalErrorResponse';
|
|
17
|
+
export type { NotFoundResponse } from './responses/NotFoundResponse';
|
|
20
18
|
export type { UnauthenticatedResponse } from './responses/UnauthenticatedResponse';
|
|
21
19
|
export type { UnauthorizedResponse } from './responses/UnauthorizedResponse';
|
|
22
20
|
export type { CoverageSummary } from './schemas/CoverageSummary';
|
|
23
21
|
export type { Error } from './schemas/Error';
|
|
24
|
-
export type {
|
|
25
|
-
export type {
|
|
26
|
-
export type {
|
|
27
|
-
export type { Result } from './schemas/Result';
|
|
22
|
+
export type { ItemSummary } from './schemas/ItemSummary';
|
|
23
|
+
export type { PipelineExecutionReport } from './schemas/PipelineExecutionReport';
|
|
24
|
+
export type { ReportOutput } from './schemas/ReportOutput';
|
|
28
25
|
export type { SearchResults } from './schemas/SearchResults';
|
|
29
26
|
export type { SelectionDetails } from './schemas/SelectionDetails';
|
|
30
27
|
export type { SelectionOverview } from './schemas/SelectionOverview';
|
|
31
28
|
export type { StepInfo } from './schemas/StepInfo';
|
|
32
|
-
export type { TestCase } from './schemas/TestCase';
|
|
33
|
-
export type { TestCaseStatus } from './schemas/TestCaseStatus';
|
|
34
|
-
export type { TestCases } from './schemas/TestCases';
|
|
35
29
|
export type { TestReportSummary } from './schemas/TestReportSummary';
|
|
@@ -3,6 +3,5 @@ export { getToken, useGetTokenQuery } from './hooks/useGetTokenQuery';
|
|
|
3
3
|
export { reportSummary, useReportSummaryQuery } from './hooks/useReportSummaryQuery';
|
|
4
4
|
export { reportsInfo, useReportsInfoQuery } from './hooks/useReportsInfoQuery';
|
|
5
5
|
export { searchCoverageFiles, useSearchCoverageFilesQuery, } from './hooks/useSearchCoverageFilesQuery';
|
|
6
|
-
export { testCaseSummaryV2, useTestCaseSummaryV2Query } from './hooks/useTestCaseSummaryV2Query';
|
|
7
6
|
export { testInfo, useTestInfoQuery } from './hooks/useTestInfoQuery';
|
|
8
7
|
export { testOverview, useTestOverviewQuery } from './hooks/useTestOverviewQuery';
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type GetPathParamsType<T> = T extends {
|
|
2
|
-
pathParams: infer R;
|
|
3
|
-
} ? R : never;
|
|
4
|
-
export interface ResponseWithPagination<T> {
|
|
5
|
-
content: T;
|
|
6
|
-
pagination?: {
|
|
7
|
-
total?: number;
|
|
8
|
-
pageSize?: number;
|
|
9
|
-
pageCount?: number;
|
|
10
|
-
pageNumber?: number;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export type WithOptional<TInput, Tkeys extends keyof TInput> = Omit<TInput, Tkeys> & Partial<Pick<TInput, Tkeys>>;
|
|
14
|
-
export type PickPartial<TInput, Tkeys extends keyof TInput> = Pick<Partial<TInput>, Tkeys>;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import type { TestCases } from '../schemas/TestCases';
|
|
3
|
-
import type { Error } from '../schemas/Error';
|
|
4
|
-
import type { ResponseWithPagination } from '../helpers';
|
|
5
|
-
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
-
export interface TestCaseSummaryV2QueryQueryParams {
|
|
7
|
-
accountId: string;
|
|
8
|
-
orgId: string;
|
|
9
|
-
projectId: string;
|
|
10
|
-
pipelineId: string;
|
|
11
|
-
buildId: string;
|
|
12
|
-
stepId?: string;
|
|
13
|
-
stageId?: string;
|
|
14
|
-
report: 'junit';
|
|
15
|
-
suite_name?: string;
|
|
16
|
-
testCaseSearchTerm?: string;
|
|
17
|
-
/**
|
|
18
|
-
* @default 100
|
|
19
|
-
*/
|
|
20
|
-
pageSize?: number;
|
|
21
|
-
/**
|
|
22
|
-
* @default 0
|
|
23
|
-
*/
|
|
24
|
-
pageIndex?: number;
|
|
25
|
-
status?: 'failed';
|
|
26
|
-
flaky?: boolean;
|
|
27
|
-
sort?: 'class_name' | 'duration_ms' | 'name' | 'status';
|
|
28
|
-
/**
|
|
29
|
-
* @default "ASC"
|
|
30
|
-
*/
|
|
31
|
-
order?: 'ASC' | 'DESC';
|
|
32
|
-
}
|
|
33
|
-
export type TestCaseSummaryV2OkResponse = ResponseWithPagination<TestCases>;
|
|
34
|
-
export type TestCaseSummaryV2ErrorResponse = Error;
|
|
35
|
-
export interface TestCaseSummaryV2Props extends Omit<FetcherOptions<TestCaseSummaryV2QueryQueryParams, unknown>, 'url'> {
|
|
36
|
-
queryParams: TestCaseSummaryV2QueryQueryParams;
|
|
37
|
-
}
|
|
38
|
-
export declare function testCaseSummaryV2(props: TestCaseSummaryV2Props): Promise<TestCaseSummaryV2OkResponse>;
|
|
39
|
-
/**
|
|
40
|
-
* Get test case details
|
|
41
|
-
*/
|
|
42
|
-
export declare function useTestCaseSummaryV2Query(props: TestCaseSummaryV2Props, options?: Omit<UseQueryOptions<TestCaseSummaryV2OkResponse, TestCaseSummaryV2ErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<TestCaseSummaryV2OkResponse, Error>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// This code is autogenerated using @harnessio/oats-cli.
|
|
3
|
-
// Please do not modify this code directly.
|
|
4
|
-
import { useQuery } from '@tanstack/react-query';
|
|
5
|
-
import { fetcher } from '../../../../fetcher/index.js';
|
|
6
|
-
export function testCaseSummaryV2(props) {
|
|
7
|
-
return fetcher(Object.assign({ url: `/reports/test_cases_v2`, method: 'GET' }, props));
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Get test case details
|
|
11
|
-
*/
|
|
12
|
-
export function useTestCaseSummaryV2Query(props, options) {
|
|
13
|
-
return useQuery(['testCaseSummaryV2', props.queryParams], ({ signal }) => testCaseSummaryV2(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { FileSummary } from '../schemas/FileSummary';
|
|
2
|
-
import type { CoverageSummary } from '../schemas/CoverageSummary';
|
|
3
|
-
export interface ReportPipelineExecutionOutput {
|
|
4
|
-
files: FileSummary[];
|
|
5
|
-
lines?: Array<number[]>;
|
|
6
|
-
path?: string;
|
|
7
|
-
summary: CoverageSummary | {
|
|
8
|
-
report_count?: number;
|
|
9
|
-
};
|
|
10
|
-
type?: 'dir' | 'file' | 'repo';
|
|
11
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { TestCaseStatus } from '../schemas/TestCaseStatus';
|
|
2
|
-
export interface Result {
|
|
3
|
-
/**
|
|
4
|
-
* Description corresponding to the test case status
|
|
5
|
-
*/
|
|
6
|
-
desc?: string;
|
|
7
|
-
/**
|
|
8
|
-
* Message corresponding to the test case status
|
|
9
|
-
*/
|
|
10
|
-
message?: string;
|
|
11
|
-
status?: TestCaseStatus;
|
|
12
|
-
/**
|
|
13
|
-
* Type corresponding to the test case status
|
|
14
|
-
*/
|
|
15
|
-
type?: string;
|
|
16
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Result } from '../schemas/Result';
|
|
2
|
-
export interface TestCase {
|
|
3
|
-
class_name?: string;
|
|
4
|
-
/**
|
|
5
|
-
* @format int64
|
|
6
|
-
*/
|
|
7
|
-
duration_ms?: number;
|
|
8
|
-
file_name?: string;
|
|
9
|
-
flaky?: boolean;
|
|
10
|
-
name?: string;
|
|
11
|
-
result?: Result;
|
|
12
|
-
/**
|
|
13
|
-
* (Truncated) stderr while running the test
|
|
14
|
-
*/
|
|
15
|
-
stderr?: string;
|
|
16
|
-
/**
|
|
17
|
-
* (Truncated) stdout while running the test
|
|
18
|
-
*/
|
|
19
|
-
stdout?: string;
|
|
20
|
-
suite_name?: string;
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|