@harnessio/react-idp-service-client 0.103.0 → 0.103.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.
- package/dist/idp-service/src/services/hooks/useTraverseEntityGraphQuery.d.ts +26 -0
- package/dist/idp-service/src/services/hooks/useTraverseEntityGraphQuery.js +14 -0
- package/dist/idp-service/src/services/index.d.ts +7 -0
- package/dist/idp-service/src/services/index.js +1 -0
- package/dist/idp-service/src/services/responses/GraphTraversalResponseResponse.d.ts +2 -0
- package/dist/idp-service/src/services/responses/GraphTraversalResponseResponse.js +1 -0
- package/dist/idp-service/src/services/schemas/GraphEdge.d.ts +30 -0
- package/dist/idp-service/src/services/schemas/GraphEdge.js +4 -0
- package/dist/idp-service/src/services/schemas/GraphMetadata.d.ts +20 -0
- package/dist/idp-service/src/services/schemas/GraphMetadata.js +4 -0
- package/dist/idp-service/src/services/schemas/GraphNode.d.ts +25 -0
- package/dist/idp-service/src/services/schemas/GraphNode.js +4 -0
- package/dist/idp-service/src/services/schemas/GraphTraversalResponse.d.ts +17 -0
- package/dist/idp-service/src/services/schemas/GraphTraversalResponse.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { GraphTraversalResponseResponse } from '../responses/GraphTraversalResponseResponse';
|
|
3
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
4
|
+
import { FetcherOptions } from '../../../../custom-idp-fetcher/index.js';
|
|
5
|
+
export interface TraverseEntityGraphQueryQueryParams {
|
|
6
|
+
entityRef: string;
|
|
7
|
+
relationshipType?: string[];
|
|
8
|
+
kind?: string[];
|
|
9
|
+
/**
|
|
10
|
+
* @default 1
|
|
11
|
+
*/
|
|
12
|
+
depth?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface TraverseEntityGraphQueryHeaderParams {
|
|
15
|
+
'Harness-Account'?: string;
|
|
16
|
+
}
|
|
17
|
+
export type TraverseEntityGraphOkResponse = ResponseWithPagination<GraphTraversalResponseResponse>;
|
|
18
|
+
export type TraverseEntityGraphErrorResponse = unknown;
|
|
19
|
+
export interface TraverseEntityGraphProps extends Omit<FetcherOptions<TraverseEntityGraphQueryQueryParams, unknown, TraverseEntityGraphQueryHeaderParams>, 'url'> {
|
|
20
|
+
queryParams: TraverseEntityGraphQueryQueryParams;
|
|
21
|
+
}
|
|
22
|
+
export declare function traverseEntityGraph(props: TraverseEntityGraphProps): Promise<TraverseEntityGraphOkResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Traverse the catalog entity graph starting from a given entity, following relationships up to a specified depth. Returns a graph structure with nodes and edges.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useTraverseEntityGraphQuery(props: TraverseEntityGraphProps, options?: Omit<UseQueryOptions<TraverseEntityGraphOkResponse, TraverseEntityGraphErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<TraverseEntityGraphOkResponse, 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 '../../../../custom-idp-fetcher/index.js';
|
|
6
|
+
export function traverseEntityGraph(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/v1/graph/traverse`, method: 'GET' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Traverse the catalog entity graph starting from a given entity, following relationships up to a specified depth. Returns a graph structure with nodes and edges.
|
|
11
|
+
*/
|
|
12
|
+
export function useTraverseEntityGraphQuery(props, options) {
|
|
13
|
+
return useQuery(['traverse-entity-graph', props.queryParams], ({ signal }) => traverseEntityGraph(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
|
+
}
|
|
@@ -245,6 +245,8 @@ export type { ScorecardRecalibrateErrorResponse, ScorecardRecalibrateOkResponse,
|
|
|
245
245
|
export { scorecardRecalibrate, useScorecardRecalibrateMutation, } from './hooks/useScorecardRecalibrateMutation';
|
|
246
246
|
export type { TogglePluginForAccountErrorResponse, TogglePluginForAccountMutationPathParams, TogglePluginForAccountMutationQueryParams, TogglePluginForAccountOkResponse, TogglePluginForAccountProps, } from './hooks/useTogglePluginForAccountMutation';
|
|
247
247
|
export { togglePluginForAccount, useTogglePluginForAccountMutation, } from './hooks/useTogglePluginForAccountMutation';
|
|
248
|
+
export type { TraverseEntityGraphErrorResponse, TraverseEntityGraphOkResponse, TraverseEntityGraphProps, TraverseEntityGraphQueryQueryParams, } from './hooks/useTraverseEntityGraphQuery';
|
|
249
|
+
export { traverseEntityGraph, useTraverseEntityGraphQuery, } from './hooks/useTraverseEntityGraphQuery';
|
|
248
250
|
export type { TriggerAggregationRuleComputationErrorResponse, TriggerAggregationRuleComputationMutationPathParams, TriggerAggregationRuleComputationOkResponse, TriggerAggregationRuleComputationProps, } from './hooks/useTriggerAggregationRuleComputationMutation';
|
|
249
251
|
export { triggerAggregationRuleComputation, useTriggerAggregationRuleComputationMutation, } from './hooks/useTriggerAggregationRuleComputationMutation';
|
|
250
252
|
export type { UnlinkIntegrationEntitiesErrorResponse, UnlinkIntegrationEntitiesMutationPathParams, UnlinkIntegrationEntitiesMutationQueryParams, UnlinkIntegrationEntitiesOkResponse, UnlinkIntegrationEntitiesProps, UnlinkIntegrationEntitiesRequestBody, } from './hooks/useUnlinkIntegrationEntitiesMutation';
|
|
@@ -361,6 +363,7 @@ export type { EntityVersionResponseBodyListResponse } from './responses/EntityVe
|
|
|
361
363
|
export type { EntityVersionResponseBodyResponse } from './responses/EntityVersionResponseBodyResponse';
|
|
362
364
|
export type { EnvironmentBlueprintInfoResponseResponse } from './responses/EnvironmentBlueprintInfoResponseResponse';
|
|
363
365
|
export type { GenerateYamlResponseResponse } from './responses/GenerateYamlResponseResponse';
|
|
366
|
+
export type { GraphTraversalResponseResponse } from './responses/GraphTraversalResponseResponse';
|
|
364
367
|
export type { GroupResponseListResponse } from './responses/GroupResponseListResponse';
|
|
365
368
|
export type { GroupResponseResponse } from './responses/GroupResponseResponse';
|
|
366
369
|
export type { HarnessEntitiesCountResponseResponse } from './responses/HarnessEntitiesCountResponseResponse';
|
|
@@ -507,6 +510,10 @@ export type { GitIntegrationRequest } from './schemas/GitIntegrationRequest';
|
|
|
507
510
|
export type { GitMetadataUpdateRequest } from './schemas/GitMetadataUpdateRequest';
|
|
508
511
|
export type { GitMoveDetails } from './schemas/GitMoveDetails';
|
|
509
512
|
export type { GitUpdateDetails } from './schemas/GitUpdateDetails';
|
|
513
|
+
export type { GraphEdge } from './schemas/GraphEdge';
|
|
514
|
+
export type { GraphMetadata } from './schemas/GraphMetadata';
|
|
515
|
+
export type { GraphNode } from './schemas/GraphNode';
|
|
516
|
+
export type { GraphTraversalResponse } from './schemas/GraphTraversalResponse';
|
|
510
517
|
export type { Group } from './schemas/Group';
|
|
511
518
|
export type { GroupRequest } from './schemas/GroupRequest';
|
|
512
519
|
export type { GroupResponse } from './schemas/GroupResponse';
|
|
@@ -121,6 +121,7 @@ export { saveHomePageLayoutInfo, useSaveHomePageLayoutInfoMutation, } from './ho
|
|
|
121
121
|
export { saveOrUpdatePluginAppConfig, useSaveOrUpdatePluginAppConfigMutation, } from './hooks/useSaveOrUpdatePluginAppConfigMutation';
|
|
122
122
|
export { scorecardRecalibrate, useScorecardRecalibrateMutation, } from './hooks/useScorecardRecalibrateMutation';
|
|
123
123
|
export { togglePluginForAccount, useTogglePluginForAccountMutation, } from './hooks/useTogglePluginForAccountMutation';
|
|
124
|
+
export { traverseEntityGraph, useTraverseEntityGraphQuery, } from './hooks/useTraverseEntityGraphQuery';
|
|
124
125
|
export { triggerAggregationRuleComputation, useTriggerAggregationRuleComputationMutation, } from './hooks/useTriggerAggregationRuleComputationMutation';
|
|
125
126
|
export { unlinkIntegrationEntities, useUnlinkIntegrationEntitiesMutation, } from './hooks/useUnlinkIntegrationEntitiesMutation';
|
|
126
127
|
export { updateAggregationRule, useUpdateAggregationRuleMutation, } from './hooks/useUpdateAggregationRuleMutation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a directed edge in the catalog entity graph
|
|
3
|
+
*/
|
|
4
|
+
export interface GraphEdge {
|
|
5
|
+
/**
|
|
6
|
+
* BFS traversal depth at which this edge was discovered
|
|
7
|
+
* @example 1
|
|
8
|
+
*/
|
|
9
|
+
depth: number;
|
|
10
|
+
/**
|
|
11
|
+
* Relationship type (dependsOn, providesApi, consumesApi, ownedBy, etc.)
|
|
12
|
+
* @example "dependsOn"
|
|
13
|
+
*/
|
|
14
|
+
relation: string;
|
|
15
|
+
/**
|
|
16
|
+
* The reverse/inverse of the relation type (e.g., dependsOn → dependencyOf)
|
|
17
|
+
* @example "dependencyOf"
|
|
18
|
+
*/
|
|
19
|
+
reverseRelation?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Source entity reference (matches GraphNode.entityRef)
|
|
22
|
+
* @example "component:account/payment-service"
|
|
23
|
+
*/
|
|
24
|
+
source: string;
|
|
25
|
+
/**
|
|
26
|
+
* Target entity reference (matches GraphNode.entityRef)
|
|
27
|
+
* @example "component:account/order-service"
|
|
28
|
+
*/
|
|
29
|
+
target: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata about the graph traversal results
|
|
3
|
+
*/
|
|
4
|
+
export interface GraphMetadata {
|
|
5
|
+
/**
|
|
6
|
+
* The starting entity reference for the traversal
|
|
7
|
+
* @example "component:account/payment-service"
|
|
8
|
+
*/
|
|
9
|
+
baseEntityRef: string;
|
|
10
|
+
/**
|
|
11
|
+
* Maximum depth reached during traversal
|
|
12
|
+
* @example 2
|
|
13
|
+
*/
|
|
14
|
+
maxDepthReached: number;
|
|
15
|
+
/**
|
|
16
|
+
* Total number of edges in the result
|
|
17
|
+
* @example 15
|
|
18
|
+
*/
|
|
19
|
+
totalEdges: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a node in the catalog entity graph
|
|
3
|
+
*/
|
|
4
|
+
export interface GraphNode {
|
|
5
|
+
/**
|
|
6
|
+
* Unique entity reference in format kind:account[.org[.project]]/identifier
|
|
7
|
+
* @example "component:account/payment-service"
|
|
8
|
+
*/
|
|
9
|
+
entityRef: string;
|
|
10
|
+
/**
|
|
11
|
+
* Entity kind (component, api, resource, group, etc.)
|
|
12
|
+
* @example "component"
|
|
13
|
+
*/
|
|
14
|
+
kind: string;
|
|
15
|
+
/**
|
|
16
|
+
* Human-readable entity name
|
|
17
|
+
* @example "payment-service"
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* Entity type (service, library, website, openapi, etc.)
|
|
22
|
+
* @example "service"
|
|
23
|
+
*/
|
|
24
|
+
type?: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { GraphEdge } from '../schemas/GraphEdge';
|
|
2
|
+
import type { GraphMetadata } from '../schemas/GraphMetadata';
|
|
3
|
+
import type { GraphNode } from '../schemas/GraphNode';
|
|
4
|
+
/**
|
|
5
|
+
* Response containing the graph traversal results with a normalized structure of nodes and edges
|
|
6
|
+
*/
|
|
7
|
+
export interface GraphTraversalResponse {
|
|
8
|
+
/**
|
|
9
|
+
* List of edges connecting the nodes
|
|
10
|
+
*/
|
|
11
|
+
edges: GraphEdge[];
|
|
12
|
+
metadata: GraphMetadata;
|
|
13
|
+
/**
|
|
14
|
+
* List of unique nodes discovered during traversal
|
|
15
|
+
*/
|
|
16
|
+
nodes: GraphNode[];
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|