@harnessio/react-ti-service-client 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/ti-service/src/services/hooks/usePatchCoverageFilesQuery.d.ts +30 -0
  2. package/dist/ti-service/src/services/hooks/usePatchCoverageFilesQuery.js +20 -0
  3. package/dist/ti-service/src/services/hooks/useTestCaseSummaryV2Query.d.ts +47 -0
  4. package/dist/ti-service/src/services/hooks/useTestCaseSummaryV2Query.js +14 -0
  5. package/dist/ti-service/src/services/index.d.ts +11 -0
  6. package/dist/ti-service/src/services/index.js +2 -0
  7. package/dist/ti-service/src/services/schemas/CoverageSummary.d.ts +4 -7
  8. package/dist/ti-service/src/services/schemas/CoverageSummary.js +0 -3
  9. package/dist/ti-service/src/services/schemas/ItemSummary.d.ts +2 -0
  10. package/dist/ti-service/src/services/schemas/PatchFilesResponse.d.ts +8 -0
  11. package/dist/ti-service/src/services/schemas/PatchFilesResponse.js +1 -0
  12. package/dist/ti-service/src/services/schemas/PatchSummary.d.ts +7 -0
  13. package/dist/ti-service/src/services/schemas/PatchSummary.js +4 -0
  14. package/dist/ti-service/src/services/schemas/ReportOutput.d.ts +2 -0
  15. package/dist/ti-service/src/services/schemas/ResponseMetadata.d.ts +6 -0
  16. package/dist/ti-service/src/services/schemas/ResponseMetadata.js +4 -0
  17. package/dist/ti-service/src/services/schemas/Result.d.ts +16 -0
  18. package/dist/ti-service/src/services/schemas/Result.js +1 -0
  19. package/dist/ti-service/src/services/schemas/TestCase.d.ts +21 -0
  20. package/dist/ti-service/src/services/schemas/TestCase.js +1 -0
  21. package/dist/ti-service/src/services/schemas/TestCaseStatus.d.ts +4 -0
  22. package/dist/ti-service/src/services/schemas/TestCaseStatus.js +4 -0
  23. package/dist/ti-service/src/services/schemas/TestCases.d.ts +6 -0
  24. package/dist/ti-service/src/services/schemas/TestCases.js +1 -0
  25. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { PatchFilesResponse } from '../schemas/PatchFilesResponse';
3
+ import type { BadRequestResponse } from '../responses/BadRequestResponse';
4
+ import type { UnauthenticatedResponse } from '../responses/UnauthenticatedResponse';
5
+ import type { UnauthorizedResponse } from '../responses/UnauthorizedResponse';
6
+ import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
7
+ import { FetcherOptions } from '../../../../custom-fetcher/index.js';
8
+ export interface PatchCoverageFilesQueryPathParams {
9
+ account_identifier: string;
10
+ execution_id: string;
11
+ repo_ref: string;
12
+ commit: string;
13
+ }
14
+ export interface PatchCoverageFilesQueryHeaderParams {
15
+ 'harness-account'?: string;
16
+ 'X-Harness-Token': string;
17
+ }
18
+ export type PatchCoverageFilesOkResponse = PatchFilesResponse;
19
+ export type PatchCoverageFilesErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | InternalErrorResponse;
20
+ export interface PatchCoverageFilesProps extends PatchCoverageFilesQueryPathParams, Omit<FetcherOptions<unknown, unknown, PatchCoverageFilesQueryHeaderParams>, 'url'> {
21
+ }
22
+ export interface PatchCoverageFilesResponseContainer {
23
+ body: PatchCoverageFilesOkResponse;
24
+ headers: Headers;
25
+ }
26
+ export declare function patchCoverageFiles(props: PatchCoverageFilesProps): Promise<PatchCoverageFilesResponseContainer>;
27
+ /**
28
+ * Show coverage for patch files
29
+ */
30
+ export declare function usePatchCoverageFilesQuery(props: PatchCoverageFilesProps, options?: Omit<UseQueryOptions<PatchCoverageFilesResponseContainer, PatchCoverageFilesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<PatchCoverageFilesResponseContainer, import("..").Error>;
@@ -0,0 +1,20 @@
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 '../../../../custom-fetcher/index.js';
6
+ export function patchCoverageFiles(props) {
7
+ return fetcher(Object.assign({ url: `/coverage/api/v1/accounts/${props.account_identifier}/executions/${props.execution_id}/repo/${props.repo_ref}/patch/${props.commit}`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Show coverage for patch files
11
+ */
12
+ export function usePatchCoverageFilesQuery(props, options) {
13
+ return useQuery([
14
+ 'patchCoverageFiles',
15
+ props.account_identifier,
16
+ props.execution_id,
17
+ props.repo_ref,
18
+ props.commit,
19
+ ], ({ signal }) => patchCoverageFiles(Object.assign(Object.assign({}, props), { signal })), options);
20
+ }
@@ -0,0 +1,47 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { TestCases } from '../schemas/TestCases';
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';
7
+ export interface TestCaseSummaryV2QueryQueryParams {
8
+ accountId: string;
9
+ orgId: string;
10
+ projectId: string;
11
+ pipelineId: string;
12
+ buildId: string;
13
+ stepId?: string;
14
+ stageId?: string;
15
+ report: 'junit';
16
+ suite_name?: string;
17
+ testCaseSearchTerm?: string;
18
+ /**
19
+ * @default 100
20
+ */
21
+ pageSize?: number;
22
+ /**
23
+ * @default 0
24
+ */
25
+ pageIndex?: number;
26
+ status?: 'failed';
27
+ flaky?: boolean;
28
+ sort?: 'class_name' | 'duration_ms' | 'name' | 'status';
29
+ /**
30
+ * @default "ASC"
31
+ */
32
+ order?: 'ASC' | 'DESC';
33
+ }
34
+ export type TestCaseSummaryV2OkResponse = TestCases;
35
+ export type TestCaseSummaryV2ErrorResponse = BadRequestResponse | NotFoundResponse | InternalErrorResponse;
36
+ export interface TestCaseSummaryV2Props extends Omit<FetcherOptions<TestCaseSummaryV2QueryQueryParams, unknown>, 'url'> {
37
+ queryParams: TestCaseSummaryV2QueryQueryParams;
38
+ }
39
+ export interface TestCaseSummaryV2ResponseContainer {
40
+ body: TestCaseSummaryV2OkResponse;
41
+ headers: Headers;
42
+ }
43
+ export declare function testCaseSummaryV2(props: TestCaseSummaryV2Props): Promise<TestCaseSummaryV2ResponseContainer>;
44
+ /**
45
+ * Get test case details
46
+ */
47
+ export declare function useTestCaseSummaryV2Query(props: TestCaseSummaryV2Props, options?: Omit<UseQueryOptions<TestCaseSummaryV2ResponseContainer, TestCaseSummaryV2ErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<TestCaseSummaryV2ResponseContainer, import("..").Error>;
@@ -0,0 +1,14 @@
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 '../../../../custom-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
+ }
@@ -2,12 +2,16 @@ export type { GetExecutionCoverageReportErrorResponse, GetExecutionCoverageRepor
2
2
  export { getExecutionCoverageReport, useGetExecutionCoverageReportQuery, } from './hooks/useGetExecutionCoverageReportQuery';
3
3
  export type { GetTokenErrorResponse, GetTokenOkResponse, GetTokenProps, GetTokenQueryQueryParams, } from './hooks/useGetTokenQuery';
4
4
  export { getToken, useGetTokenQuery } from './hooks/useGetTokenQuery';
5
+ export type { PatchCoverageFilesErrorResponse, PatchCoverageFilesOkResponse, PatchCoverageFilesProps, PatchCoverageFilesQueryPathParams, } from './hooks/usePatchCoverageFilesQuery';
6
+ export { patchCoverageFiles, usePatchCoverageFilesQuery } from './hooks/usePatchCoverageFilesQuery';
5
7
  export type { ReportSummaryErrorResponse, ReportSummaryOkResponse, ReportSummaryProps, ReportSummaryQueryQueryParams, } from './hooks/useReportSummaryQuery';
6
8
  export { reportSummary, useReportSummaryQuery } from './hooks/useReportSummaryQuery';
7
9
  export type { ReportsInfoErrorResponse, ReportsInfoOkResponse, ReportsInfoProps, ReportsInfoQueryQueryParams, } from './hooks/useReportsInfoQuery';
8
10
  export { reportsInfo, useReportsInfoQuery } from './hooks/useReportsInfoQuery';
9
11
  export type { SearchCoverageFilesErrorResponse, SearchCoverageFilesOkResponse, SearchCoverageFilesProps, SearchCoverageFilesQueryPathParams, SearchCoverageFilesQueryQueryParams, } from './hooks/useSearchCoverageFilesQuery';
10
12
  export { searchCoverageFiles, useSearchCoverageFilesQuery, } from './hooks/useSearchCoverageFilesQuery';
13
+ export type { TestCaseSummaryV2ErrorResponse, TestCaseSummaryV2OkResponse, TestCaseSummaryV2Props, TestCaseSummaryV2QueryQueryParams, } from './hooks/useTestCaseSummaryV2Query';
14
+ export { testCaseSummaryV2, useTestCaseSummaryV2Query } from './hooks/useTestCaseSummaryV2Query';
11
15
  export type { TestInfoErrorResponse, TestInfoOkResponse, TestInfoProps, TestInfoQueryQueryParams, } from './hooks/useTestInfoQuery';
12
16
  export { testInfo, useTestInfoQuery } from './hooks/useTestInfoQuery';
13
17
  export type { TestOverviewErrorResponse, TestOverviewOkResponse, TestOverviewProps, TestOverviewQueryQueryParams, } from './hooks/useTestOverviewQuery';
@@ -20,10 +24,17 @@ export type { UnauthorizedResponse } from './responses/UnauthorizedResponse';
20
24
  export type { CoverageSummary } from './schemas/CoverageSummary';
21
25
  export type { Error } from './schemas/Error';
22
26
  export type { ItemSummary } from './schemas/ItemSummary';
27
+ export type { PatchFilesResponse } from './schemas/PatchFilesResponse';
28
+ export type { PatchSummary } from './schemas/PatchSummary';
23
29
  export type { PipelineExecutionReport } from './schemas/PipelineExecutionReport';
24
30
  export type { ReportOutput } from './schemas/ReportOutput';
31
+ export type { ResponseMetadata } from './schemas/ResponseMetadata';
32
+ export type { Result } from './schemas/Result';
25
33
  export type { SearchResults } from './schemas/SearchResults';
26
34
  export type { SelectionDetails } from './schemas/SelectionDetails';
27
35
  export type { SelectionOverview } from './schemas/SelectionOverview';
28
36
  export type { StepInfo } from './schemas/StepInfo';
37
+ export type { TestCase } from './schemas/TestCase';
38
+ export type { TestCaseStatus } from './schemas/TestCaseStatus';
39
+ export type { TestCases } from './schemas/TestCases';
29
40
  export type { TestReportSummary } from './schemas/TestReportSummary';
@@ -1,7 +1,9 @@
1
1
  export { getExecutionCoverageReport, useGetExecutionCoverageReportQuery, } from './hooks/useGetExecutionCoverageReportQuery';
2
2
  export { getToken, useGetTokenQuery } from './hooks/useGetTokenQuery';
3
+ export { patchCoverageFiles, usePatchCoverageFilesQuery } from './hooks/usePatchCoverageFilesQuery';
3
4
  export { reportSummary, useReportSummaryQuery } from './hooks/useReportSummaryQuery';
4
5
  export { reportsInfo, useReportsInfoQuery } from './hooks/useReportsInfoQuery';
5
6
  export { searchCoverageFiles, useSearchCoverageFilesQuery, } from './hooks/useSearchCoverageFilesQuery';
7
+ export { testCaseSummaryV2, useTestCaseSummaryV2Query } from './hooks/useTestCaseSummaryV2Query';
6
8
  export { testInfo, useTestInfoQuery } from './hooks/useTestInfoQuery';
7
9
  export { testOverview, useTestOverviewQuery } from './hooks/useTestOverviewQuery';
@@ -1,8 +1,5 @@
1
- export interface CoverageSummary {
2
- coverage: number;
3
- files: number;
4
- hits: number;
5
- lines: number;
6
- misses: number;
7
- partials: number;
1
+ import type { PatchSummary } from '../schemas/PatchSummary';
2
+ export interface CoverageSummary extends PatchSummary {
3
+ files?: number;
4
+ patch?: PatchSummary;
8
5
  }
@@ -1,4 +1 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
1
  export {};
@@ -1,5 +1,7 @@
1
1
  import type { CoverageSummary } from '../schemas/CoverageSummary';
2
2
  export interface ItemSummary extends CoverageSummary {
3
+ git_ref?: string;
4
+ is_harness_code?: boolean;
3
5
  path?: string;
4
6
  type?: 'directory' | 'file' | 'repository';
5
7
  }
@@ -0,0 +1,8 @@
1
+ import type { CoverageSummary } from '../schemas/CoverageSummary';
2
+ export type PatchFilesResponse = Array<{
3
+ lines?: Array<number[]>;
4
+ path?: string;
5
+ summary?: CoverageSummary | {
6
+ changes?: number;
7
+ };
8
+ }>;
@@ -0,0 +1,7 @@
1
+ export interface PatchSummary {
2
+ coverage?: number;
3
+ hits?: number;
4
+ lines?: number;
5
+ misses?: number;
6
+ partials?: number;
7
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -1,6 +1,8 @@
1
1
  import type { ItemSummary } from '../schemas/ItemSummary';
2
2
  import type { CoverageSummary } from '../schemas/CoverageSummary';
3
3
  export interface ReportOutput {
4
+ git_ref?: string;
5
+ is_harness_code?: boolean;
4
6
  items?: ItemSummary[];
5
7
  lines?: Array<number[]>;
6
8
  path?: string;
@@ -0,0 +1,6 @@
1
+ export interface ResponseMetadata {
2
+ pageItemCount?: number;
3
+ pageSize?: number;
4
+ totalItems?: number;
5
+ totalPages?: number;
6
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -0,0 +1,16 @@
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
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
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
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Status of the test
3
+ */
4
+ export type TestCaseStatus = 'error' | 'failed' | 'passed' | 'skipped' | 'skipped_by_ti';
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { TestCase } from '../schemas/TestCase';
2
+ import type { ResponseMetadata } from '../schemas/ResponseMetadata';
3
+ export interface TestCases {
4
+ content?: TestCase[];
5
+ data?: ResponseMetadata;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-ti-service-client",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "Harness React TI service client - TI APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",