@harnessio/react-ccm-optimization-service-client 0.3.0 → 0.3.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 (39) hide show
  1. package/dist/ccm-optimization-service/src/services/hooks/useDeleteAiGovernancePolicyMutation.d.ts +2 -2
  2. package/dist/ccm-optimization-service/src/services/hooks/useGetMyAiGovernanceBudgetOverviewQuery.d.ts +28 -0
  3. package/dist/ccm-optimization-service/src/services/hooks/useGetMyAiGovernanceBudgetOverviewQuery.js +14 -0
  4. package/dist/ccm-optimization-service/src/services/hooks/useListAiGovernancePoliciesMutation.d.ts +1 -1
  5. package/dist/ccm-optimization-service/src/services/hooks/useListAiGovernancePoliciesMutation.js +1 -1
  6. package/dist/ccm-optimization-service/src/services/hooks/useRequestMyAiGovernanceBudgetOverrideMutation.d.ts +23 -0
  7. package/dist/ccm-optimization-service/src/services/hooks/useRequestMyAiGovernanceBudgetOverrideMutation.js +14 -0
  8. package/dist/ccm-optimization-service/src/services/index.d.ts +13 -1
  9. package/dist/ccm-optimization-service/src/services/index.js +2 -0
  10. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceApprovalRequest.d.ts +1 -4
  11. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceConnectorRef.d.ts +4 -0
  12. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceDryRunSubject.d.ts +4 -4
  13. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceGovernancePeriod.d.ts +21 -0
  14. package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicy.d.ts +0 -29
  15. package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyAuthoring.d.ts +4 -12
  16. package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyAuthoring.js +0 -3
  17. package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyBudget.d.ts +9 -0
  18. package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyBudget.js +1 -0
  19. package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyDocument.d.ts +4 -20
  20. package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyDocument.js +0 -3
  21. package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyOverviewMetrics.d.ts +2 -13
  22. package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicySpec.d.ts +56 -0
  23. package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicySpec.js +4 -0
  24. package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyUpsertRequest.d.ts +1 -1
  25. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceRequestBudgetOverrideRequest.d.ts +20 -0
  26. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceRequestBudgetOverrideRequest.js +4 -0
  27. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceRuleBudget.d.ts +32 -0
  28. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceRuleBudget.js +1 -0
  29. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceSubjects.d.ts +31 -0
  30. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceSubjects.js +4 -0
  31. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceUserBudgetOverview.d.ts +8 -0
  32. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceUserBudgetOverview.js +1 -0
  33. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceUserBudgetOverviewResponse.d.ts +4 -0
  34. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceUserBudgetOverviewResponse.js +1 -0
  35. package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceUserBudgetRow.d.ts +18 -5
  36. package/dist/ccm-optimization-service/src/services/schemas/{AiGovernanceMessageResponse.d.ts → AlertMessageResponse.d.ts} +1 -1
  37. package/dist/ccm-optimization-service/src/services/schemas/AlertMessageResponse.js +4 -0
  38. package/package.json +1 -1
  39. /package/dist/ccm-optimization-service/src/services/schemas/{AiGovernanceMessageResponse.js → AiGovernanceGovernancePeriod.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { UseMutationOptions } from '@tanstack/react-query';
2
- import type { AiGovernanceMessageResponse } from '../schemas/AiGovernanceMessageResponse';
2
+ import type { AlertMessageResponse } from '../schemas/AlertMessageResponse';
3
3
  import type { ResponseWithPagination } from '../helpers';
4
4
  import { FetcherOptions } from '../../../../fetcher/index.js';
5
5
  export interface DeleteAiGovernancePolicyMutationPathParams {
@@ -12,7 +12,7 @@ export interface DeleteAiGovernancePolicyMutationPathParams {
12
12
  export interface DeleteAiGovernancePolicyMutationQueryParams {
13
13
  accountIdentifier: string;
14
14
  }
15
- export type DeleteAiGovernancePolicyOkResponse = ResponseWithPagination<AiGovernanceMessageResponse>;
15
+ export type DeleteAiGovernancePolicyOkResponse = ResponseWithPagination<AlertMessageResponse>;
16
16
  export type DeleteAiGovernancePolicyErrorResponse = unknown;
17
17
  export interface DeleteAiGovernancePolicyProps extends DeleteAiGovernancePolicyMutationPathParams, Omit<FetcherOptions<DeleteAiGovernancePolicyMutationQueryParams, unknown>, 'url'> {
18
18
  queryParams: DeleteAiGovernancePolicyMutationQueryParams;
@@ -0,0 +1,28 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { AiGovernanceUserBudgetOverviewResponse } from '../schemas/AiGovernanceUserBudgetOverviewResponse';
3
+ import type { ResponseWithPagination } from '../helpers';
4
+ import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface GetMyAiGovernanceBudgetOverviewQueryPathParams {
6
+ account_id: string;
7
+ }
8
+ export interface GetMyAiGovernanceBudgetOverviewQueryQueryParams {
9
+ accountIdentifier: string;
10
+ /**
11
+ * @format date-time
12
+ */
13
+ from?: string;
14
+ /**
15
+ * @format date-time
16
+ */
17
+ to?: string;
18
+ }
19
+ export type GetMyAiGovernanceBudgetOverviewOkResponse = ResponseWithPagination<AiGovernanceUserBudgetOverviewResponse>;
20
+ export type GetMyAiGovernanceBudgetOverviewErrorResponse = unknown;
21
+ export interface GetMyAiGovernanceBudgetOverviewProps extends GetMyAiGovernanceBudgetOverviewQueryPathParams, Omit<FetcherOptions<GetMyAiGovernanceBudgetOverviewQueryQueryParams, unknown>, 'url'> {
22
+ queryParams: GetMyAiGovernanceBudgetOverviewQueryQueryParams;
23
+ }
24
+ export declare function getMyAiGovernanceBudgetOverview(props: GetMyAiGovernanceBudgetOverviewProps): Promise<GetMyAiGovernanceBudgetOverviewOkResponse>;
25
+ /**
26
+ * Returns a spend-versus-budget overview for the logged-in user across all mapped governance policies. Each policy includes per-rule spend, effective ceiling, utilization percentages, and the current budget period window. When from and to query parameters are omitted, the window defaults to the last 30 days ending at the current UTC time. Requires authentication only; governed users do not need AI governance admin RBAC.
27
+ */
28
+ export declare function useGetMyAiGovernanceBudgetOverviewQuery(props: GetMyAiGovernanceBudgetOverviewProps, options?: Omit<UseQueryOptions<GetMyAiGovernanceBudgetOverviewOkResponse, GetMyAiGovernanceBudgetOverviewErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetMyAiGovernanceBudgetOverviewOkResponse, 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/index.js';
6
+ export function getMyAiGovernanceBudgetOverview(props) {
7
+ return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/me/overview`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Returns a spend-versus-budget overview for the logged-in user across all mapped governance policies. Each policy includes per-rule spend, effective ceiling, utilization percentages, and the current budget period window. When from and to query parameters are omitted, the window defaults to the last 30 days ending at the current UTC time. Requires authentication only; governed users do not need AI governance admin RBAC.
11
+ */
12
+ export function useGetMyAiGovernanceBudgetOverviewQuery(props, options) {
13
+ return useQuery(['GetMyAIGovernanceBudgetOverview', props.account_id, props.queryParams], ({ signal }) => getMyAiGovernanceBudgetOverview(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -18,6 +18,6 @@ export interface ListAiGovernancePoliciesProps extends ListAiGovernancePoliciesM
18
18
  }
19
19
  export declare function listAiGovernancePolicies(props: ListAiGovernancePoliciesProps): Promise<ListAiGovernancePoliciesOkResponse>;
20
20
  /**
21
- * Returns a paginated list of non-deleted governance policies for the account. Each policy document includes persisted ruleIds per rule. List responses omit rawYaml.
21
+ * Returns a paginated list of governance policies. Each item is a flat object with persisted policy fields (id, name, document, audit metadata) plus overview metrics (subjects, budget, spend, health). List responses omit rawYaml. cumulativeSpend, spendPercent, and userHealth are null until dry-run or reconcile has seeded the per-policy stats cache for the current period.
22
22
  */
23
23
  export declare function useListAiGovernancePoliciesMutation(options?: Omit<UseMutationOptions<ListAiGovernancePoliciesOkResponse, ListAiGovernancePoliciesErrorResponse, ListAiGovernancePoliciesProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ListAiGovernancePoliciesOkResponse, unknown, ListAiGovernancePoliciesProps, unknown>;
@@ -7,7 +7,7 @@ export function listAiGovernancePolicies(props) {
7
7
  return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/policies/list`, method: 'POST' }, props));
8
8
  }
9
9
  /**
10
- * Returns a paginated list of non-deleted governance policies for the account. Each policy document includes persisted ruleIds per rule. List responses omit rawYaml.
10
+ * Returns a paginated list of governance policies. Each item is a flat object with persisted policy fields (id, name, document, audit metadata) plus overview metrics (subjects, budget, spend, health). List responses omit rawYaml. cumulativeSpend, spendPercent, and userHealth are null until dry-run or reconcile has seeded the per-policy stats cache for the current period.
11
11
  */
12
12
  export function useListAiGovernancePoliciesMutation(options) {
13
13
  return useMutation((mutateProps) => listAiGovernancePolicies(mutateProps), options);
@@ -0,0 +1,23 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { AlertMessageResponse } from '../schemas/AlertMessageResponse';
3
+ import type { AiGovernanceRequestBudgetOverrideRequest } from '../schemas/AiGovernanceRequestBudgetOverrideRequest';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface RequestMyAiGovernanceBudgetOverrideMutationPathParams {
7
+ account_id: string;
8
+ }
9
+ export interface RequestMyAiGovernanceBudgetOverrideMutationQueryParams {
10
+ accountIdentifier: string;
11
+ }
12
+ export type RequestMyAiGovernanceBudgetOverrideRequestBody = AiGovernanceRequestBudgetOverrideRequest;
13
+ export type RequestMyAiGovernanceBudgetOverrideOkResponse = ResponseWithPagination<AlertMessageResponse>;
14
+ export type RequestMyAiGovernanceBudgetOverrideErrorResponse = unknown;
15
+ export interface RequestMyAiGovernanceBudgetOverrideProps extends RequestMyAiGovernanceBudgetOverrideMutationPathParams, Omit<FetcherOptions<RequestMyAiGovernanceBudgetOverrideMutationQueryParams, RequestMyAiGovernanceBudgetOverrideRequestBody>, 'url'> {
16
+ queryParams: RequestMyAiGovernanceBudgetOverrideMutationQueryParams;
17
+ body: RequestMyAiGovernanceBudgetOverrideRequestBody;
18
+ }
19
+ export declare function requestMyAiGovernanceBudgetOverride(props: RequestMyAiGovernanceBudgetOverrideProps): Promise<RequestMyAiGovernanceBudgetOverrideOkResponse>;
20
+ /**
21
+ * Submits a budget ceiling raise request for one budget-cap rule on a policy that governs the logged-in user. The request enters the policy's configured approval workflow (single- or multi-tier). Requires authentication only; governed users do not need AI governance admin RBAC.
22
+ */
23
+ export declare function useRequestMyAiGovernanceBudgetOverrideMutation(options?: Omit<UseMutationOptions<RequestMyAiGovernanceBudgetOverrideOkResponse, RequestMyAiGovernanceBudgetOverrideErrorResponse, RequestMyAiGovernanceBudgetOverrideProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<RequestMyAiGovernanceBudgetOverrideOkResponse, unknown, RequestMyAiGovernanceBudgetOverrideProps, 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/index.js';
6
+ export function requestMyAiGovernanceBudgetOverride(props) {
7
+ return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/me/budgets/override/request`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Submits a budget ceiling raise request for one budget-cap rule on a policy that governs the logged-in user. The request enters the policy's configured approval workflow (single- or multi-tier). Requires authentication only; governed users do not need AI governance admin RBAC.
11
+ */
12
+ export function useRequestMyAiGovernanceBudgetOverrideMutation(options) {
13
+ return useMutation((mutateProps) => requestMyAiGovernanceBudgetOverride(mutateProps), options);
14
+ }
@@ -209,6 +209,8 @@ export type { GetKeyPairsForProxyErrorResponse, GetKeyPairsForProxyOkResponse, G
209
209
  export { getKeyPairsForProxy, useGetKeyPairsForProxyQuery, } from './hooks/useGetKeyPairsForProxyQuery';
210
210
  export type { GetMachineListForZoneErrorResponse, GetMachineListForZoneOkResponse, GetMachineListForZoneProps, GetMachineListForZoneQueryPathParams, GetMachineListForZoneQueryQueryParams, } from './hooks/useGetMachineListForZoneQuery';
211
211
  export { getMachineListForZone, useGetMachineListForZoneQuery, } from './hooks/useGetMachineListForZoneQuery';
212
+ export type { GetMyAiGovernanceBudgetOverviewErrorResponse, GetMyAiGovernanceBudgetOverviewOkResponse, GetMyAiGovernanceBudgetOverviewProps, GetMyAiGovernanceBudgetOverviewQueryPathParams, GetMyAiGovernanceBudgetOverviewQueryQueryParams, } from './hooks/useGetMyAiGovernanceBudgetOverviewQuery';
213
+ export { getMyAiGovernanceBudgetOverview, useGetMyAiGovernanceBudgetOverviewQuery, } from './hooks/useGetMyAiGovernanceBudgetOverviewQuery';
212
214
  export type { GetNodeClassErrorResponse, GetNodeClassOkResponse, GetNodeClassProps, GetNodeClassQueryPathParams, GetNodeClassQueryQueryParams, } from './hooks/useGetNodeClassQuery';
213
215
  export { getNodeClass, useGetNodeClassQuery } from './hooks/useGetNodeClassQuery';
214
216
  export type { GetNodePoolErrorResponse, GetNodePoolOkResponse, GetNodePoolProps, GetNodePoolQueryPathParams, GetNodePoolQueryQueryParams, } from './hooks/useGetNodePoolQuery';
@@ -297,6 +299,8 @@ export type { PaginatedAccessPointsErrorResponse, PaginatedAccessPointsMutationP
297
299
  export { paginatedAccessPoints, usePaginatedAccessPointsMutation, } from './hooks/usePaginatedAccessPointsMutation';
298
300
  export type { PerformBulkRuleActionErrorResponse, PerformBulkRuleActionMutationPathParams, PerformBulkRuleActionMutationQueryParams, PerformBulkRuleActionOkResponse, PerformBulkRuleActionProps, PerformBulkRuleActionRequestBody, } from './hooks/usePerformBulkRuleActionMutation';
299
301
  export { performBulkRuleAction, usePerformBulkRuleActionMutation, } from './hooks/usePerformBulkRuleActionMutation';
302
+ export type { RequestMyAiGovernanceBudgetOverrideErrorResponse, RequestMyAiGovernanceBudgetOverrideMutationPathParams, RequestMyAiGovernanceBudgetOverrideMutationQueryParams, RequestMyAiGovernanceBudgetOverrideOkResponse, RequestMyAiGovernanceBudgetOverrideProps, RequestMyAiGovernanceBudgetOverrideRequestBody, } from './hooks/useRequestMyAiGovernanceBudgetOverrideMutation';
303
+ export { requestMyAiGovernanceBudgetOverride, useRequestMyAiGovernanceBudgetOverrideMutation, } from './hooks/useRequestMyAiGovernanceBudgetOverrideMutation';
300
304
  export type { RequestsOfServiceErrorResponse, RequestsOfServiceOkResponse, RequestsOfServiceProps, RequestsOfServiceQueryPathParams, RequestsOfServiceQueryQueryParams, } from './hooks/useRequestsOfServiceQuery';
301
305
  export { requestsOfService, useRequestsOfServiceQuery } from './hooks/useRequestsOfServiceQuery';
302
306
  export type { ReviewAiGovernanceOverrideRequestsErrorResponse, ReviewAiGovernanceOverrideRequestsMutationPathParams, ReviewAiGovernanceOverrideRequestsMutationQueryParams, ReviewAiGovernanceOverrideRequestsOkResponse, ReviewAiGovernanceOverrideRequestsProps, ReviewAiGovernanceOverrideRequestsRequestBody, } from './hooks/useReviewAiGovernanceOverrideRequestsMutation';
@@ -366,13 +370,14 @@ export type { AiGovernanceDryRunResponse } from './schemas/AiGovernanceDryRunRes
366
370
  export type { AiGovernanceDryRunResult } from './schemas/AiGovernanceDryRunResult';
367
371
  export type { AiGovernanceDryRunRuleResult } from './schemas/AiGovernanceDryRunRuleResult';
368
372
  export type { AiGovernanceDryRunSubject } from './schemas/AiGovernanceDryRunSubject';
369
- export type { AiGovernanceMessageResponse } from './schemas/AiGovernanceMessageResponse';
373
+ export type { AiGovernanceGovernancePeriod } from './schemas/AiGovernanceGovernancePeriod';
370
374
  export type { AiGovernanceMyOverrideRequestsList } from './schemas/AiGovernanceMyOverrideRequestsList';
371
375
  export type { AiGovernanceMyOverrideRequestsListRequest } from './schemas/AiGovernanceMyOverrideRequestsListRequest';
372
376
  export type { AiGovernanceMyOverrideRequestsListResponse } from './schemas/AiGovernanceMyOverrideRequestsListResponse';
373
377
  export type { AiGovernanceOverrideRequestsListRequest } from './schemas/AiGovernanceOverrideRequestsListRequest';
374
378
  export type { AiGovernancePolicy } from './schemas/AiGovernancePolicy';
375
379
  export type { AiGovernancePolicyAuthoring } from './schemas/AiGovernancePolicyAuthoring';
380
+ export type { AiGovernancePolicyBudget } from './schemas/AiGovernancePolicyBudget';
376
381
  export type { AiGovernancePolicyDetails } from './schemas/AiGovernancePolicyDetails';
377
382
  export type { AiGovernancePolicyDetailsResponse } from './schemas/AiGovernancePolicyDetailsResponse';
378
383
  export type { AiGovernancePolicyDocument } from './schemas/AiGovernancePolicyDocument';
@@ -381,16 +386,22 @@ export type { AiGovernancePolicyListRequest } from './schemas/AiGovernancePolicy
381
386
  export type { AiGovernancePolicyListResponse } from './schemas/AiGovernancePolicyListResponse';
382
387
  export type { AiGovernancePolicyOverviewMetrics } from './schemas/AiGovernancePolicyOverviewMetrics';
383
388
  export type { AiGovernancePolicyResponse } from './schemas/AiGovernancePolicyResponse';
389
+ export type { AiGovernancePolicySpec } from './schemas/AiGovernancePolicySpec';
384
390
  export type { AiGovernancePolicySubjectRow } from './schemas/AiGovernancePolicySubjectRow';
385
391
  export type { AiGovernancePolicySubjectsRequest } from './schemas/AiGovernancePolicySubjectsRequest';
386
392
  export type { AiGovernancePolicySubjectsResponse } from './schemas/AiGovernancePolicySubjectsResponse';
387
393
  export type { AiGovernancePolicyUpsertRequest } from './schemas/AiGovernancePolicyUpsertRequest';
388
394
  export type { AiGovernancePolicyUserHealth } from './schemas/AiGovernancePolicyUserHealth';
395
+ export type { AiGovernanceRequestBudgetOverrideRequest } from './schemas/AiGovernanceRequestBudgetOverrideRequest';
389
396
  export type { AiGovernanceReviewOverrideItem } from './schemas/AiGovernanceReviewOverrideItem';
390
397
  export type { AiGovernanceReviewOverrideOutcome } from './schemas/AiGovernanceReviewOverrideOutcome';
391
398
  export type { AiGovernanceReviewOverridesRequest } from './schemas/AiGovernanceReviewOverridesRequest';
392
399
  export type { AiGovernanceReviewOverridesResponse } from './schemas/AiGovernanceReviewOverridesResponse';
393
400
  export type { AiGovernanceReviewOverridesResult } from './schemas/AiGovernanceReviewOverridesResult';
401
+ export type { AiGovernanceRuleBudget } from './schemas/AiGovernanceRuleBudget';
402
+ export type { AiGovernanceSubjects } from './schemas/AiGovernanceSubjects';
403
+ export type { AiGovernanceUserBudgetOverview } from './schemas/AiGovernanceUserBudgetOverview';
404
+ export type { AiGovernanceUserBudgetOverviewResponse } from './schemas/AiGovernanceUserBudgetOverviewResponse';
394
405
  export type { AiGovernanceUserBudgetRow } from './schemas/AiGovernanceUserBudgetRow';
395
406
  export type { AiGovernanceUserBudgets } from './schemas/AiGovernanceUserBudgets';
396
407
  export type { AiGovernanceUserBudgetsResponse } from './schemas/AiGovernanceUserBudgetsResponse';
@@ -399,6 +410,7 @@ export type { Alert } from './schemas/Alert';
399
410
  export type { AlertAssociatedEntity } from './schemas/AlertAssociatedEntity';
400
411
  export type { AlertDeleteResponse } from './schemas/AlertDeleteResponse';
401
412
  export type { AlertEvent } from './schemas/AlertEvent';
413
+ export type { AlertMessageResponse } from './schemas/AlertMessageResponse';
402
414
  export type { AlertRecipient } from './schemas/AlertRecipient';
403
415
  export type { AlertRequest } from './schemas/AlertRequest';
404
416
  export type { AlertSearchRequest } from './schemas/AlertSearchRequest';
@@ -103,6 +103,7 @@ export { getInstanceHealthCheckDetails, useGetInstanceHealthCheckDetailsQuery, }
103
103
  export { getInstancesTags, useGetInstancesTagsQuery } from './hooks/useGetInstancesTagsQuery';
104
104
  export { getKeyPairsForProxy, useGetKeyPairsForProxyQuery, } from './hooks/useGetKeyPairsForProxyQuery';
105
105
  export { getMachineListForZone, useGetMachineListForZoneQuery, } from './hooks/useGetMachineListForZoneQuery';
106
+ export { getMyAiGovernanceBudgetOverview, useGetMyAiGovernanceBudgetOverviewQuery, } from './hooks/useGetMyAiGovernanceBudgetOverviewQuery';
106
107
  export { getNodeClass, useGetNodeClassQuery } from './hooks/useGetNodeClassQuery';
107
108
  export { getNodePool, useGetNodePoolQuery } from './hooks/useGetNodePoolQuery';
108
109
  export { getNodepoolSchedules, useGetNodepoolSchedulesQuery, } from './hooks/useGetNodepoolSchedulesQuery';
@@ -147,6 +148,7 @@ export { logsOfServiceV2, useLogsOfServiceV2Mutation } from './hooks/useLogsOfSe
147
148
  export { mapToDns, useMapToDnsMutation } from './hooks/useMapToDnsMutation';
148
149
  export { paginatedAccessPoints, usePaginatedAccessPointsMutation, } from './hooks/usePaginatedAccessPointsMutation';
149
150
  export { performBulkRuleAction, usePerformBulkRuleActionMutation, } from './hooks/usePerformBulkRuleActionMutation';
151
+ export { requestMyAiGovernanceBudgetOverride, useRequestMyAiGovernanceBudgetOverrideMutation, } from './hooks/useRequestMyAiGovernanceBudgetOverrideMutation';
150
152
  export { requestsOfService, useRequestsOfServiceQuery } from './hooks/useRequestsOfServiceQuery';
151
153
  export { reviewAiGovernanceOverrideRequests, useReviewAiGovernanceOverrideRequestsMutation, } from './hooks/useReviewAiGovernanceOverrideRequestsMutation';
152
154
  export { routeDetails, useRouteDetailsQuery } from './hooks/useRouteDetailsQuery';
@@ -38,10 +38,6 @@ export interface AiGovernanceApprovalRequest {
38
38
  */
39
39
  requestedAmount: number;
40
40
  requestedBy: string;
41
- /**
42
- * @format uuid
43
- */
44
- ruleId: string;
45
41
  status: 'approved' | 'deferred' | 'error' | 'expired' | 'pending' | 'rejected';
46
42
  subjectId: string;
47
43
  /**
@@ -61,6 +57,7 @@ export interface AiGovernanceApprovalRequest {
61
57
  */
62
58
  updatedAt: string;
63
59
  /**
60
+ * Override validity end; set on final approval to the end of the current budget period
64
61
  * @format date-time
65
62
  */
66
63
  validUntil?: string;
@@ -3,6 +3,10 @@ export interface AiGovernanceConnectorRef {
3
3
  * Explicit cloud connector id when targeted directly
4
4
  */
5
5
  connectorId?: string;
6
+ /**
7
+ * BQ genAISubAccountId for AWS/Bedrock rows; used to resolve child account connectors when connectorId is not set
8
+ */
9
+ genAISubAccountId?: string;
6
10
  /**
7
11
  * AI provider identifier
8
12
  */
@@ -1,8 +1,8 @@
1
1
  export interface AiGovernanceDryRunSubject {
2
2
  /**
3
- * @format int64
3
+ * Effective budget ceiling in USD dollars
4
4
  */
5
- ceilingCents?: number;
5
+ ceilingDollars?: number;
6
6
  disallowedModels?: string[];
7
7
  /**
8
8
  * @format int64
@@ -16,9 +16,9 @@ export interface AiGovernanceDryRunSubject {
16
16
  reason?: string;
17
17
  skippedForRuleType?: boolean;
18
18
  /**
19
- * @format int64
19
+ * Current-period spend in USD dollars
20
20
  */
21
- spendCents?: number;
21
+ spendDollars?: number;
22
22
  subject: {
23
23
  email?: string;
24
24
  id?: string;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Budget period window used for spend attribution. JSON keys match attribution.GovernancePeriod (capitalized Period and Range).
3
+ */
4
+ export interface AiGovernanceGovernancePeriod {
5
+ /**
6
+ * Budget period label for the rule
7
+ */
8
+ Period: 'monthly' | 'quarterly' | 'weekly';
9
+ Range: {
10
+ /**
11
+ * UTC end of the governance period window (typically the evaluation anchor time)
12
+ * @format date-time
13
+ */
14
+ End: string;
15
+ /**
16
+ * Inclusive UTC start of the governance period window
17
+ * @format date-time
18
+ */
19
+ Start: string;
20
+ };
21
+ }
@@ -12,42 +12,13 @@ export interface AiGovernancePolicy {
12
12
  */
13
13
  id?: string;
14
14
  name?: string;
15
- /**
16
- * Count of pending cap-raise approval requests for this policy. Present on list responses only.
17
- */
18
- pendingUpgradeRequests?: number;
19
15
  /**
20
16
  * Original YAML upload when the policy was created or last updated via rawYaml. Empty when the JSON policy path was used; document is always authoritative.
21
17
  */
22
18
  rawYaml?: string;
23
- /**
24
- * Total current-period spend across governed subjects for budget-cap rules on this policy. Present on list responses only.
25
- */
26
- rolledUpSpend?: number;
27
- /**
28
- * Total number of unique governed subjects across budget-cap rules on this policy. Present on list responses only.
29
- */
30
- totalUsers?: number;
31
19
  /**
32
20
  * @format date-time
33
21
  */
34
22
  updatedAt?: string;
35
23
  updatedBy?: string;
36
- /**
37
- * Counts of governed subjects by budget utilization band. Present on list responses only.
38
- */
39
- userHealth?: {
40
- /**
41
- * Subjects at or above the at-risk threshold but below budget
42
- */
43
- atRisk?: number;
44
- /**
45
- * Subjects below the at-risk spend threshold
46
- */
47
- good?: number;
48
- /**
49
- * Subjects at or above 100% of their effective budget ceiling
50
- */
51
- overBudget?: number;
52
- };
53
24
  }
@@ -1,18 +1,10 @@
1
+ import type { AiGovernancePolicySpec } from '../schemas/AiGovernancePolicySpec';
2
+ import type { AiGovernanceSubjects } from '../schemas/AiGovernanceSubjects';
1
3
  export interface AiGovernancePolicyAuthoring {
2
4
  /**
3
5
  * Lowercase slug policy name
4
6
  */
5
7
  name: string;
6
- /**
7
- * Governance rules with flat type-specific fields (same shape as YAML rules)
8
- */
9
- rules: Array<{
10
- [key: string]: any;
11
- }>;
12
- /**
13
- * Policy-level subject selectors
14
- */
15
- subjects: {
16
- [key: string]: any;
17
- };
8
+ spec: AiGovernancePolicySpec;
9
+ subjects: AiGovernanceSubjects;
18
10
  }
@@ -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,9 @@
1
+ import type { AiGovernanceRuleBudget } from '../schemas/AiGovernanceRuleBudget';
2
+ export interface AiGovernancePolicyBudget {
3
+ /**
4
+ * @format uuid
5
+ */
6
+ policy_id: string;
7
+ policy_name: string;
8
+ rule_budgets: AiGovernanceRuleBudget[];
9
+ }
@@ -1,22 +1,6 @@
1
+ import type { AiGovernancePolicySpec } from '../schemas/AiGovernancePolicySpec';
2
+ import type { AiGovernanceSubjects } from '../schemas/AiGovernanceSubjects';
1
3
  export interface AiGovernancePolicyDocument {
2
- /**
3
- * Persisted rules with platform-assigned ruleIds
4
- */
5
- rules?: Array<{
6
- connectors?: Array<{
7
- [key: string]: any;
8
- }>;
9
- frequency?: string;
10
- /**
11
- * @format uuid
12
- */
13
- ruleId?: string;
14
- type?: string;
15
- }>;
16
- /**
17
- * Policy-level subject selectors
18
- */
19
- subjects?: {
20
- [key: string]: any;
21
- };
4
+ spec?: AiGovernancePolicySpec;
5
+ subjects?: AiGovernanceSubjects;
22
6
  }
@@ -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 {};
@@ -1,3 +1,4 @@
1
+ import type { AiGovernanceGovernancePeriod } from '../schemas/AiGovernanceGovernancePeriod';
1
2
  import type { AiGovernancePolicyUserHealth } from '../schemas/AiGovernancePolicyUserHealth';
2
3
  /**
3
4
  * Overview metrics shared by policy list items and the single-policy overview response. Spend fields are populated only after dry-run or reconcile writes the per-policy stats cache.
@@ -8,19 +9,7 @@ export interface AiGovernancePolicyOverviewMetrics {
8
9
  */
9
10
  cumulativeSpend?: number | null;
10
11
  pendingRequestsCount: number;
11
- period?: {
12
- period?: string;
13
- range?: {
14
- /**
15
- * @format date-time
16
- */
17
- end?: string;
18
- /**
19
- * @format date-time
20
- */
21
- start?: string;
22
- };
23
- };
12
+ period: AiGovernanceGovernancePeriod;
24
13
  /**
25
14
  * 1-indexed day within the current budget period
26
15
  */
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Typed constraint payload for a policy. Only type=budget-cap is currently supported.
3
+ */
4
+ export interface AiGovernancePolicySpec {
5
+ /**
6
+ * Graduated responses triggered at ascending spend thresholds. Actions determine enforcement behavior; there is no separate enforcement strategy field.
7
+ */
8
+ actions?: Array<{
9
+ channels?: string[];
10
+ dedupeByCeiling?: boolean;
11
+ delivery?: 'digest' | 'immediate';
12
+ do: 'block-user' | 'notify' | 'remove-premium-models';
13
+ includeRecoveryInstructions?: boolean;
14
+ models?: string[];
15
+ when: {
16
+ thresholdPercent?: number;
17
+ };
18
+ }>;
19
+ /**
20
+ * Overall budget ceiling. Required unless every entry in providers sets its own amount.
21
+ */
22
+ amount?: number;
23
+ /**
24
+ * Approval tiers for budget-override requests, with strictly ascending upToAmount
25
+ */
26
+ approvals?: Array<{
27
+ approvers: {
28
+ emails?: string[];
29
+ userGroups?: string[];
30
+ };
31
+ autoApproveWhen?: {
32
+ maxPremiumSpendPercent?: number;
33
+ };
34
+ upToAmount: number;
35
+ }>;
36
+ /**
37
+ * Cron expression or descriptor (e.g. @hourly) controlling how often the policy is evaluated
38
+ */
39
+ evaluationSchedule: string;
40
+ /**
41
+ * Whether the ceiling applies per subject or to a shared pool. Defaults to per-subject (pooled for account-scoped subjects). Account-scoped policies must use pooled.
42
+ */
43
+ mode?: 'per-subject' | 'pooled';
44
+ period: 'custom' | 'monthly' | 'quarterly' | 'weekly';
45
+ /**
46
+ * Per-provider budget ceilings. Required (non-empty) when amount is omitted; provider names must not repeat. Each entry with its own amount creates an independent provider scope; an entry with no amount is governed by the total scope only.
47
+ */
48
+ providers?: Array<{
49
+ amount?: number;
50
+ provider: 'anthropic' | 'bedrock' | 'cursor';
51
+ }>;
52
+ /**
53
+ * Constraint shape; only budget-cap is currently supported
54
+ */
55
+ type: 'budget-cap';
56
+ }
@@ -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 {};
@@ -5,7 +5,7 @@ import type { AiGovernancePolicyAuthoring } from '../schemas/AiGovernancePolicyA
5
5
  export interface AiGovernancePolicyUpsertRequest {
6
6
  policy?: AiGovernancePolicyAuthoring;
7
7
  /**
8
- * Full governance policy YAML document with exactly one policy entry containing subjects and rules
8
+ * Full governance policy YAML document with exactly one policy entry containing subjects and spec
9
9
  */
10
10
  rawYaml?: string;
11
11
  }
@@ -0,0 +1,20 @@
1
+ export interface AiGovernanceRequestBudgetOverrideRequest {
2
+ /**
3
+ * Requested budget ceiling raise in USD dollars
4
+ */
5
+ amount: number;
6
+ /**
7
+ * Governance policy that contains the budget-cap rule
8
+ * @format uuid
9
+ */
10
+ policy_id: string;
11
+ /**
12
+ * Business justification for the override request
13
+ */
14
+ reason: string;
15
+ /**
16
+ * Budget-cap rule to raise
17
+ * @format uuid
18
+ */
19
+ rule_id: string;
20
+ }
@@ -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 {};
@@ -0,0 +1,32 @@
1
+ import type { AiGovernanceGovernancePeriod } from '../schemas/AiGovernanceGovernancePeriod';
2
+ export interface AiGovernanceRuleBudget {
3
+ /**
4
+ * Effective budget ceiling in USD dollars after active overrides
5
+ */
6
+ amount: number;
7
+ /**
8
+ * Spend as a percentage of the effective ceiling
9
+ */
10
+ percentage: number;
11
+ period: AiGovernanceGovernancePeriod;
12
+ /**
13
+ * Connector providers with spend in the current period for this rule
14
+ */
15
+ providers: string[];
16
+ /**
17
+ * Remaining budget in USD dollars (effective ceiling minus spend)
18
+ */
19
+ remaining: number;
20
+ /**
21
+ * Remaining budget as a percentage of the effective ceiling
22
+ */
23
+ remaining_percentage: number;
24
+ /**
25
+ * @format uuid
26
+ */
27
+ rule_id: string;
28
+ /**
29
+ * Current-period spend in USD dollars
30
+ */
31
+ spend: number;
32
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Policy-level subject selector. Exactly one of account, users, userGroups, perspective, or costCategory must be set.
3
+ */
4
+ export interface AiGovernanceSubjects {
5
+ /**
6
+ * Governs every subject on the account. Must be true when set.
7
+ */
8
+ account?: boolean;
9
+ /**
10
+ * Cost category identifier in scope
11
+ */
12
+ costCategory?: string;
13
+ /**
14
+ * Principals permanently excluded from every scope under the policy
15
+ */
16
+ exclude?: {
17
+ users?: string[];
18
+ };
19
+ /**
20
+ * Cost perspective identifier in scope
21
+ */
22
+ perspective?: string;
23
+ /**
24
+ * User group identifiers in scope
25
+ */
26
+ userGroups?: string[];
27
+ /**
28
+ * Explicit user emails in scope
29
+ */
30
+ users?: string[];
31
+ }
@@ -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 {};
@@ -0,0 +1,8 @@
1
+ import type { AiGovernancePolicyBudget } from '../schemas/AiGovernancePolicyBudget';
2
+ export interface AiGovernanceUserBudgetOverview {
3
+ policy_budgets: AiGovernancePolicyBudget[];
4
+ /**
5
+ * Canonical subject identifier for the logged-in user (typically email when available)
6
+ */
7
+ subject_id: string;
8
+ }
@@ -0,0 +1,4 @@
1
+ import type { AiGovernanceUserBudgetOverview } from '../schemas/AiGovernanceUserBudgetOverview';
2
+ export interface AiGovernanceUserBudgetOverviewResponse {
3
+ response: AiGovernanceUserBudgetOverview;
4
+ }
@@ -1,12 +1,26 @@
1
1
  import type { AiGovernanceConnectorRef } from '../schemas/AiGovernanceConnectorRef';
2
2
  export interface AiGovernanceUserBudgetRow {
3
+ /**
4
+ * Graduated budget actions configured on the policy rule
5
+ */
6
+ actions?: Array<{
7
+ channels?: string[];
8
+ dedupeByCeiling?: boolean;
9
+ delivery?: 'digest' | 'immediate';
10
+ do: 'block-user' | 'notify' | 'remove-premium-models';
11
+ includeRecoveryInstructions?: boolean;
12
+ models?: string[];
13
+ when: {
14
+ thresholdPercent: number;
15
+ };
16
+ }>;
3
17
  /**
4
18
  * Budget ceiling from policy YAML, in USD dollars
5
19
  */
6
20
  authoredAmount: number;
7
21
  authoredConnectors: AiGovernanceConnectorRef[];
8
22
  /**
9
- * Effective ceiling after active overrides (same as authored until Phase 1b overrides land)
23
+ * Effective ceiling after active overrides, in USD dollars
10
24
  */
11
25
  effectiveAmount: number;
12
26
  mode: 'per-subject' | 'pooled';
@@ -32,12 +46,11 @@ export interface AiGovernanceUserBudgetRow {
32
46
  */
33
47
  ruleId: string;
34
48
  /**
35
- * Current-period spend in USD cents from attribution
36
- * @format int64
49
+ * Current-period spend in USD dollars from attribution
37
50
  */
38
- spendCents: number;
51
+ spendDollars: number;
39
52
  /**
40
- * Spend as a percentage of the effective ceiling
53
+ * Spend as a percentage of the effective ceiling; omitted when effective ceiling is zero
41
54
  */
42
55
  spendPercent?: number;
43
56
  /**
@@ -1,4 +1,4 @@
1
- export interface AiGovernanceMessageResponse {
1
+ export interface AlertMessageResponse {
2
2
  response: {
3
3
  /**
4
4
  * Success message
@@ -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-ccm-optimization-service-client",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Harness CCM Optimization Service APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",