@harnessio/react-ti-service-client 0.6.6 → 0.6.8

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,33 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { MarkedTestsResponse } from '../schemas/MarkedTestsResponse';
3
+ import type { BadRequestResponse } from '../responses/BadRequestResponse';
4
+ import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
5
+ import { FetcherOptions } from '../../../../custom-fetcher/index.js';
6
+ export interface GetProblematicTestsQueryQueryParams {
7
+ accountId: string;
8
+ orgId: string;
9
+ projectId: string;
10
+ repo: string;
11
+ /**
12
+ * @default 0
13
+ */
14
+ pageIndex?: number;
15
+ /**
16
+ * @default 100
17
+ */
18
+ pageSize?: number;
19
+ }
20
+ export type GetProblematicTestsOkResponse = MarkedTestsResponse;
21
+ export type GetProblematicTestsErrorResponse = BadRequestResponse | InternalErrorResponse;
22
+ export interface GetProblematicTestsProps extends Omit<FetcherOptions<GetProblematicTestsQueryQueryParams, unknown>, 'url'> {
23
+ queryParams: GetProblematicTestsQueryQueryParams;
24
+ }
25
+ export interface GetProblematicTestsResponseContainer {
26
+ body: GetProblematicTestsOkResponse;
27
+ headers: Headers;
28
+ }
29
+ export declare function getProblematicTests(props: GetProblematicTestsProps): Promise<GetProblematicTestsResponseContainer>;
30
+ /**
31
+ * Returns all tests currently marked as problematic for the given account and repo, with pagination.
32
+ */
33
+ export declare function useGetProblematicTestsQuery(props: GetProblematicTestsProps, options?: Omit<UseQueryOptions<GetProblematicTestsResponseContainer, GetProblematicTestsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetProblematicTestsResponseContainer, 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 getProblematicTests(props) {
7
+ return fetcher(Object.assign({ url: `/test-management/problematic`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Returns all tests currently marked as problematic for the given account and repo, with pagination.
11
+ */
12
+ export function useGetProblematicTestsQuery(props, options) {
13
+ return useQuery(['getProblematicTests', props.queryParams], ({ signal }) => getProblematicTests(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -0,0 +1,31 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { TestMarkingResponse } from '../schemas/TestMarkingResponse';
3
+ import type { BadRequestResponse } from '../responses/BadRequestResponse';
4
+ import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
5
+ import type { TestMarkingRequest } from '../schemas/TestMarkingRequest';
6
+ import { FetcherOptions } from '../../../../custom-fetcher/index.js';
7
+ export interface SetProblematicStatusMutationQueryParams {
8
+ accountId: string;
9
+ orgId: string;
10
+ projectId: string;
11
+ repo: string;
12
+ }
13
+ export type SetProblematicStatusRequestBody = TestMarkingRequest[];
14
+ export type SetProblematicStatusOkResponse = TestMarkingResponse;
15
+ export type SetProblematicStatusErrorResponse = BadRequestResponse | InternalErrorResponse;
16
+ export interface SetProblematicStatusProps extends Omit<FetcherOptions<SetProblematicStatusMutationQueryParams, SetProblematicStatusRequestBody>, 'url'> {
17
+ queryParams: SetProblematicStatusMutationQueryParams;
18
+ body: SetProblematicStatusRequestBody;
19
+ }
20
+ export interface SetProblematicStatusResponseContainer {
21
+ body: SetProblematicStatusOkResponse;
22
+ headers: Headers;
23
+ }
24
+ export declare function setProblematicStatus(props: SetProblematicStatusProps): Promise<SetProblematicStatusResponseContainer>;
25
+ export type SetProblematicStatusMutationProps<T extends keyof SetProblematicStatusProps> = Omit<SetProblematicStatusProps, T> & Partial<Pick<SetProblematicStatusProps, T>>;
26
+ /**
27
+ * Upserts the problematic marking for each test in the request body. A `marking` of `"true"` (or boolean `true`) marks the test as problematic, `"false"` removes the marking, and `"unset"` clears any stored value.
28
+ * Problematic markings exist only in the V2 schema, so each item must identify a test by the combination of `test_name` + `class_name` (optionally `suite_name`) and the `repo` query parameter is required. Unlike flaky, problematic is never applied by a default policy.
29
+ *
30
+ */
31
+ export declare function useSetProblematicStatusMutation<T extends keyof SetProblematicStatusProps>(props: Pick<Partial<SetProblematicStatusProps>, T>, options?: Omit<UseMutationOptions<SetProblematicStatusResponseContainer, SetProblematicStatusErrorResponse, SetProblematicStatusMutationProps<T>>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<SetProblematicStatusResponseContainer, import("..").Error, SetProblematicStatusMutationProps<T>, unknown>;
@@ -0,0 +1,16 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ import { useMutation } from '@tanstack/react-query';
5
+ import { fetcher } from '../../../../custom-fetcher/index.js';
6
+ export function setProblematicStatus(props) {
7
+ return fetcher(Object.assign({ url: `/test-management/problematic`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Upserts the problematic marking for each test in the request body. A `marking` of `"true"` (or boolean `true`) marks the test as problematic, `"false"` removes the marking, and `"unset"` clears any stored value.
11
+ * Problematic markings exist only in the V2 schema, so each item must identify a test by the combination of `test_name` + `class_name` (optionally `suite_name`) and the `repo` query parameter is required. Unlike flaky, problematic is never applied by a default policy.
12
+ *
13
+ */
14
+ export function useSetProblematicStatusMutation(props, options) {
15
+ return useMutation((mutateProps) => setProblematicStatus(Object.assign(Object.assign({}, props), mutateProps)), options);
16
+ }
@@ -8,6 +8,8 @@ export type { GetFlakyTestsErrorResponse, GetFlakyTestsOkResponse, GetFlakyTests
8
8
  export { getFlakyTests, useGetFlakyTestsQuery } from './hooks/useGetFlakyTestsQuery';
9
9
  export type { GetPoliciesErrorResponse, GetPoliciesOkResponse, GetPoliciesProps, GetPoliciesQueryQueryParams, } from './hooks/useGetPoliciesQuery';
10
10
  export { getPolicies, useGetPoliciesQuery } from './hooks/useGetPoliciesQuery';
11
+ export type { GetProblematicTestsErrorResponse, GetProblematicTestsOkResponse, GetProblematicTestsProps, GetProblematicTestsQueryQueryParams, } from './hooks/useGetProblematicTestsQuery';
12
+ export { getProblematicTests, useGetProblematicTestsQuery, } from './hooks/useGetProblematicTestsQuery';
11
13
  export type { GetTestManagementRepositoriesErrorResponse, GetTestManagementRepositoriesOkResponse, GetTestManagementRepositoriesProps, GetTestManagementRepositoriesQueryQueryParams, } from './hooks/useGetTestManagementRepositoriesQuery';
12
14
  export { getTestManagementRepositories, useGetTestManagementRepositoriesQuery, } from './hooks/useGetTestManagementRepositoriesQuery';
13
15
  export type { GetTokenErrorResponse, GetTokenOkResponse, GetTokenProps, GetTokenQueryQueryParams, } from './hooks/useGetTokenQuery';
@@ -22,6 +24,8 @@ export type { SearchCoverageFilesErrorResponse, SearchCoverageFilesOkResponse, S
22
24
  export { searchCoverageFiles, useSearchCoverageFilesQuery, } from './hooks/useSearchCoverageFilesQuery';
23
25
  export type { SetFlakyStatusErrorResponse, SetFlakyStatusMutationProps, SetFlakyStatusMutationQueryParams, SetFlakyStatusOkResponse, SetFlakyStatusProps, SetFlakyStatusRequestBody, } from './hooks/useSetFlakyStatusMutation';
24
26
  export { setFlakyStatus, useSetFlakyStatusMutation } from './hooks/useSetFlakyStatusMutation';
27
+ export type { SetProblematicStatusErrorResponse, SetProblematicStatusMutationProps, SetProblematicStatusMutationQueryParams, SetProblematicStatusOkResponse, SetProblematicStatusProps, SetProblematicStatusRequestBody, } from './hooks/useSetProblematicStatusMutation';
28
+ export { setProblematicStatus, useSetProblematicStatusMutation, } from './hooks/useSetProblematicStatusMutation';
25
29
  export type { SetQuarantineStatusErrorResponse, SetQuarantineStatusMutationProps, SetQuarantineStatusMutationQueryParams, SetQuarantineStatusOkResponse, SetQuarantineStatusProps, SetQuarantineStatusRequestBody, } from './hooks/useSetQuarantineStatusMutation';
26
30
  export { setQuarantineStatus, useSetQuarantineStatusMutation, } from './hooks/useSetQuarantineStatusMutation';
27
31
  export type { TestCaseSummaryV2ErrorResponse, TestCaseSummaryV2OkResponse, TestCaseSummaryV2Props, TestCaseSummaryV2QueryQueryParams, } from './hooks/useTestCaseSummaryV2Query';
@@ -3,6 +3,7 @@ export { getCoverageHistory, useGetCoverageHistoryQuery } from './hooks/useGetCo
3
3
  export { getExecutionCoverageReport, useGetExecutionCoverageReportQuery, } from './hooks/useGetExecutionCoverageReportQuery';
4
4
  export { getFlakyTests, useGetFlakyTestsQuery } from './hooks/useGetFlakyTestsQuery';
5
5
  export { getPolicies, useGetPoliciesQuery } from './hooks/useGetPoliciesQuery';
6
+ export { getProblematicTests, useGetProblematicTestsQuery, } from './hooks/useGetProblematicTestsQuery';
6
7
  export { getTestManagementRepositories, useGetTestManagementRepositoriesQuery, } from './hooks/useGetTestManagementRepositoriesQuery';
7
8
  export { getToken, useGetTokenQuery } from './hooks/useGetTokenQuery';
8
9
  export { patchCoverageFiles, usePatchCoverageFilesQuery } from './hooks/usePatchCoverageFilesQuery';
@@ -10,6 +11,7 @@ export { reportSummary, useReportSummaryQuery } from './hooks/useReportSummaryQu
10
11
  export { reportsInfo, useReportsInfoQuery } from './hooks/useReportsInfoQuery';
11
12
  export { searchCoverageFiles, useSearchCoverageFilesQuery, } from './hooks/useSearchCoverageFilesQuery';
12
13
  export { setFlakyStatus, useSetFlakyStatusMutation } from './hooks/useSetFlakyStatusMutation';
14
+ export { setProblematicStatus, useSetProblematicStatusMutation, } from './hooks/useSetProblematicStatusMutation';
13
15
  export { setQuarantineStatus, useSetQuarantineStatusMutation, } from './hooks/useSetQuarantineStatusMutation';
14
16
  export { testCaseSummaryV2, useTestCaseSummaryV2Query } from './hooks/useTestCaseSummaryV2Query';
15
17
  export { testInfo, useTestInfoQuery } from './hooks/useTestInfoQuery';
@@ -14,6 +14,15 @@ export interface TestMarkingDetail {
14
14
  * true = flaky, false = not flaky, null = not marked
15
15
  */
16
16
  flaky_status?: boolean | null;
17
+ /**
18
+ * Latest persisted v2 execution result, or null when the test has no execution history
19
+ */
20
+ last_execution_status?: 'error' | 'failed' | 'passed' | 'skipped' | null;
21
+ /**
22
+ * Start time of the latest persisted v2 execution, or null when the test has no execution history
23
+ * @format date-time
24
+ */
25
+ last_execution_time?: string | null;
17
26
  /**
18
27
  * Optional reason the test was marked problematic
19
28
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-ti-service-client",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "Harness React TI service client - TI APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",