@harnessio/react-idp-service-client 0.7.0 → 0.9.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.
package/dist/fetcher.js CHANGED
@@ -39,10 +39,25 @@ export function fetcher(options) {
39
39
  response = (_b = fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.responseInterceptor) === null || _b === void 0 ? void 0 : _b.call(fetcherCallbacks, response.clone());
40
40
  }
41
41
  const contentType = response.headers.get('Content-Type');
42
+ let total, pageSize, pageNumber, pagination;
43
+ try {
44
+ total = response.headers.get('x-total-elements');
45
+ pageSize = response.headers.get('x-page-size');
46
+ pageNumber = response.headers.get('x-page-number');
47
+ pagination = total || pageSize || pageNumber;
48
+ if (pagination) {
49
+ total = Number(total);
50
+ pageSize = Number(pageSize);
51
+ pageNumber = Number(pageNumber);
52
+ }
53
+ }
54
+ catch (e) {
55
+ throw new Error('HarnessReactAPIClient: An error occurred while parsing pagination headers. ' + e);
56
+ }
42
57
  const asJson = contentType && JSON_CONTENT_TYPES.some((h) => contentType.startsWith(h));
43
58
  const data = yield (asJson ? response.json() : response.text());
44
59
  if (response.ok) {
45
- return data;
60
+ return (Object.assign({ content: data }, (pagination ? { pagination: { total, pageSize, pageNumber } } : {})));
46
61
  }
47
62
  throw data;
48
63
  });
@@ -0,0 +1,13 @@
1
+ export type GetPathParamsType<T> = T extends {
2
+ pathParams: infer R;
3
+ } ? R : never;
4
+ export interface ResponseWithPagination<T> {
5
+ content: T;
6
+ pagination?: {
7
+ total?: number;
8
+ pageSize?: number;
9
+ pageNumber?: number;
10
+ };
11
+ }
12
+ export type WithOptional<TInput, Tkeys extends keyof TInput> = Omit<TInput, Tkeys> & Partial<Pick<TInput, Tkeys>>;
13
+ export type PickPartial<TInput, Tkeys extends keyof TInput> = Pick<Partial<TInput>, Tkeys>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,19 +1,19 @@
1
1
  import { UseMutationOptions } from '@tanstack/react-query';
2
2
  import type { BackstagePermissionsResponseResponse } from '../responses/BackstagePermissionsResponseResponse';
3
3
  import type { BackstagePermissionsRequestRequestBody } from '../requestBodies/BackstagePermissionsRequestRequestBody';
4
+ import type { ResponseWithPagination } from '../helpers';
4
5
  import { FetcherOptions } from './../../fetcher';
5
6
  export interface CreateBackstagePermissionsMutationHeaderParams {
6
7
  'Harness-Account'?: string;
7
8
  }
8
9
  export type CreateBackstagePermissionsRequestBody = BackstagePermissionsRequestRequestBody;
9
- export type CreateBackstagePermissionsOkResponse = BackstagePermissionsResponseResponse;
10
+ export type CreateBackstagePermissionsOkResponse = ResponseWithPagination<BackstagePermissionsResponseResponse>;
10
11
  export type CreateBackstagePermissionsErrorResponse = unknown;
11
12
  export interface CreateBackstagePermissionsProps extends Omit<FetcherOptions<unknown, CreateBackstagePermissionsRequestBody, CreateBackstagePermissionsMutationHeaderParams>, 'url'> {
12
13
  body: CreateBackstagePermissionsRequestBody;
13
14
  }
14
15
  export declare function createBackstagePermissions(props: CreateBackstagePermissionsProps): Promise<CreateBackstagePermissionsOkResponse>;
15
- export type CreateBackstagePermissionsMutationProps<T extends keyof CreateBackstagePermissionsProps> = Omit<CreateBackstagePermissionsProps, T> & Partial<Pick<CreateBackstagePermissionsProps, T>>;
16
16
  /**
17
17
  * Creates backstage Permissions for a given account
18
18
  */
19
- export declare function useCreateBackstagePermissionsMutation<T extends keyof CreateBackstagePermissionsProps>(props: Pick<Partial<CreateBackstagePermissionsProps>, T>, options?: Omit<UseMutationOptions<CreateBackstagePermissionsOkResponse, CreateBackstagePermissionsErrorResponse, CreateBackstagePermissionsMutationProps<T>>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<import("..").BackstagePermissionsResponse, unknown, CreateBackstagePermissionsMutationProps<T>, unknown>;
19
+ export declare function useCreateBackstagePermissionsMutation(options?: Omit<UseMutationOptions<CreateBackstagePermissionsOkResponse, CreateBackstagePermissionsErrorResponse, CreateBackstagePermissionsProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<CreateBackstagePermissionsOkResponse, unknown, CreateBackstagePermissionsProps, unknown>;
@@ -9,6 +9,6 @@ export function createBackstagePermissions(props) {
9
9
  /**
10
10
  * Creates backstage Permissions for a given account
11
11
  */
12
- export function useCreateBackstagePermissionsMutation(props, options) {
13
- return useMutation((mutateProps) => createBackstagePermissions(Object.assign(Object.assign({}, props), mutateProps)), options);
12
+ export function useCreateBackstagePermissionsMutation(options) {
13
+ return useMutation((mutateProps) => createBackstagePermissions(mutateProps), options);
14
14
  }
@@ -1,19 +1,19 @@
1
1
  import { UseMutationOptions } from '@tanstack/react-query';
2
2
  import type { LayoutResponseResponse } from '../responses/LayoutResponseResponse';
3
3
  import type { LayoutRequest } from '../schemas/LayoutRequest';
4
+ import type { ResponseWithPagination } from '../helpers';
4
5
  import { FetcherOptions } from './../../fetcher';
5
6
  export interface CreateLayoutMutationHeaderParams {
6
7
  'Harness-Account'?: string;
7
8
  }
8
9
  export type CreateLayoutRequestBody = LayoutRequest;
9
- export type CreateLayoutOkResponse = LayoutResponseResponse;
10
+ export type CreateLayoutOkResponse = ResponseWithPagination<LayoutResponseResponse>;
10
11
  export type CreateLayoutErrorResponse = unknown;
11
12
  export interface CreateLayoutProps extends Omit<FetcherOptions<unknown, CreateLayoutRequestBody, CreateLayoutMutationHeaderParams>, 'url'> {
12
13
  body: CreateLayoutRequestBody;
13
14
  }
14
15
  export declare function createLayout(props: CreateLayoutProps): Promise<CreateLayoutOkResponse>;
15
- export type CreateLayoutMutationProps<T extends keyof CreateLayoutProps> = Omit<CreateLayoutProps, T> & Partial<Pick<CreateLayoutProps, T>>;
16
16
  /**
17
17
  * Create layout
18
18
  */
19
- export declare function useCreateLayoutMutation<T extends keyof CreateLayoutProps>(props: Pick<Partial<CreateLayoutProps>, T>, options?: Omit<UseMutationOptions<CreateLayoutOkResponse, CreateLayoutErrorResponse, CreateLayoutMutationProps<T>>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<import("..").LayoutResponse, unknown, CreateLayoutMutationProps<T>, unknown>;
19
+ export declare function useCreateLayoutMutation(options?: Omit<UseMutationOptions<CreateLayoutOkResponse, CreateLayoutErrorResponse, CreateLayoutProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<CreateLayoutOkResponse, unknown, CreateLayoutProps, unknown>;
@@ -9,6 +9,6 @@ export function createLayout(props) {
9
9
  /**
10
10
  * Create layout
11
11
  */
12
- export function useCreateLayoutMutation(props, options) {
13
- return useMutation((mutateProps) => createLayout(Object.assign(Object.assign({}, props), mutateProps)), options);
12
+ export function useCreateLayoutMutation(options) {
13
+ return useMutation((mutateProps) => createLayout(mutateProps), options);
14
14
  }
@@ -1,10 +1,11 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
2
  import type { LayoutResponseResponse } from '../responses/LayoutResponseResponse';
3
+ import type { ResponseWithPagination } from '../helpers';
3
4
  import { FetcherOptions } from './../../fetcher';
4
5
  export interface GetAllLayoutsQueryHeaderParams {
5
6
  'Harness-Account'?: string;
6
7
  }
7
- export type GetAllLayoutsOkResponse = LayoutResponseResponse;
8
+ export type GetAllLayoutsOkResponse = ResponseWithPagination<LayoutResponseResponse>;
8
9
  export type GetAllLayoutsErrorResponse = unknown;
9
10
  export interface GetAllLayoutsProps extends Omit<FetcherOptions<unknown, unknown, GetAllLayoutsQueryHeaderParams>, 'url'> {
10
11
  }
@@ -12,4 +13,4 @@ export declare function getAllLayouts(props: GetAllLayoutsProps): Promise<GetAll
12
13
  /**
13
14
  * Get all layouts
14
15
  */
15
- export declare function useGetAllLayoutsQuery(props: GetAllLayoutsProps, options?: Omit<UseQueryOptions<GetAllLayoutsOkResponse, GetAllLayoutsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<import("..").LayoutResponse, unknown>;
16
+ export declare function useGetAllLayoutsQuery(props: GetAllLayoutsProps, options?: Omit<UseQueryOptions<GetAllLayoutsOkResponse, GetAllLayoutsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetAllLayoutsOkResponse, unknown>;
@@ -1,10 +1,11 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
2
  import type { BackstagePermissionsResponseResponse } from '../responses/BackstagePermissionsResponseResponse';
3
+ import type { ResponseWithPagination } from '../helpers';
3
4
  import { FetcherOptions } from './../../fetcher';
4
5
  export interface GetBackstagePermissionsQueryHeaderParams {
5
6
  'Harness-Account'?: string;
6
7
  }
7
- export type GetBackstagePermissionsOkResponse = BackstagePermissionsResponseResponse;
8
+ export type GetBackstagePermissionsOkResponse = ResponseWithPagination<BackstagePermissionsResponseResponse>;
8
9
  export type GetBackstagePermissionsErrorResponse = unknown;
9
10
  export interface GetBackstagePermissionsProps extends Omit<FetcherOptions<unknown, unknown, GetBackstagePermissionsQueryHeaderParams>, 'url'> {
10
11
  }
@@ -12,4 +13,4 @@ export declare function getBackstagePermissions(props: GetBackstagePermissionsPr
12
13
  /**
13
14
  * Get all backstage permissions for a given account
14
15
  */
15
- export declare function useGetBackstagePermissionsQuery(props: GetBackstagePermissionsProps, options?: Omit<UseQueryOptions<GetBackstagePermissionsOkResponse, GetBackstagePermissionsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<import("..").BackstagePermissionsResponse, unknown>;
16
+ export declare function useGetBackstagePermissionsQuery(props: GetBackstagePermissionsProps, options?: Omit<UseQueryOptions<GetBackstagePermissionsOkResponse, GetBackstagePermissionsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetBackstagePermissionsOkResponse, unknown>;
@@ -1,5 +1,6 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
2
  import type { HarnessEntitiesResponseResponse } from '../responses/HarnessEntitiesResponseResponse';
3
+ import type { ResponseWithPagination } from '../helpers';
3
4
  import { FetcherOptions } from './../../fetcher';
4
5
  export interface GetHarnessEntitiesQueryQueryParams {
5
6
  page?: number;
@@ -11,7 +12,7 @@ export interface GetHarnessEntitiesQueryQueryParams {
11
12
  export interface GetHarnessEntitiesQueryHeaderParams {
12
13
  'Harness-Account'?: string;
13
14
  }
14
- export type GetHarnessEntitiesOkResponse = HarnessEntitiesResponseResponse;
15
+ export type GetHarnessEntitiesOkResponse = ResponseWithPagination<HarnessEntitiesResponseResponse>;
15
16
  export type GetHarnessEntitiesErrorResponse = unknown;
16
17
  export interface GetHarnessEntitiesProps extends Omit<FetcherOptions<GetHarnessEntitiesQueryQueryParams, unknown, GetHarnessEntitiesQueryHeaderParams>, 'url'> {
17
18
  queryParams: GetHarnessEntitiesQueryQueryParams;
@@ -20,4 +21,4 @@ export declare function getHarnessEntities(props: GetHarnessEntitiesProps): Prom
20
21
  /**
21
22
  * Get Harness Entities
22
23
  */
23
- export declare function useGetHarnessEntitiesQuery(props: GetHarnessEntitiesProps, options?: Omit<UseQueryOptions<GetHarnessEntitiesOkResponse, GetHarnessEntitiesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<import("..").HarnessEntitiesResponse, unknown>;
24
+ export declare function useGetHarnessEntitiesQuery(props: GetHarnessEntitiesProps, options?: Omit<UseQueryOptions<GetHarnessEntitiesOkResponse, GetHarnessEntitiesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetHarnessEntitiesOkResponse, unknown>;
@@ -1,5 +1,6 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
2
  import type { LayoutResponseResponse } from '../responses/LayoutResponseResponse';
3
+ import type { ResponseWithPagination } from '../helpers';
3
4
  import { FetcherOptions } from './../../fetcher';
4
5
  export interface GetLayoutQueryPathParams {
5
6
  'layout-identifier': string;
@@ -7,7 +8,7 @@ export interface GetLayoutQueryPathParams {
7
8
  export interface GetLayoutQueryHeaderParams {
8
9
  'Harness-Account'?: string;
9
10
  }
10
- export type GetLayoutOkResponse = LayoutResponseResponse;
11
+ export type GetLayoutOkResponse = ResponseWithPagination<LayoutResponseResponse>;
11
12
  export type GetLayoutErrorResponse = unknown;
12
13
  export interface GetLayoutProps extends GetLayoutQueryPathParams, Omit<FetcherOptions<unknown, unknown, GetLayoutQueryHeaderParams>, 'url'> {
13
14
  }
@@ -15,4 +16,4 @@ export declare function getLayout(props: GetLayoutProps): Promise<GetLayoutOkRes
15
16
  /**
16
17
  * Get Layout
17
18
  */
18
- export declare function useGetLayoutQuery(props: GetLayoutProps, options?: Omit<UseQueryOptions<GetLayoutOkResponse, GetLayoutErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<import("..").LayoutResponse, unknown>;
19
+ export declare function useGetLayoutQuery(props: GetLayoutProps, options?: Omit<UseQueryOptions<GetLayoutOkResponse, GetLayoutErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetLayoutOkResponse, unknown>;
@@ -1,5 +1,6 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
2
  import type { StatusInfoResponseResponse } from '../responses/StatusInfoResponseResponse';
3
+ import type { ResponseWithPagination } from '../helpers';
3
4
  import { FetcherOptions } from './../../fetcher';
4
5
  export interface GetStatusInfoByTypeQueryPathParams {
5
6
  type: 'infra' | 'onboarding';
@@ -7,7 +8,7 @@ export interface GetStatusInfoByTypeQueryPathParams {
7
8
  export interface GetStatusInfoByTypeQueryHeaderParams {
8
9
  'Harness-Account'?: string;
9
10
  }
10
- export type GetStatusInfoByTypeOkResponse = StatusInfoResponseResponse;
11
+ export type GetStatusInfoByTypeOkResponse = ResponseWithPagination<StatusInfoResponseResponse>;
11
12
  export type GetStatusInfoByTypeErrorResponse = unknown;
12
13
  export interface GetStatusInfoByTypeProps extends GetStatusInfoByTypeQueryPathParams, Omit<FetcherOptions<unknown, unknown, GetStatusInfoByTypeQueryHeaderParams>, 'url'> {
13
14
  }
@@ -15,4 +16,4 @@ export declare function getStatusInfoByType(props: GetStatusInfoByTypeProps): Pr
15
16
  /**
16
17
  * Get status info for the given type
17
18
  */
18
- export declare function useGetStatusInfoByTypeQuery(props: GetStatusInfoByTypeProps, options?: Omit<UseQueryOptions<GetStatusInfoByTypeOkResponse, GetStatusInfoByTypeErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<import("..").StatusInfoResponse, unknown>;
19
+ export declare function useGetStatusInfoByTypeQuery(props: GetStatusInfoByTypeProps, options?: Omit<UseQueryOptions<GetStatusInfoByTypeOkResponse, GetStatusInfoByTypeErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetStatusInfoByTypeOkResponse, unknown>;
@@ -1,19 +1,19 @@
1
1
  import { UseMutationOptions } from '@tanstack/react-query';
2
2
  import type { ImportEntitiesResponseResponse } from '../responses/ImportEntitiesResponseResponse';
3
3
  import type { ImportHarnessEntitiesRequestRequestBody } from '../requestBodies/ImportHarnessEntitiesRequestRequestBody';
4
+ import type { ResponseWithPagination } from '../helpers';
4
5
  import { FetcherOptions } from './../../fetcher';
5
6
  export interface ImportHarnessEntitiesMutationHeaderParams {
6
7
  'Harness-Account'?: string;
7
8
  }
8
9
  export type ImportHarnessEntitiesRequestBody = ImportHarnessEntitiesRequestRequestBody;
9
- export type ImportHarnessEntitiesOkResponse = ImportEntitiesResponseResponse;
10
+ export type ImportHarnessEntitiesOkResponse = ResponseWithPagination<ImportEntitiesResponseResponse>;
10
11
  export type ImportHarnessEntitiesErrorResponse = unknown;
11
12
  export interface ImportHarnessEntitiesProps extends Omit<FetcherOptions<unknown, ImportHarnessEntitiesRequestBody, ImportHarnessEntitiesMutationHeaderParams>, 'url'> {
12
13
  body: ImportHarnessEntitiesRequestBody;
13
14
  }
14
15
  export declare function importHarnessEntities(props: ImportHarnessEntitiesProps): Promise<ImportHarnessEntitiesOkResponse>;
15
- export type ImportHarnessEntitiesMutationProps<T extends keyof ImportHarnessEntitiesProps> = Omit<ImportHarnessEntitiesProps, T> & Partial<Pick<ImportHarnessEntitiesProps, T>>;
16
16
  /**
17
17
  * Import Harness Entities to IDP
18
18
  */
19
- export declare function useImportHarnessEntitiesMutation<T extends keyof ImportHarnessEntitiesProps>(props: Pick<Partial<ImportHarnessEntitiesProps>, T>, options?: Omit<UseMutationOptions<ImportHarnessEntitiesOkResponse, ImportHarnessEntitiesErrorResponse, ImportHarnessEntitiesMutationProps<T>>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<import("..").ImportEntitiesResponse, unknown, ImportHarnessEntitiesMutationProps<T>, unknown>;
19
+ export declare function useImportHarnessEntitiesMutation(options?: Omit<UseMutationOptions<ImportHarnessEntitiesOkResponse, ImportHarnessEntitiesErrorResponse, ImportHarnessEntitiesProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ImportHarnessEntitiesOkResponse, unknown, ImportHarnessEntitiesProps, unknown>;
@@ -9,6 +9,6 @@ export function importHarnessEntities(props) {
9
9
  /**
10
10
  * Import Harness Entities to IDP
11
11
  */
12
- export function useImportHarnessEntitiesMutation(props, options) {
13
- return useMutation((mutateProps) => importHarnessEntities(Object.assign(Object.assign({}, props), mutateProps)), options);
12
+ export function useImportHarnessEntitiesMutation(options) {
13
+ return useMutation((mutateProps) => importHarnessEntities(mutateProps), options);
14
14
  }
@@ -1,19 +1,19 @@
1
1
  import { UseMutationOptions } from '@tanstack/react-query';
2
2
  import type { BackstagePermissionsResponseResponse } from '../responses/BackstagePermissionsResponseResponse';
3
3
  import type { BackstagePermissionsRequestRequestBody } from '../requestBodies/BackstagePermissionsRequestRequestBody';
4
+ import type { ResponseWithPagination } from '../helpers';
4
5
  import { FetcherOptions } from './../../fetcher';
5
6
  export interface UpdateBackstagePermissionsMutationHeaderParams {
6
7
  'Harness-Account'?: string;
7
8
  }
8
9
  export type UpdateBackstagePermissionsRequestBody = BackstagePermissionsRequestRequestBody;
9
- export type UpdateBackstagePermissionsOkResponse = BackstagePermissionsResponseResponse;
10
+ export type UpdateBackstagePermissionsOkResponse = ResponseWithPagination<BackstagePermissionsResponseResponse>;
10
11
  export type UpdateBackstagePermissionsErrorResponse = unknown;
11
12
  export interface UpdateBackstagePermissionsProps extends Omit<FetcherOptions<unknown, UpdateBackstagePermissionsRequestBody, UpdateBackstagePermissionsMutationHeaderParams>, 'url'> {
12
13
  body: UpdateBackstagePermissionsRequestBody;
13
14
  }
14
15
  export declare function updateBackstagePermissions(props: UpdateBackstagePermissionsProps): Promise<UpdateBackstagePermissionsOkResponse>;
15
- export type UpdateBackstagePermissionsMutationProps<T extends keyof UpdateBackstagePermissionsProps> = Omit<UpdateBackstagePermissionsProps, T> & Partial<Pick<UpdateBackstagePermissionsProps, T>>;
16
16
  /**
17
17
  * Update Backstage Permission
18
18
  */
19
- export declare function useUpdateBackstagePermissionsMutation<T extends keyof UpdateBackstagePermissionsProps>(props: Pick<Partial<UpdateBackstagePermissionsProps>, T>, options?: Omit<UseMutationOptions<UpdateBackstagePermissionsOkResponse, UpdateBackstagePermissionsErrorResponse, UpdateBackstagePermissionsMutationProps<T>>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<import("..").BackstagePermissionsResponse, unknown, UpdateBackstagePermissionsMutationProps<T>, unknown>;
19
+ export declare function useUpdateBackstagePermissionsMutation(options?: Omit<UseMutationOptions<UpdateBackstagePermissionsOkResponse, UpdateBackstagePermissionsErrorResponse, UpdateBackstagePermissionsProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<UpdateBackstagePermissionsOkResponse, unknown, UpdateBackstagePermissionsProps, unknown>;
@@ -9,6 +9,6 @@ export function updateBackstagePermissions(props) {
9
9
  /**
10
10
  * Update Backstage Permission
11
11
  */
12
- export function useUpdateBackstagePermissionsMutation(props, options) {
13
- return useMutation((mutateProps) => updateBackstagePermissions(Object.assign(Object.assign({}, props), mutateProps)), options);
12
+ export function useUpdateBackstagePermissionsMutation(options) {
13
+ return useMutation((mutateProps) => updateBackstagePermissions(mutateProps), options);
14
14
  }
@@ -1,6 +1,7 @@
1
- export type { CreateBackstagePermissionsErrorResponse, CreateBackstagePermissionsMutationProps, CreateBackstagePermissionsOkResponse, CreateBackstagePermissionsProps, CreateBackstagePermissionsRequestBody, } from './hooks/useCreateBackstagePermissionsMutation';
1
+ export type { GetPathParamsType, ResponseWithPagination } from './helpers';
2
+ export type { CreateBackstagePermissionsErrorResponse, CreateBackstagePermissionsOkResponse, CreateBackstagePermissionsProps, CreateBackstagePermissionsRequestBody, } from './hooks/useCreateBackstagePermissionsMutation';
2
3
  export { createBackstagePermissions, useCreateBackstagePermissionsMutation, } from './hooks/useCreateBackstagePermissionsMutation';
3
- export type { CreateLayoutErrorResponse, CreateLayoutMutationProps, CreateLayoutOkResponse, CreateLayoutProps, CreateLayoutRequestBody, } from './hooks/useCreateLayoutMutation';
4
+ export type { CreateLayoutErrorResponse, CreateLayoutOkResponse, CreateLayoutProps, CreateLayoutRequestBody, } from './hooks/useCreateLayoutMutation';
4
5
  export { createLayout, useCreateLayoutMutation } from './hooks/useCreateLayoutMutation';
5
6
  export type { GetAllLayoutsErrorResponse, GetAllLayoutsOkResponse, GetAllLayoutsProps, } from './hooks/useGetAllLayoutsQuery';
6
7
  export { getAllLayouts, useGetAllLayoutsQuery } from './hooks/useGetAllLayoutsQuery';
@@ -12,11 +13,9 @@ export type { GetLayoutErrorResponse, GetLayoutOkResponse, GetLayoutProps, GetLa
12
13
  export { getLayout, useGetLayoutQuery } from './hooks/useGetLayoutQuery';
13
14
  export type { GetStatusInfoByTypeErrorResponse, GetStatusInfoByTypeOkResponse, GetStatusInfoByTypeProps, GetStatusInfoByTypeQueryPathParams, } from './hooks/useGetStatusInfoByTypeQuery';
14
15
  export { getStatusInfoByType, useGetStatusInfoByTypeQuery, } from './hooks/useGetStatusInfoByTypeQuery';
15
- export type { ImportHarnessEntitiesErrorResponse, ImportHarnessEntitiesMutationProps, ImportHarnessEntitiesOkResponse, ImportHarnessEntitiesProps, ImportHarnessEntitiesRequestBody, } from './hooks/useImportHarnessEntitiesMutation';
16
+ export type { ImportHarnessEntitiesErrorResponse, ImportHarnessEntitiesOkResponse, ImportHarnessEntitiesProps, ImportHarnessEntitiesRequestBody, } from './hooks/useImportHarnessEntitiesMutation';
16
17
  export { importHarnessEntities, useImportHarnessEntitiesMutation, } from './hooks/useImportHarnessEntitiesMutation';
17
- export type { OnboardingAccessCheckErrorResponse, OnboardingAccessCheckOkResponse, OnboardingAccessCheckProps, } from './hooks/useOnboardingAccessCheckQuery';
18
- export { onboardingAccessCheck, useOnboardingAccessCheckQuery, } from './hooks/useOnboardingAccessCheckQuery';
19
- export type { UpdateBackstagePermissionsErrorResponse, UpdateBackstagePermissionsMutationProps, UpdateBackstagePermissionsOkResponse, UpdateBackstagePermissionsProps, UpdateBackstagePermissionsRequestBody, } from './hooks/useUpdateBackstagePermissionsMutation';
18
+ export type { UpdateBackstagePermissionsErrorResponse, UpdateBackstagePermissionsOkResponse, UpdateBackstagePermissionsProps, UpdateBackstagePermissionsRequestBody, } from './hooks/useUpdateBackstagePermissionsMutation';
20
19
  export { updateBackstagePermissions, useUpdateBackstagePermissionsMutation, } from './hooks/useUpdateBackstagePermissionsMutation';
21
20
  export type { BackstagePermissionsRequestRequestBody } from './requestBodies/BackstagePermissionsRequestRequestBody';
22
21
  export type { EnvironmentSecretRequestListRequestBody } from './requestBodies/EnvironmentSecretRequestListRequestBody';
@@ -6,5 +6,4 @@ export { getHarnessEntities, useGetHarnessEntitiesQuery } from './hooks/useGetHa
6
6
  export { getLayout, useGetLayoutQuery } from './hooks/useGetLayoutQuery';
7
7
  export { getStatusInfoByType, useGetStatusInfoByTypeQuery, } from './hooks/useGetStatusInfoByTypeQuery';
8
8
  export { importHarnessEntities, useImportHarnessEntitiesMutation, } from './hooks/useImportHarnessEntitiesMutation';
9
- export { onboardingAccessCheck, useOnboardingAccessCheckQuery, } from './hooks/useOnboardingAccessCheckQuery';
10
9
  export { updateBackstagePermissions, useUpdateBackstagePermissionsMutation, } from './hooks/useUpdateBackstagePermissionsMutation';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-idp-service-client",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Harness React idp service client - IDP APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",
@@ -35,6 +35,7 @@
35
35
  "devDependencies": {
36
36
  "@harnessio/oats-cli": "^2.1.1",
37
37
  "@harnessio/oats-plugin-react-query": "^2.1.2",
38
+ "@harnessio/oats-plugin-react-query-harness": "^0.4.0",
38
39
  "@types/node": "^18.11.9",
39
40
  "@types/react": "^18.0.24",
40
41
  "eslint": "^8.15.0",
@@ -1,15 +0,0 @@
1
- import { UseQueryOptions } from '@tanstack/react-query';
2
- import type { OnboardingAccessCheckResponseResponse } from '../responses/OnboardingAccessCheckResponseResponse';
3
- import { FetcherOptions } from './../../fetcher';
4
- export interface OnboardingAccessCheckQueryHeaderParams {
5
- 'Harness-Account'?: string;
6
- }
7
- export type OnboardingAccessCheckOkResponse = OnboardingAccessCheckResponseResponse;
8
- export type OnboardingAccessCheckErrorResponse = unknown;
9
- export interface OnboardingAccessCheckProps extends Omit<FetcherOptions<unknown, unknown, OnboardingAccessCheckQueryHeaderParams>, 'url'> {
10
- }
11
- export declare function onboardingAccessCheck(props: OnboardingAccessCheckProps): Promise<OnboardingAccessCheckOkResponse>;
12
- /**
13
- * Check if User is allowed to perform IDP onboarding workflow
14
- */
15
- export declare function useOnboardingAccessCheckQuery(props: OnboardingAccessCheckProps, options?: Omit<UseQueryOptions<OnboardingAccessCheckOkResponse, OnboardingAccessCheckErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<import("..").OnboardingAccessCheckResponse, unknown>;
@@ -1,14 +0,0 @@
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';
6
- export function onboardingAccessCheck(props) {
7
- return fetcher(Object.assign({ url: `/v1/onboarding/access-check`, method: 'GET' }, props));
8
- }
9
- /**
10
- * Check if User is allowed to perform IDP onboarding workflow
11
- */
12
- export function useOnboardingAccessCheckQuery(props, options) {
13
- return useQuery(['onboarding-access-check'], ({ signal }) => onboardingAccessCheck(Object.assign(Object.assign({}, props), { signal })), options);
14
- }