@harnessio/react-sto-core-client 0.7.4 → 0.7.5

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,46 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { Exemption } from '../schemas/Exemption';
3
+ import type { NotFound } from '../schemas/NotFound';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface ExemptionsGetExemptionForIssueQueryPathParams {
7
+ /**
8
+ * Issue ID to find exemption for
9
+ * @example "abcdef1234567890ghijkl"
10
+ */
11
+ issueId: string;
12
+ }
13
+ export interface ExemptionsGetExemptionForIssueQueryQueryParams {
14
+ /**
15
+ * Harness Account ID
16
+ * @example "abcdef1234567890ghijkl"
17
+ */
18
+ accountId: string;
19
+ /**
20
+ * Harness Organization ID
21
+ * @example "example_org"
22
+ */
23
+ orgId?: string;
24
+ /**
25
+ * Harness Project ID
26
+ * @example "example_project"
27
+ */
28
+ projectId?: string;
29
+ }
30
+ export interface ExemptionsGetExemptionForIssueQueryHeaderParams {
31
+ /**
32
+ * Harness personal or service access token
33
+ * @example "Quaerat aliquam est."
34
+ */
35
+ 'X-Api-Key'?: string;
36
+ }
37
+ export type ExemptionsGetExemptionForIssueOkResponse = ResponseWithPagination<Exemption>;
38
+ export type ExemptionsGetExemptionForIssueErrorResponse = NotFound;
39
+ export interface ExemptionsGetExemptionForIssueProps extends ExemptionsGetExemptionForIssueQueryPathParams, Omit<FetcherOptions<ExemptionsGetExemptionForIssueQueryQueryParams, unknown, ExemptionsGetExemptionForIssueQueryHeaderParams>, 'url'> {
40
+ queryParams: ExemptionsGetExemptionForIssueQueryQueryParams;
41
+ }
42
+ export declare function exemptionsGetExemptionForIssue(props: ExemptionsGetExemptionForIssueProps): Promise<ExemptionsGetExemptionForIssueOkResponse>;
43
+ /**
44
+ * Get the highest-priority exemption for an issue across all scopes (account, org, project)
45
+ */
46
+ export declare function useExemptionsGetExemptionForIssueQuery(props: ExemptionsGetExemptionForIssueProps, options?: Omit<UseQueryOptions<ExemptionsGetExemptionForIssueOkResponse, ExemptionsGetExemptionForIssueErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ExemptionsGetExemptionForIssueOkResponse, NotFound>;
@@ -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 '../../../../fetcher/index.js';
6
+ export function exemptionsGetExemptionForIssue(props) {
7
+ return fetcher(Object.assign({ url: `/api/v2/exemptions/issue/${props.issueId}`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Get the highest-priority exemption for an issue across all scopes (account, org, project)
11
+ */
12
+ export function useExemptionsGetExemptionForIssueQuery(props, options) {
13
+ return useQuery(['Exemptions#GetExemptionForIssue', props.issueId, props.queryParams], ({ signal }) => exemptionsGetExemptionForIssue(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -7,8 +7,8 @@ export type { ExemptionsDeleteExemptionErrorResponse, ExemptionsDeleteExemptionM
7
7
  export { exemptionsDeleteExemption, useExemptionsDeleteExemptionMutation, } from './hooks/useExemptionsDeleteExemptionMutation';
8
8
  export type { ExemptionsFindExemptionByIdErrorResponse, ExemptionsFindExemptionByIdOkResponse, ExemptionsFindExemptionByIdProps, ExemptionsFindExemptionByIdQueryPathParams, ExemptionsFindExemptionByIdQueryQueryParams, } from './hooks/useExemptionsFindExemptionByIdQuery';
9
9
  export { exemptionsFindExemptionById, useExemptionsFindExemptionByIdQuery, } from './hooks/useExemptionsFindExemptionByIdQuery';
10
- export type { ExemptionsGetProjectLevelExemptionForIssueErrorResponse, ExemptionsGetProjectLevelExemptionForIssueOkResponse, ExemptionsGetProjectLevelExemptionForIssueProps, ExemptionsGetProjectLevelExemptionForIssueQueryPathParams, ExemptionsGetProjectLevelExemptionForIssueQueryQueryParams, } from './hooks/useExemptionsGetProjectLevelExemptionForIssueQuery';
11
- export { exemptionsGetProjectLevelExemptionForIssue, useExemptionsGetProjectLevelExemptionForIssueQuery, } from './hooks/useExemptionsGetProjectLevelExemptionForIssueQuery';
10
+ export type { ExemptionsGetExemptionForIssueErrorResponse, ExemptionsGetExemptionForIssueOkResponse, ExemptionsGetExemptionForIssueProps, ExemptionsGetExemptionForIssueQueryPathParams, ExemptionsGetExemptionForIssueQueryQueryParams, } from './hooks/useExemptionsGetExemptionForIssueQuery';
11
+ export { exemptionsGetExemptionForIssue, useExemptionsGetExemptionForIssueQuery, } from './hooks/useExemptionsGetExemptionForIssueQuery';
12
12
  export type { ExemptionsListExemptionsErrorResponse, ExemptionsListExemptionsOkResponse, ExemptionsListExemptionsProps, ExemptionsListExemptionsQueryQueryParams, } from './hooks/useExemptionsListExemptionsQuery';
13
13
  export { exemptionsListExemptions, useExemptionsListExemptionsQuery, } from './hooks/useExemptionsListExemptionsQuery';
14
14
  export type { ExemptionsPromoteExemptionErrorResponse, ExemptionsPromoteExemptionMutationPathParams, ExemptionsPromoteExemptionMutationQueryParams, ExemptionsPromoteExemptionOkResponse, ExemptionsPromoteExemptionProps, ExemptionsPromoteExemptionRequestBody, } from './hooks/useExemptionsPromoteExemptionMutation';
@@ -2,7 +2,7 @@ export { exemptionsApproveExemption, useExemptionsApproveExemptionMutation, } fr
2
2
  export { exemptionsCreateExemption, useExemptionsCreateExemptionMutation, } from './hooks/useExemptionsCreateExemptionMutation';
3
3
  export { exemptionsDeleteExemption, useExemptionsDeleteExemptionMutation, } from './hooks/useExemptionsDeleteExemptionMutation';
4
4
  export { exemptionsFindExemptionById, useExemptionsFindExemptionByIdQuery, } from './hooks/useExemptionsFindExemptionByIdQuery';
5
- export { exemptionsGetProjectLevelExemptionForIssue, useExemptionsGetProjectLevelExemptionForIssueQuery, } from './hooks/useExemptionsGetProjectLevelExemptionForIssueQuery';
5
+ export { exemptionsGetExemptionForIssue, useExemptionsGetExemptionForIssueQuery, } from './hooks/useExemptionsGetExemptionForIssueQuery';
6
6
  export { exemptionsListExemptions, useExemptionsListExemptionsQuery, } from './hooks/useExemptionsListExemptionsQuery';
7
7
  export { exemptionsPromoteExemption, useExemptionsPromoteExemptionMutation, } from './hooks/useExemptionsPromoteExemptionMutation';
8
8
  export { exemptionsUpdateExemption, useExemptionsUpdateExemptionMutation, } from './hooks/useExemptionsUpdateExemptionMutation';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-sto-core-client",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "Harness STO service APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",
@@ -1,46 +0,0 @@
1
- import { UseQueryOptions } from '@tanstack/react-query';
2
- import type { Exemption } from '../schemas/Exemption';
3
- import type { NotFound } from '../schemas/NotFound';
4
- import type { ResponseWithPagination } from '../helpers';
5
- import { FetcherOptions } from '../../../../fetcher/index.js';
6
- export interface ExemptionsGetProjectLevelExemptionForIssueQueryPathParams {
7
- /**
8
- * Issue ID to find exemption for
9
- * @example "abcdef1234567890ghijkl"
10
- */
11
- issueId: string;
12
- }
13
- export interface ExemptionsGetProjectLevelExemptionForIssueQueryQueryParams {
14
- /**
15
- * Harness Account ID
16
- * @example "abcdef1234567890ghijkl"
17
- */
18
- accountId: string;
19
- /**
20
- * Harness Organization ID
21
- * @example "example_org"
22
- */
23
- orgId?: string;
24
- /**
25
- * Harness Project ID
26
- * @example "example_project"
27
- */
28
- projectId?: string;
29
- }
30
- export interface ExemptionsGetProjectLevelExemptionForIssueQueryHeaderParams {
31
- /**
32
- * Harness personal or service access token
33
- * @example "Quaerat aliquam est."
34
- */
35
- 'X-Api-Key'?: string;
36
- }
37
- export type ExemptionsGetProjectLevelExemptionForIssueOkResponse = ResponseWithPagination<Exemption>;
38
- export type ExemptionsGetProjectLevelExemptionForIssueErrorResponse = NotFound;
39
- export interface ExemptionsGetProjectLevelExemptionForIssueProps extends ExemptionsGetProjectLevelExemptionForIssueQueryPathParams, Omit<FetcherOptions<ExemptionsGetProjectLevelExemptionForIssueQueryQueryParams, unknown, ExemptionsGetProjectLevelExemptionForIssueQueryHeaderParams>, 'url'> {
40
- queryParams: ExemptionsGetProjectLevelExemptionForIssueQueryQueryParams;
41
- }
42
- export declare function exemptionsGetProjectLevelExemptionForIssue(props: ExemptionsGetProjectLevelExemptionForIssueProps): Promise<ExemptionsGetProjectLevelExemptionForIssueOkResponse>;
43
- /**
44
- * Get the highest-priority project-level exemption for an issue
45
- */
46
- export declare function useExemptionsGetProjectLevelExemptionForIssueQuery(props: ExemptionsGetProjectLevelExemptionForIssueProps, options?: Omit<UseQueryOptions<ExemptionsGetProjectLevelExemptionForIssueOkResponse, ExemptionsGetProjectLevelExemptionForIssueErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ExemptionsGetProjectLevelExemptionForIssueOkResponse, NotFound>;
@@ -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 exemptionsGetProjectLevelExemptionForIssue(props) {
7
- return fetcher(Object.assign({ url: `/api/v2/exemptions/for-issue/${props.issueId}`, method: 'GET' }, props));
8
- }
9
- /**
10
- * Get the highest-priority project-level exemption for an issue
11
- */
12
- export function useExemptionsGetProjectLevelExemptionForIssueQuery(props, options) {
13
- return useQuery(['Exemptions#GetProjectLevelExemptionForIssue', props.issueId, props.queryParams], ({ signal }) => exemptionsGetProjectLevelExemptionForIssue(Object.assign(Object.assign({}, props), { signal })), options);
14
- }