@harnessio/react-har-service-client 0.5.0 → 0.6.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.
@@ -6,17 +6,17 @@ import type { UnauthorizedResponse } from '../responses/UnauthorizedResponse';
6
6
  import type { InternalServerErrorResponse } from '../responses/InternalServerErrorResponse';
7
7
  import type { ResponseWithPagination } from '../helpers';
8
8
  import { FetcherOptions } from '../../../../fetcher/index.js';
9
- export interface RetriggerWebhookExecutionQueryPathParams {
9
+ export interface ReTriggerWebhookExecutionQueryPathParams {
10
10
  registry_ref: string;
11
11
  webhook_identifier: string;
12
12
  webhook_execution_id: string;
13
13
  }
14
- export type RetriggerWebhookExecutionOkResponse = ResponseWithPagination<WebhookExecutionResponseResponse>;
15
- export type RetriggerWebhookExecutionErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | InternalServerErrorResponse;
16
- export interface RetriggerWebhookExecutionProps extends RetriggerWebhookExecutionQueryPathParams, Omit<FetcherOptions<unknown, unknown>, 'url'> {
14
+ export type ReTriggerWebhookExecutionOkResponse = ResponseWithPagination<WebhookExecutionResponseResponse>;
15
+ export type ReTriggerWebhookExecutionErrorResponse = BadRequestResponse | UnauthenticatedResponse | UnauthorizedResponse | InternalServerErrorResponse;
16
+ export interface ReTriggerWebhookExecutionProps extends ReTriggerWebhookExecutionQueryPathParams, Omit<FetcherOptions<unknown, unknown>, 'url'> {
17
17
  }
18
- export declare function retriggerWebhookExecution(props: RetriggerWebhookExecutionProps): Promise<RetriggerWebhookExecutionOkResponse>;
18
+ export declare function reTriggerWebhookExecution(props: ReTriggerWebhookExecutionProps): Promise<ReTriggerWebhookExecutionOkResponse>;
19
19
  /**
20
20
  * Retrigger Webhook Execution
21
21
  */
22
- export declare function useRetriggerWebhookExecutionQuery(props: RetriggerWebhookExecutionProps, options?: Omit<UseQueryOptions<RetriggerWebhookExecutionOkResponse, RetriggerWebhookExecutionErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<RetriggerWebhookExecutionOkResponse, import("..").Error>;
22
+ export declare function useReTriggerWebhookExecutionQuery(props: ReTriggerWebhookExecutionProps, options?: Omit<UseQueryOptions<ReTriggerWebhookExecutionOkResponse, ReTriggerWebhookExecutionErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ReTriggerWebhookExecutionOkResponse, import("..").Error>;
@@ -3,17 +3,17 @@
3
3
  // Please do not modify this code directly.
4
4
  import { useQuery } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../fetcher/index.js';
6
- export function retriggerWebhookExecution(props) {
6
+ export function reTriggerWebhookExecution(props) {
7
7
  return fetcher(Object.assign({ url: `/registry/${props.registry_ref}/webhooks/${props.webhook_identifier}/executions/${props.webhook_execution_id}/retrigger`, method: 'GET' }, props));
8
8
  }
9
9
  /**
10
10
  * Retrigger Webhook Execution
11
11
  */
12
- export function useRetriggerWebhookExecutionQuery(props, options) {
12
+ export function useReTriggerWebhookExecutionQuery(props, options) {
13
13
  return useQuery([
14
- 'RetriggerWebhookExecution',
14
+ 'ReTriggerWebhookExecution',
15
15
  props.registry_ref,
16
16
  props.webhook_identifier,
17
17
  props.webhook_execution_id,
18
- ], ({ signal }) => retriggerWebhookExecution(Object.assign(Object.assign({}, props), { signal })), options);
18
+ ], ({ signal }) => reTriggerWebhookExecution(Object.assign(Object.assign({}, props), { signal })), options);
19
19
  }
@@ -4,7 +4,7 @@
4
4
  import { useMutation } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../fetcher/index.js';
6
6
  export function updateWebhook(props) {
7
- return fetcher(Object.assign({ url: `/registry/${props.registry_ref}/webhooks/${props.webhook_identifier}`, method: 'PATCH' }, props));
7
+ return fetcher(Object.assign({ url: `/registry/${props.registry_ref}/webhooks/${props.webhook_identifier}`, method: 'PUT' }, props));
8
8
  }
9
9
  /**
10
10
  * Returns Webhook Details
@@ -65,10 +65,10 @@ export type { ListWebhooksErrorResponse, ListWebhooksOkResponse, ListWebhooksPro
65
65
  export { listWebhooks, useListWebhooksQuery } from './hooks/useListWebhooksQuery';
66
66
  export type { ModifyRegistryErrorResponse, ModifyRegistryMutationPathParams, ModifyRegistryOkResponse, ModifyRegistryProps, ModifyRegistryRequestBody, } from './hooks/useModifyRegistryMutation';
67
67
  export { modifyRegistry, useModifyRegistryMutation } from './hooks/useModifyRegistryMutation';
68
+ export type { ReTriggerWebhookExecutionErrorResponse, ReTriggerWebhookExecutionOkResponse, ReTriggerWebhookExecutionProps, ReTriggerWebhookExecutionQueryPathParams, } from './hooks/useReTriggerWebhookExecutionQuery';
69
+ export { reTriggerWebhookExecution, useReTriggerWebhookExecutionQuery, } from './hooks/useReTriggerWebhookExecutionQuery';
68
70
  export type { RedirectHarnessArtifactErrorResponse, RedirectHarnessArtifactOkResponse, RedirectHarnessArtifactProps, RedirectHarnessArtifactQueryPathParams, RedirectHarnessArtifactQueryQueryParams, } from './hooks/useRedirectHarnessArtifactQuery';
69
71
  export { redirectHarnessArtifact, useRedirectHarnessArtifactQuery, } from './hooks/useRedirectHarnessArtifactQuery';
70
- export type { RetriggerWebhookExecutionErrorResponse, RetriggerWebhookExecutionOkResponse, RetriggerWebhookExecutionProps, RetriggerWebhookExecutionQueryPathParams, } from './hooks/useRetriggerWebhookExecutionQuery';
71
- export { retriggerWebhookExecution, useRetriggerWebhookExecutionQuery, } from './hooks/useRetriggerWebhookExecutionQuery';
72
72
  export type { UpdateArtifactLabelsErrorResponse, UpdateArtifactLabelsMutationPathParams, UpdateArtifactLabelsOkResponse, UpdateArtifactLabelsProps, UpdateArtifactLabelsRequestBody, } from './hooks/useUpdateArtifactLabelsMutation';
73
73
  export { updateArtifactLabels, useUpdateArtifactLabelsMutation, } from './hooks/useUpdateArtifactLabelsMutation';
74
74
  export type { UpdateWebhookErrorResponse, UpdateWebhookMutationPathParams, UpdateWebhookOkResponse, UpdateWebhookProps, UpdateWebhookRequestBody, } from './hooks/useUpdateWebhookMutation';
@@ -141,6 +141,7 @@ export type { DockerManifestDetails } from './schemas/DockerManifestDetails';
141
141
  export type { DockerManifests } from './schemas/DockerManifests';
142
142
  export type { EnvironmentType } from './schemas/EnvironmentType';
143
143
  export type { Error } from './schemas/Error';
144
+ export type { ExtraHeader } from './schemas/ExtraHeader';
144
145
  export type { FileDetail } from './schemas/FileDetail';
145
146
  export type { GenericArtifactDetailConfig } from './schemas/GenericArtifactDetailConfig';
146
147
  export type { HelmArtifactDetail } from './schemas/HelmArtifactDetail';
@@ -31,7 +31,7 @@ export { listArtifactLabels, useListArtifactLabelsQuery } from './hooks/useListA
31
31
  export { listWebhookExecutions, useListWebhookExecutionsQuery, } from './hooks/useListWebhookExecutionsQuery';
32
32
  export { listWebhooks, useListWebhooksQuery } from './hooks/useListWebhooksQuery';
33
33
  export { modifyRegistry, useModifyRegistryMutation } from './hooks/useModifyRegistryMutation';
34
+ export { reTriggerWebhookExecution, useReTriggerWebhookExecutionQuery, } from './hooks/useReTriggerWebhookExecutionQuery';
34
35
  export { redirectHarnessArtifact, useRedirectHarnessArtifactQuery, } from './hooks/useRedirectHarnessArtifactQuery';
35
- export { retriggerWebhookExecution, useRetriggerWebhookExecutionQuery, } from './hooks/useRetriggerWebhookExecutionQuery';
36
36
  export { updateArtifactLabels, useUpdateArtifactLabelsMutation, } from './hooks/useUpdateArtifactLabelsMutation';
37
37
  export { updateWebhook, useUpdateWebhookMutation } from './hooks/useUpdateWebhookMutation';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Webhook Extra Header
3
+ */
4
+ export interface ExtraHeader {
5
+ key?: string;
6
+ value?: string;
7
+ }
@@ -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,31 +1,26 @@
1
+ import type { ExtraHeader } from '../schemas/ExtraHeader';
1
2
  import type { WebhookExecResult } from '../schemas/WebhookExecResult';
2
3
  import type { Trigger } from '../schemas/Trigger';
3
4
  /**
4
5
  * Harness Regstries Webhook
5
6
  */
6
7
  export interface Webhook {
8
+ createdAt?: string;
7
9
  /**
8
10
  * @format int64
9
11
  */
10
- createdAt?: number;
11
- /**
12
- * @format int64
13
- */
14
- created_by?: number;
15
- enabled?: boolean;
16
- has_secret?: boolean;
17
- /**
18
- * @format int64
19
- */
20
- id?: number;
12
+ createdBy?: number;
13
+ description?: string;
14
+ enabled: boolean;
15
+ extraHeaders?: ExtraHeader[];
21
16
  identifier: string;
22
- insecure?: boolean;
17
+ insecure: boolean;
23
18
  latestExecutionResult?: WebhookExecResult;
24
- /**
25
- * @format int64
26
- */
27
- modifiedAt?: number;
19
+ modifiedAt?: string;
28
20
  name: string;
21
+ secretIdentifier?: string;
22
+ secretSpaceId?: number;
23
+ secretSpacePath?: string;
29
24
  triggers?: Trigger[];
30
25
  url: string;
31
26
  /**
@@ -5,5 +5,5 @@ export interface WebhookExecResponse {
5
5
  body?: string;
6
6
  headers?: string;
7
7
  status?: string;
8
- status_code?: number;
8
+ statusCode?: number;
9
9
  }
@@ -25,11 +25,11 @@ export interface WebhookExecution {
25
25
  /**
26
26
  * @format int64
27
27
  */
28
- retrigger_of?: number;
28
+ retriggerOf?: number;
29
29
  retriggerable?: boolean;
30
- trigger_type?: Trigger;
30
+ triggerType?: Trigger;
31
31
  /**
32
32
  * @format int64
33
33
  */
34
- webhook_id?: number;
34
+ webhookId?: number;
35
35
  }
@@ -1,10 +1,15 @@
1
+ import type { ExtraHeader } from '../schemas/ExtraHeader';
1
2
  import type { Trigger } from '../schemas/Trigger';
2
3
  export interface WebhookRequest {
3
4
  description?: string;
4
- enabled?: boolean;
5
+ enabled: boolean;
6
+ extraHeaders?: ExtraHeader[];
5
7
  identifier: string;
6
- insecure?: boolean;
7
- secret?: string;
8
+ insecure: boolean;
9
+ name: string;
10
+ secretIdentifier?: string;
11
+ secretSpaceId?: number;
12
+ secretSpacePath?: string;
8
13
  triggers?: Trigger[];
9
14
  url: string;
10
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-har-service-client",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Harness HAR Service APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",