@harnessio/react-ti-service-client 0.6.2 → 0.6.4

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 (28) hide show
  1. package/dist/ti-service/src/services/hooks/useGetAllTestMarkingsQuery.d.ts +2 -1
  2. package/dist/ti-service/src/services/hooks/useGetAllTestMarkingsQuery.js +1 -1
  3. package/dist/ti-service/src/services/hooks/useGetPoliciesQuery.d.ts +2 -5
  4. package/dist/ti-service/src/services/hooks/useGetPoliciesQuery.js +1 -2
  5. package/dist/ti-service/src/services/hooks/useSetFlakyStatusMutation.d.ts +2 -1
  6. package/dist/ti-service/src/services/hooks/useSetFlakyStatusMutation.js +2 -1
  7. package/dist/ti-service/src/services/hooks/useSetQuarantineStatusMutation.d.ts +2 -1
  8. package/dist/ti-service/src/services/hooks/useSetQuarantineStatusMutation.js +2 -1
  9. package/dist/ti-service/src/services/hooks/useUpsertPoliciesMutation.d.ts +6 -8
  10. package/dist/ti-service/src/services/hooks/useUpsertPoliciesMutation.js +1 -3
  11. package/dist/ti-service/src/services/index.d.ts +1 -4
  12. package/dist/ti-service/src/services/index.js +0 -1
  13. package/dist/ti-service/src/services/schemas/MarkedTest.d.ts +6 -6
  14. package/dist/ti-service/src/services/schemas/MarkedTestsResponse.d.ts +2 -2
  15. package/dist/ti-service/src/services/schemas/Pagination.d.ts +6 -9
  16. package/dist/ti-service/src/services/schemas/PoliciesResponse.d.ts +2 -2
  17. package/dist/ti-service/src/services/schemas/Policy.d.ts +4 -4
  18. package/dist/ti-service/src/services/schemas/TestMarkingDetail.d.ts +37 -0
  19. package/dist/ti-service/src/services/schemas/TestMarkingRequest.d.ts +21 -7
  20. package/dist/ti-service/src/services/schemas/TestMarkingResponse.d.ts +6 -4
  21. package/dist/ti-service/src/services/schemas/TestMarkingsResponse.d.ts +13 -3
  22. package/package.json +1 -1
  23. package/dist/ti-service/src/services/hooks/useGetQuarantinedTestsQuery.d.ts +0 -33
  24. package/dist/ti-service/src/services/hooks/useGetQuarantinedTestsQuery.js +0 -14
  25. package/dist/ti-service/src/services/schemas/TestMarking.d.ts +0 -39
  26. package/dist/ti-service/src/services/schemas/UpsertPoliciesResponse.d.ts +0 -13
  27. package/dist/ti-service/src/services/schemas/UpsertPoliciesResponse.js +0 -4
  28. /package/dist/ti-service/src/services/schemas/{TestMarking.js → TestMarkingDetail.js} +0 -0
@@ -18,6 +18,7 @@ export interface GetAllTestMarkingsQueryQueryParams {
18
18
  pageSize?: number;
19
19
  flaky?: boolean;
20
20
  quarantine?: boolean;
21
+ test_name?: string;
21
22
  }
22
23
  export type GetAllTestMarkingsOkResponse = TestMarkingsResponse;
23
24
  export type GetAllTestMarkingsErrorResponse = BadRequestResponse | InternalErrorResponse;
@@ -30,7 +31,7 @@ export interface GetAllTestMarkingsResponseContainer {
30
31
  }
31
32
  export declare function getAllTestMarkings(props: GetAllTestMarkingsProps): Promise<GetAllTestMarkingsResponseContainer>;
32
33
  /**
33
- * Returns all tests with their combined flaky and quarantine markings for the given account and repo, with pagination. Use the optional `flaky` and `quarantine` parameters to filter results to only tests with a specific status for each field.
34
+ * Returns all tests with their combined flaky and quarantine markings for the given account and repo, with pagination. Use the optional `flaky` and `quarantine` parameters to filter results to only tests with a specific status for each field. The response also includes `totalFlaky` and `totalQuarantine` — the aggregate counts of flaky and quarantined tests across the entire repository, independent of any active pagination or filters.
34
35
  *
35
36
  */
36
37
  export declare function useGetAllTestMarkingsQuery(props: GetAllTestMarkingsProps, options?: Omit<UseQueryOptions<GetAllTestMarkingsResponseContainer, GetAllTestMarkingsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetAllTestMarkingsResponseContainer, import("..").Error>;
@@ -7,7 +7,7 @@ export function getAllTestMarkings(props) {
7
7
  return fetcher(Object.assign({ url: `/test-management/tests`, method: 'GET' }, props));
8
8
  }
9
9
  /**
10
- * Returns all tests with their combined flaky and quarantine markings for the given account and repo, with pagination. Use the optional `flaky` and `quarantine` parameters to filter results to only tests with a specific status for each field.
10
+ * Returns all tests with their combined flaky and quarantine markings for the given account and repo, with pagination. Use the optional `flaky` and `quarantine` parameters to filter results to only tests with a specific status for each field. The response also includes `totalFlaky` and `totalQuarantine` — the aggregate counts of flaky and quarantined tests across the entire repository, independent of any active pagination or filters.
11
11
  *
12
12
  */
13
13
  export function useGetAllTestMarkingsQuery(props, options) {
@@ -1,8 +1,6 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
2
  import type { PoliciesResponse } from '../schemas/PoliciesResponse';
3
3
  import type { BadRequestResponse } from '../responses/BadRequestResponse';
4
- import type { UnauthenticatedResponse } from '../responses/UnauthenticatedResponse';
5
- import type { UnauthorizedResponse } from '../responses/UnauthorizedResponse';
6
4
  import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
7
5
  import { FetcherOptions } from '../../../../custom-fetcher/index.js';
8
6
  export interface GetPoliciesQueryQueryParams {
@@ -12,7 +10,7 @@ export interface GetPoliciesQueryQueryParams {
12
10
  repo: string;
13
11
  }
14
12
  export type GetPoliciesOkResponse = PoliciesResponse;
15
- export type GetPoliciesErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | InternalErrorResponse;
13
+ export type GetPoliciesErrorResponse = BadRequestResponse | InternalErrorResponse;
16
14
  export interface GetPoliciesProps extends Omit<FetcherOptions<GetPoliciesQueryQueryParams, unknown>, 'url'> {
17
15
  queryParams: GetPoliciesQueryQueryParams;
18
16
  }
@@ -22,7 +20,6 @@ export interface GetPoliciesResponseContainer {
22
20
  }
23
21
  export declare function getPolicies(props: GetPoliciesProps): Promise<GetPoliciesResponseContainer>;
24
22
  /**
25
- * Returns all automation policies configured for the given repository scope. Policies define rules that automatically mark or unmark tests as flaky or quarantined based on observed test behaviour.
26
- *
23
+ * Returns all automation policies configured for the given account, org, project, and repo.
27
24
  */
28
25
  export declare function useGetPoliciesQuery(props: GetPoliciesProps, options?: Omit<UseQueryOptions<GetPoliciesResponseContainer, GetPoliciesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetPoliciesResponseContainer, import("..").Error>;
@@ -7,8 +7,7 @@ export function getPolicies(props) {
7
7
  return fetcher(Object.assign({ url: `/test-management/policies`, method: 'GET' }, props));
8
8
  }
9
9
  /**
10
- * Returns all automation policies configured for the given repository scope. Policies define rules that automatically mark or unmark tests as flaky or quarantined based on observed test behaviour.
11
- *
10
+ * Returns all automation policies configured for the given account, org, project, and repo.
12
11
  */
13
12
  export function useGetPoliciesQuery(props, options) {
14
13
  return useQuery(['getPolicies', props.queryParams], ({ signal }) => getPolicies(Object.assign(Object.assign({}, props), { signal })), options);
@@ -24,7 +24,8 @@ export interface SetFlakyStatusResponseContainer {
24
24
  export declare function setFlakyStatus(props: SetFlakyStatusProps): Promise<SetFlakyStatusResponseContainer>;
25
25
  export type SetFlakyStatusMutationProps<T extends keyof SetFlakyStatusProps> = Omit<SetFlakyStatusProps, T> & Partial<Pick<SetFlakyStatusProps, T>>;
26
26
  /**
27
- * Upserts the flaky marking for each test in the request body. A `marking` of `"true"` marks the test as flaky, `"false"` removes the marking, and `"unset"` clears any stored value.
27
+ * Upserts the flaky marking for each test in the request body. A `marking` of `"true"` (or boolean `true`) marks the test as flaky, `"false"` removes the marking, and `"unset"` clears any stored value.
28
+ * Each item may identify a test either by `test_id` alone **or** by the combination of `test_name` + `class_name`. When every item supplies a `test_id` the `repo` query parameter is not required.
28
29
  *
29
30
  */
30
31
  export declare function useSetFlakyStatusMutation<T extends keyof SetFlakyStatusProps>(props: Pick<Partial<SetFlakyStatusProps>, T>, options?: Omit<UseMutationOptions<SetFlakyStatusResponseContainer, SetFlakyStatusErrorResponse, SetFlakyStatusMutationProps<T>>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<SetFlakyStatusResponseContainer, import("..").Error, SetFlakyStatusMutationProps<T>, unknown>;
@@ -7,7 +7,8 @@ export function setFlakyStatus(props) {
7
7
  return fetcher(Object.assign({ url: `/test-management/flaky`, method: 'POST' }, props));
8
8
  }
9
9
  /**
10
- * Upserts the flaky marking for each test in the request body. A `marking` of `"true"` marks the test as flaky, `"false"` removes the marking, and `"unset"` clears any stored value.
10
+ * Upserts the flaky marking for each test in the request body. A `marking` of `"true"` (or boolean `true`) marks the test as flaky, `"false"` removes the marking, and `"unset"` clears any stored value.
11
+ * Each item may identify a test either by `test_id` alone **or** by the combination of `test_name` + `class_name`. When every item supplies a `test_id` the `repo` query parameter is not required.
11
12
  *
12
13
  */
13
14
  export function useSetFlakyStatusMutation(props, options) {
@@ -24,7 +24,8 @@ export interface SetQuarantineStatusResponseContainer {
24
24
  export declare function setQuarantineStatus(props: SetQuarantineStatusProps): Promise<SetQuarantineStatusResponseContainer>;
25
25
  export type SetQuarantineStatusMutationProps<T extends keyof SetQuarantineStatusProps> = Omit<SetQuarantineStatusProps, T> & Partial<Pick<SetQuarantineStatusProps, T>>;
26
26
  /**
27
- * Upserts the quarantine marking for each test in the request body. A `marking` of `"true"` quarantines the test, `"false"` removes the quarantine, and `"unset"` clears any stored value.
27
+ * Upserts the quarantine marking for each test in the request body. A `marking` of `"true"` (or boolean `true`) quarantines the test, `"false"` removes the quarantine, and `"unset"` clears any stored value.
28
+ * Each item may identify a test either by `test_id` alone **or** by the combination of `test_name` + `class_name`. When every item supplies a `test_id` the `repo` query parameter is not required.
28
29
  *
29
30
  */
30
31
  export declare function useSetQuarantineStatusMutation<T extends keyof SetQuarantineStatusProps>(props: Pick<Partial<SetQuarantineStatusProps>, T>, options?: Omit<UseMutationOptions<SetQuarantineStatusResponseContainer, SetQuarantineStatusErrorResponse, SetQuarantineStatusMutationProps<T>>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<SetQuarantineStatusResponseContainer, import("..").Error, SetQuarantineStatusMutationProps<T>, unknown>;
@@ -7,7 +7,8 @@ export function setQuarantineStatus(props) {
7
7
  return fetcher(Object.assign({ url: `/test-management/quarantine`, method: 'POST' }, props));
8
8
  }
9
9
  /**
10
- * Upserts the quarantine marking for each test in the request body. A `marking` of `"true"` quarantines the test, `"false"` removes the quarantine, and `"unset"` clears any stored value.
10
+ * Upserts the quarantine marking for each test in the request body. A `marking` of `"true"` (or boolean `true`) quarantines the test, `"false"` removes the quarantine, and `"unset"` clears any stored value.
11
+ * Each item may identify a test either by `test_id` alone **or** by the combination of `test_name` + `class_name`. When every item supplies a `test_id` the `repo` query parameter is not required.
11
12
  *
12
13
  */
13
14
  export function useSetQuarantineStatusMutation(props, options) {
@@ -1,8 +1,5 @@
1
1
  import { UseMutationOptions } from '@tanstack/react-query';
2
- import type { UpsertPoliciesResponse } from '../schemas/UpsertPoliciesResponse';
3
2
  import type { BadRequestResponse } from '../responses/BadRequestResponse';
4
- import type { UnauthenticatedResponse } from '../responses/UnauthenticatedResponse';
5
- import type { UnauthorizedResponse } from '../responses/UnauthorizedResponse';
6
3
  import type { InternalErrorResponse } from '../responses/InternalErrorResponse';
7
4
  import type { Policy } from '../schemas/Policy';
8
5
  import { FetcherOptions } from '../../../../custom-fetcher/index.js';
@@ -13,8 +10,11 @@ export interface UpsertPoliciesMutationQueryParams {
13
10
  repo: string;
14
11
  }
15
12
  export type UpsertPoliciesRequestBody = Policy[];
16
- export type UpsertPoliciesOkResponse = UpsertPoliciesResponse;
17
- export type UpsertPoliciesErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | InternalErrorResponse;
13
+ export type UpsertPoliciesOkResponse = {
14
+ count?: number;
15
+ message?: string;
16
+ };
17
+ export type UpsertPoliciesErrorResponse = BadRequestResponse | InternalErrorResponse;
18
18
  export interface UpsertPoliciesProps extends Omit<FetcherOptions<UpsertPoliciesMutationQueryParams, UpsertPoliciesRequestBody>, 'url'> {
19
19
  queryParams: UpsertPoliciesMutationQueryParams;
20
20
  body: UpsertPoliciesRequestBody;
@@ -26,9 +26,7 @@ export interface UpsertPoliciesResponseContainer {
26
26
  export declare function upsertPolicies(props: UpsertPoliciesProps): Promise<UpsertPoliciesResponseContainer>;
27
27
  export type UpsertPoliciesMutationProps<T extends keyof UpsertPoliciesProps> = Omit<UpsertPoliciesProps, T> & Partial<Pick<UpsertPoliciesProps, T>>;
28
28
  /**
29
- * Replaces the full set of automation policies for the given repository scope. The request body must contain all desired policies; any previously saved policies not included in the request will be removed. Requires project-edit permission.
30
- * **Valid rule conditions:** - `"test is flaky"` - `"test is slow"` - `"test failed"` - `"passes ? consecutive times on ? branch"` — requires 2 values (count, branch) - `"failed more than ? times on ? branch"` — requires 2 values (count, branch) - `"test passed and failed on the same commit"`
31
- * **Valid actions:** - `"mark quarantine"` / `"mark unquarantine"` / `"unmark quarantine"` - `"mark flaky"` / `"mark unflaky"` / `"unmark flaky"`
29
+ * Replaces all policies for the given account, org, project, and repo scope with the supplied list. Sending an empty array clears all policies. Each policy must have at least one rule condition and one action. Valid rule conditions: `"test is flaky"`, `"test is slow"`, `"test failed"`, `"passes ? consecutive times on ? branch"`, `"failed more than ? times on ? branch"`, `"test passed and failed on the same commit"`. Valid actions: `"mark quarantine"`, `"mark unquarantine"`, `"unmark quarantine"`, `"mark flaky"`, `"mark unflaky"`, `"unmark flaky"`.
32
30
  *
33
31
  */
34
32
  export declare function useUpsertPoliciesMutation<T extends keyof UpsertPoliciesProps>(props: Pick<Partial<UpsertPoliciesProps>, T>, options?: Omit<UseMutationOptions<UpsertPoliciesResponseContainer, UpsertPoliciesErrorResponse, UpsertPoliciesMutationProps<T>>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<UpsertPoliciesResponseContainer, import("..").Error, UpsertPoliciesMutationProps<T>, unknown>;
@@ -7,9 +7,7 @@ export function upsertPolicies(props) {
7
7
  return fetcher(Object.assign({ url: `/test-management/policies`, method: 'PUT' }, props));
8
8
  }
9
9
  /**
10
- * Replaces the full set of automation policies for the given repository scope. The request body must contain all desired policies; any previously saved policies not included in the request will be removed. Requires project-edit permission.
11
- * **Valid rule conditions:** - `"test is flaky"` - `"test is slow"` - `"test failed"` - `"passes ? consecutive times on ? branch"` — requires 2 values (count, branch) - `"failed more than ? times on ? branch"` — requires 2 values (count, branch) - `"test passed and failed on the same commit"`
12
- * **Valid actions:** - `"mark quarantine"` / `"mark unquarantine"` / `"unmark quarantine"` - `"mark flaky"` / `"mark unflaky"` / `"unmark flaky"`
10
+ * Replaces all policies for the given account, org, project, and repo scope with the supplied list. Sending an empty array clears all policies. Each policy must have at least one rule condition and one action. Valid rule conditions: `"test is flaky"`, `"test is slow"`, `"test failed"`, `"passes ? consecutive times on ? branch"`, `"failed more than ? times on ? branch"`, `"test passed and failed on the same commit"`. Valid actions: `"mark quarantine"`, `"mark unquarantine"`, `"unmark quarantine"`, `"mark flaky"`, `"mark unflaky"`, `"unmark flaky"`.
13
11
  *
14
12
  */
15
13
  export function useUpsertPoliciesMutation(props, options) {
@@ -8,8 +8,6 @@ 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 { GetQuarantinedTestsErrorResponse, GetQuarantinedTestsOkResponse, GetQuarantinedTestsProps, GetQuarantinedTestsQueryQueryParams, } from './hooks/useGetQuarantinedTestsQuery';
12
- export { getQuarantinedTests, useGetQuarantinedTestsQuery, } from './hooks/useGetQuarantinedTestsQuery';
13
11
  export type { GetTestManagementRepositoriesErrorResponse, GetTestManagementRepositoriesOkResponse, GetTestManagementRepositoriesProps, GetTestManagementRepositoriesQueryQueryParams, } from './hooks/useGetTestManagementRepositoriesQuery';
14
12
  export { getTestManagementRepositories, useGetTestManagementRepositoriesQuery, } from './hooks/useGetTestManagementRepositoriesQuery';
15
13
  export type { GetTokenErrorResponse, GetTokenOkResponse, GetTokenProps, GetTokenQueryQueryParams, } from './hooks/useGetTokenQuery';
@@ -65,9 +63,8 @@ export type { StepInfo } from './schemas/StepInfo';
65
63
  export type { TestCase } from './schemas/TestCase';
66
64
  export type { TestCaseStatus } from './schemas/TestCaseStatus';
67
65
  export type { TestCases } from './schemas/TestCases';
68
- export type { TestMarking } from './schemas/TestMarking';
66
+ export type { TestMarkingDetail } from './schemas/TestMarkingDetail';
69
67
  export type { TestMarkingRequest } from './schemas/TestMarkingRequest';
70
68
  export type { TestMarkingResponse } from './schemas/TestMarkingResponse';
71
69
  export type { TestMarkingsResponse } from './schemas/TestMarkingsResponse';
72
70
  export type { TestReportSummary } from './schemas/TestReportSummary';
73
- export type { UpsertPoliciesResponse } from './schemas/UpsertPoliciesResponse';
@@ -3,7 +3,6 @@ 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 { getQuarantinedTests, useGetQuarantinedTestsQuery, } from './hooks/useGetQuarantinedTestsQuery';
7
6
  export { getTestManagementRepositories, useGetTestManagementRepositoriesQuery, } from './hooks/useGetTestManagementRepositoriesQuery';
8
7
  export { getToken, useGetTokenQuery } from './hooks/useGetTokenQuery';
9
8
  export { patchCoverageFiles, usePatchCoverageFilesQuery } from './hooks/usePatchCoverageFilesQuery';
@@ -3,19 +3,19 @@
3
3
  */
4
4
  export interface MarkedTest {
5
5
  /**
6
- * Fully-qualified class name containing the test
6
+ * Fully-qualified class name of the test
7
7
  */
8
- class_name: string;
8
+ class_name?: string;
9
9
  /**
10
- * Name of the test suite (if available)
10
+ * Suite the test belongs to (omitted when empty)
11
11
  */
12
12
  suite_name?: string;
13
13
  /**
14
- * Unique identifier for the test
14
+ * Deterministic hash that uniquely identifies the test
15
15
  */
16
- test_id: string;
16
+ test_id?: string;
17
17
  /**
18
18
  * Name of the test method
19
19
  */
20
- test_name: string;
20
+ test_name?: string;
21
21
  }
@@ -1,9 +1,9 @@
1
1
  import type { Pagination } from '../schemas/Pagination';
2
2
  import type { MarkedTest } from '../schemas/MarkedTest';
3
3
  /**
4
- * Paginated list of tests marked as flaky or quarantined
4
+ * Paginated list of marked (flaky or quarantined) tests
5
5
  */
6
6
  export interface MarkedTestsResponse {
7
7
  pagination?: Pagination;
8
- tests: MarkedTest[];
8
+ tests?: MarkedTest[];
9
9
  }
@@ -1,21 +1,18 @@
1
- /**
2
- * Pagination metadata included in list responses
3
- */
4
1
  export interface Pagination {
5
2
  /**
6
- * Zero-based index of the current page
3
+ * Current page index (0-based)
7
4
  */
8
- pageIndex: number;
5
+ pageIndex?: number;
9
6
  /**
10
7
  * Maximum number of items per page
11
8
  */
12
- pageSize: number;
9
+ pageSize?: number;
13
10
  /**
14
- * Total number of items across all pages
11
+ * Total number of items matching the query
15
12
  */
16
- totalItems: number;
13
+ totalItems?: number;
17
14
  /**
18
15
  * Total number of pages
19
16
  */
20
- totalPages: number;
17
+ totalPages?: number;
21
18
  }
@@ -1,7 +1,7 @@
1
1
  import type { Policy } from '../schemas/Policy';
2
2
  /**
3
- * List of automation policies for a repository scope
3
+ * List of policies for a scope
4
4
  */
5
5
  export interface PoliciesResponse {
6
- policies: Policy[];
6
+ policies?: Policy[];
7
7
  }
@@ -1,20 +1,20 @@
1
1
  /**
2
- * An automation policy that evaluates rule conditions and executes actions on matching tests (e.g. automatically quarantine a flaky test).
2
+ * An automation policy that triggers actions when rule conditions are met. Parameterized conditions (containing `?`) require a corresponding entry in `values` at the same index.
3
3
  *
4
4
  */
5
5
  export interface Policy {
6
6
  /**
7
- * One or more actions to execute when all rule conditions are met. Valid actions: `"mark quarantine"`, `"mark unquarantine"`, `"unmark quarantine"`, `"mark flaky"`, `"mark unflaky"`, `"unmark flaky"`.
7
+ * One or more actions to apply. Valid values: "mark quarantine", "mark unquarantine", "unmark quarantine", "mark flaky", "mark unflaky", "unmark flaky".
8
8
  *
9
9
  */
10
10
  action: string[];
11
11
  /**
12
- * One or more rule conditions that must all be satisfied for the policy to fire. Valid conditions: `"test is flaky"`, `"test is slow"`, `"test failed"`, `"passes ? consecutive times on ? branch"`, `"failed more than ? times on ? branch"`, `"test passed and failed on the same commit"`.
12
+ * One or more rule conditions. Valid values: "test is flaky", "test is slow", "test failed", "passes ? consecutive times on ? branch", "failed more than ? times on ? branch", "test passed and failed on the same commit".
13
13
  *
14
14
  */
15
15
  rule: string[];
16
16
  /**
17
- * Optional array of value arrays used to fill `?` placeholders in parameterised rule conditions. The outer array index corresponds to the rule condition index. For example, `"passes ? consecutive times on ? branch"` requires two values: `["3", "main"]`.
17
+ * Optional. Values to substitute for `?` placeholders in parameterized rule conditions. Index corresponds to the rule condition at the same position.
18
18
  *
19
19
  */
20
20
  values?: Array<string[]>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * A test together with both its flaky and quarantine markings
3
+ */
4
+ export interface TestMarkingDetail {
5
+ /**
6
+ * Fully-qualified class name of the test
7
+ */
8
+ class_name?: string;
9
+ /**
10
+ * Optional reason the test was marked flaky
11
+ */
12
+ flaky_reason?: string | null;
13
+ /**
14
+ * true = flaky, false = not flaky, null = not marked
15
+ */
16
+ flaky_status?: boolean | null;
17
+ /**
18
+ * Optional reason the test was quarantined
19
+ */
20
+ quarantine_reason?: string | null;
21
+ /**
22
+ * true = quarantined, false = not quarantined, null = not marked
23
+ */
24
+ quarantine_status?: boolean | null;
25
+ /**
26
+ * Suite the test belongs to (omitted when empty)
27
+ */
28
+ suite_name?: string;
29
+ /**
30
+ * Deterministic hash that uniquely identifies the test
31
+ */
32
+ test_id?: string;
33
+ /**
34
+ * Name of the test method
35
+ */
36
+ test_name?: string;
37
+ }
@@ -1,18 +1,32 @@
1
1
  /**
2
- * A single test marking update request
2
+ * Request payload for setting flaky or quarantine status on a single test. A test can be identified either by `test_id` alone **or** by the combination of `test_name` + `class_name` (with optional `suite_name`). When `test_id` is provided, `test_name`, `class_name`, and the `repo` query parameter are not required.
3
+ *
3
4
  */
4
5
  export interface TestMarkingRequest {
5
6
  /**
6
- * Fully-qualified class name of the test
7
+ * Fully-qualified class name of the test (required when test_id is absent)
8
+ * @example "com.example.MyTest"
7
9
  */
8
- class_name: string;
10
+ class_name?: string;
9
11
  /**
10
- * Tri-state marking value. `"true"` explicitly marks the test (flaky or quarantined depending on the endpoint), `"false"` explicitly unmarks it, `"unset"` clears any stored marking.
12
+ * Desired marking state. Accepts either a JSON boolean (`true`/`false`) or the string values `"true"`, `"false"`, or `"unset"`. `"unset"` clears any stored value.
11
13
  *
12
14
  */
13
- marking: 'false' | 'true' | 'unset';
15
+ marking: (boolean & 'false') | 'true' | 'unset';
14
16
  /**
15
- * Name of the test method
17
+ * Suite (module) the test belongs to
18
+ * @example "unit"
16
19
  */
17
- test_name: string;
20
+ suite_name?: string;
21
+ /**
22
+ * Deterministic identifier for the test (returned by list endpoints). When provided, `test_name` and `class_name` are not needed.
23
+ *
24
+ * @example "36449"
25
+ */
26
+ test_id?: string;
27
+ /**
28
+ * Name of the test method (required when test_id is absent)
29
+ * @example "shouldReturnTrue"
30
+ */
31
+ test_name?: string;
18
32
  }
@@ -1,13 +1,15 @@
1
1
  /**
2
- * Result of a batch test-marking operation
2
+ * Response returned after a set-flaky or set-quarantine operation
3
3
  */
4
4
  export interface TestMarkingResponse {
5
5
  /**
6
- * Human-readable summary of the operation
6
+ * Human-readable summary
7
+ * @example "Successfully updated flaky status for 3 test(s)"
7
8
  */
8
9
  message?: string;
9
10
  /**
10
- * Number of test markings that were successfully updated
11
+ * Number of tests whose status was updated
12
+ * @example 3
11
13
  */
12
- updated: number;
14
+ updated?: number;
13
15
  }
@@ -1,9 +1,19 @@
1
1
  import type { Pagination } from '../schemas/Pagination';
2
- import type { TestMarking } from '../schemas/TestMarking';
2
+ import type { TestMarkingDetail } from '../schemas/TestMarkingDetail';
3
3
  /**
4
- * Paginated list of all tests with their marking information
4
+ * Paginated list of tests with their combined markings
5
5
  */
6
6
  export interface TestMarkingsResponse {
7
7
  pagination?: Pagination;
8
- tests: TestMarking[];
8
+ tests?: TestMarkingDetail[];
9
+ /**
10
+ * Total number of tests marked as flaky in the repository (independent of pagination and filters)
11
+ * @example 12
12
+ */
13
+ totalFlaky?: number;
14
+ /**
15
+ * Total number of tests marked as quarantined in the repository (independent of pagination and filters)
16
+ * @example 5
17
+ */
18
+ totalQuarantine?: number;
9
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-ti-service-client",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "Harness React TI service client - TI APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",
@@ -1,33 +0,0 @@
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 GetQuarantinedTestsQueryQueryParams {
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 GetQuarantinedTestsOkResponse = MarkedTestsResponse;
21
- export type GetQuarantinedTestsErrorResponse = BadRequestResponse | InternalErrorResponse;
22
- export interface GetQuarantinedTestsProps extends Omit<FetcherOptions<GetQuarantinedTestsQueryQueryParams, unknown>, 'url'> {
23
- queryParams: GetQuarantinedTestsQueryQueryParams;
24
- }
25
- export interface GetQuarantinedTestsResponseContainer {
26
- body: GetQuarantinedTestsOkResponse;
27
- headers: Headers;
28
- }
29
- export declare function getQuarantinedTests(props: GetQuarantinedTestsProps): Promise<GetQuarantinedTestsResponseContainer>;
30
- /**
31
- * Returns all tests currently marked as quarantined for the given account and repo, with pagination.
32
- */
33
- export declare function useGetQuarantinedTestsQuery(props: GetQuarantinedTestsProps, options?: Omit<UseQueryOptions<GetQuarantinedTestsResponseContainer, GetQuarantinedTestsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetQuarantinedTestsResponseContainer, import("..").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 '../../../../custom-fetcher/index.js';
6
- export function getQuarantinedTests(props) {
7
- return fetcher(Object.assign({ url: `/test-management/quarantine`, method: 'GET' }, props));
8
- }
9
- /**
10
- * Returns all tests currently marked as quarantined for the given account and repo, with pagination.
11
- */
12
- export function useGetQuarantinedTestsQuery(props, options) {
13
- return useQuery(['getQuarantinedTests', props.queryParams], ({ signal }) => getQuarantinedTests(Object.assign(Object.assign({}, props), { signal })), options);
14
- }
@@ -1,39 +0,0 @@
1
- /**
2
- * A test together with all of its current flaky and quarantine marking information
3
- */
4
- export interface TestMarking {
5
- /**
6
- * Fully-qualified class name containing the test
7
- */
8
- class_name: string;
9
- /**
10
- * Human-readable reason the test was marked as flaky (if available)
11
- */
12
- flaky_reason?: string | null;
13
- /**
14
- * Whether the test is marked as flaky. `true` = flaky, `false` = explicitly not flaky, `null` = no marking set.
15
- *
16
- */
17
- flaky_status: boolean | null;
18
- /**
19
- * Human-readable reason the test was quarantined (if available)
20
- */
21
- quarantine_reason?: string | null;
22
- /**
23
- * Whether the test is quarantined. `true` = quarantined, `false` = explicitly not quarantined, `null` = no marking set.
24
- *
25
- */
26
- quarantine_status: boolean | null;
27
- /**
28
- * Name of the test suite (if available)
29
- */
30
- suite_name?: string;
31
- /**
32
- * Unique identifier for the test
33
- */
34
- test_id: string;
35
- /**
36
- * Name of the test method
37
- */
38
- test_name: string;
39
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Result of a policy upsert operation
3
- */
4
- export interface UpsertPoliciesResponse {
5
- /**
6
- * Number of policies saved
7
- */
8
- count: number;
9
- /**
10
- * Human-readable confirmation message
11
- */
12
- message: string;
13
- }
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
- export {};