@harnessio/react-rmg-service-client 0.0.3 → 0.1.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.
Files changed (26) hide show
  1. package/dist/rmg-service/src/services/hooks/useGetReleaseActivitiesQuery.d.ts +26 -0
  2. package/dist/rmg-service/src/services/hooks/useGetReleaseActivitiesQuery.js +14 -0
  3. package/dist/rmg-service/src/services/index.d.ts +10 -0
  4. package/dist/rmg-service/src/services/index.js +1 -0
  5. package/dist/rmg-service/src/services/requestBodies/ReleaseSummaryRequestRequestBody.d.ts +6 -12
  6. package/dist/rmg-service/src/services/responses/ReleaseActivitiesResponseResponse.d.ts +7 -0
  7. package/dist/rmg-service/src/services/responses/ReleaseActivitiesResponseResponse.js +1 -0
  8. package/dist/rmg-service/src/services/responses/ReleaseSummaryResponseResponse.d.ts +3 -1
  9. package/dist/rmg-service/src/services/schemas/ActivityType.d.ts +4 -0
  10. package/dist/rmg-service/src/services/schemas/ActivityType.js +4 -0
  11. package/dist/rmg-service/src/services/schemas/Freq.d.ts +4 -0
  12. package/dist/rmg-service/src/services/schemas/Freq.js +4 -0
  13. package/dist/rmg-service/src/services/schemas/ReleaseActivity.d.ts +163 -0
  14. package/dist/rmg-service/src/services/schemas/ReleaseActivity.js +1 -0
  15. package/dist/rmg-service/src/services/schemas/ReleaseCadence.d.ts +17 -7
  16. package/dist/rmg-service/src/services/schemas/ReleaseComponent.d.ts +33 -6
  17. package/dist/rmg-service/src/services/schemas/ReleaseFrequency.d.ts +1 -1
  18. package/dist/rmg-service/src/services/schemas/StageInfoType.d.ts +4 -0
  19. package/dist/rmg-service/src/services/schemas/StageInfoType.js +4 -0
  20. package/dist/rmg-service/src/services/schemas/Status.d.ts +4 -0
  21. package/dist/rmg-service/src/services/schemas/Status.js +4 -0
  22. package/dist/rmg-service/src/services/schemas/StepInfoType.d.ts +4 -0
  23. package/dist/rmg-service/src/services/schemas/StepInfoType.js +4 -0
  24. package/dist/rmg-service/src/services/schemas/TriggerType.d.ts +4 -0
  25. package/dist/rmg-service/src/services/schemas/TriggerType.js +4 -0
  26. package/package.json +1 -1
@@ -0,0 +1,26 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { ReleaseActivitiesResponseResponse } from '../responses/ReleaseActivitiesResponseResponse';
3
+ import type { ErrorResponseResponse } from '../responses/ErrorResponseResponse';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetReleaseActivitiesQueryPathParams {
7
+ releaseId: string;
8
+ }
9
+ export interface GetReleaseActivitiesQueryQueryParams {
10
+ orgIdentifier?: string;
11
+ startTs: number;
12
+ endTs: number;
13
+ }
14
+ export interface GetReleaseActivitiesQueryHeaderParams {
15
+ 'Harness-Account': string;
16
+ }
17
+ export type GetReleaseActivitiesOkResponse = ResponseWithPagination<ReleaseActivitiesResponseResponse>;
18
+ export type GetReleaseActivitiesErrorResponse = ErrorResponseResponse;
19
+ export interface GetReleaseActivitiesProps extends GetReleaseActivitiesQueryPathParams, Omit<FetcherOptions<GetReleaseActivitiesQueryQueryParams, unknown, GetReleaseActivitiesQueryHeaderParams>, 'url'> {
20
+ queryParams: GetReleaseActivitiesQueryQueryParams;
21
+ }
22
+ export declare function getReleaseActivities(props: GetReleaseActivitiesProps): Promise<GetReleaseActivitiesOkResponse>;
23
+ /**
24
+ * Fetch a list of activities based on the startTime, endTime and release Id.
25
+ */
26
+ export declare function useGetReleaseActivitiesQuery(props: GetReleaseActivitiesProps, options?: Omit<UseQueryOptions<GetReleaseActivitiesOkResponse, GetReleaseActivitiesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetReleaseActivitiesOkResponse, 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 getReleaseActivities(props) {
7
+ return fetcher(Object.assign({ url: `/release/${props.releaseId}/activities`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Fetch a list of activities based on the startTime, endTime and release Id.
11
+ */
12
+ export function useGetReleaseActivitiesQuery(props, options) {
13
+ return useQuery(['getReleaseActivities', props.releaseId, props.queryParams], ({ signal }) => getReleaseActivities(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -1,6 +1,8 @@
1
1
  export type { GetPathParamsType, ResponseWithPagination } from './helpers';
2
2
  export type { DeleteReleaseGroupErrorResponse, DeleteReleaseGroupMutationPathParams, DeleteReleaseGroupMutationQueryParams, DeleteReleaseGroupOkResponse, DeleteReleaseGroupProps, } from './hooks/useDeleteReleaseGroupMutation';
3
3
  export { deleteReleaseGroup, useDeleteReleaseGroupMutation, } from './hooks/useDeleteReleaseGroupMutation';
4
+ export type { GetReleaseActivitiesErrorResponse, GetReleaseActivitiesOkResponse, GetReleaseActivitiesProps, GetReleaseActivitiesQueryPathParams, GetReleaseActivitiesQueryQueryParams, } from './hooks/useGetReleaseActivitiesQuery';
5
+ export { getReleaseActivities, useGetReleaseActivitiesQuery, } from './hooks/useGetReleaseActivitiesQuery';
4
6
  export type { GetReleaseGroupErrorResponse, GetReleaseGroupOkResponse, GetReleaseGroupProps, GetReleaseGroupQueryPathParams, GetReleaseGroupQueryQueryParams, } from './hooks/useGetReleaseGroupQuery';
5
7
  export { getReleaseGroup, useGetReleaseGroupQuery } from './hooks/useGetReleaseGroupQuery';
6
8
  export type { PostReleaseGroupErrorResponse, PostReleaseGroupMutationQueryParams, PostReleaseGroupOkResponse, PostReleaseGroupProps, PostReleaseGroupRequestBody, } from './hooks/usePostReleaseGroupMutation';
@@ -16,10 +18,14 @@ export type { CreateReleaseGroupResponseResponse } from './responses/CreateRelea
16
18
  export type { DeleteReleaseGroupResponseResponse } from './responses/DeleteReleaseGroupResponseResponse';
17
19
  export type { ErrorResponseResponse } from './responses/ErrorResponseResponse';
18
20
  export type { GetReleaseGroupResponseResponse } from './responses/GetReleaseGroupResponseResponse';
21
+ export type { ReleaseActivitiesResponseResponse } from './responses/ReleaseActivitiesResponseResponse';
19
22
  export type { ReleaseSummaryResponseResponse } from './responses/ReleaseSummaryResponseResponse';
20
23
  export type { UpdateReleaseGroupResponseResponse } from './responses/UpdateReleaseGroupResponseResponse';
24
+ export type { ActivityType } from './schemas/ActivityType';
21
25
  export type { Error } from './schemas/Error';
26
+ export type { Freq } from './schemas/Freq';
22
27
  export type { GetReleaseGroupResponse } from './schemas/GetReleaseGroupResponse';
28
+ export type { ReleaseActivity } from './schemas/ReleaseActivity';
23
29
  export type { ReleaseCadence } from './schemas/ReleaseCadence';
24
30
  export type { ReleaseComponent } from './schemas/ReleaseComponent';
25
31
  export type { ReleaseEntity } from './schemas/ReleaseEntity';
@@ -27,3 +33,7 @@ export type { ReleaseFrequency } from './schemas/ReleaseFrequency';
27
33
  export type { ReleaseGroupYaml } from './schemas/ReleaseGroupYaml';
28
34
  export type { ReleaseType } from './schemas/ReleaseType';
29
35
  export type { RepeatUnit } from './schemas/RepeatUnit';
36
+ export type { StageInfoType } from './schemas/StageInfoType';
37
+ export type { Status } from './schemas/Status';
38
+ export type { StepInfoType } from './schemas/StepInfoType';
39
+ export type { TriggerType } from './schemas/TriggerType';
@@ -1,4 +1,5 @@
1
1
  export { deleteReleaseGroup, useDeleteReleaseGroupMutation, } from './hooks/useDeleteReleaseGroupMutation';
2
+ export { getReleaseActivities, useGetReleaseActivitiesQuery, } from './hooks/useGetReleaseActivitiesQuery';
2
3
  export { getReleaseGroup, useGetReleaseGroupQuery } from './hooks/useGetReleaseGroupQuery';
3
4
  export { postReleaseGroup, usePostReleaseGroupMutation } from './hooks/usePostReleaseGroupMutation';
4
5
  export { postReleaseSummary, usePostReleaseSummaryMutation, } from './hooks/usePostReleaseSummaryMutation';
@@ -1,12 +1,6 @@
1
- export type ReleaseSummaryRequestRequestBody = Array<{
2
- /**
3
- * End timestamp in milliseconds
4
- * @example 1700600000000
5
- */
6
- endTime: number;
7
- /**
8
- * Start timestamp in milliseconds
9
- * @example 1700000000000
10
- */
11
- startTime: number;
12
- }>;
1
+ export interface ReleaseSummaryRequestRequestBody {
2
+ timeRanges?: Array<{
3
+ endTime: number;
4
+ startTime: number;
5
+ }>;
6
+ }
@@ -0,0 +1,7 @@
1
+ import type { ReleaseActivity } from '../schemas/ReleaseActivity';
2
+ export interface ReleaseActivitiesResponseResponse {
3
+ /**
4
+ * List of activities.
5
+ */
6
+ activities?: ReleaseActivity[];
7
+ }
@@ -1,2 +1,4 @@
1
1
  import type { ReleaseEntity } from '../schemas/ReleaseEntity';
2
- export type ReleaseSummaryResponseResponse = ReleaseEntity[];
2
+ export interface ReleaseSummaryResponseResponse {
3
+ releases?: ReleaseEntity[];
4
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Type of the activity (e.g., stage, step).
3
+ */
4
+ export type ActivityType = 'stage' | 'step';
@@ -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,4 @@
1
+ /**
2
+ * Unit of time used for repeating releases.
3
+ */
4
+ export type Freq = 'Daily' | 'Monthly' | 'Weekly';
@@ -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,163 @@
1
+ import type { Status } from '../schemas/Status';
2
+ import type { StageInfoType } from '../schemas/StageInfoType';
3
+ import type { StepInfoType } from '../schemas/StepInfoType';
4
+ import type { TriggerType } from '../schemas/TriggerType';
5
+ import type { ActivityType } from '../schemas/ActivityType';
6
+ export interface ReleaseActivity {
7
+ /**
8
+ * Account identifier.
9
+ */
10
+ accountId: string;
11
+ /**
12
+ * Unique identifier for the activity.
13
+ */
14
+ id: string;
15
+ /**
16
+ * Organization identifier.
17
+ */
18
+ orgIdentifier: string;
19
+ /**
20
+ * Pipeline identifier.
21
+ */
22
+ pipelineIdentifier: string;
23
+ /**
24
+ * Name of the pipeline.
25
+ */
26
+ pipelineName: string;
27
+ /**
28
+ * Plan execution identifier.
29
+ */
30
+ planExecutionId: string;
31
+ /**
32
+ * Project identifier.
33
+ */
34
+ projectIdentifier: string;
35
+ /**
36
+ * Details about the stage activity (provided if type is stage).
37
+ */
38
+ stageInfo?: {
39
+ /**
40
+ * End timestamp of the stage.
41
+ */
42
+ endTs?: number;
43
+ /**
44
+ * Identifier of the stage.
45
+ */
46
+ identifier: string;
47
+ /**
48
+ * Info related to stage
49
+ */
50
+ info?: {
51
+ /**
52
+ * Display name of the artifact.
53
+ */
54
+ artifactDisplayName?: string;
55
+ /**
56
+ * Identifier of the environment.
57
+ */
58
+ envId?: string;
59
+ /**
60
+ * Name of the environment.
61
+ */
62
+ envName?: string;
63
+ /**
64
+ * Identifier of the service.
65
+ */
66
+ serviceId?: string;
67
+ /**
68
+ * Name of the service.
69
+ */
70
+ serviceName?: string;
71
+ } | null;
72
+ /**
73
+ * Name of the stage.
74
+ */
75
+ name: string;
76
+ /**
77
+ * Start timestamp of the stage.
78
+ */
79
+ startTs?: number;
80
+ status: Status;
81
+ type: StageInfoType;
82
+ } | null;
83
+ /**
84
+ * Details about the step activity (provided if type is step).
85
+ */
86
+ stepInfo?: {
87
+ /**
88
+ * End timestamp of the step.
89
+ */
90
+ endTs?: number;
91
+ /**
92
+ * Identifier of the step.
93
+ */
94
+ identifier: string;
95
+ /**
96
+ * Provided if `type` is Approval.
97
+ */
98
+ info?: {
99
+ /**
100
+ * Action taken for the approval.
101
+ */
102
+ approvalAction?: string;
103
+ /**
104
+ * Timestamp of the approval.
105
+ * @format int64
106
+ */
107
+ approvedAt?: number;
108
+ /**
109
+ * Email of the person who approved the step.
110
+ */
111
+ approvedByEmail?: string;
112
+ /**
113
+ * Name of the person who approved the step.
114
+ */
115
+ approvedByName?: string;
116
+ /**
117
+ * Comments provided during the approval.
118
+ */
119
+ comments?: string;
120
+ /**
121
+ * Type of the Jira issue.
122
+ */
123
+ issueType?: string;
124
+ /**
125
+ * URL of the Jira ticket.
126
+ */
127
+ jiraUrl?: string;
128
+ /**
129
+ * Status of the Jira ticket.
130
+ */
131
+ ticketStatus?: string;
132
+ } | null;
133
+ /**
134
+ * Name of the step.
135
+ */
136
+ name: string;
137
+ /**
138
+ * Start timestamp of the step.
139
+ */
140
+ startTs?: number;
141
+ status: Status;
142
+ type: StepInfoType;
143
+ } | null;
144
+ /**
145
+ * Details of the user who triggered the activity.
146
+ */
147
+ triggeredBy: {
148
+ /**
149
+ * Avatar URL of the person.
150
+ */
151
+ avatar?: string;
152
+ /**
153
+ * Identifier of the person who triggered the activity.
154
+ */
155
+ id?: string;
156
+ /**
157
+ * Name of the person who triggered the activity.
158
+ */
159
+ name?: string;
160
+ triggerType?: TriggerType;
161
+ };
162
+ type: ActivityType;
163
+ }
@@ -1,17 +1,27 @@
1
1
  import type { ReleaseFrequency } from '../schemas/ReleaseFrequency';
2
- import type { RepeatUnit } from '../schemas/RepeatUnit';
2
+ import type { Freq } from '../schemas/Freq';
3
3
  export interface ReleaseCadence {
4
+ /**
5
+ * duration for the release cadence.
6
+ */
7
+ duration: string;
4
8
  /**
5
9
  * End date of the release cadence (YYYY-MM-DD).
6
10
  * @format date
7
11
  */
8
- endDate?: string;
12
+ endDate: string;
9
13
  frequency: ReleaseFrequency;
10
- /**
11
- * Number of units between releases.
12
- */
13
- repeatInterval: number;
14
- repeatUnit: RepeatUnit;
14
+ spec?: {
15
+ freq: Freq;
16
+ /**
17
+ * Number of units between releases.
18
+ */
19
+ interval: number;
20
+ /**
21
+ * weekday
22
+ */
23
+ weekday?: string;
24
+ };
15
25
  /**
16
26
  * Start date of the release cadence (YYYY-MM-DD).
17
27
  * @format date
@@ -1,22 +1,49 @@
1
1
  export interface ReleaseComponent {
2
2
  /**
3
- * List of environment identifiers.
3
+ * Details about environments with filterType and refs.
4
4
  */
5
- environments?: string[];
5
+ environments?: {
6
+ /**
7
+ * Type of filter applied for environments.
8
+ */
9
+ filterType?: 'All' | 'Equals';
10
+ /**
11
+ * List of environment identifiers.
12
+ */
13
+ refs?: string[];
14
+ };
6
15
  /**
7
16
  * Identifier for the organization.
8
17
  */
9
18
  orgIdentifier: string;
10
19
  /**
11
- * List of pipeline identifiers.
20
+ * Details about pipelines with filterType and refs.
12
21
  */
13
- pipelines?: string[];
22
+ pipelines?: {
23
+ /**
24
+ * Type of filter applied for pipelines.
25
+ */
26
+ filterType?: 'All' | 'Equals';
27
+ /**
28
+ * List of pipeline identifiers.
29
+ */
30
+ refs?: string[];
31
+ };
14
32
  /**
15
33
  * Identifier for the project.
16
34
  */
17
35
  projectIdentifier: string;
18
36
  /**
19
- * List of service identifiers.
37
+ * Details about services with filterType and refs.
20
38
  */
21
- services?: string[];
39
+ services?: {
40
+ /**
41
+ * Type of filter applied for services.
42
+ */
43
+ filterType?: 'All' | 'Equals';
44
+ /**
45
+ * List of service identifiers.
46
+ */
47
+ refs?: string[];
48
+ };
22
49
  }
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Frequency of the release cadence.
3
3
  */
4
- export type ReleaseFrequency = 'Custom' | 'Daily' | 'Monthly' | 'Weekly';
4
+ export type ReleaseFrequency = 'BiWeekly' | 'Custom' | 'Daily' | 'Monthly' | 'Weekly';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Type of the stage (e.g., CD, custom)
3
+ */
4
+ export type StageInfoType = 'CD' | 'Custom';
@@ -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,4 @@
1
+ /**
2
+ * Status of the stage.
3
+ */
4
+ export type Status = 'ABORTED' | 'ABORTEDBYFREEZE' | 'APPROVALREJECTED' | 'APPROVALWAITING' | 'DISCONTINUING' | 'ERRORED' | 'EXPIRED' | 'FAILED' | 'IGNOREFAILED' | 'INPUTWAITING' | 'INTERVENTIONWAITING' | 'NOTSTARTED' | 'PAUSED' | 'PAUSING' | 'QUEUED' | 'QUEUED_EXECUTION_CONCURRENCY_REACHED' | 'QUEUED_LICENSE_LIMIT_REACHED' | 'RESOURCEWAITING' | 'SKIPPED' | 'SUCCESS' | 'SUSPENDED' | 'TIMEDWAITING' | 'UPLOADWAITING' | 'WAITSTEPRUNNING';
@@ -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,4 @@
1
+ /**
2
+ * Type of the step (e.g., Approval, JiraUpdate, JiraCreate, JiraApproval).
3
+ */
4
+ export type StepInfoType = 'Approval' | 'JiraApproval' | 'JiraCreate' | 'JiraUpdate';
@@ -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,4 @@
1
+ /**
2
+ * Unit of time used for repeating releases.
3
+ */
4
+ export type TriggerType = 'ARTIFACT' | 'MANIFEST' | 'MANUAL' | 'SCHEDULER_CRON' | 'WEBHOOK' | 'WEBHOOK_CUSTOM';
@@ -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-rmg-service-client",
3
- "version": "0.0.3",
3
+ "version": "0.1.0",
4
4
  "description": "Harness Release Management Service APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",