@harnessio/react-idp-service-client 0.49.0 → 0.49.1

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 (19) hide show
  1. package/dist/idp-service/src/services/hooks/useCreateIntegrationMutation.d.ts +6 -3
  2. package/dist/idp-service/src/services/hooks/useCreateIntegrationMutation.js +1 -1
  3. package/dist/idp-service/src/services/hooks/useGetIntegrationQuery.d.ts +1 -0
  4. package/dist/idp-service/src/services/hooks/useGetIntegrationQuery.js +2 -2
  5. package/dist/idp-service/src/services/hooks/useGetIntegrationsQuery.d.ts +4 -1
  6. package/dist/idp-service/src/services/hooks/useGetIntegrationsQuery.js +2 -2
  7. package/dist/idp-service/src/services/hooks/useUpdateIntegrationMutation.d.ts +3 -3
  8. package/dist/idp-service/src/services/hooks/useUpdateIntegrationMutation.js +1 -1
  9. package/dist/idp-service/src/services/index.d.ts +4 -5
  10. package/dist/idp-service/src/services/requestBodies/IntegrationRequestRequestBody.d.ts +2 -0
  11. package/dist/idp-service/src/services/schemas/BaseIntegrationRequest.d.ts +6 -0
  12. package/dist/idp-service/src/services/schemas/IntegrationResponse.d.ts +1 -7
  13. package/package.json +1 -1
  14. package/dist/idp-service/src/services/schemas/IntegrationRequest.d.ts +0 -7
  15. package/dist/idp-service/src/services/schemas/ReadValidationDetails.d.ts +0 -3
  16. package/dist/idp-service/src/services/schemas/WriteValidationDetails.d.ts +0 -5
  17. package/dist/idp-service/src/services/schemas/WriteValidationDetails.js +0 -4
  18. /package/dist/idp-service/src/services/{schemas/IntegrationRequest.js → requestBodies/IntegrationRequestRequestBody.js} +0 -0
  19. /package/dist/idp-service/src/services/schemas/{ReadValidationDetails.js → BaseIntegrationRequest.js} +0 -0
@@ -1,8 +1,11 @@
1
1
  import { UseMutationOptions } from '@tanstack/react-query';
2
2
  import type { IntegrationResponseResponse } from '../responses/IntegrationResponseResponse';
3
- import type { IntegrationRequest } from '../schemas/IntegrationRequest';
3
+ import type { IntegrationRequestRequestBody } from '../requestBodies/IntegrationRequestRequestBody';
4
4
  import type { ResponseWithPagination } from '../helpers';
5
5
  import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface CreateIntegrationMutationPathParams {
7
+ integration: 'git';
8
+ }
6
9
  export interface CreateIntegrationMutationQueryParams {
7
10
  dry_run?: boolean;
8
11
  write_validation?: boolean;
@@ -10,10 +13,10 @@ export interface CreateIntegrationMutationQueryParams {
10
13
  export interface CreateIntegrationMutationHeaderParams {
11
14
  'Harness-Account'?: string;
12
15
  }
13
- export type CreateIntegrationRequestBody = IntegrationRequest;
16
+ export type CreateIntegrationRequestBody = IntegrationRequestRequestBody;
14
17
  export type CreateIntegrationOkResponse = ResponseWithPagination<IntegrationResponseResponse>;
15
18
  export type CreateIntegrationErrorResponse = unknown;
16
- export interface CreateIntegrationProps extends Omit<FetcherOptions<CreateIntegrationMutationQueryParams, CreateIntegrationRequestBody, CreateIntegrationMutationHeaderParams>, 'url'> {
19
+ export interface CreateIntegrationProps extends CreateIntegrationMutationPathParams, Omit<FetcherOptions<CreateIntegrationMutationQueryParams, CreateIntegrationRequestBody, CreateIntegrationMutationHeaderParams>, 'url'> {
17
20
  queryParams: CreateIntegrationMutationQueryParams;
18
21
  body: CreateIntegrationRequestBody;
19
22
  }
@@ -4,7 +4,7 @@
4
4
  import { useMutation } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../fetcher/index.js';
6
6
  export function createIntegration(props) {
7
- return fetcher(Object.assign({ url: `/v1/integrations`, method: 'POST' }, props));
7
+ return fetcher(Object.assign({ url: `/v1/integrations/${props.integration}`, method: 'POST' }, props));
8
8
  }
9
9
  /**
10
10
  * Create integration
@@ -3,6 +3,7 @@ import type { IntegrationResponseResponse } from '../responses/IntegrationRespon
3
3
  import type { ResponseWithPagination } from '../helpers';
4
4
  import { FetcherOptions } from '../../../../fetcher/index.js';
5
5
  export interface GetIntegrationQueryPathParams {
6
+ integration: 'git';
6
7
  'integration-id': string;
7
8
  }
8
9
  export interface GetIntegrationQueryHeaderParams {
@@ -4,11 +4,11 @@
4
4
  import { useQuery } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../fetcher/index.js';
6
6
  export function getIntegration(props) {
7
- return fetcher(Object.assign({ url: `/v1/integrations/${props['integration-id']}`, method: 'GET' }, props));
7
+ return fetcher(Object.assign({ url: `/v1/integrations/${props.integration}/${props['integration-id']}`, method: 'GET' }, props));
8
8
  }
9
9
  /**
10
10
  * Get integration details for given integrationId
11
11
  */
12
12
  export function useGetIntegrationQuery(props, options) {
13
- return useQuery(['get-integration', props['integration-id']], ({ signal }) => getIntegration(Object.assign(Object.assign({}, props), { signal })), options);
13
+ return useQuery(['get-integration', props.integration, props['integration-id']], ({ signal }) => getIntegration(Object.assign(Object.assign({}, props), { signal })), options);
14
14
  }
@@ -2,6 +2,9 @@ import { UseQueryOptions } from '@tanstack/react-query';
2
2
  import type { IntegrationResponseListResponse } from '../responses/IntegrationResponseListResponse';
3
3
  import type { ResponseWithPagination } from '../helpers';
4
4
  import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface GetIntegrationsQueryPathParams {
6
+ integration: 'git';
7
+ }
5
8
  export interface GetIntegrationsQueryQueryParams {
6
9
  page?: number;
7
10
  limit?: number;
@@ -13,7 +16,7 @@ export interface GetIntegrationsQueryHeaderParams {
13
16
  }
14
17
  export type GetIntegrationsOkResponse = ResponseWithPagination<IntegrationResponseListResponse>;
15
18
  export type GetIntegrationsErrorResponse = unknown;
16
- export interface GetIntegrationsProps extends Omit<FetcherOptions<GetIntegrationsQueryQueryParams, unknown, GetIntegrationsQueryHeaderParams>, 'url'> {
19
+ export interface GetIntegrationsProps extends GetIntegrationsQueryPathParams, Omit<FetcherOptions<GetIntegrationsQueryQueryParams, unknown, GetIntegrationsQueryHeaderParams>, 'url'> {
17
20
  queryParams: GetIntegrationsQueryQueryParams;
18
21
  }
19
22
  export declare function getIntegrations(props: GetIntegrationsProps): Promise<GetIntegrationsOkResponse>;
@@ -4,11 +4,11 @@
4
4
  import { useQuery } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../fetcher/index.js';
6
6
  export function getIntegrations(props) {
7
- return fetcher(Object.assign({ url: `/v1/integrations`, method: 'GET' }, props));
7
+ return fetcher(Object.assign({ url: `/v1/integrations/${props.integration}`, method: 'GET' }, props));
8
8
  }
9
9
  /**
10
10
  * Get all integrations available
11
11
  */
12
12
  export function useGetIntegrationsQuery(props, options) {
13
- return useQuery(['get-integrations', props.queryParams], ({ signal }) => getIntegrations(Object.assign(Object.assign({}, props), { signal })), options);
13
+ return useQuery(['get-integrations', props.integration, props.queryParams], ({ signal }) => getIntegrations(Object.assign(Object.assign({}, props), { signal })), options);
14
14
  }
@@ -1,19 +1,19 @@
1
1
  import { UseMutationOptions } from '@tanstack/react-query';
2
2
  import type { IntegrationResponseResponse } from '../responses/IntegrationResponseResponse';
3
- import type { IntegrationRequest } from '../schemas/IntegrationRequest';
3
+ import type { IntegrationRequestRequestBody } from '../requestBodies/IntegrationRequestRequestBody';
4
4
  import type { ResponseWithPagination } from '../helpers';
5
5
  import { FetcherOptions } from '../../../../fetcher/index.js';
6
6
  export interface UpdateIntegrationMutationPathParams {
7
+ integration: 'git';
7
8
  'integration-id': string;
8
9
  }
9
10
  export interface UpdateIntegrationMutationQueryParams {
10
11
  dry_run?: boolean;
11
- write_validation?: boolean;
12
12
  }
13
13
  export interface UpdateIntegrationMutationHeaderParams {
14
14
  'Harness-Account'?: string;
15
15
  }
16
- export type UpdateIntegrationRequestBody = IntegrationRequest;
16
+ export type UpdateIntegrationRequestBody = IntegrationRequestRequestBody;
17
17
  export type UpdateIntegrationOkResponse = ResponseWithPagination<IntegrationResponseResponse>;
18
18
  export type UpdateIntegrationErrorResponse = unknown;
19
19
  export interface UpdateIntegrationProps extends UpdateIntegrationMutationPathParams, Omit<FetcherOptions<UpdateIntegrationMutationQueryParams, UpdateIntegrationRequestBody, UpdateIntegrationMutationHeaderParams>, 'url'> {
@@ -4,7 +4,7 @@
4
4
  import { useMutation } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../fetcher/index.js';
6
6
  export function updateIntegration(props) {
7
- return fetcher(Object.assign({ url: `/v1/integrations/${props['integration-id']}`, method: 'PUT' }, props));
7
+ return fetcher(Object.assign({ url: `/v1/integrations/${props.integration}/${props['integration-id']}`, method: 'PUT' }, props));
8
8
  }
9
9
  /**
10
10
  * Update integration details for given integrationId
@@ -5,7 +5,7 @@ export type { CreateBackstagePermissionsErrorResponse, CreateBackstagePermission
5
5
  export { createBackstagePermissions, useCreateBackstagePermissionsMutation, } from './hooks/useCreateBackstagePermissionsMutation';
6
6
  export type { CreateCheckErrorResponse, CreateCheckOkResponse, CreateCheckProps, CreateCheckRequestBody, } from './hooks/useCreateCheckMutation';
7
7
  export { createCheck, useCreateCheckMutation } from './hooks/useCreateCheckMutation';
8
- export type { CreateIntegrationErrorResponse, CreateIntegrationMutationQueryParams, CreateIntegrationOkResponse, CreateIntegrationProps, CreateIntegrationRequestBody, } from './hooks/useCreateIntegrationMutation';
8
+ export type { CreateIntegrationErrorResponse, CreateIntegrationMutationPathParams, CreateIntegrationMutationQueryParams, CreateIntegrationOkResponse, CreateIntegrationProps, CreateIntegrationRequestBody, } from './hooks/useCreateIntegrationMutation';
9
9
  export { createIntegration, useCreateIntegrationMutation, } from './hooks/useCreateIntegrationMutation';
10
10
  export type { CreateLayoutErrorResponse, CreateLayoutOkResponse, CreateLayoutProps, CreateLayoutRequestBody, } from './hooks/useCreateLayoutMutation';
11
11
  export { createLayout, useCreateLayoutMutation } from './hooks/useCreateLayoutMutation';
@@ -49,7 +49,7 @@ export type { GetHarnessEntitiesErrorResponse, GetHarnessEntitiesOkResponse, Get
49
49
  export { getHarnessEntities, useGetHarnessEntitiesQuery } from './hooks/useGetHarnessEntitiesQuery';
50
50
  export type { GetIntegrationErrorResponse, GetIntegrationOkResponse, GetIntegrationProps, GetIntegrationQueryPathParams, } from './hooks/useGetIntegrationQuery';
51
51
  export { getIntegration, useGetIntegrationQuery } from './hooks/useGetIntegrationQuery';
52
- export type { GetIntegrationsErrorResponse, GetIntegrationsOkResponse, GetIntegrationsProps, GetIntegrationsQueryQueryParams, } from './hooks/useGetIntegrationsQuery';
52
+ export type { GetIntegrationsErrorResponse, GetIntegrationsOkResponse, GetIntegrationsProps, GetIntegrationsQueryPathParams, GetIntegrationsQueryQueryParams, } from './hooks/useGetIntegrationsQuery';
53
53
  export { getIntegrations, useGetIntegrationsQuery } from './hooks/useGetIntegrationsQuery';
54
54
  export type { GetLayoutErrorResponse, GetLayoutOkResponse, GetLayoutProps, GetLayoutQueryPathParams, } from './hooks/useGetLayoutQuery';
55
55
  export { getLayout, useGetLayoutQuery } from './hooks/useGetLayoutQuery';
@@ -112,6 +112,7 @@ export type { CustomPluginCreateRequestRequestBody } from './requestBodies/Custo
112
112
  export type { CustomPluginInfoRequestRequestBody } from './requestBodies/CustomPluginInfoRequestRequestBody';
113
113
  export type { GenerateYamlRequestRequestBody } from './requestBodies/GenerateYamlRequestRequestBody';
114
114
  export type { ImportHarnessEntitiesRequestRequestBody } from './requestBodies/ImportHarnessEntitiesRequestRequestBody';
115
+ export type { IntegrationRequestRequestBody } from './requestBodies/IntegrationRequestRequestBody';
115
116
  export type { RequestPluginRequestRequestBody } from './requestBodies/RequestPluginRequestRequestBody';
116
117
  export type { ScorecardRecalibrateRequestRequestBody } from './requestBodies/ScorecardRecalibrateRequestRequestBody';
117
118
  export type { AllowListResponseResponse } from './responses/AllowListResponseResponse';
@@ -162,6 +163,7 @@ export type { BackstageEnvVariableResponse } from './schemas/BackstageEnvVariabl
162
163
  export type { BackstagePermissions } from './schemas/BackstagePermissions';
163
164
  export type { BackstagePermissionsRequest } from './schemas/BackstagePermissionsRequest';
164
165
  export type { BackstagePermissionsResponse } from './schemas/BackstagePermissionsResponse';
166
+ export type { BaseIntegrationRequest } from './schemas/BaseIntegrationRequest';
165
167
  export type { CatalogConnectorInfo } from './schemas/CatalogConnectorInfo';
166
168
  export type { Check } from './schemas/Check';
167
169
  export type { CheckDetails } from './schemas/CheckDetails';
@@ -201,7 +203,6 @@ export type { ImportEntitiesBase } from './schemas/ImportEntitiesBase';
201
203
  export type { ImportEntitiesResponse } from './schemas/ImportEntitiesResponse';
202
204
  export type { InputDetails } from './schemas/InputDetails';
203
205
  export type { InputValue } from './schemas/InputValue';
204
- export type { IntegrationRequest } from './schemas/IntegrationRequest';
205
206
  export type { IntegrationResponse } from './schemas/IntegrationResponse';
206
207
  export type { LayoutIngestRequest } from './schemas/LayoutIngestRequest';
207
208
  export type { LayoutRequest } from './schemas/LayoutRequest';
@@ -214,7 +215,6 @@ export type { PluginDetails } from './schemas/PluginDetails';
214
215
  export type { PluginInfo } from './schemas/PluginInfo';
215
216
  export type { PluginInfoResponse } from './schemas/PluginInfoResponse';
216
217
  export type { ProxyHostDetail } from './schemas/ProxyHostDetail';
217
- export type { ReadValidationDetails } from './schemas/ReadValidationDetails';
218
218
  export type { RequestPlugin } from './schemas/RequestPlugin';
219
219
  export type { Rule } from './schemas/Rule';
220
220
  export type { Scorecard } from './schemas/Scorecard';
@@ -236,4 +236,3 @@ export type { StatusInfo } from './schemas/StatusInfo';
236
236
  export type { StatusInfoResponse } from './schemas/StatusInfoResponse';
237
237
  export type { StatusInfoV2 } from './schemas/StatusInfoV2';
238
238
  export type { User } from './schemas/User';
239
- export type { WriteValidationDetails } from './schemas/WriteValidationDetails';
@@ -0,0 +1,2 @@
1
+ import type { BaseIntegrationRequest } from '../schemas/BaseIntegrationRequest';
2
+ export type IntegrationRequestRequestBody = BaseIntegrationRequest;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Abstract base for integration request
3
+ */
4
+ export interface BaseIntegrationRequest {
5
+ type: 'git';
6
+ }
@@ -1,9 +1,3 @@
1
1
  export interface IntegrationResponse {
2
- auth_type?: string;
3
- connector_identifier?: string;
4
- host?: string;
5
- identifier?: string;
6
- name?: string;
7
- type?: string;
8
- via_delegate?: boolean;
2
+ integration_type: 'git';
9
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-idp-service-client",
3
- "version": "0.49.0",
3
+ "version": "0.49.1",
4
4
  "description": "Harness React idp service client - IDP APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",
@@ -1,7 +0,0 @@
1
- import type { ReadValidationDetails } from '../schemas/ReadValidationDetails';
2
- import type { WriteValidationDetails } from '../schemas/WriteValidationDetails';
3
- export interface IntegrationRequest {
4
- connector_identifier: string;
5
- read_validation_details?: ReadValidationDetails;
6
- write_validation_details?: WriteValidationDetails;
7
- }
@@ -1,3 +0,0 @@
1
- export interface ReadValidationDetails {
2
- file_url?: string;
3
- }
@@ -1,5 +0,0 @@
1
- export interface WriteValidationDetails {
2
- branch?: string;
3
- path?: string;
4
- repository?: string;
5
- }
@@ -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 {};