@harnessio/react-ccm-optimization-service-client 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ccm-optimization-service/src/services/hooks/useCreateAiGovernanceOverrideMutation.d.ts +27 -0
- package/dist/ccm-optimization-service/src/services/hooks/useCreateAiGovernanceOverrideMutation.js +14 -0
- package/dist/ccm-optimization-service/src/services/hooks/useCreateAiGovernancePolicyMutation.d.ts +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useCreateAiGovernancePolicyMutation.js +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useDryRunAiGovernancePolicyMutation.d.ts +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useDryRunAiGovernancePolicyMutation.js +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useGetAiGovernancePolicyOverviewQuery.d.ts +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useGetAiGovernancePolicyOverviewQuery.js +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useListAiGovernanceOverrideRequestsMutation.d.ts +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useListAiGovernanceOverrideRequestsMutation.js +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useListAiGovernancePoliciesMutation.d.ts +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useListAiGovernancePoliciesMutation.js +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useListAiGovernancePolicySubjectsMutation.d.ts +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useListAiGovernancePolicySubjectsMutation.js +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useListMyAiGovernanceBudgetsQuery.d.ts +2 -6
- package/dist/ccm-optimization-service/src/services/hooks/useListMyAiGovernanceBudgetsQuery.js +2 -2
- package/dist/ccm-optimization-service/src/services/hooks/useReviewAiGovernanceOverrideRequestsMutation.d.ts +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useReviewAiGovernanceOverrideRequestsMutation.js +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useUpdateAiGovernancePolicyMutation.d.ts +1 -1
- package/dist/ccm-optimization-service/src/services/hooks/useUpdateAiGovernancePolicyMutation.js +1 -1
- package/dist/ccm-optimization-service/src/services/index.d.ts +8 -1
- package/dist/ccm-optimization-service/src/services/index.js +1 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceApprovalRequest.d.ts +0 -26
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceApprovalRequestView.d.ts +1 -1
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceBudgetAction.d.ts +27 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceBudgetAction.js +1 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceBudgetActionWhen.d.ts +6 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceBudgetActionWhen.js +4 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceConnectorRef.d.ts +0 -4
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceCreateOverrideRequest.d.ts +10 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceCreateOverrideRequest.js +4 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceDryRunRuleResult.d.ts +1 -2
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceDryRunSubject.d.ts +0 -6
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceGovernancePeriod.d.ts +6 -8
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicy.d.ts +4 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyAuthoring.d.ts +7 -1
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyDocument.d.ts +6 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyListItem.d.ts +4 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyListRequest.d.ts +26 -2
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyOverviewMetrics.d.ts +17 -2
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicySpec.d.ts +4 -15
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicySpec.js +0 -3
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicySubjectRow.d.ts +4 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicySubjectsRequest.d.ts +2 -2
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyUpsertRequest.d.ts +14 -8
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceRequestBudgetOverrideRequest.d.ts +1 -6
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceRuleOverride.d.ts +36 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceRuleOverride.js +4 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceRuleOverrideResponse.d.ts +12 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceRuleOverrideResponse.js +1 -0
- package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceUserBudgetRow.d.ts +6 -16
- package/package.json +1 -1
package/dist/ccm-optimization-service/src/services/hooks/useCreateAiGovernanceOverrideMutation.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { AiGovernanceRuleOverrideResponse } from '../schemas/AiGovernanceRuleOverrideResponse';
|
|
3
|
+
import type { AiGovernanceCreateOverrideRequest } from '../schemas/AiGovernanceCreateOverrideRequest';
|
|
4
|
+
import type { ResponseWithPagination } from '../helpers';
|
|
5
|
+
import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
6
|
+
export interface CreateAiGovernanceOverrideMutationPathParams {
|
|
7
|
+
account_id: string;
|
|
8
|
+
/**
|
|
9
|
+
* @format uuid
|
|
10
|
+
*/
|
|
11
|
+
policy_id: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CreateAiGovernanceOverrideMutationQueryParams {
|
|
14
|
+
accountIdentifier: string;
|
|
15
|
+
}
|
|
16
|
+
export type CreateAiGovernanceOverrideRequestBody = AiGovernanceCreateOverrideRequest;
|
|
17
|
+
export type CreateAiGovernanceOverrideOkResponse = ResponseWithPagination<AiGovernanceRuleOverrideResponse>;
|
|
18
|
+
export type CreateAiGovernanceOverrideErrorResponse = unknown;
|
|
19
|
+
export interface CreateAiGovernanceOverrideProps extends CreateAiGovernanceOverrideMutationPathParams, Omit<FetcherOptions<CreateAiGovernanceOverrideMutationQueryParams, CreateAiGovernanceOverrideRequestBody>, 'url'> {
|
|
20
|
+
queryParams: CreateAiGovernanceOverrideMutationQueryParams;
|
|
21
|
+
body: CreateAiGovernanceOverrideRequestBody;
|
|
22
|
+
}
|
|
23
|
+
export declare function createAiGovernanceOverride(props: CreateAiGovernanceOverrideProps): Promise<CreateAiGovernanceOverrideOkResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Allows a policy approver to grant a direct budget override for a governed subject until the end of the current policy budget period. The caller must be an approver on an approval tier that covers the requested amount, and the amount must exceed the subject's current effective budget ceiling. Requires CCM Budget Create/Edit permission (ccm_budget_edit); folder-scoped roles may act only on policies in allowed folders.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useCreateAiGovernanceOverrideMutation(options?: Omit<UseMutationOptions<CreateAiGovernanceOverrideOkResponse, CreateAiGovernanceOverrideErrorResponse, CreateAiGovernanceOverrideProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<CreateAiGovernanceOverrideOkResponse, unknown, CreateAiGovernanceOverrideProps, unknown>;
|
package/dist/ccm-optimization-service/src/services/hooks/useCreateAiGovernanceOverrideMutation.js
ADDED
|
@@ -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 createAiGovernanceOverride(props) {
|
|
7
|
+
return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/policies/${props.policy_id}/override`, method: 'POST' }, props));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Allows a policy approver to grant a direct budget override for a governed subject until the end of the current policy budget period. The caller must be an approver on an approval tier that covers the requested amount, and the amount must exceed the subject's current effective budget ceiling. Requires CCM Budget Create/Edit permission (ccm_budget_edit); folder-scoped roles may act only on policies in allowed folders.
|
|
11
|
+
*/
|
|
12
|
+
export function useCreateAiGovernanceOverrideMutation(options) {
|
|
13
|
+
return useMutation((mutateProps) => createAiGovernanceOverride(mutateProps), options);
|
|
14
|
+
}
|
package/dist/ccm-optimization-service/src/services/hooks/useCreateAiGovernancePolicyMutation.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ export interface CreateAiGovernancePolicyProps extends CreateAiGovernancePolicyM
|
|
|
18
18
|
}
|
|
19
19
|
export declare function createAiGovernancePolicy(props: CreateAiGovernancePolicyProps): Promise<CreateAiGovernancePolicyOkResponse>;
|
|
20
20
|
/**
|
|
21
|
-
* Creates a governance policy from either a YAML upload (rawYaml) or a JSON policy object (policy). The persisted document is always canonical JSON with platform-assigned ruleIds. When the JSON path is used, rawYaml in the response is empty.
|
|
21
|
+
* Creates a governance policy from either a YAML upload (rawYaml) or a JSON policy object (policy). The persisted document is always canonical JSON with platform-assigned ruleIds. When the JSON path is used, rawYaml in the response is empty. Optional beginsAt on the policy (YAML or JSON) is stored in document.beginsAt; reconcile and dry-run skip evaluation until that UTC timestamp is reached. Optional folderId at the request root assigns the policy to a Harness folder for RBAC and UI organization.
|
|
22
22
|
*/
|
|
23
23
|
export declare function useCreateAiGovernancePolicyMutation(options?: Omit<UseMutationOptions<CreateAiGovernancePolicyOkResponse, CreateAiGovernancePolicyErrorResponse, CreateAiGovernancePolicyProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<CreateAiGovernancePolicyOkResponse, unknown, CreateAiGovernancePolicyProps, unknown>;
|
package/dist/ccm-optimization-service/src/services/hooks/useCreateAiGovernancePolicyMutation.js
CHANGED
|
@@ -7,7 +7,7 @@ export function createAiGovernancePolicy(props) {
|
|
|
7
7
|
return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/policies`, method: 'POST' }, props));
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Creates a governance policy from either a YAML upload (rawYaml) or a JSON policy object (policy). The persisted document is always canonical JSON with platform-assigned ruleIds. When the JSON path is used, rawYaml in the response is empty.
|
|
10
|
+
* Creates a governance policy from either a YAML upload (rawYaml) or a JSON policy object (policy). The persisted document is always canonical JSON with platform-assigned ruleIds. When the JSON path is used, rawYaml in the response is empty. Optional beginsAt on the policy (YAML or JSON) is stored in document.beginsAt; reconcile and dry-run skip evaluation until that UTC timestamp is reached. Optional folderId at the request root assigns the policy to a Harness folder for RBAC and UI organization.
|
|
11
11
|
*/
|
|
12
12
|
export function useCreateAiGovernancePolicyMutation(options) {
|
|
13
13
|
return useMutation((mutateProps) => createAiGovernancePolicy(mutateProps), options);
|
package/dist/ccm-optimization-service/src/services/hooks/useDryRunAiGovernancePolicyMutation.d.ts
CHANGED
|
@@ -24,6 +24,6 @@ export interface DryRunAiGovernancePolicyProps extends DryRunAiGovernancePolicyM
|
|
|
24
24
|
}
|
|
25
25
|
export declare function dryRunAiGovernancePolicy(props: DryRunAiGovernancePolicyProps): Promise<DryRunAiGovernancePolicyOkResponse>;
|
|
26
26
|
/**
|
|
27
|
-
* Evaluates who would be governed for the policy without persisting enforcement state. Optionally scope to one rule and/or subject.
|
|
27
|
+
* Evaluates who would be governed for the policy without persisting enforcement state. Optionally scope to one rule and/or subject. Returns empty subject outcomes when document.beginsAt is still in the future.
|
|
28
28
|
*/
|
|
29
29
|
export declare function useDryRunAiGovernancePolicyMutation(options?: Omit<UseMutationOptions<DryRunAiGovernancePolicyOkResponse, DryRunAiGovernancePolicyErrorResponse, DryRunAiGovernancePolicyProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<DryRunAiGovernancePolicyOkResponse, unknown, DryRunAiGovernancePolicyProps, unknown>;
|
package/dist/ccm-optimization-service/src/services/hooks/useDryRunAiGovernancePolicyMutation.js
CHANGED
|
@@ -7,7 +7,7 @@ export function dryRunAiGovernancePolicy(props) {
|
|
|
7
7
|
return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/policies/${props.policy_id}/dry-run`, method: 'POST' }, props));
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Evaluates who would be governed for the policy without persisting enforcement state. Optionally scope to one rule and/or subject.
|
|
10
|
+
* Evaluates who would be governed for the policy without persisting enforcement state. Optionally scope to one rule and/or subject. Returns empty subject outcomes when document.beginsAt is still in the future.
|
|
11
11
|
*/
|
|
12
12
|
export function useDryRunAiGovernancePolicyMutation(options) {
|
|
13
13
|
return useMutation((mutateProps) => dryRunAiGovernancePolicy(mutateProps), options);
|
package/dist/ccm-optimization-service/src/services/hooks/useGetAiGovernancePolicyOverviewQuery.d.ts
CHANGED
|
@@ -19,6 +19,6 @@ export interface GetAiGovernancePolicyOverviewProps extends GetAiGovernancePolic
|
|
|
19
19
|
}
|
|
20
20
|
export declare function getAiGovernancePolicyOverview(props: GetAiGovernancePolicyOverviewProps): Promise<GetAiGovernancePolicyOverviewOkResponse>;
|
|
21
21
|
/**
|
|
22
|
-
* Returns an admin overview for one governance policy including subject count, aggregate budget, health bands, cumulative spend in the current budget period, and pending budget raise requests. cumulativeSpend, spendPercent, and userHealth are null until dry-run or reconcile has seeded the per-policy stats cache for the current period; list and overview read that cache and do not query BigQuery.
|
|
22
|
+
* Returns an admin overview for one governance policy including subject count, aggregate budget, health bands, cumulative spend in the current budget period, and pending budget raise requests. cumulativeSpend, spendPercent, and userHealth are null until dry-run or reconcile has seeded the per-policy stats cache for the current period; list and overview read that cache and do not query BigQuery. Requires CCM Budget View permission (ccm_budget_view); folder-scoped roles may access only policies in allowed folders.
|
|
23
23
|
*/
|
|
24
24
|
export declare function useGetAiGovernancePolicyOverviewQuery(props: GetAiGovernancePolicyOverviewProps, options?: Omit<UseQueryOptions<GetAiGovernancePolicyOverviewOkResponse, GetAiGovernancePolicyOverviewErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetAiGovernancePolicyOverviewOkResponse, unknown>;
|
package/dist/ccm-optimization-service/src/services/hooks/useGetAiGovernancePolicyOverviewQuery.js
CHANGED
|
@@ -7,7 +7,7 @@ export function getAiGovernancePolicyOverview(props) {
|
|
|
7
7
|
return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/policies/${props.policy_id}/overview`, method: 'GET' }, props));
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Returns an admin overview for one governance policy including subject count, aggregate budget, health bands, cumulative spend in the current budget period, and pending budget raise requests. cumulativeSpend, spendPercent, and userHealth are null until dry-run or reconcile has seeded the per-policy stats cache for the current period; list and overview read that cache and do not query BigQuery.
|
|
10
|
+
* Returns an admin overview for one governance policy including subject count, aggregate budget, health bands, cumulative spend in the current budget period, and pending budget raise requests. cumulativeSpend, spendPercent, and userHealth are null until dry-run or reconcile has seeded the per-policy stats cache for the current period; list and overview read that cache and do not query BigQuery. Requires CCM Budget View permission (ccm_budget_view); folder-scoped roles may access only policies in allowed folders.
|
|
11
11
|
*/
|
|
12
12
|
export function useGetAiGovernancePolicyOverviewQuery(props, options) {
|
|
13
13
|
return useQuery(['GetAIGovernancePolicyOverview', props.account_id, props.policy_id, props.queryParams], ({ signal }) => getAiGovernancePolicyOverview(Object.assign(Object.assign({}, props), { signal })), options);
|
|
@@ -22,6 +22,6 @@ export interface ListAiGovernanceOverrideRequestsProps extends ListAiGovernanceO
|
|
|
22
22
|
}
|
|
23
23
|
export declare function listAiGovernanceOverrideRequests(props: ListAiGovernanceOverrideRequestsProps): Promise<ListAiGovernanceOverrideRequestsOkResponse>;
|
|
24
24
|
/**
|
|
25
|
-
* Returns active override requests and a paginated decision history for a governance policy. Visible only to users who are approvers on at least one approval tier of the policy. Each active request includes canApprove indicating whether the caller can act on the pending tier for the requested amount. Pagination (page/limit) applies to history; open requests are always returned in full. Optionally pass filters with field subject_id and operator equals to scope results to one governed user.
|
|
25
|
+
* Returns active override requests and a paginated decision history for a governance policy. Visible only to users who are approvers on at least one approval tier of the policy. Each active request includes canApprove indicating whether the caller can act on the pending tier for the requested amount. Pagination (page/limit) applies to history; open requests are always returned in full. Optionally pass filters with field subject_id and operator equals to scope results to one governed user. Requires CCM Budget View permission (ccm_budget_view); folder-scoped roles may access only policies in allowed folders.
|
|
26
26
|
*/
|
|
27
27
|
export declare function useListAiGovernanceOverrideRequestsMutation(options?: Omit<UseMutationOptions<ListAiGovernanceOverrideRequestsOkResponse, ListAiGovernanceOverrideRequestsErrorResponse, ListAiGovernanceOverrideRequestsProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ListAiGovernanceOverrideRequestsOkResponse, unknown, ListAiGovernanceOverrideRequestsProps, unknown>;
|
|
@@ -7,7 +7,7 @@ export function listAiGovernanceOverrideRequests(props) {
|
|
|
7
7
|
return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/policies/${props.policy_id}/override/requests`, method: 'POST' }, props));
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Returns active override requests and a paginated decision history for a governance policy. Visible only to users who are approvers on at least one approval tier of the policy. Each active request includes canApprove indicating whether the caller can act on the pending tier for the requested amount. Pagination (page/limit) applies to history; open requests are always returned in full. Optionally pass filters with field subject_id and operator equals to scope results to one governed user.
|
|
10
|
+
* Returns active override requests and a paginated decision history for a governance policy. Visible only to users who are approvers on at least one approval tier of the policy. Each active request includes canApprove indicating whether the caller can act on the pending tier for the requested amount. Pagination (page/limit) applies to history; open requests are always returned in full. Optionally pass filters with field subject_id and operator equals to scope results to one governed user. Requires CCM Budget View permission (ccm_budget_view); folder-scoped roles may access only policies in allowed folders.
|
|
11
11
|
*/
|
|
12
12
|
export function useListAiGovernanceOverrideRequestsMutation(options) {
|
|
13
13
|
return useMutation((mutateProps) => listAiGovernanceOverrideRequests(mutateProps), options);
|
package/dist/ccm-optimization-service/src/services/hooks/useListAiGovernancePoliciesMutation.d.ts
CHANGED
|
@@ -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 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.
|
|
21
|
+
* Returns a paginated list of governance policies. Each item is a flat object with persisted policy fields (id, name, folderId, 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. Use query for case-insensitive partial name search; supports filters on name, folder_id, created_at, and updated_at. Requires CCM Budget View permission (ccm_budget_view); folder-scoped roles may access only policies in allowed folders.
|
|
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>;
|
package/dist/ccm-optimization-service/src/services/hooks/useListAiGovernancePoliciesMutation.js
CHANGED
|
@@ -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 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.
|
|
10
|
+
* Returns a paginated list of governance policies. Each item is a flat object with persisted policy fields (id, name, folderId, 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. Use query for case-insensitive partial name search; supports filters on name, folder_id, created_at, and updated_at. Requires CCM Budget View permission (ccm_budget_view); folder-scoped roles may access only policies in allowed folders.
|
|
11
11
|
*/
|
|
12
12
|
export function useListAiGovernancePoliciesMutation(options) {
|
|
13
13
|
return useMutation((mutateProps) => listAiGovernancePolicies(mutateProps), options);
|
|
@@ -22,6 +22,6 @@ export interface ListAiGovernancePolicySubjectsProps extends ListAiGovernancePol
|
|
|
22
22
|
}
|
|
23
23
|
export declare function listAiGovernancePolicySubjects(props: ListAiGovernancePolicySubjectsProps): Promise<ListAiGovernancePolicySubjectsOkResponse>;
|
|
24
24
|
/**
|
|
25
|
-
* Returns a paginated admin view of subjects mapped to a governance policy. Each row includes effective budget (after active overrides), current-period spend, budget health status, and any open budget raise request.
|
|
25
|
+
* Returns a paginated admin view of subjects mapped to a governance policy. Each row includes effective budget (after active overrides), current-period spend, budget health status, and any open budget raise request. Requires CCM Budget View permission (ccm_budget_view); folder-scoped roles may access only policies in allowed folders.
|
|
26
26
|
*/
|
|
27
27
|
export declare function useListAiGovernancePolicySubjectsMutation(options?: Omit<UseMutationOptions<ListAiGovernancePolicySubjectsOkResponse, ListAiGovernancePolicySubjectsErrorResponse, ListAiGovernancePolicySubjectsProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ListAiGovernancePolicySubjectsOkResponse, unknown, ListAiGovernancePolicySubjectsProps, unknown>;
|
|
@@ -7,7 +7,7 @@ export function listAiGovernancePolicySubjects(props) {
|
|
|
7
7
|
return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/policies/${props.policy_id}/subjects`, method: 'POST' }, props));
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Returns a paginated admin view of subjects mapped to a governance policy. Each row includes effective budget (after active overrides), current-period spend, budget health status, and any open budget raise request.
|
|
10
|
+
* Returns a paginated admin view of subjects mapped to a governance policy. Each row includes effective budget (after active overrides), current-period spend, budget health status, and any open budget raise request. Requires CCM Budget View permission (ccm_budget_view); folder-scoped roles may access only policies in allowed folders.
|
|
11
11
|
*/
|
|
12
12
|
export function useListAiGovernancePolicySubjectsMutation(options) {
|
|
13
13
|
return useMutation((mutateProps) => listAiGovernancePolicySubjects(mutateProps), options);
|
package/dist/ccm-optimization-service/src/services/hooks/useListMyAiGovernanceBudgetsQuery.d.ts
CHANGED
|
@@ -5,16 +5,12 @@ import { FetcherOptions } from '../../../../fetcher/index.js';
|
|
|
5
5
|
export interface ListMyAiGovernanceBudgetsQueryPathParams {
|
|
6
6
|
account_id: string;
|
|
7
7
|
}
|
|
8
|
-
export interface ListMyAiGovernanceBudgetsQueryQueryParams {
|
|
9
|
-
accountIdentifier: string;
|
|
10
|
-
}
|
|
11
8
|
export type ListMyAiGovernanceBudgetsOkResponse = ResponseWithPagination<AiGovernanceUserBudgetsResponse>;
|
|
12
9
|
export type ListMyAiGovernanceBudgetsErrorResponse = unknown;
|
|
13
|
-
export interface ListMyAiGovernanceBudgetsProps extends ListMyAiGovernanceBudgetsQueryPathParams, Omit<FetcherOptions<
|
|
14
|
-
queryParams: ListMyAiGovernanceBudgetsQueryQueryParams;
|
|
10
|
+
export interface ListMyAiGovernanceBudgetsProps extends ListMyAiGovernanceBudgetsQueryPathParams, Omit<FetcherOptions<unknown, unknown>, 'url'> {
|
|
15
11
|
}
|
|
16
12
|
export declare function listMyAiGovernanceBudgets(props: ListMyAiGovernanceBudgetsProps): Promise<ListMyAiGovernanceBudgetsOkResponse>;
|
|
17
13
|
/**
|
|
18
|
-
* Returns budget-cap rules that govern the logged-in user, including effective ceilings
|
|
14
|
+
* Returns budget-cap rules that govern the logged-in user, including effective ceilings, current-period spend, and the graduated actions configured on each rule. Requires authentication only; governed users do not need AI governance admin RBAC.
|
|
19
15
|
*/
|
|
20
16
|
export declare function useListMyAiGovernanceBudgetsQuery(props: ListMyAiGovernanceBudgetsProps, options?: Omit<UseQueryOptions<ListMyAiGovernanceBudgetsOkResponse, ListMyAiGovernanceBudgetsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ListMyAiGovernanceBudgetsOkResponse, unknown>;
|
package/dist/ccm-optimization-service/src/services/hooks/useListMyAiGovernanceBudgetsQuery.js
CHANGED
|
@@ -7,8 +7,8 @@ export function listMyAiGovernanceBudgets(props) {
|
|
|
7
7
|
return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/me/budgets`, method: 'GET' }, props));
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Returns budget-cap rules that govern the logged-in user, including effective ceilings
|
|
10
|
+
* Returns budget-cap rules that govern the logged-in user, including effective ceilings, current-period spend, and the graduated actions configured on each rule. Requires authentication only; governed users do not need AI governance admin RBAC.
|
|
11
11
|
*/
|
|
12
12
|
export function useListMyAiGovernanceBudgetsQuery(props, options) {
|
|
13
|
-
return useQuery(['ListMyAIGovernanceBudgets', props.account_id
|
|
13
|
+
return useQuery(['ListMyAIGovernanceBudgets', props.account_id], ({ signal }) => listMyAiGovernanceBudgets(Object.assign(Object.assign({}, props), { signal })), options);
|
|
14
14
|
}
|
|
@@ -22,6 +22,6 @@ export interface ReviewAiGovernanceOverrideRequestsProps extends ReviewAiGoverna
|
|
|
22
22
|
}
|
|
23
23
|
export declare function reviewAiGovernanceOverrideRequests(props: ReviewAiGovernanceOverrideRequestsProps): Promise<ReviewAiGovernanceOverrideRequestsOkResponse>;
|
|
24
24
|
/**
|
|
25
|
-
* Applies approve or reject actions to one or more open budget override requests on a governance policy. Each item is processed independently. The caller must be eligible to act on the pending approval tier. Approve advances multi-tier requests until all required tiers sign off; optional approved_amount on approve sets the approved ceiling when the caller is authorized for that amount.
|
|
25
|
+
* Applies approve or reject actions to one or more open budget override requests on a governance policy. Each item is processed independently. The caller must be eligible to act on the pending approval tier. Approve advances multi-tier requests until all required tiers sign off; optional approved_amount on approve sets the approved ceiling when the caller is authorized for that amount. Requires CCM Budget Create/Edit permission (ccm_budget_edit); folder-scoped roles may act only on policies in allowed folders.
|
|
26
26
|
*/
|
|
27
27
|
export declare function useReviewAiGovernanceOverrideRequestsMutation(options?: Omit<UseMutationOptions<ReviewAiGovernanceOverrideRequestsOkResponse, ReviewAiGovernanceOverrideRequestsErrorResponse, ReviewAiGovernanceOverrideRequestsProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ReviewAiGovernanceOverrideRequestsOkResponse, unknown, ReviewAiGovernanceOverrideRequestsProps, unknown>;
|
|
@@ -7,7 +7,7 @@ export function reviewAiGovernanceOverrideRequests(props) {
|
|
|
7
7
|
return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/policies/${props.policy_id}/override/requests/review`, method: 'POST' }, props));
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Applies approve or reject actions to one or more open budget override requests on a governance policy. Each item is processed independently. The caller must be eligible to act on the pending approval tier. Approve advances multi-tier requests until all required tiers sign off; optional approved_amount on approve sets the approved ceiling when the caller is authorized for that amount.
|
|
10
|
+
* Applies approve or reject actions to one or more open budget override requests on a governance policy. Each item is processed independently. The caller must be eligible to act on the pending approval tier. Approve advances multi-tier requests until all required tiers sign off; optional approved_amount on approve sets the approved ceiling when the caller is authorized for that amount. Requires CCM Budget Create/Edit permission (ccm_budget_edit); folder-scoped roles may act only on policies in allowed folders.
|
|
11
11
|
*/
|
|
12
12
|
export function useReviewAiGovernanceOverrideRequestsMutation(options) {
|
|
13
13
|
return useMutation((mutateProps) => reviewAiGovernanceOverrideRequests(mutateProps), options);
|
package/dist/ccm-optimization-service/src/services/hooks/useUpdateAiGovernancePolicyMutation.d.ts
CHANGED
|
@@ -22,6 +22,6 @@ export interface UpdateAiGovernancePolicyProps extends UpdateAiGovernancePolicyM
|
|
|
22
22
|
}
|
|
23
23
|
export declare function updateAiGovernancePolicy(props: UpdateAiGovernancePolicyProps): Promise<UpdateAiGovernancePolicyOkResponse>;
|
|
24
24
|
/**
|
|
25
|
-
* Replaces policy content from either rawYaml or policy JSON while preserving stable ruleIds where rule content is unchanged. When updated via the JSON path, any previously stored rawYaml is cleared so GET never returns YAML that no longer matches document.
|
|
25
|
+
* Replaces policy content from either rawYaml or policy JSON while preserving stable ruleIds where rule content is unchanged. When updated via the JSON path, any previously stored rawYaml is cleared so GET never returns YAML that no longer matches document. Optional beginsAt is stored in document.beginsAt; omitting it clears a previously scheduled start.
|
|
26
26
|
*/
|
|
27
27
|
export declare function useUpdateAiGovernancePolicyMutation(options?: Omit<UseMutationOptions<UpdateAiGovernancePolicyOkResponse, UpdateAiGovernancePolicyErrorResponse, UpdateAiGovernancePolicyProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<UpdateAiGovernancePolicyOkResponse, unknown, UpdateAiGovernancePolicyProps, unknown>;
|
package/dist/ccm-optimization-service/src/services/hooks/useUpdateAiGovernancePolicyMutation.js
CHANGED
|
@@ -7,7 +7,7 @@ export function updateAiGovernancePolicy(props) {
|
|
|
7
7
|
return fetcher(Object.assign({ url: `/accounts/${props.account_id}/ai-governance/policies/${props.policy_id}`, method: 'PUT' }, props));
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Replaces policy content from either rawYaml or policy JSON while preserving stable ruleIds where rule content is unchanged. When updated via the JSON path, any previously stored rawYaml is cleared so GET never returns YAML that no longer matches document.
|
|
10
|
+
* Replaces policy content from either rawYaml or policy JSON while preserving stable ruleIds where rule content is unchanged. When updated via the JSON path, any previously stored rawYaml is cleared so GET never returns YAML that no longer matches document. Optional beginsAt is stored in document.beginsAt; omitting it clears a previously scheduled start.
|
|
11
11
|
*/
|
|
12
12
|
export function useUpdateAiGovernancePolicyMutation(options) {
|
|
13
13
|
return useMutation((mutateProps) => updateAiGovernancePolicy(mutateProps), options);
|
|
@@ -43,6 +43,8 @@ export type { CoolDownAutostoppingRuleErrorResponse, CoolDownAutostoppingRuleMut
|
|
|
43
43
|
export { coolDownAutostoppingRule, useCoolDownAutostoppingRuleMutation, } from './hooks/useCoolDownAutostoppingRuleMutation';
|
|
44
44
|
export type { CreateAccessPointErrorResponse, CreateAccessPointMutationPathParams, CreateAccessPointMutationQueryParams, CreateAccessPointOkResponse, CreateAccessPointProps, CreateAccessPointRequestBody, } from './hooks/useCreateAccessPointMutation';
|
|
45
45
|
export { createAccessPoint, useCreateAccessPointMutation, } from './hooks/useCreateAccessPointMutation';
|
|
46
|
+
export type { CreateAiGovernanceOverrideErrorResponse, CreateAiGovernanceOverrideMutationPathParams, CreateAiGovernanceOverrideMutationQueryParams, CreateAiGovernanceOverrideOkResponse, CreateAiGovernanceOverrideProps, CreateAiGovernanceOverrideRequestBody, } from './hooks/useCreateAiGovernanceOverrideMutation';
|
|
47
|
+
export { createAiGovernanceOverride, useCreateAiGovernanceOverrideMutation, } from './hooks/useCreateAiGovernanceOverrideMutation';
|
|
46
48
|
export type { CreateAiGovernancePolicyErrorResponse, CreateAiGovernancePolicyMutationPathParams, CreateAiGovernancePolicyMutationQueryParams, CreateAiGovernancePolicyOkResponse, CreateAiGovernancePolicyProps, CreateAiGovernancePolicyRequestBody, } from './hooks/useCreateAiGovernancePolicyMutation';
|
|
47
49
|
export { createAiGovernancePolicy, useCreateAiGovernancePolicyMutation, } from './hooks/useCreateAiGovernancePolicyMutation';
|
|
48
50
|
export type { CreateAlertErrorResponse, CreateAlertMutationPathParams, CreateAlertMutationQueryParams, CreateAlertOkResponse, CreateAlertProps, CreateAlertRequestBody, } from './hooks/useCreateAlertMutation';
|
|
@@ -267,7 +269,7 @@ export type { ListClusterRecommendationsErrorResponse, ListClusterRecommendation
|
|
|
267
269
|
export { listClusterRecommendations, useListClusterRecommendationsQuery, } from './hooks/useListClusterRecommendationsQuery';
|
|
268
270
|
export type { ListDistinctK8sConnIdsForRecommendationsErrorResponse, ListDistinctK8sConnIdsForRecommendationsOkResponse, ListDistinctK8sConnIdsForRecommendationsProps, ListDistinctK8sConnIdsForRecommendationsQueryPathParams, ListDistinctK8sConnIdsForRecommendationsQueryQueryParams, } from './hooks/useListDistinctK8sConnIdsForRecommendationsQuery';
|
|
269
271
|
export { listDistinctK8sConnIdsForRecommendations, useListDistinctK8sConnIdsForRecommendationsQuery, } from './hooks/useListDistinctK8sConnIdsForRecommendationsQuery';
|
|
270
|
-
export type { ListMyAiGovernanceBudgetsErrorResponse, ListMyAiGovernanceBudgetsOkResponse, ListMyAiGovernanceBudgetsProps, ListMyAiGovernanceBudgetsQueryPathParams,
|
|
272
|
+
export type { ListMyAiGovernanceBudgetsErrorResponse, ListMyAiGovernanceBudgetsOkResponse, ListMyAiGovernanceBudgetsProps, ListMyAiGovernanceBudgetsQueryPathParams, } from './hooks/useListMyAiGovernanceBudgetsQuery';
|
|
271
273
|
export { listMyAiGovernanceBudgets, useListMyAiGovernanceBudgetsQuery, } from './hooks/useListMyAiGovernanceBudgetsQuery';
|
|
272
274
|
export type { ListMyAiGovernanceOverrideRequestsErrorResponse, ListMyAiGovernanceOverrideRequestsMutationPathParams, ListMyAiGovernanceOverrideRequestsMutationQueryParams, ListMyAiGovernanceOverrideRequestsOkResponse, ListMyAiGovernanceOverrideRequestsProps, ListMyAiGovernanceOverrideRequestsRequestBody, } from './hooks/useListMyAiGovernanceOverrideRequestsMutation';
|
|
273
275
|
export { listMyAiGovernanceOverrideRequests, useListMyAiGovernanceOverrideRequestsMutation, } from './hooks/useListMyAiGovernanceOverrideRequestsMutation';
|
|
@@ -365,7 +367,10 @@ export type { AiGovernanceApprovalRequest } from './schemas/AiGovernanceApproval
|
|
|
365
367
|
export type { AiGovernanceApprovalRequestList } from './schemas/AiGovernanceApprovalRequestList';
|
|
366
368
|
export type { AiGovernanceApprovalRequestListResponse } from './schemas/AiGovernanceApprovalRequestListResponse';
|
|
367
369
|
export type { AiGovernanceApprovalRequestView } from './schemas/AiGovernanceApprovalRequestView';
|
|
370
|
+
export type { AiGovernanceBudgetAction } from './schemas/AiGovernanceBudgetAction';
|
|
371
|
+
export type { AiGovernanceBudgetActionWhen } from './schemas/AiGovernanceBudgetActionWhen';
|
|
368
372
|
export type { AiGovernanceConnectorRef } from './schemas/AiGovernanceConnectorRef';
|
|
373
|
+
export type { AiGovernanceCreateOverrideRequest } from './schemas/AiGovernanceCreateOverrideRequest';
|
|
369
374
|
export type { AiGovernanceDryRunResponse } from './schemas/AiGovernanceDryRunResponse';
|
|
370
375
|
export type { AiGovernanceDryRunResult } from './schemas/AiGovernanceDryRunResult';
|
|
371
376
|
export type { AiGovernanceDryRunRuleResult } from './schemas/AiGovernanceDryRunRuleResult';
|
|
@@ -399,6 +404,8 @@ export type { AiGovernanceReviewOverridesRequest } from './schemas/AiGovernanceR
|
|
|
399
404
|
export type { AiGovernanceReviewOverridesResponse } from './schemas/AiGovernanceReviewOverridesResponse';
|
|
400
405
|
export type { AiGovernanceReviewOverridesResult } from './schemas/AiGovernanceReviewOverridesResult';
|
|
401
406
|
export type { AiGovernanceRuleBudget } from './schemas/AiGovernanceRuleBudget';
|
|
407
|
+
export type { AiGovernanceRuleOverride } from './schemas/AiGovernanceRuleOverride';
|
|
408
|
+
export type { AiGovernanceRuleOverrideResponse } from './schemas/AiGovernanceRuleOverrideResponse';
|
|
402
409
|
export type { AiGovernanceSubjects } from './schemas/AiGovernanceSubjects';
|
|
403
410
|
export type { AiGovernanceUserBudgetOverview } from './schemas/AiGovernanceUserBudgetOverview';
|
|
404
411
|
export type { AiGovernanceUserBudgetOverviewResponse } from './schemas/AiGovernanceUserBudgetOverviewResponse';
|
|
@@ -20,6 +20,7 @@ export { configureClusterOrchestrator, useConfigureClusterOrchestratorMutation,
|
|
|
20
20
|
export { configureClusterOrchestratorWorkloads, useConfigureClusterOrchestratorWorkloadsMutation, } from './hooks/useConfigureClusterOrchestratorWorkloadsMutation';
|
|
21
21
|
export { coolDownAutostoppingRule, useCoolDownAutostoppingRuleMutation, } from './hooks/useCoolDownAutostoppingRuleMutation';
|
|
22
22
|
export { createAccessPoint, useCreateAccessPointMutation, } from './hooks/useCreateAccessPointMutation';
|
|
23
|
+
export { createAiGovernanceOverride, useCreateAiGovernanceOverrideMutation, } from './hooks/useCreateAiGovernanceOverrideMutation';
|
|
23
24
|
export { createAiGovernancePolicy, useCreateAiGovernancePolicyMutation, } from './hooks/useCreateAiGovernancePolicyMutation';
|
|
24
25
|
export { createAlert, useCreateAlertMutation } from './hooks/useCreateAlertMutation';
|
|
25
26
|
export { createClusterOrchestrator, useCreateClusterOrchestratorMutation, } from './hooks/useCreateClusterOrchestratorMutation';
|
|
@@ -19,14 +19,6 @@ export interface AiGovernanceApprovalRequest {
|
|
|
19
19
|
* @format uuid
|
|
20
20
|
*/
|
|
21
21
|
id: string;
|
|
22
|
-
/**
|
|
23
|
-
* Index into tiersRequired for the tier awaiting action
|
|
24
|
-
*/
|
|
25
|
-
pendingTierIndex: number;
|
|
26
|
-
/**
|
|
27
|
-
* @format date-time
|
|
28
|
-
*/
|
|
29
|
-
periodStart: string;
|
|
30
22
|
/**
|
|
31
23
|
* @format uuid
|
|
32
24
|
*/
|
|
@@ -37,28 +29,10 @@ export interface AiGovernanceApprovalRequest {
|
|
|
37
29
|
* Requested budget ceiling raise in USD dollars
|
|
38
30
|
*/
|
|
39
31
|
requestedAmount: number;
|
|
40
|
-
requestedBy: string;
|
|
41
32
|
status: 'approved' | 'deferred' | 'error' | 'expired' | 'pending' | 'rejected';
|
|
42
33
|
subjectId: string;
|
|
43
|
-
/**
|
|
44
|
-
* Per-tier approval records as requests progress through multi-tier approval
|
|
45
|
-
*/
|
|
46
|
-
tierApprovals: Array<{
|
|
47
|
-
[key: string]: any;
|
|
48
|
-
}>;
|
|
49
|
-
/**
|
|
50
|
-
* Approval tiers required for this request, snapshotted at submission time
|
|
51
|
-
*/
|
|
52
|
-
tiersRequired: Array<{
|
|
53
|
-
[key: string]: any;
|
|
54
|
-
}>;
|
|
55
34
|
/**
|
|
56
35
|
* @format date-time
|
|
57
36
|
*/
|
|
58
37
|
updatedAt: string;
|
|
59
|
-
/**
|
|
60
|
-
* Override validity end; set on final approval to the end of the current budget period
|
|
61
|
-
* @format date-time
|
|
62
|
-
*/
|
|
63
|
-
validUntil?: string;
|
|
64
38
|
}
|
package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceApprovalRequestView.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AiGovernanceApprovalRequest } from '../schemas/AiGovernanceApprovalRequest';
|
|
2
2
|
export interface AiGovernanceApprovalRequestView extends AiGovernanceApprovalRequest {
|
|
3
3
|
/**
|
|
4
|
-
* True when the caller
|
|
4
|
+
* True when the caller is an approver on a required tier for the requested amount
|
|
5
5
|
*/
|
|
6
6
|
canApprove: boolean;
|
|
7
7
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AiGovernanceBudgetActionWhen } from '../schemas/AiGovernanceBudgetActionWhen';
|
|
2
|
+
/**
|
|
3
|
+
* Graduated response triggered when spend crosses a threshold during the budget period
|
|
4
|
+
*/
|
|
5
|
+
export interface AiGovernanceBudgetAction {
|
|
6
|
+
/**
|
|
7
|
+
* Notification channels when do is notify (e.g. email, slack)
|
|
8
|
+
*/
|
|
9
|
+
channels?: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Notify delivery mode when do is notify
|
|
12
|
+
*/
|
|
13
|
+
delivery?: 'digest' | 'immediate';
|
|
14
|
+
/**
|
|
15
|
+
* Response to apply when the threshold is reached
|
|
16
|
+
*/
|
|
17
|
+
do: 'block-user' | 'notify' | 'remove-premium-models';
|
|
18
|
+
/**
|
|
19
|
+
* When true, block-level notify actions include instructions for requesting a budget raise
|
|
20
|
+
*/
|
|
21
|
+
includeRecoveryInstructions?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Model globs affected when do is remove-premium-models
|
|
24
|
+
*/
|
|
25
|
+
models?: string[];
|
|
26
|
+
when: AiGovernanceBudgetActionWhen;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,10 +3,6 @@ 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;
|
|
10
6
|
/**
|
|
11
7
|
* AI provider identifier
|
|
12
8
|
*/
|
package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceDryRunRuleResult.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { AiGovernanceConnectorRef } from '../schemas/AiGovernanceConnectorRef';
|
|
2
2
|
import type { AiGovernanceDryRunSubject } from '../schemas/AiGovernanceDryRunSubject';
|
|
3
3
|
export interface AiGovernanceDryRunRuleResult {
|
|
4
|
-
|
|
5
|
-
resolvedConnectors: AiGovernanceConnectorRef[];
|
|
4
|
+
connectors: AiGovernanceConnectorRef[];
|
|
6
5
|
/**
|
|
7
6
|
* @format uuid
|
|
8
7
|
*/
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export interface AiGovernanceDryRunSubject {
|
|
2
|
-
/**
|
|
3
|
-
* Effective budget ceiling in USD dollars
|
|
4
|
-
*/
|
|
5
2
|
ceilingDollars?: number;
|
|
6
3
|
disallowedModels?: string[];
|
|
7
4
|
/**
|
|
@@ -15,9 +12,6 @@ export interface AiGovernanceDryRunSubject {
|
|
|
15
12
|
modelsUsed?: string[];
|
|
16
13
|
reason?: string;
|
|
17
14
|
skippedForRuleType?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Current-period spend in USD dollars
|
|
20
|
-
*/
|
|
21
15
|
spendDollars?: number;
|
|
22
16
|
subject: {
|
|
23
17
|
email?: string;
|
package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceGovernancePeriod.d.ts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Budget period window used for spend attribution
|
|
2
|
+
* Budget period window used for spend attribution on a rule
|
|
3
3
|
*/
|
|
4
4
|
export interface AiGovernanceGovernancePeriod {
|
|
5
5
|
/**
|
|
6
|
-
* Budget period label
|
|
6
|
+
* Budget period label, e.g. monthly, weekly, quarterly
|
|
7
7
|
*/
|
|
8
|
-
Period
|
|
9
|
-
Range
|
|
8
|
+
Period?: string;
|
|
9
|
+
Range?: {
|
|
10
10
|
/**
|
|
11
|
-
* UTC end of the governance period window (typically the evaluation anchor time)
|
|
12
11
|
* @format date-time
|
|
13
12
|
*/
|
|
14
|
-
End
|
|
13
|
+
End?: string;
|
|
15
14
|
/**
|
|
16
|
-
* Inclusive UTC start of the governance period window
|
|
17
15
|
* @format date-time
|
|
18
16
|
*/
|
|
19
|
-
Start
|
|
17
|
+
Start?: string;
|
|
20
18
|
};
|
|
21
19
|
}
|
|
@@ -7,6 +7,10 @@ export interface AiGovernancePolicy {
|
|
|
7
7
|
createdAt?: string;
|
|
8
8
|
createdBy?: string;
|
|
9
9
|
document?: AiGovernancePolicyDocument;
|
|
10
|
+
/**
|
|
11
|
+
* Harness folder identifier when the policy is assigned to a folder. Omitted when unset.
|
|
12
|
+
*/
|
|
13
|
+
folderId?: string;
|
|
10
14
|
/**
|
|
11
15
|
* @format uuid
|
|
12
16
|
*/
|
|
@@ -2,7 +2,13 @@ import type { AiGovernancePolicySpec } from '../schemas/AiGovernancePolicySpec';
|
|
|
2
2
|
import type { AiGovernanceSubjects } from '../schemas/AiGovernanceSubjects';
|
|
3
3
|
export interface AiGovernancePolicyAuthoring {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Optional UTC timestamp before which policy evaluation is skipped. Omitted means the policy is active immediately.
|
|
6
|
+
* @format date-time
|
|
7
|
+
* @example "2026-09-01T00:00:00Z"
|
|
8
|
+
*/
|
|
9
|
+
beginsAt?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Human-readable policy name; must start with a letter and contain only letters, digits, spaces, and hyphens
|
|
6
12
|
*/
|
|
7
13
|
name: string;
|
|
8
14
|
spec: AiGovernancePolicySpec;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { AiGovernancePolicySpec } from '../schemas/AiGovernancePolicySpec';
|
|
2
2
|
import type { AiGovernanceSubjects } from '../schemas/AiGovernanceSubjects';
|
|
3
3
|
export interface AiGovernancePolicyDocument {
|
|
4
|
+
/**
|
|
5
|
+
* Optional UTC timestamp before which policy evaluation is skipped. Omitted means the policy is active immediately.
|
|
6
|
+
* @format date-time
|
|
7
|
+
* @example "2026-09-01T00:00:00Z"
|
|
8
|
+
*/
|
|
9
|
+
beginsAt?: string;
|
|
4
10
|
spec?: AiGovernancePolicySpec;
|
|
5
11
|
subjects?: AiGovernanceSubjects;
|
|
6
12
|
}
|
|
@@ -8,6 +8,10 @@ export interface AiGovernancePolicyListItem extends AiGovernancePolicyOverviewMe
|
|
|
8
8
|
createdAt?: string;
|
|
9
9
|
createdBy?: string;
|
|
10
10
|
document?: AiGovernancePolicyDocument;
|
|
11
|
+
/**
|
|
12
|
+
* Harness folder identifier when the policy is assigned to a folder. Omitted when unset.
|
|
13
|
+
*/
|
|
14
|
+
folderId?: string;
|
|
11
15
|
/**
|
|
12
16
|
* @format uuid
|
|
13
17
|
*/
|
package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyListRequest.d.ts
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pagination request for listing governance policies
|
|
2
|
+
* Pagination request for listing governance policies. Use query for free-text name search; use filters for exact or structured criteria.
|
|
3
3
|
*/
|
|
4
4
|
export interface AiGovernancePolicyListRequest {
|
|
5
|
+
/**
|
|
6
|
+
* Optional filters; supports name, folder_id, created_at, and updated_at with standard operators (equals, not_equals, greater_than, greater_than_or_equals, less_than, less_than_or_equals)
|
|
7
|
+
* @example [{"field":"folder_id","operator":"equals","values":["folder-abc123"]}]
|
|
8
|
+
*/
|
|
5
9
|
filters?: Array<{
|
|
6
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Database column to filter on. Use folder_id (snake_case) to scope policies to a Harness folder.
|
|
12
|
+
*/
|
|
13
|
+
field?: 'created_at' | 'folder_id' | 'name' | 'updated_at';
|
|
14
|
+
/**
|
|
15
|
+
* Multiple fields to filter with OR clause (higher priority than single field)
|
|
16
|
+
*/
|
|
17
|
+
fields?: Array<'created_at' | 'folder_id' | 'name' | 'updated_at'>;
|
|
18
|
+
/**
|
|
19
|
+
* Filter operator
|
|
20
|
+
*/
|
|
21
|
+
operator?: 'equals' | 'greater_than' | 'greater_than_or_equals' | 'less_than' | 'less_than_or_equals' | 'not_equals';
|
|
22
|
+
/**
|
|
23
|
+
* Values to match against the selected field
|
|
24
|
+
*/
|
|
25
|
+
values?: string[];
|
|
7
26
|
}>;
|
|
8
27
|
/**
|
|
9
28
|
* Number of records per page (max 100)
|
|
@@ -17,6 +36,11 @@ export interface AiGovernancePolicyListRequest {
|
|
|
17
36
|
* @example 1
|
|
18
37
|
*/
|
|
19
38
|
page?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Search query to filter policies by name (case-insensitive partial match)
|
|
41
|
+
* @example "production"
|
|
42
|
+
*/
|
|
43
|
+
query?: string;
|
|
20
44
|
/**
|
|
21
45
|
* Sorting options
|
|
22
46
|
*/
|
package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyOverviewMetrics.d.ts
CHANGED
|
@@ -1,15 +1,30 @@
|
|
|
1
|
-
import type { AiGovernanceGovernancePeriod } from '../schemas/AiGovernanceGovernancePeriod';
|
|
2
1
|
import type { AiGovernancePolicyUserHealth } from '../schemas/AiGovernancePolicyUserHealth';
|
|
3
2
|
/**
|
|
4
3
|
* 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.
|
|
5
4
|
*/
|
|
6
5
|
export interface AiGovernancePolicyOverviewMetrics {
|
|
6
|
+
/**
|
|
7
|
+
* Number of mapped subjects with an active block-user enforcement action
|
|
8
|
+
*/
|
|
9
|
+
blockedCount: number;
|
|
7
10
|
/**
|
|
8
11
|
* Null until dry-run or reconcile has seeded the per-policy stats cache for the current period
|
|
9
12
|
*/
|
|
10
13
|
cumulativeSpend?: number | null;
|
|
11
14
|
pendingRequestsCount: number;
|
|
12
|
-
period
|
|
15
|
+
period?: {
|
|
16
|
+
period?: string;
|
|
17
|
+
range?: {
|
|
18
|
+
/**
|
|
19
|
+
* @format date-time
|
|
20
|
+
*/
|
|
21
|
+
end?: string;
|
|
22
|
+
/**
|
|
23
|
+
* @format date-time
|
|
24
|
+
*/
|
|
25
|
+
start?: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
13
28
|
/**
|
|
14
29
|
* 1-indexed day within the current budget period
|
|
15
30
|
*/
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
+
import type { AiGovernanceBudgetAction } from '../schemas/AiGovernanceBudgetAction';
|
|
1
2
|
/**
|
|
2
3
|
* Typed constraint payload for a policy. Only type=budget-cap is currently supported.
|
|
3
4
|
*/
|
|
4
5
|
export interface AiGovernancePolicySpec {
|
|
5
6
|
/**
|
|
6
|
-
* Graduated responses triggered at ascending spend thresholds. Actions determine enforcement behavior; there is no separate enforcement strategy field.
|
|
7
|
+
* Graduated responses triggered at ascending spend thresholds. Actions determine enforcement behavior; there is no separate enforcement strategy field. When omitted on create, the platform default is block-user at 100%.
|
|
7
8
|
*/
|
|
8
|
-
actions?:
|
|
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
|
-
}>;
|
|
9
|
+
actions?: AiGovernanceBudgetAction[];
|
|
19
10
|
/**
|
|
20
11
|
* Overall budget ceiling. Required unless every entry in providers sets its own amount.
|
|
21
12
|
*/
|
|
@@ -25,12 +16,10 @@ export interface AiGovernancePolicySpec {
|
|
|
25
16
|
*/
|
|
26
17
|
approvals?: Array<{
|
|
27
18
|
approvers: {
|
|
19
|
+
auto?: boolean;
|
|
28
20
|
emails?: string[];
|
|
29
21
|
userGroups?: string[];
|
|
30
22
|
};
|
|
31
|
-
autoApproveWhen?: {
|
|
32
|
-
maxPremiumSpendPercent?: number;
|
|
33
|
-
};
|
|
34
23
|
upToAmount: number;
|
|
35
24
|
}>;
|
|
36
25
|
/**
|
package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicySubjectRow.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { AiGovernanceApprovalRequestView } from '../schemas/AiGovernanceApprovalRequestView';
|
|
2
2
|
export interface AiGovernancePolicySubjectRow {
|
|
3
|
+
/**
|
|
4
|
+
* True when the subject has an active block-user enforcement action
|
|
5
|
+
*/
|
|
6
|
+
blocked: boolean;
|
|
3
7
|
/**
|
|
4
8
|
* Effective budget ceiling after active overrides
|
|
5
9
|
*/
|
package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicySubjectsRequest.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface AiGovernancePolicySubjectsRequest {
|
|
5
5
|
/**
|
|
6
|
-
* all returns every mapped subject; pending_requests returns only subjects with an open budget raise request
|
|
6
|
+
* all returns every mapped subject; pending_requests returns only subjects with an open budget raise request; blocked returns only subjects with an active block-user enforcement action
|
|
7
7
|
* @default "all"
|
|
8
8
|
*/
|
|
9
|
-
filter?: 'all' | 'pending_requests';
|
|
9
|
+
filter?: 'all' | 'blocked' | 'pending_requests';
|
|
10
10
|
/**
|
|
11
11
|
* Number of records per page (max 100)
|
|
12
12
|
* @default 10
|
package/dist/ccm-optimization-service/src/services/schemas/AiGovernancePolicyUpsertRequest.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import type { AiGovernancePolicyAuthoring } from '../schemas/AiGovernancePolicyAuthoring';
|
|
2
|
-
|
|
3
|
-
* Provide either rawYaml or policy (not both required in schema, but one must be supplied at runtime).
|
|
4
|
-
*/
|
|
5
|
-
export interface AiGovernancePolicyUpsertRequest {
|
|
6
|
-
policy?: AiGovernancePolicyAuthoring;
|
|
2
|
+
export type AiGovernancePolicyUpsertRequest = {
|
|
7
3
|
/**
|
|
8
|
-
*
|
|
4
|
+
* Optional Harness folder identifier for RBAC scoping and UI organization. Stored as a table column; not part of the policy document.
|
|
9
5
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
folderId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Full governance policy YAML document with exactly one policy entry containing optional beginsAt, subjects, and spec
|
|
9
|
+
*/
|
|
10
|
+
rawYaml: string;
|
|
11
|
+
} & {
|
|
12
|
+
/**
|
|
13
|
+
* Optional Harness folder identifier for RBAC scoping and UI organization. Stored as a table column; not part of the policy document.
|
|
14
|
+
*/
|
|
15
|
+
folderId?: string;
|
|
16
|
+
policy: AiGovernancePolicyAuthoring;
|
|
17
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface AiGovernanceRuleOverride {
|
|
2
|
+
/**
|
|
3
|
+
* @format uuid
|
|
4
|
+
*/
|
|
5
|
+
approvalRequestId?: string;
|
|
6
|
+
/**
|
|
7
|
+
* @format date-time
|
|
8
|
+
*/
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
createdBy?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @format date-time
|
|
13
|
+
*/
|
|
14
|
+
expiresAt?: string;
|
|
15
|
+
/**
|
|
16
|
+
* @format uuid
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
payload?: {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @format uuid
|
|
24
|
+
*/
|
|
25
|
+
policyId: string;
|
|
26
|
+
/**
|
|
27
|
+
* @format uuid
|
|
28
|
+
*/
|
|
29
|
+
ruleId: string;
|
|
30
|
+
source: 'approved' | 'self-service';
|
|
31
|
+
subjectId: string;
|
|
32
|
+
/**
|
|
33
|
+
* @format date-time
|
|
34
|
+
*/
|
|
35
|
+
updatedAt?: string;
|
|
36
|
+
}
|
package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceRuleOverrideResponse.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AiGovernanceRuleOverride } from '../schemas/AiGovernanceRuleOverride';
|
|
2
|
+
export interface AiGovernanceRuleOverrideResponse {
|
|
3
|
+
code?: string;
|
|
4
|
+
errors?: string[];
|
|
5
|
+
response?: AiGovernanceRuleOverride;
|
|
6
|
+
success?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Unix milliseconds timestamp
|
|
9
|
+
* @format int64
|
|
10
|
+
*/
|
|
11
|
+
ts?: number;
|
|
12
|
+
}
|
package/dist/ccm-optimization-service/src/services/schemas/AiGovernanceRuleOverrideResponse.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
+
import type { AiGovernanceBudgetAction } from '../schemas/AiGovernanceBudgetAction';
|
|
1
2
|
import type { AiGovernanceConnectorRef } from '../schemas/AiGovernanceConnectorRef';
|
|
2
3
|
export interface AiGovernanceUserBudgetRow {
|
|
3
4
|
/**
|
|
4
|
-
* Graduated
|
|
5
|
+
* Graduated responses configured on the budget-cap rule, in ascending threshold order
|
|
5
6
|
*/
|
|
6
|
-
actions
|
|
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
|
-
}>;
|
|
7
|
+
actions: AiGovernanceBudgetAction[];
|
|
17
8
|
/**
|
|
18
9
|
* Budget ceiling from policy YAML, in USD dollars
|
|
19
10
|
*/
|
|
20
11
|
authoredAmount: number;
|
|
21
|
-
|
|
12
|
+
connectors: AiGovernanceConnectorRef[];
|
|
22
13
|
/**
|
|
23
|
-
* Effective ceiling after active overrides
|
|
14
|
+
* Effective ceiling after active overrides (same as authored until Phase 1b overrides land)
|
|
24
15
|
*/
|
|
25
16
|
effectiveAmount: number;
|
|
26
17
|
mode: 'per-subject' | 'pooled';
|
|
@@ -40,7 +31,6 @@ export interface AiGovernanceUserBudgetRow {
|
|
|
40
31
|
*/
|
|
41
32
|
policyId: string;
|
|
42
33
|
policyName: string;
|
|
43
|
-
resolvedConnectors: AiGovernanceConnectorRef[];
|
|
44
34
|
/**
|
|
45
35
|
* @format uuid
|
|
46
36
|
*/
|
|
@@ -50,7 +40,7 @@ export interface AiGovernanceUserBudgetRow {
|
|
|
50
40
|
*/
|
|
51
41
|
spendDollars: number;
|
|
52
42
|
/**
|
|
53
|
-
* Spend as a percentage of the effective ceiling
|
|
43
|
+
* Spend as a percentage of the effective ceiling
|
|
54
44
|
*/
|
|
55
45
|
spendPercent?: number;
|
|
56
46
|
/**
|
package/package.json
CHANGED