@harnessio/react-ti-service-client 0.4.0 → 0.5.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.
@@ -0,0 +1,36 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { CoverageHistoryResponse } from '../schemas/CoverageHistoryResponse';
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 GetCoverageHistoryQueryPathParams {
9
+ account_identifier: string;
10
+ pipeline_id: string;
11
+ }
12
+ export interface GetCoverageHistoryQueryQueryParams {
13
+ accountId: string;
14
+ /**
15
+ * @default 30
16
+ */
17
+ limit?: number;
18
+ }
19
+ export interface GetCoverageHistoryQueryHeaderParams {
20
+ 'harness-account'?: string;
21
+ 'X-Harness-Token': string;
22
+ }
23
+ export type GetCoverageHistoryOkResponse = CoverageHistoryResponse;
24
+ export type GetCoverageHistoryErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | InternalErrorResponse;
25
+ export interface GetCoverageHistoryProps extends GetCoverageHistoryQueryPathParams, Omit<FetcherOptions<GetCoverageHistoryQueryQueryParams, unknown, GetCoverageHistoryQueryHeaderParams>, 'url'> {
26
+ queryParams: GetCoverageHistoryQueryQueryParams;
27
+ }
28
+ export interface GetCoverageHistoryResponseContainer {
29
+ body: GetCoverageHistoryOkResponse;
30
+ headers: Headers;
31
+ }
32
+ export declare function getCoverageHistory(props: GetCoverageHistoryProps): Promise<GetCoverageHistoryResponseContainer>;
33
+ /**
34
+ * Retrieve coverage history for a specific pipeline with delta information
35
+ */
36
+ export declare function useGetCoverageHistoryQuery(props: GetCoverageHistoryProps, options?: Omit<UseQueryOptions<GetCoverageHistoryResponseContainer, GetCoverageHistoryErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetCoverageHistoryResponseContainer, 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 getCoverageHistory(props) {
7
+ return fetcher(Object.assign({ url: `/coverage/api/v1/accounts/${props.account_identifier}/pipelines/${props.pipeline_id}/history`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Retrieve coverage history for a specific pipeline with delta information
11
+ */
12
+ export function useGetCoverageHistoryQuery(props, options) {
13
+ return useQuery(['getCoverageHistory', props.account_identifier, props.pipeline_id, props.queryParams], ({ signal }) => getCoverageHistory(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -11,13 +11,17 @@ export interface PatchCoverageFilesQueryPathParams {
11
11
  repo_ref: string;
12
12
  commit: string;
13
13
  }
14
+ export interface PatchCoverageFilesQueryQueryParams {
15
+ accountId: string;
16
+ }
14
17
  export interface PatchCoverageFilesQueryHeaderParams {
15
18
  'harness-account'?: string;
16
19
  'X-Harness-Token': string;
17
20
  }
18
21
  export type PatchCoverageFilesOkResponse = PatchFilesResponse;
19
22
  export type PatchCoverageFilesErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | InternalErrorResponse;
20
- export interface PatchCoverageFilesProps extends PatchCoverageFilesQueryPathParams, Omit<FetcherOptions<unknown, unknown, PatchCoverageFilesQueryHeaderParams>, 'url'> {
23
+ export interface PatchCoverageFilesProps extends PatchCoverageFilesQueryPathParams, Omit<FetcherOptions<PatchCoverageFilesQueryQueryParams, unknown, PatchCoverageFilesQueryHeaderParams>, 'url'> {
24
+ queryParams: PatchCoverageFilesQueryQueryParams;
21
25
  }
22
26
  export interface PatchCoverageFilesResponseContainer {
23
27
  body: PatchCoverageFilesOkResponse;
@@ -16,5 +16,6 @@ export function usePatchCoverageFilesQuery(props, options) {
16
16
  props.execution_id,
17
17
  props.repo_ref,
18
18
  props.commit,
19
+ props.queryParams,
19
20
  ], ({ signal }) => patchCoverageFiles(Object.assign(Object.assign({}, props), { signal })), options);
20
21
  }
@@ -1,8 +1,10 @@
1
+ export type { GetCoverageHistoryErrorResponse, GetCoverageHistoryOkResponse, GetCoverageHistoryProps, GetCoverageHistoryQueryPathParams, GetCoverageHistoryQueryQueryParams, } from './hooks/useGetCoverageHistoryQuery';
2
+ export { getCoverageHistory, useGetCoverageHistoryQuery } from './hooks/useGetCoverageHistoryQuery';
1
3
  export type { GetExecutionCoverageReportErrorResponse, GetExecutionCoverageReportOkResponse, GetExecutionCoverageReportProps, GetExecutionCoverageReportQueryPathParams, GetExecutionCoverageReportQueryQueryParams, } from './hooks/useGetExecutionCoverageReportQuery';
2
4
  export { getExecutionCoverageReport, useGetExecutionCoverageReportQuery, } from './hooks/useGetExecutionCoverageReportQuery';
3
5
  export type { GetTokenErrorResponse, GetTokenOkResponse, GetTokenProps, GetTokenQueryQueryParams, } from './hooks/useGetTokenQuery';
4
6
  export { getToken, useGetTokenQuery } from './hooks/useGetTokenQuery';
5
- export type { PatchCoverageFilesErrorResponse, PatchCoverageFilesOkResponse, PatchCoverageFilesProps, PatchCoverageFilesQueryPathParams, } from './hooks/usePatchCoverageFilesQuery';
7
+ export type { PatchCoverageFilesErrorResponse, PatchCoverageFilesOkResponse, PatchCoverageFilesProps, PatchCoverageFilesQueryPathParams, PatchCoverageFilesQueryQueryParams, } from './hooks/usePatchCoverageFilesQuery';
6
8
  export { patchCoverageFiles, usePatchCoverageFilesQuery } from './hooks/usePatchCoverageFilesQuery';
7
9
  export type { ReportSummaryErrorResponse, ReportSummaryOkResponse, ReportSummaryProps, ReportSummaryQueryQueryParams, } from './hooks/useReportSummaryQuery';
8
10
  export { reportSummary, useReportSummaryQuery } from './hooks/useReportSummaryQuery';
@@ -21,6 +23,9 @@ export type { InternalErrorResponse } from './responses/InternalErrorResponse';
21
23
  export type { NotFoundResponse } from './responses/NotFoundResponse';
22
24
  export type { UnauthenticatedResponse } from './responses/UnauthenticatedResponse';
23
25
  export type { UnauthorizedResponse } from './responses/UnauthorizedResponse';
26
+ export type { CoverageHistoryEntry } from './schemas/CoverageHistoryEntry';
27
+ export type { CoverageHistoryResponse } from './schemas/CoverageHistoryResponse';
28
+ export type { CoverageMetric } from './schemas/CoverageMetric';
24
29
  export type { CoverageSummary } from './schemas/CoverageSummary';
25
30
  export type { Error } from './schemas/Error';
26
31
  export type { ItemSummary } from './schemas/ItemSummary';
@@ -1,3 +1,4 @@
1
+ export { getCoverageHistory, useGetCoverageHistoryQuery } from './hooks/useGetCoverageHistoryQuery';
1
2
  export { getExecutionCoverageReport, useGetExecutionCoverageReportQuery, } from './hooks/useGetExecutionCoverageReportQuery';
2
3
  export { getToken, useGetTokenQuery } from './hooks/useGetTokenQuery';
3
4
  export { patchCoverageFiles, usePatchCoverageFilesQuery } from './hooks/usePatchCoverageFilesQuery';
@@ -0,0 +1,17 @@
1
+ export interface CoverageHistoryEntry {
2
+ /**
3
+ * Number of covered lines
4
+ * @format int64
5
+ */
6
+ coveredLines: number;
7
+ /**
8
+ * Epoch timestamp in milliseconds
9
+ * @format int64
10
+ */
11
+ date: number;
12
+ /**
13
+ * Total number of lines
14
+ * @format int64
15
+ */
16
+ totalLines: number;
17
+ }
@@ -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,7 @@
1
+ import type { CoverageMetric } from '../schemas/CoverageMetric';
2
+ import type { CoverageHistoryEntry } from '../schemas/CoverageHistoryEntry';
3
+ export interface CoverageHistoryResponse {
4
+ covered?: CoverageMetric;
5
+ history: CoverageHistoryEntry[];
6
+ total?: CoverageMetric;
7
+ }
@@ -0,0 +1,16 @@
1
+ export interface CoverageMetric {
2
+ /**
3
+ * Percentage change from previous entry
4
+ * @format double
5
+ */
6
+ changePercentage?: number;
7
+ /**
8
+ * Delta from previous entry (e.g., "5" or "-5")
9
+ */
10
+ delta?: string;
11
+ /**
12
+ * Number of lines
13
+ * @format int64
14
+ */
15
+ lines: number;
16
+ }
@@ -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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-ti-service-client",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Harness React TI service client - TI APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",