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

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 (22) 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 +7 -3
  10. package/dist/idp-service/src/services/requestBodies/IntegrationRequestRequestBody.d.ts +2 -0
  11. package/dist/idp-service/src/services/schemas/BaseIntegrationRequest.d.ts +8 -0
  12. package/dist/idp-service/src/services/schemas/BaseIntegrationRequest.js +1 -0
  13. package/dist/idp-service/src/services/schemas/{IntegrationRequest.d.ts → GitIntegrationRequest.d.ts} +2 -1
  14. package/dist/idp-service/src/services/schemas/GitIntegrationRequest.js +1 -0
  15. package/dist/idp-service/src/services/schemas/GitIntegrationResponse.d.ts +13 -0
  16. package/dist/idp-service/src/services/schemas/GitIntegrationResponse.js +1 -0
  17. package/dist/idp-service/src/services/schemas/IntegrationResponse.d.ts +3 -7
  18. package/dist/idp-service/src/services/schemas/IntegrationResponse.js +0 -3
  19. package/dist/idp-service/src/services/schemas/ValidationResponse.d.ts +8 -0
  20. package/dist/idp-service/src/services/schemas/ValidationResponse.js +4 -0
  21. package/package.json +1 -1
  22. /package/dist/idp-service/src/services/{schemas/IntegrationRequest.js → requestBodies/IntegrationRequestRequestBody.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';
@@ -193,6 +195,8 @@ export type { Exports } from './schemas/Exports';
193
195
  export type { Facets } from './schemas/Facets';
194
196
  export type { GenerateYamlRequest } from './schemas/GenerateYamlRequest';
195
197
  export type { GenerateYamlResponse } from './schemas/GenerateYamlResponse';
198
+ export type { GitIntegrationRequest } from './schemas/GitIntegrationRequest';
199
+ export type { GitIntegrationResponse } from './schemas/GitIntegrationResponse';
196
200
  export type { HarnessBackstageEntities } from './schemas/HarnessBackstageEntities';
197
201
  export type { HarnessEntitiesCountResponse } from './schemas/HarnessEntitiesCountResponse';
198
202
  export type { HarnessEntitiesResponse } from './schemas/HarnessEntitiesResponse';
@@ -201,7 +205,6 @@ export type { ImportEntitiesBase } from './schemas/ImportEntitiesBase';
201
205
  export type { ImportEntitiesResponse } from './schemas/ImportEntitiesResponse';
202
206
  export type { InputDetails } from './schemas/InputDetails';
203
207
  export type { InputValue } from './schemas/InputValue';
204
- export type { IntegrationRequest } from './schemas/IntegrationRequest';
205
208
  export type { IntegrationResponse } from './schemas/IntegrationResponse';
206
209
  export type { LayoutIngestRequest } from './schemas/LayoutIngestRequest';
207
210
  export type { LayoutRequest } from './schemas/LayoutRequest';
@@ -236,4 +239,5 @@ export type { StatusInfo } from './schemas/StatusInfo';
236
239
  export type { StatusInfoResponse } from './schemas/StatusInfoResponse';
237
240
  export type { StatusInfoV2 } from './schemas/StatusInfoV2';
238
241
  export type { User } from './schemas/User';
242
+ export type { ValidationResponse } from './schemas/ValidationResponse';
239
243
  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,8 @@
1
+ import type { GitIntegrationRequest } from '../schemas/GitIntegrationRequest';
2
+ /**
3
+ * Abstract base for integration request
4
+ */
5
+ export interface BaseIntegrationRequest {
6
+ oneOf?: GitIntegrationRequest;
7
+ type: 'git';
8
+ }
@@ -1,6 +1,7 @@
1
1
  import type { ReadValidationDetails } from '../schemas/ReadValidationDetails';
2
2
  import type { WriteValidationDetails } from '../schemas/WriteValidationDetails';
3
- export interface IntegrationRequest {
3
+ import type { BaseIntegrationRequest } from '../schemas/BaseIntegrationRequest';
4
+ export interface GitIntegrationRequest extends BaseIntegrationRequest {
4
5
  connector_identifier: string;
5
6
  read_validation_details?: ReadValidationDetails;
6
7
  write_validation_details?: WriteValidationDetails;
@@ -0,0 +1,13 @@
1
+ import type { ValidationResponse } from '../schemas/ValidationResponse';
2
+ import type { IntegrationResponse } from '../schemas/IntegrationResponse';
3
+ export interface GitIntegrationResponse extends IntegrationResponse {
4
+ auth_type?: string;
5
+ connector_identifier?: string;
6
+ connector_type?: string;
7
+ display_type?: string;
8
+ host?: string;
9
+ identifier?: string;
10
+ name?: string;
11
+ validation?: ValidationResponse;
12
+ via_delegate?: boolean;
13
+ }
@@ -1,9 +1,5 @@
1
+ import type { GitIntegrationResponse } from '../schemas/GitIntegrationResponse';
1
2
  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;
3
+ integration_type: 'git';
4
+ oneOf?: GitIntegrationResponse;
9
5
  }
@@ -1,4 +1 @@
1
- /* eslint-disable */
2
- // This code is autogenerated using @harnessio/oats-cli.
3
- // Please do not modify this code directly.
4
1
  export {};
@@ -0,0 +1,8 @@
1
+ export interface ValidationResponse {
2
+ error?: string;
3
+ status?: string;
4
+ /**
5
+ * @format int64
6
+ */
7
+ validated?: number;
8
+ }
@@ -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-idp-service-client",
3
- "version": "0.49.0",
3
+ "version": "0.49.2",
4
4
  "description": "Harness React idp service client - IDP APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",