@harnessio/react-idp-service-client 0.5.0 → 0.7.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.
@@ -1,16 +1,19 @@
1
1
  import { UseMutationOptions } from '@tanstack/react-query';
2
- import type { GeneralResponseResponse } from '../responses/GeneralResponseResponse';
2
+ import type { LayoutResponseResponse } from '../responses/LayoutResponseResponse';
3
+ import type { LayoutRequest } from '../schemas/LayoutRequest';
3
4
  import { FetcherOptions } from './../../fetcher';
4
5
  export interface CreateLayoutMutationHeaderParams {
5
6
  'Harness-Account'?: string;
6
7
  }
7
- export type CreateLayoutOkResponse = GeneralResponseResponse;
8
+ export type CreateLayoutRequestBody = LayoutRequest;
9
+ export type CreateLayoutOkResponse = LayoutResponseResponse;
8
10
  export type CreateLayoutErrorResponse = unknown;
9
- export interface CreateLayoutProps extends Omit<FetcherOptions<unknown, unknown, CreateLayoutMutationHeaderParams>, 'url'> {
11
+ export interface CreateLayoutProps extends Omit<FetcherOptions<unknown, CreateLayoutRequestBody, CreateLayoutMutationHeaderParams>, 'url'> {
12
+ body: CreateLayoutRequestBody;
10
13
  }
11
14
  export declare function createLayout(props: CreateLayoutProps): Promise<CreateLayoutOkResponse>;
12
15
  export type CreateLayoutMutationProps<T extends keyof CreateLayoutProps> = Omit<CreateLayoutProps, T> & Partial<Pick<CreateLayoutProps, T>>;
13
16
  /**
14
17
  * Create layout
15
18
  */
16
- 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("..").GeneralResponse, unknown, CreateLayoutMutationProps<T>, unknown>;
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>;
@@ -1,10 +1,10 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
- import type { GeneralResponseResponse } from '../responses/GeneralResponseResponse';
2
+ import type { LayoutResponseResponse } from '../responses/LayoutResponseResponse';
3
3
  import { FetcherOptions } from './../../fetcher';
4
4
  export interface GetAllLayoutsQueryHeaderParams {
5
5
  'Harness-Account'?: string;
6
6
  }
7
- export type GetAllLayoutsOkResponse = GeneralResponseResponse;
7
+ export type GetAllLayoutsOkResponse = LayoutResponseResponse;
8
8
  export type GetAllLayoutsErrorResponse = unknown;
9
9
  export interface GetAllLayoutsProps extends Omit<FetcherOptions<unknown, unknown, GetAllLayoutsQueryHeaderParams>, 'url'> {
10
10
  }
@@ -12,4 +12,4 @@ export declare function getAllLayouts(props: GetAllLayoutsProps): Promise<GetAll
12
12
  /**
13
13
  * Get all layouts
14
14
  */
15
- export declare function useGetAllLayoutsQuery(props: GetAllLayoutsProps, options?: Omit<UseQueryOptions<GetAllLayoutsOkResponse, GetAllLayoutsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<import("..").GeneralResponse, unknown>;
15
+ export declare function useGetAllLayoutsQuery(props: GetAllLayoutsProps, options?: Omit<UseQueryOptions<GetAllLayoutsOkResponse, GetAllLayoutsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<import("..").LayoutResponse, unknown>;
@@ -0,0 +1,23 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { HarnessEntitiesResponseResponse } from '../responses/HarnessEntitiesResponseResponse';
3
+ import { FetcherOptions } from './../../fetcher';
4
+ export interface GetHarnessEntitiesQueryQueryParams {
5
+ page?: number;
6
+ limit?: number;
7
+ sort?: string;
8
+ order?: string;
9
+ search_term?: string;
10
+ }
11
+ export interface GetHarnessEntitiesQueryHeaderParams {
12
+ 'Harness-Account'?: string;
13
+ }
14
+ export type GetHarnessEntitiesOkResponse = HarnessEntitiesResponseResponse;
15
+ export type GetHarnessEntitiesErrorResponse = unknown;
16
+ export interface GetHarnessEntitiesProps extends Omit<FetcherOptions<GetHarnessEntitiesQueryQueryParams, unknown, GetHarnessEntitiesQueryHeaderParams>, 'url'> {
17
+ queryParams: GetHarnessEntitiesQueryQueryParams;
18
+ }
19
+ export declare function getHarnessEntities(props: GetHarnessEntitiesProps): Promise<GetHarnessEntitiesOkResponse>;
20
+ /**
21
+ * Get Harness Entities
22
+ */
23
+ export declare function useGetHarnessEntitiesQuery(props: GetHarnessEntitiesProps, options?: Omit<UseQueryOptions<GetHarnessEntitiesOkResponse, GetHarnessEntitiesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<import("..").HarnessEntitiesResponse, unknown>;
@@ -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';
6
+ export function getHarnessEntities(props) {
7
+ return fetcher(Object.assign({ url: `/v1/onboarding/harness-entities`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Get Harness Entities
11
+ */
12
+ export function useGetHarnessEntitiesQuery(props, options) {
13
+ return useQuery(['get-harness-entities', props.queryParams], ({ signal }) => getHarnessEntities(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -1,5 +1,5 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
- import type { GeneralResponseResponse } from '../responses/GeneralResponseResponse';
2
+ import type { LayoutResponseResponse } from '../responses/LayoutResponseResponse';
3
3
  import { FetcherOptions } from './../../fetcher';
4
4
  export interface GetLayoutQueryPathParams {
5
5
  'layout-identifier': string;
@@ -7,7 +7,7 @@ export interface GetLayoutQueryPathParams {
7
7
  export interface GetLayoutQueryHeaderParams {
8
8
  'Harness-Account'?: string;
9
9
  }
10
- export type GetLayoutOkResponse = GeneralResponseResponse;
10
+ export type GetLayoutOkResponse = LayoutResponseResponse;
11
11
  export type GetLayoutErrorResponse = unknown;
12
12
  export interface GetLayoutProps extends GetLayoutQueryPathParams, Omit<FetcherOptions<unknown, unknown, GetLayoutQueryHeaderParams>, 'url'> {
13
13
  }
@@ -15,4 +15,4 @@ export declare function getLayout(props: GetLayoutProps): Promise<GetLayoutOkRes
15
15
  /**
16
16
  * Get Layout
17
17
  */
18
- export declare function useGetLayoutQuery(props: GetLayoutProps, options?: Omit<UseQueryOptions<GetLayoutOkResponse, GetLayoutErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<import("..").GeneralResponse, unknown>;
18
+ export declare function useGetLayoutQuery(props: GetLayoutProps, options?: Omit<UseQueryOptions<GetLayoutOkResponse, GetLayoutErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<import("..").LayoutResponse, unknown>;
@@ -0,0 +1,19 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { ImportEntitiesResponseResponse } from '../responses/ImportEntitiesResponseResponse';
3
+ import type { ImportHarnessEntitiesRequestRequestBody } from '../requestBodies/ImportHarnessEntitiesRequestRequestBody';
4
+ import { FetcherOptions } from './../../fetcher';
5
+ export interface ImportHarnessEntitiesMutationHeaderParams {
6
+ 'Harness-Account'?: string;
7
+ }
8
+ export type ImportHarnessEntitiesRequestBody = ImportHarnessEntitiesRequestRequestBody;
9
+ export type ImportHarnessEntitiesOkResponse = ImportEntitiesResponseResponse;
10
+ export type ImportHarnessEntitiesErrorResponse = unknown;
11
+ export interface ImportHarnessEntitiesProps extends Omit<FetcherOptions<unknown, ImportHarnessEntitiesRequestBody, ImportHarnessEntitiesMutationHeaderParams>, 'url'> {
12
+ body: ImportHarnessEntitiesRequestBody;
13
+ }
14
+ export declare function importHarnessEntities(props: ImportHarnessEntitiesProps): Promise<ImportHarnessEntitiesOkResponse>;
15
+ export type ImportHarnessEntitiesMutationProps<T extends keyof ImportHarnessEntitiesProps> = Omit<ImportHarnessEntitiesProps, T> & Partial<Pick<ImportHarnessEntitiesProps, T>>;
16
+ /**
17
+ * Import Harness Entities to IDP
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>;
@@ -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 { useMutation } from '@tanstack/react-query';
5
+ import { fetcher } from './../../fetcher';
6
+ export function importHarnessEntities(props) {
7
+ return fetcher(Object.assign({ url: `/v1/onboarding/import-harness-entities`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Import Harness Entities to IDP
11
+ */
12
+ export function useImportHarnessEntitiesMutation(props, options) {
13
+ return useMutation((mutateProps) => importHarnessEntities(Object.assign(Object.assign({}, props), mutateProps)), options);
14
+ }
@@ -0,0 +1,15 @@
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>;
@@ -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';
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
+ }
@@ -1,29 +1,36 @@
1
1
  export type { CreateBackstagePermissionsErrorResponse, CreateBackstagePermissionsMutationProps, CreateBackstagePermissionsOkResponse, CreateBackstagePermissionsProps, CreateBackstagePermissionsRequestBody, } from './hooks/useCreateBackstagePermissionsMutation';
2
2
  export { createBackstagePermissions, useCreateBackstagePermissionsMutation, } from './hooks/useCreateBackstagePermissionsMutation';
3
- export type { CreateLayoutErrorResponse, CreateLayoutMutationProps, CreateLayoutOkResponse, CreateLayoutProps, } from './hooks/useCreateLayoutMutation';
3
+ export type { CreateLayoutErrorResponse, CreateLayoutMutationProps, CreateLayoutOkResponse, CreateLayoutProps, CreateLayoutRequestBody, } from './hooks/useCreateLayoutMutation';
4
4
  export { createLayout, useCreateLayoutMutation } from './hooks/useCreateLayoutMutation';
5
5
  export type { GetAllLayoutsErrorResponse, GetAllLayoutsOkResponse, GetAllLayoutsProps, } from './hooks/useGetAllLayoutsQuery';
6
6
  export { getAllLayouts, useGetAllLayoutsQuery } from './hooks/useGetAllLayoutsQuery';
7
7
  export type { GetBackstagePermissionsErrorResponse, GetBackstagePermissionsOkResponse, GetBackstagePermissionsProps, } from './hooks/useGetBackstagePermissionsQuery';
8
8
  export { getBackstagePermissions, useGetBackstagePermissionsQuery, } from './hooks/useGetBackstagePermissionsQuery';
9
+ export type { GetHarnessEntitiesErrorResponse, GetHarnessEntitiesOkResponse, GetHarnessEntitiesProps, GetHarnessEntitiesQueryQueryParams, } from './hooks/useGetHarnessEntitiesQuery';
10
+ export { getHarnessEntities, useGetHarnessEntitiesQuery } from './hooks/useGetHarnessEntitiesQuery';
9
11
  export type { GetLayoutErrorResponse, GetLayoutOkResponse, GetLayoutProps, GetLayoutQueryPathParams, } from './hooks/useGetLayoutQuery';
10
12
  export { getLayout, useGetLayoutQuery } from './hooks/useGetLayoutQuery';
11
13
  export type { GetStatusInfoByTypeErrorResponse, GetStatusInfoByTypeOkResponse, GetStatusInfoByTypeProps, GetStatusInfoByTypeQueryPathParams, } from './hooks/useGetStatusInfoByTypeQuery';
12
14
  export { getStatusInfoByType, useGetStatusInfoByTypeQuery, } from './hooks/useGetStatusInfoByTypeQuery';
15
+ export type { ImportHarnessEntitiesErrorResponse, ImportHarnessEntitiesMutationProps, ImportHarnessEntitiesOkResponse, ImportHarnessEntitiesProps, ImportHarnessEntitiesRequestBody, } from './hooks/useImportHarnessEntitiesMutation';
16
+ export { importHarnessEntities, useImportHarnessEntitiesMutation, } from './hooks/useImportHarnessEntitiesMutation';
17
+ export type { OnboardingAccessCheckErrorResponse, OnboardingAccessCheckOkResponse, OnboardingAccessCheckProps, } from './hooks/useOnboardingAccessCheckQuery';
18
+ export { onboardingAccessCheck, useOnboardingAccessCheckQuery, } from './hooks/useOnboardingAccessCheckQuery';
13
19
  export type { UpdateBackstagePermissionsErrorResponse, UpdateBackstagePermissionsMutationProps, UpdateBackstagePermissionsOkResponse, UpdateBackstagePermissionsProps, UpdateBackstagePermissionsRequestBody, } from './hooks/useUpdateBackstagePermissionsMutation';
14
20
  export { updateBackstagePermissions, useUpdateBackstagePermissionsMutation, } from './hooks/useUpdateBackstagePermissionsMutation';
15
21
  export type { BackstagePermissionsRequestRequestBody } from './requestBodies/BackstagePermissionsRequestRequestBody';
16
22
  export type { EnvironmentSecretRequestListRequestBody } from './requestBodies/EnvironmentSecretRequestListRequestBody';
17
23
  export type { EnvironmentSecretRequestRequestBody } from './requestBodies/EnvironmentSecretRequestRequestBody';
18
24
  export type { ImportHarnessEntitiesRequestRequestBody } from './requestBodies/ImportHarnessEntitiesRequestRequestBody';
25
+ export type { LayoutRequestRequestBody } from './requestBodies/LayoutRequestRequestBody';
19
26
  export type { ManualImportEntityRequestRequestBody } from './requestBodies/ManualImportEntityRequestRequestBody';
20
27
  export type { StatusInfoRequestRequestBody } from './requestBodies/StatusInfoRequestRequestBody';
21
28
  export type { BackstagePermissionsResponseResponse } from './responses/BackstagePermissionsResponseResponse';
22
29
  export type { EnvironmentSecretResponseListResponse } from './responses/EnvironmentSecretResponseListResponse';
23
30
  export type { EnvironmentSecretResponseResponse } from './responses/EnvironmentSecretResponseResponse';
24
- export type { GeneralResponseResponse } from './responses/GeneralResponseResponse';
25
31
  export type { HarnessEntitiesResponseResponse } from './responses/HarnessEntitiesResponseResponse';
26
32
  export type { ImportEntitiesResponseResponse } from './responses/ImportEntitiesResponseResponse';
33
+ export type { LayoutResponseResponse } from './responses/LayoutResponseResponse';
27
34
  export type { NamespaceResponseResponse } from './responses/NamespaceResponseResponse';
28
35
  export type { OnboardingAccessCheckResponseResponse } from './responses/OnboardingAccessCheckResponseResponse';
29
36
  export type { StatusInfoResponseResponse } from './responses/StatusInfoResponseResponse';
@@ -36,11 +43,12 @@ export type { EntitiesForImport } from './schemas/EntitiesForImport';
36
43
  export type { EnvironmentSecret } from './schemas/EnvironmentSecret';
37
44
  export type { EnvironmentSecretRequest } from './schemas/EnvironmentSecretRequest';
38
45
  export type { EnvironmentSecretResponse } from './schemas/EnvironmentSecretResponse';
39
- export type { GeneralResponse } from './schemas/GeneralResponse';
40
46
  export type { HarnessBackstageEntities } from './schemas/HarnessBackstageEntities';
41
47
  export type { HarnessEntitiesResponse } from './schemas/HarnessEntitiesResponse';
42
48
  export type { ImportEntitiesResponse } from './schemas/ImportEntitiesResponse';
43
49
  export type { ImportHarnessEntitiesRequest } from './schemas/ImportHarnessEntitiesRequest';
50
+ export type { LayoutRequest } from './schemas/LayoutRequest';
51
+ export type { LayoutResponse } from './schemas/LayoutResponse';
44
52
  export type { ManualImportEntityRequest } from './schemas/ManualImportEntityRequest';
45
53
  export type { NamepsaceResponse } from './schemas/NamepsaceResponse';
46
54
  export type { NamespaceInfo } from './schemas/NamespaceInfo';
@@ -2,6 +2,9 @@ export { createBackstagePermissions, useCreateBackstagePermissionsMutation, } fr
2
2
  export { createLayout, useCreateLayoutMutation } from './hooks/useCreateLayoutMutation';
3
3
  export { getAllLayouts, useGetAllLayoutsQuery } from './hooks/useGetAllLayoutsQuery';
4
4
  export { getBackstagePermissions, useGetBackstagePermissionsQuery, } from './hooks/useGetBackstagePermissionsQuery';
5
+ export { getHarnessEntities, useGetHarnessEntitiesQuery } from './hooks/useGetHarnessEntitiesQuery';
5
6
  export { getLayout, useGetLayoutQuery } from './hooks/useGetLayoutQuery';
6
7
  export { getStatusInfoByType, useGetStatusInfoByTypeQuery, } from './hooks/useGetStatusInfoByTypeQuery';
8
+ export { importHarnessEntities, useImportHarnessEntitiesMutation, } from './hooks/useImportHarnessEntitiesMutation';
9
+ export { onboardingAccessCheck, useOnboardingAccessCheckQuery, } from './hooks/useOnboardingAccessCheckQuery';
7
10
  export { updateBackstagePermissions, useUpdateBackstagePermissionsMutation, } from './hooks/useUpdateBackstagePermissionsMutation';
@@ -0,0 +1,2 @@
1
+ import type { LayoutRequest } from '../schemas/LayoutRequest';
2
+ export type LayoutRequestRequestBody = LayoutRequest;
@@ -0,0 +1,2 @@
1
+ import type { LayoutResponse } from '../schemas/LayoutResponse';
2
+ export type LayoutResponseResponse = LayoutResponse;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * LayoutRequest
3
+ */
4
+ export interface LayoutRequest {
5
+ defaultYaml?: string;
6
+ displayName?: string;
7
+ id?: string;
8
+ name?: string;
9
+ type?: string;
10
+ yaml?: string;
11
+ }
@@ -0,0 +1,3 @@
1
+ export interface LayoutResponse {
2
+ [key: string]: any;
3
+ }
@@ -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.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Harness React idp service client - IDP APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- import type { GeneralResponse } from '../schemas/GeneralResponse';
2
- export type GeneralResponseResponse = GeneralResponse;
@@ -1,3 +0,0 @@
1
- export interface GeneralResponse {
2
- [key: string]: any;
3
- }