@harnessio/react-ccm-service-client 0.4.5 → 0.4.6

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.
@@ -0,0 +1,21 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { BusinessMappingValidationResponseDto } from '../schemas/BusinessMappingValidationResponseDto';
3
+ import type { Error } from '../schemas/Error';
4
+ import type { BusinessMappingValidationRequestDto } from '../schemas/BusinessMappingValidationRequestDto';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface ValidateOverlapInCostCategoryMutationQueryParams {
8
+ accountIdentifier?: string;
9
+ }
10
+ export type ValidateOverlapInCostCategoryRequestBody = BusinessMappingValidationRequestDto;
11
+ export type ValidateOverlapInCostCategoryOkResponse = ResponseWithPagination<BusinessMappingValidationResponseDto>;
12
+ export type ValidateOverlapInCostCategoryErrorResponse = unknown | Error;
13
+ export interface ValidateOverlapInCostCategoryProps extends Omit<FetcherOptions<ValidateOverlapInCostCategoryMutationQueryParams, ValidateOverlapInCostCategoryRequestBody>, 'url'> {
14
+ queryParams: ValidateOverlapInCostCategoryMutationQueryParams;
15
+ body: ValidateOverlapInCostCategoryRequestBody;
16
+ }
17
+ export declare function validateOverlapInCostCategory(props: ValidateOverlapInCostCategoryProps): Promise<ValidateOverlapInCostCategoryOkResponse>;
18
+ /**
19
+ * Detect overlapping cost-bucket rules on an already-saved Cost Category over a window of billing data, defaulting to the last 30 days when startTime and endTime are omitted. The window must be at most 31 days. Persists per-bucket cost, row count, and overlapping cost, and marks overlapValidationState as COMPLETE on success or FAILED on failure.
20
+ */
21
+ export declare function useValidateOverlapInCostCategoryMutation(options?: Omit<UseMutationOptions<ValidateOverlapInCostCategoryOkResponse, ValidateOverlapInCostCategoryErrorResponse, ValidateOverlapInCostCategoryProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ValidateOverlapInCostCategoryOkResponse, unknown, ValidateOverlapInCostCategoryProps, 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 validateOverlapInCostCategory(props) {
7
+ return fetcher(Object.assign({ url: `/business-mapping/validate-overlap`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Detect overlapping cost-bucket rules on an already-saved Cost Category over a window of billing data, defaulting to the last 30 days when startTime and endTime are omitted. The window must be at most 31 days. Persists per-bucket cost, row count, and overlapping cost, and marks overlapValidationState as COMPLETE on success or FAILED on failure.
11
+ */
12
+ export function useValidateOverlapInCostCategoryMutation(options) {
13
+ return useMutation((mutateProps) => validateOverlapInCostCategory(mutateProps), options);
14
+ }
@@ -537,6 +537,8 @@ export type { UpsertJiraFieldMappingErrorResponse, UpsertJiraFieldMappingMutatio
537
537
  export { upsertJiraFieldMapping, useUpsertJiraFieldMappingMutation, } from './hooks/useUpsertJiraFieldMappingMutation';
538
538
  export type { ValidateGovernanceRuleErrorResponse, ValidateGovernanceRuleMutationQueryParams, ValidateGovernanceRuleOkResponse, ValidateGovernanceRuleProps, ValidateGovernanceRuleRequestBody, } from './hooks/useValidateGovernanceRuleMutation';
539
539
  export { useValidateGovernanceRuleMutation, validateGovernanceRule, } from './hooks/useValidateGovernanceRuleMutation';
540
+ export type { ValidateOverlapInCostCategoryErrorResponse, ValidateOverlapInCostCategoryMutationQueryParams, ValidateOverlapInCostCategoryOkResponse, ValidateOverlapInCostCategoryProps, ValidateOverlapInCostCategoryRequestBody, } from './hooks/useValidateOverlapInCostCategoryMutation';
541
+ export { useValidateOverlapInCostCategoryMutation, validateOverlapInCostCategory, } from './hooks/useValidateOverlapInCostCategoryMutation';
540
542
  export type { WorkloadRecommendationDetailErrorResponse, WorkloadRecommendationDetailOkResponse, WorkloadRecommendationDetailProps, WorkloadRecommendationDetailQueryQueryParams, } from './hooks/useWorkloadRecommendationDetailQuery';
541
543
  export { useWorkloadRecommendationDetailQuery, workloadRecommendationDetail, } from './hooks/useWorkloadRecommendationDetailQuery';
542
544
  export type { AccountScopedPreference } from './schemas/AccountScopedPreference';
@@ -588,6 +590,8 @@ export type { BudgetScope } from './schemas/BudgetScope';
588
590
  export type { BudgetSummary } from './schemas/BudgetSummary';
589
591
  export type { BusinessMapping } from './schemas/BusinessMapping';
590
592
  export type { BusinessMappingListDto } from './schemas/BusinessMappingListDto';
593
+ export type { BusinessMappingValidationRequestDto } from './schemas/BusinessMappingValidationRequestDto';
594
+ export type { BusinessMappingValidationResponseDto } from './schemas/BusinessMappingValidationResponseDto';
591
595
  export type { CcmAggregation } from './schemas/CcmAggregation';
592
596
  export type { CcmBudgetFilterProperties } from './schemas/CcmBudgetFilterProperties';
593
597
  export type { CcmCloudAccount } from './schemas/CcmCloudAccount';
@@ -267,4 +267,5 @@ export { updateRuleSet, useUpdateRuleSetMutation } from './hooks/useUpdateRuleSe
267
267
  export { updateUnitMetric, useUpdateUnitMetricMutation } from './hooks/useUpdateUnitMetricMutation';
268
268
  export { upsertJiraFieldMapping, useUpsertJiraFieldMappingMutation, } from './hooks/useUpsertJiraFieldMappingMutation';
269
269
  export { useValidateGovernanceRuleMutation, validateGovernanceRule, } from './hooks/useValidateGovernanceRuleMutation';
270
+ export { useValidateOverlapInCostCategoryMutation, validateOverlapInCostCategory, } from './hooks/useValidateOverlapInCostCategoryMutation';
270
271
  export { useWorkloadRecommendationDetailQuery, workloadRecommendationDetail, } from './hooks/useWorkloadRecommendationDetailQuery';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Request to validate overlap in an existing Cost Category
3
+ */
4
+ export interface BusinessMappingValidationRequestDto {
5
+ /**
6
+ * Identifier of the Cost Category (Business Mapping) to validate for overlap
7
+ */
8
+ businessMappingId: string;
9
+ /**
10
+ * Inclusive end of the billing-data window as epoch millis. Must be sent together with startTime, must be after startTime, and must be within 31 days of it.
11
+ * @format int64
12
+ */
13
+ endTime?: number;
14
+ /**
15
+ * Inclusive start of the billing-data window as epoch millis. Must be sent together with endTime; when both are omitted the last 30 days are used. The window must be at most 31 days.
16
+ * @format int64
17
+ */
18
+ startTime?: number;
19
+ }
@@ -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,17 @@
1
+ import type { CostBucketOverlapStatDto } from '../schemas/CostBucketOverlapStatDto';
2
+ /**
3
+ * Response body for the Cost Category overlap-validate action. Returns the validation outcome, scored window, and per-bucket overlap stats without echoing the full Cost Category definition.
4
+ */
5
+ export interface BusinessMappingValidationResponseDto {
6
+ businessMappingId?: string;
7
+ costBucketOverlapStats?: CostBucketOverlapStatDto[];
8
+ overlapValidationState?: 'COMPLETE' | 'FAILED' | 'NOT_VALIDATED';
9
+ /**
10
+ * @format int64
11
+ */
12
+ windowEnd?: number;
13
+ /**
14
+ * @format int64
15
+ */
16
+ windowStart?: number;
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-ccm-service-client",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Harness CCM Service APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",