@harnessio/react-rmg-service-client 0.2.0 → 0.3.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,29 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { ReleaseApprovalsResponseResponse } from '../responses/ReleaseApprovalsResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetReleaseReleaseIdApprovalsQueryPathParams {
7
+ releaseId: string;
8
+ }
9
+ export interface GetReleaseReleaseIdApprovalsQueryQueryParams {
10
+ orgIdentifier?: string;
11
+ searchTerm?: string;
12
+ status?: string[];
13
+ page?: number;
14
+ size?: number;
15
+ sort?: string[];
16
+ }
17
+ export interface GetReleaseReleaseIdApprovalsQueryHeaderParams {
18
+ 'Harness-Account': string;
19
+ }
20
+ export type GetReleaseReleaseIdApprovalsOkResponse = ResponseWithPagination<ReleaseApprovalsResponseResponse>;
21
+ export type GetReleaseReleaseIdApprovalsErrorResponse = ErrorResponseResponse;
22
+ export interface GetReleaseReleaseIdApprovalsProps extends GetReleaseReleaseIdApprovalsQueryPathParams, Omit<FetcherOptions<GetReleaseReleaseIdApprovalsQueryQueryParams, unknown, GetReleaseReleaseIdApprovalsQueryHeaderParams>, 'url'> {
23
+ queryParams: GetReleaseReleaseIdApprovalsQueryQueryParams;
24
+ }
25
+ export declare function getReleaseReleaseIdApprovals(props: GetReleaseReleaseIdApprovalsProps): Promise<GetReleaseReleaseIdApprovalsOkResponse>;
26
+ /**
27
+ * Fetch approvals activity for a release
28
+ */
29
+ export declare function useGetReleaseReleaseIdApprovalsQuery(props: GetReleaseReleaseIdApprovalsProps, options?: Omit<UseQueryOptions<GetReleaseReleaseIdApprovalsOkResponse, GetReleaseReleaseIdApprovalsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetReleaseReleaseIdApprovalsOkResponse, 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 '../../../../fetcher/index.js';
6
+ export function getReleaseReleaseIdApprovals(props) {
7
+ return fetcher(Object.assign({ url: `/release/${props.releaseId}/approvals`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Fetch approvals activity for a release
11
+ */
12
+ export function useGetReleaseReleaseIdApprovalsQuery(props, options) {
13
+ return useQuery(['get-release-releaseId-approvals', props.releaseId, props.queryParams], ({ signal }) => getReleaseReleaseIdApprovals(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -9,6 +9,8 @@ export type { GetReleaseGroupSummaryErrorResponse, GetReleaseGroupSummaryOkRespo
9
9
  export { getReleaseGroupSummary, useGetReleaseGroupSummaryQuery, } from './hooks/useGetReleaseGroupSummaryQuery';
10
10
  export type { GetReleaseErrorResponse, GetReleaseOkResponse, GetReleaseProps, GetReleaseQueryPathParams, } from './hooks/useGetReleaseQuery';
11
11
  export { getRelease, useGetReleaseQuery } from './hooks/useGetReleaseQuery';
12
+ export type { GetReleaseReleaseIdApprovalsErrorResponse, GetReleaseReleaseIdApprovalsOkResponse, GetReleaseReleaseIdApprovalsProps, GetReleaseReleaseIdApprovalsQueryPathParams, GetReleaseReleaseIdApprovalsQueryQueryParams, } from './hooks/useGetReleaseReleaseIdApprovalsQuery';
13
+ export { getReleaseReleaseIdApprovals, useGetReleaseReleaseIdApprovalsQuery, } from './hooks/useGetReleaseReleaseIdApprovalsQuery';
12
14
  export type { GetReleaseReleaseIdEnvironmentDashboardErrorResponse, GetReleaseReleaseIdEnvironmentDashboardOkResponse, GetReleaseReleaseIdEnvironmentDashboardProps, GetReleaseReleaseIdEnvironmentDashboardQueryPathParams, GetReleaseReleaseIdEnvironmentDashboardQueryQueryParams, } from './hooks/useGetReleaseReleaseIdEnvironmentDashboardQuery';
13
15
  export { getReleaseReleaseIdEnvironmentDashboard, useGetReleaseReleaseIdEnvironmentDashboardQuery, } from './hooks/useGetReleaseReleaseIdEnvironmentDashboardQuery';
14
16
  export type { PostReleaseGroupErrorResponse, PostReleaseGroupMutationQueryParams, PostReleaseGroupOkResponse, PostReleaseGroupProps, PostReleaseGroupRequestBody, } from './hooks/usePostReleaseGroupMutation';
@@ -26,11 +28,14 @@ export type { EnvironmentDashboardResponseResponse } from './responses/Environme
26
28
  export type { ErrorResponseResponse } from './responses/ErrorResponseResponse';
27
29
  export type { GetReleaseGroupResponseResponse } from './responses/GetReleaseGroupResponseResponse';
28
30
  export type { ReleaseActivitiesResponseResponse } from './responses/ReleaseActivitiesResponseResponse';
31
+ export type { ReleaseApprovalsResponseResponse } from './responses/ReleaseApprovalsResponseResponse';
29
32
  export type { ReleaseDetailsResponseResponse } from './responses/ReleaseDetailsResponseResponse';
30
33
  export type { ReleaseGroupSummaryResponseResponse } from './responses/ReleaseGroupSummaryResponseResponse';
31
34
  export type { ReleaseSummaryResponseResponse } from './responses/ReleaseSummaryResponseResponse';
32
35
  export type { UpdateReleaseGroupResponseResponse } from './responses/UpdateReleaseGroupResponseResponse';
33
36
  export type { ActivityType } from './schemas/ActivityType';
37
+ export type { ApprovalInfoDto } from './schemas/ApprovalInfoDto';
38
+ export type { ApprovedByDto } from './schemas/ApprovedByDto';
34
39
  export type { EnvironmentDashboardDto } from './schemas/EnvironmentDashboardDto';
35
40
  export type { EnvironmentType } from './schemas/EnvironmentType';
36
41
  export type { Error } from './schemas/Error';
@@ -39,6 +44,8 @@ export type { GetReleaseGroupResponse } from './schemas/GetReleaseGroupResponse'
39
44
  export type { Pageable } from './schemas/Pageable';
40
45
  export type { PageableSort } from './schemas/PageableSort';
41
46
  export type { ReleaseActivity } from './schemas/ReleaseActivity';
47
+ export type { ReleaseApprovalDto } from './schemas/ReleaseApprovalDto';
48
+ export type { ReleaseApprovalType } from './schemas/ReleaseApprovalType';
42
49
  export type { ReleaseCadence } from './schemas/ReleaseCadence';
43
50
  export type { ReleaseComponent } from './schemas/ReleaseComponent';
44
51
  export type { ReleaseEntity } from './schemas/ReleaseEntity';
@@ -3,6 +3,7 @@ export { getReleaseActivities, useGetReleaseActivitiesQuery, } from './hooks/use
3
3
  export { getReleaseGroup, useGetReleaseGroupQuery } from './hooks/useGetReleaseGroupQuery';
4
4
  export { getReleaseGroupSummary, useGetReleaseGroupSummaryQuery, } from './hooks/useGetReleaseGroupSummaryQuery';
5
5
  export { getRelease, useGetReleaseQuery } from './hooks/useGetReleaseQuery';
6
+ export { getReleaseReleaseIdApprovals, useGetReleaseReleaseIdApprovalsQuery, } from './hooks/useGetReleaseReleaseIdApprovalsQuery';
6
7
  export { getReleaseReleaseIdEnvironmentDashboard, useGetReleaseReleaseIdEnvironmentDashboardQuery, } from './hooks/useGetReleaseReleaseIdEnvironmentDashboardQuery';
7
8
  export { postReleaseGroup, usePostReleaseGroupMutation } from './hooks/usePostReleaseGroupMutation';
8
9
  export { postReleaseSummary, usePostReleaseSummaryMutation, } from './hooks/usePostReleaseSummaryMutation';
@@ -0,0 +1,16 @@
1
+ import type { ReleaseApprovalDto } from '../schemas/ReleaseApprovalDto';
2
+ import type { Pageable } from '../schemas/Pageable';
3
+ import type { PageableSort } from '../schemas/PageableSort';
4
+ export interface ReleaseApprovalsResponseResponse {
5
+ content: ReleaseApprovalDto[];
6
+ empty: boolean;
7
+ first: boolean;
8
+ last: boolean;
9
+ number: number;
10
+ numberOfElements: number;
11
+ pageable: Pageable;
12
+ size: number;
13
+ sort: PageableSort;
14
+ totalElements: number;
15
+ totalPages: number;
16
+ }
@@ -0,0 +1,13 @@
1
+ import type { ApprovedByDto } from '../schemas/ApprovedByDto';
2
+ export interface ApprovalInfoDto {
3
+ /**
4
+ * Timestamp of the approval.
5
+ * @format int64
6
+ */
7
+ approvedAt: number;
8
+ approvedBy: ApprovedByDto;
9
+ /**
10
+ * Comments provided during the approval.
11
+ */
12
+ comments?: string;
13
+ }
@@ -0,0 +1,10 @@
1
+ export interface ApprovedByDto {
2
+ /**
3
+ * Email of the person who approved the step.
4
+ */
5
+ email: string;
6
+ /**
7
+ * Name of the person who approved the step.
8
+ */
9
+ name?: string;
10
+ }
@@ -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,13 @@
1
+ import type { ApprovalInfoDto } from '../schemas/ApprovalInfoDto';
2
+ import type { Status } from '../schemas/Status';
3
+ import type { ReleaseApprovalType } from '../schemas/ReleaseApprovalType';
4
+ export interface ReleaseApprovalDto {
5
+ approvalInfo?: ApprovalInfoDto;
6
+ name: string;
7
+ orgIdentifier: string;
8
+ pipelineIdentifier: string;
9
+ planExecutionId: string;
10
+ runSequenceId: number;
11
+ status: Status;
12
+ type: ReleaseApprovalType;
13
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Type of the step (e.g., Approval, JiraUpdate, JiraCreate, JiraApproval).
3
+ */
4
+ export type ReleaseApprovalType = 'HarnessApproval' | 'JiraApproval';
@@ -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,4 +1,4 @@
1
1
  /**
2
2
  * Type of the step (e.g., Approval, JiraUpdate, JiraCreate, JiraApproval).
3
3
  */
4
- export type StepInfoType = 'Approval' | 'JiraApproval' | 'JiraCreate' | 'JiraUpdate';
4
+ export type StepInfoType = 'HarnessApproval' | 'JiraApproval' | 'JiraCreate' | 'JiraUpdate';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-rmg-service-client",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Harness Release Management Service APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",